Hey all,
I'm new to PHP and i'm just trying to test out a simple script as follows:
[PHP]
#!C:/Program Files/PHP/PHP.exe
<?php
error_reporting (E_ALL);
ini_set('displa y_errors', true);
//import_request_ variables("gpc" ,"mvar_");
print "Content-type: text/html\n\n";
if (isset($_GET['name'])) {
print "Hello, " . $_GET['name'];
}
else {
print <<<HTML
<form action="http://pladdypants.hom e/cgi-bin/ch6ex.php" method="get">
Name: <input type="text" name="name" />
<input type="submit" value="Submit" />
</form>
HTML;
}
?>
[/PHP]>
I've worked at this and it runs fine, however when i click submit with a name in the field, it doesn't show up when it reruns. The url changes and it has a parameter defined there, but nothing prints to the screen. Am I overlooking something simple here? I've tried lots of different things and no luck.
I'm using XP Pro, mozilla browser, apache 2.2. This is just my computer as a server and i'm accessing local files. Is this an issue with my code, how PHP was installed, how my server is set up? Sorry for such a silly question, I'm sure I'm doing something very basic and stupid...Any help would be greatly appreciated.
-Pladdy
I'm new to PHP and i'm just trying to test out a simple script as follows:
[PHP]
#!C:/Program Files/PHP/PHP.exe
<?php
error_reporting (E_ALL);
ini_set('displa y_errors', true);
//import_request_ variables("gpc" ,"mvar_");
print "Content-type: text/html\n\n";
if (isset($_GET['name'])) {
print "Hello, " . $_GET['name'];
}
else {
print <<<HTML
<form action="http://pladdypants.hom e/cgi-bin/ch6ex.php" method="get">
Name: <input type="text" name="name" />
<input type="submit" value="Submit" />
</form>
HTML;
}
?>
[/PHP]>
I've worked at this and it runs fine, however when i click submit with a name in the field, it doesn't show up when it reruns. The url changes and it has a parameter defined there, but nothing prints to the screen. Am I overlooking something simple here? I've tried lots of different things and no luck.
I'm using XP Pro, mozilla browser, apache 2.2. This is just my computer as a server and i'm accessing local files. Is this an issue with my code, how PHP was installed, how my server is set up? Sorry for such a silly question, I'm sure I'm doing something very basic and stupid...Any help would be greatly appreciated.
-Pladdy
Comment