TeddyKiller Posted March 15, 2010 Share Posted March 15, 2010 Hello I have a script which involves this if ($action === "inventory") {require ("inventory.php"); } This works fine, however inventory needs to get $x and $y variables from the page with the require. (Code above) I thought maybe this may work. if ($action === "inventory") {require ("inventory.php?username=$x&password=$y"); } Though this gives me errors. Warning: require(inventory.php?username=Zero&password=8b1bfe77cb4bc077728e6b1607c8b73a) [function.require]: failed to open stream: No such file or directory in /home/katarra/public_html/main.php on line 263 Warning: require(inventory.php?username=Zero&password=8b1bfe77cb4bc077728e6b1607c8b73a) [function.require]: failed to open stream: No such file or directory in /home/katarra/public_html/main.php on line 263 Fatal error: require() [function.require]:Failed opening required'inventory.php?username=Zero&password=8b1bfe77cb4bc077728e6b1607c8b73a'(include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/katarra/public_html/main.php on line 263 How can I fix this so I can use variables $x and $y in inventory.php Link to comment https://forums.phpfreaks.com/topic/195327-how-do-i-pass-x-and-y-variables-to-another-page/ Share on other sites More sharing options...
litebearer Posted March 15, 2010 Share Posted March 15, 2010 seeing as you are attempting to pass a username and password, it might be better to pass them as session variables. http://www.tizag.com/phpT/phpsessions.php Link to comment https://forums.phpfreaks.com/topic/195327-how-do-i-pass-x-and-y-variables-to-another-page/#findComment-1026460 Share on other sites More sharing options...
TeddyKiller Posted March 15, 2010 Author Share Posted March 15, 2010 Oh yeah. I didn't think of that. Link to comment https://forums.phpfreaks.com/topic/195327-how-do-i-pass-x-and-y-variables-to-another-page/#findComment-1026491 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.