X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   auth.php erases php variable - a puzzle (https://forum.x-cart.com/showthread.php?t=12396)

jdedba 02-24-2005 10:52 AM

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

Jon 02-24-2005 11:36 AM

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

If you have registered globals on try using: $urlarray instead of the get.

jdedba 02-25-2005 08:42 PM

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

Jon 02-25-2005 10:03 PM

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 :D Been so long since I installed I don't recall.


All times are GMT -8. The time now is 03:04 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.