943,522 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 1826
  • PHP RSS
You are currently viewing page 3 of this multi-page discussion thread; Jump to the first page
Sep 20th, 2009
0

Re: Default Image?

I don't see the point. htaccess will enable you to enter the url you want and the $_GET['username'] variable in the index.php page will then give you a hook to the db to extract the user's details. That's it. Cookies shouldn't really feature here. The htaccess method will work whether cookies are enabled, eaten, disabled etc etc.

There are 20 ways to boil an egg, but I think using cookies for this will leave it raw.

Have you tried my suggestion?
Last edited by ardav; Sep 20th, 2009 at 1:25 pm.
Sponsor
Featured Poster
Reputation Points: 1046
Solved Threads: 941
Sarcastic Poster
ardav is offline Offline
6,661 posts
since Oct 2006
Sep 20th, 2009
0

Re: Default Image?

Click to Expand / Collapse  Quote originally posted by ardav ...
I don't see the point. htaccess will enable you to enter the url you want and the $_GET['username'] variable in the index.php page will then give you a hook to the db to extract the user's details. That's it. Cookies shouldn't really feature here. The htaccess method will work whether cookies are enabled, eaten, disabled etc etc.

There are 20 ways to boil an egg, but I think using cookies for this will leave it raw.

Have you tried my suggestion?
I have tried it, but it dont seem to do anything... None of my member urls exist on my server... They all reside on my database.

www.Mysite.com/username

I bought this php script from a guy who closed down his website shortly after... So I had no way of contacting him with questions.

If mysite.com/somename dosnt exist on my server as a visible URL. Does this .htaccess file still work on a url thats not visible? I think this url is set in my script I bought, and the only evidence i have that its there is my admin panel, or my database.

I dont know if im going to get this to work...
Reputation Points: 10
Solved Threads: 0
Light Poster
JayGeePee is offline Offline
46 posts
since Aug 2009
Sep 20th, 2009
0

Re: Default Image?

Quote ...
I have tried it, but it dont seem to do anything... None of my member urls exist on my server... They all reside on my database.
Obviously.

Use this with the htaccess file in place:

index.php - I wouldn't use this on the index.php, I'd change it to member.php or something, but it's your funeral.

PHP Syntax (Toggle Plain Text)
  1. if(isset($_GET['username'])){
  2. $username = addslashes(htmlentities($_GET['username']));
  3. $recordset = mysql_query("SELECT * FROM users WHERE username = '{$username}'");
  4. if(mysql_num_rows($recordset) > 0){
  5. $data = mysql_fetch_array($recordset);
  6. $avatar = $data['avatar'];
  7.  
  8. (... etc for all the fields you want ...)
  9.  
  10. }else{
  11. //put message to screen if user doesn't exist
  12. }
  13. }
Last edited by ardav; Sep 20th, 2009 at 3:29 pm.
Sponsor
Featured Poster
Reputation Points: 1046
Solved Threads: 941
Sarcastic Poster
ardav is offline Offline
6,661 posts
since Oct 2006
Sep 20th, 2009
0

Solved...

Solved... Thanks for your persistence, most people would of gave up on me. I didnt upload my .htaccess file right, the first way you told me to do it worked. Persistance pays off. Thanks.
Reputation Points: 10
Solved Threads: 0
Light Poster
JayGeePee is offline Offline
46 posts
since Aug 2009
Sep 20th, 2009
-1

Re: Default Image?

Da nada, Jay - glad you made it.
Sponsor
Featured Poster
Reputation Points: 1046
Solved Threads: 941
Sarcastic Poster
ardav is offline Offline
6,661 posts
since Oct 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Help
Next Thread in PHP Forum Timeline: pagination in php





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC