Jump to content

How do I pass $x and $y variables to another page


TeddyKiller

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.