tom
12-15-01, 06:52 PM
Happy Holiday!
I am working my way through 'PHP Essentials' example by
example in order to set a foundation. It's even fun sometime!
I have run into a section that I just can't figure out. I am
hoping there is an easy answer and a kind soul to provide it.
SPECIFICALLY:
- - - - - - -
The html form
- - - - - - -
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Redirection Menu</TITLE>
</HEAD>
<BODY>
<FORM method="POST" action="do_redirect.php">
<P>I want to go to:
<SELECT name="id" size="1">
<OPTION value="prima">Prima-Tech</OPTION>
<OPTION value="php">PHP.net</OPTION>
<OPTION value="slashdot">Slashdot</OPTION>
<OPTION value="linuxchix">Linuxchix</OPTION>
</SELECT>
<INPUT type="submit" value="Go!">
</FORM>
</BODY>
</HTML>
- - - - - - -
the php script
- - - - - - -
#!/usr/local/bin/php
<?php
if ($id == "prima") {
$location = "http://www.prima-tech.com/";
} else if ($id == "php") {
$location = "http://www.php.net/";
} else if ($id == "slashdot") {
$location = "http://www.slashdot.org/";
} else if ($id == "linuxchix") {
$location = "http://www.linuxchix.org/";
}
header("Location: $location");
exit;
?>
- - - - - - - - -
the error message
- - - - - - - - -
Warning: Cannot add header information - headers already sent by
(output started at /www/t/trulytimeles/htdocs/do_redirect.php:3)
in /www/t/trulytimeles/htdocs/do_redirect.php on line 23
I've made the following committment to myself -
DO NOT skip over examples that you can't get to work, figure
it out, ask someone, DON'T DO NOTHING!
Any help would be greatly appreciated.
HAPPY HOLIDAY!
I am working my way through 'PHP Essentials' example by
example in order to set a foundation. It's even fun sometime!
I have run into a section that I just can't figure out. I am
hoping there is an easy answer and a kind soul to provide it.
SPECIFICALLY:
- - - - - - -
The html form
- - - - - - -
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Redirection Menu</TITLE>
</HEAD>
<BODY>
<FORM method="POST" action="do_redirect.php">
<P>I want to go to:
<SELECT name="id" size="1">
<OPTION value="prima">Prima-Tech</OPTION>
<OPTION value="php">PHP.net</OPTION>
<OPTION value="slashdot">Slashdot</OPTION>
<OPTION value="linuxchix">Linuxchix</OPTION>
</SELECT>
<INPUT type="submit" value="Go!">
</FORM>
</BODY>
</HTML>
- - - - - - -
the php script
- - - - - - -
#!/usr/local/bin/php
<?php
if ($id == "prima") {
$location = "http://www.prima-tech.com/";
} else if ($id == "php") {
$location = "http://www.php.net/";
} else if ($id == "slashdot") {
$location = "http://www.slashdot.org/";
} else if ($id == "linuxchix") {
$location = "http://www.linuxchix.org/";
}
header("Location: $location");
exit;
?>
- - - - - - - - -
the error message
- - - - - - - - -
Warning: Cannot add header information - headers already sent by
(output started at /www/t/trulytimeles/htdocs/do_redirect.php:3)
in /www/t/trulytimeles/htdocs/do_redirect.php on line 23
I've made the following committment to myself -
DO NOT skip over examples that you can't get to work, figure
it out, ask someone, DON'T DO NOTHING!
Any help would be greatly appreciated.
HAPPY HOLIDAY!