Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old April 16th, 2003, 06:47 PM
cbnsingram cbnsingram is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Denver, CO USA
Posts: 3 cbnsingram User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Inserting cookie into hidden form field

I'm a non-programmer. I was given two snippets of php to use in my webpage that reads a cookie for the user's id and then puts that ID into a field in the page's PayPal payment form. It worked great until I had a drive crash. After restoring the page I must have missed something, because it no longer inserts the ID into the Paypal field.

Here is the code as I have it now:

Just inside the <body> tag is this to read teh cookie that has already been set (I've confirmed that the cookies are being set:
<?
$pid = $HTTP_COOKIE_VARS['Ref_ID'];
?>

--------------
Here is the code that is added to the PayPal Form in an attempt to create the custom field containing the ID.
<input type="hidden" name="custom" value="<? echo "$pid"; ?>">

I have tried altering this every logical way possible and look through a couple of books, but just can't figure out what I'm missing.

Thanks in advance for any suggestions on fixing this or changing the method entirely.

Mike

Reply With Quote
  #2  
Old April 16th, 2003, 07:15 PM
crisp crisp is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Holland
Posts: 336 crisp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Inserting cookie into hidden form field

Have you by any change reinstalled PHP?
Newer versions of PHP have by default the register_globals set to OFF (as of version 4.1.2); you may find your cookie data in $_COOKIE instead of in $HTTP_COOKIE_VARS

Reply With Quote
  #3  
Old April 16th, 2003, 11:30 PM
cbnsingram cbnsingram is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Denver, CO USA
Posts: 3 cbnsingram User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Inserting cookie into hidden form field

This server is on 4.12. How do I set the globals to true? Is there a config file that can be edited directly from ssh, or do I need to re-compile?

Reply With Quote
  #4  
Old April 16th, 2003, 11:52 PM
cbnsingram cbnsingram is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Denver, CO USA
Posts: 3 cbnsingram User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Inserting cookie into hidden form field

I discovered the .ini file. I thought that instead of globals I'd try your second suggestion but it did not work. Still not pulling in the variable.

<?
$pid = $_COOKIE['Ref_ID'];
?>


and then

<input type="hidden" name="custom" value="<? echo "$pid"; ?>">

Reply With Quote
  #5  
Old April 17th, 2003, 12:42 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Inserting cookie into hidden form field

I'm very confused now. I verified that my php.ini file already has globals turned on. So I really don't know why my original code snippet is not working.

Can anyone see a basic flaw in it?

Reply With Quote
  #6  
Old April 17th, 2003, 06:16 AM
crisp crisp is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Holland
Posts: 336 crisp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: RE: Inserting cookie into hidden form field

Quote:
I'm very confused now. I verified that my php.ini file already has globals turned on. So I really don't know why my original code snippet is not working.

Can anyone see a basic flaw in it?

not really; I think you will need to debug this thing. You say you verified that the cookie was created; did you also check it's contents?
When you create it and do a print_r($HTTP_COOKIE_VARS) do you also get the contents in your script?
Have you turned on error_reporting? Do you get notices or warnings?

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Inserting cookie into hidden form field


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT