LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-30-2004, 02:52 AM   #1
Gerardoj
Member
 
Registered: May 2003
Location: Somewhere over the Rainbow
Distribution: Slackware 9.x, Knoppix, Damn Small Linux, RedHat.
Posts: 465

Rep: Reputation: 30
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";
}
?>
 
Old 05-30-2004, 03:30 AM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
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;

 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP+apache undefined symbol:unixd_config error Emist Linux - Newbie 13 03-15-2005 10:49 AM
index.php help greenmeanie Debian 5 03-09-2005 02:31 AM
Fatal Error - Call to undefined function : pg_pconnect() in filename.php on line xx mwpeng Linux - Newbie 1 02-26-2005 08:57 AM
rm #index.php# mikeshn Linux - General 3 02-16-2004 12:38 PM
Apache php index.php problem neurotic Linux - Software 3 11-18-2003 06:02 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration