Reply
Passsing session information between pages
Old 05-15-2006, 03:16 PM Passsing session information between pages
Experienced Talker

Posts: 47
Some of my attempts to pass session information along as the user moves from page topage works correctly. And others fail for reasions I don't understand. All help appreciated.

Working code follows. The ipassed info is in the url as "?id=7" or other correct id number.

HTML Code:
href="/updatecontactscurrent_members.php ?id=<? echo $id; ?>">Update</a></font></td>
And the following code obtains the passed info correctly:

HTML Code:
$id=$_GET['id'];

The failing code is as follows: The passed info is in the url as "?UserID=<? echo $UserID;?>"

HTML Code:
<tr><td align left>
<a href="http://localhost/workinglogoutsession.php?UserID= <? echo $UserID;?>">Members Logout</a></td></tr>
And the following code obtains the passed info correctly but the info is wrong!

HTML Code:
$UserID=$_GET['UserID'];
Any ideas where I screwed up?

Frodocyber
Frodocyber is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 05-15-2006, 03:23 PM Re: Passsing session information between pages
mgraphic's Avatar
Truth Seeker

Posts: 2,284
Name: Keith Marshall
Location: West Hartford, CT
remove the space between UserID= <?

The browser will encode the space as %20 giving you wrong info
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 05-16-2006, 12:09 PM Re: Passsing session information between pages
Experienced Talker

Posts: 47
Removing the spaces had no affect on the result. Are there any tutorials available specifically focused on navigation and site security? This sometimes works...sometimes doesn't... is driving me nuts!
Frodocyber is offline
Reply With Quote
View Public Profile
 
Old 05-16-2006, 12:15 PM Re: Passsing session information between pages
mgraphic's Avatar
Truth Seeker

Posts: 2,284
Name: Keith Marshall
Location: West Hartford, CT
Double check your passed vars, on the landing page write:

PHP Code:
print_r($_GET); 
This will display the entire contents of the #_GET vars, make sure is is the data you are desiring.
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Passsing session information between pages
 

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13321 seconds with 13 queries