Hi,
I'm trying to pass parameters to a PHP script and it's not working. Whilst this is the first time I've tried to use this, I'm basically copying an example straight out of a text book and can't understand why this doesn't work.
In one script I have a (static) link:
http://localhost/text/basic.php?html=basic
ATM basic.php looks like this: <?php echo("<html>\n<body>\n<p>html: $html</p>\n</body>\n</html>\n"); ?>
Pretty simple? Well it doesn't work. All I get in my browser is:
html:
The only thing I can think of is that I have "register_globals" switched off in php.ini, but I didn't think that this applied when it came to passing parameters in URLs.
Yes, it does apply. Change $html to $_GET['html'] since you are passing this in the URL. If you were passing via a form post method, you would use $_POST['html'], and you can use $_REQUEST['html'] for either. Look here...
http://www.php.net/manual/en/language.variables.external.php
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php