Currently I'm using web matrix2 to build my php application. I was testing passing the query string to another php using GET
Scenario 1:
I have index.php and test.php
in index.php: I have a php statement include("/test.php");
in test.php: i only have 2 statements echo "hi"; and echo $_GET["msg"];
when I run it, nothing appear in my browser
When I get rid of the echo $_GET["msg"];
, it works again.
Scenario 2:
I have index.php and test.php
in index.php: I have a php statement include("/test.php?msg=hihihi")
;
in test.php: i only have 2 statements echo "hi"; and echo $_GET["msg"]
;
when I run it, nothing appear in my browser
Even I tried to type the Url http://localhost:port/test.php?msg=hihihi
, nothing appear as well..~
Then I tried to test it using a link
<a href="http://localhost:62878/menu/AddCat.php?msg=hihihi">link</a>
still nothing was displayed at AddCat.php page.
I have tried it in EasyPhp...~
The error showed in EasyPHP is
Fatal error: require(): Failed opening required 'test.php?msg=hihi' (include_path='.;C:\php\pear') in C:\Program Files\EasyPHP-12.1\www\testing\index.php on line 2
if I put the query string together with the url in the php include statement.
I'm not sure how why my code didn't work previously, but now fix.
thanks.