» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > PHP Programming and Tips

PHP Programming and Tips Discuss about PHP programming and Share Tips. Ask questions about Scripting and Errors.

Reply
 
Thread Tools Display Modes
  #1  
Old 08-09-2006, 12:19 PM
white white is offline
Junior Member
 
Join Date: Aug 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
white is on a distinguished road
Default displaying wrong username

Hello

My code is displaying S as the username and not the actual username? Here is my code that I am working with:

if (isset($_COOKIE['username']) && ($_COOKIE['password'])) {
print "Logged in as: ".$_COOKIE['username']. "<br />";
print "<a href=logout.php>log out?</a>";
}

Can you point out the reason -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Revenue Sharing Ads ( ?):
  #2  
Old 08-09-2006, 12:21 PM
azhar azhar is offline
OSP Starters
 
Join Date: Mar 2006
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
azhar is on a distinguished road
Default

Hey, that would depend on the code that a) assigns the username to the value $_COOKIE['username'] or b) retrieves the username value for assignment.

Your browser should have a method to view cookies, take a look at the values stored when you load the page.

Bye for now -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
  #3  
Old 08-09-2006, 12:23 PM
ashley ashley is offline
OSP Starters
 
Join Date: Mar 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
ashley is on a distinguished road
Default

try this code

if (isset($_COOKIE['username']) && ($_COOKIE['password'])) {
print "Logged in as: ".$_COOKIE['username']. "<br />";
print "<a href=logout.php>log out?</a>";
}


&& ($_COOKIE['password'])

should be

&& isset($_COOKIE['password'])

bye buddy -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
preventing displaying of pics? kassell Web Hosting Industry 1 12-14-2006 02:13 AM
what went wrong?, suri Link Building 4 09-26-2006 01:52 PM
is this wrong config.? drupal MySQL Forums 1 09-13-2006 04:18 AM
am i using the wrong command brackan Yahoo 3 04-25-2006 01:51 PM
yahoo not displaying the last part of URL michelle Yahoo 3 03-26-2006 08:39 AM


All times are GMT. The time now is 03:45 AM.