LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   PHP Undefined index Error (https://www.linuxquestions.org/questions/programming-9/php-undefined-index-error-187561/)

Gerardoj 05-30-2004 02:52 AM

PHP Undefined index Error
 
Hi Im getting the following error: Notice: Undefined index: rout in /home/webs/cia/web/sovereign/functions.php on line 8. What could be the problem?

Thanks a lot
PHP Code:

<html>
<form name="thingy" action="functions.php" method="post">
<input type="hidden" name="rout">
</form>
</html>

<?php
$rout 
$_POST['rout'];
$filenames = array("index",
                   
"services",
                   
"products",
                   
"quotes"
                   
"contact"
                   
"home"
                   
"admin");

if (
in_array($rout$filenames))
{
include 
"$rout.php";
exit;
}
else
{
include 
"index2.php";
}
?>


keefaz 05-30-2004 03:30 AM

I see no value assigned for the hidden field rout in the html form.
try
PHP Code:

if( !isset( $_POST["rout"] ) )
{
    echo 
"POST[rout] was not set";
    exit;




All times are GMT -5. The time now is 03:47 PM.