Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

auth.php erases php variable - a puzzle

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-24-2005, 10:52 AM
 
jdedba jdedba is offline
 

Advanced Member
  
Join Date: Dec 2004
Posts: 96
 

Default auth.php erases php variable - a puzzle

I got a very strange result by including auth.php in my php file. I wrote a php code called list.php

Code:
<?php $listingid=$_GET['listingid']; $originalurl=$_GET['urlarray']; echo "URL1 $originalurl "; require "./auth.php"; require $xcart_dir."/include/categories.php"; echo "URL2 $listingid "; echo "URL3 $originalurl "; // also do other things ... ?>

When this file is called by
link

It generastes the result:
Quote:
URL1 yuanjeff*test4*test3*test2*test1*
URL2 test2
URL3

This shows auth.php erases the value of $originalurl, and keeps the value of $listingid! I do not understand what is happening.

Can you help me on this? How can I keep all the variable values (with including auth.php in the code) because they are necessary in my code?

Thanks a lot.
Jeff
__________________
version 4.1.1
Reply With Quote
  #2  
Old 02-24-2005, 11:36 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Probably the get variable is erased in top.inc.php

If you have registered globals on try using: $urlarray instead of the get.
Reply With Quote
  #3  
Old 02-25-2005, 08:42 PM
 
jdedba jdedba is offline
 

Advanced Member
  
Join Date: Dec 2004
Posts: 96
 

Default

Jon,

Thank you very much.

One more question. What do you mean
Quote:
If you have registered globals on
? Could they be turned off by php configuration (php.ini file)?

Jeff
__________________
version 4.1.1
Reply With Quote
  #4  
Old 02-25-2005, 10:03 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Yes you can turn register globals off in your php.ini and/or depending in server configs you can toggle them in conf files. The catch... I'm not sure x-cart would function with them off however Been so long since I installed I don't recall.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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


All times are GMT -8. The time now is 12:48 AM.

   

 
X-Cart forums © 2001-2020