TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   Undefined Index (http://www.talkphp.com/general/2483-undefined-index.html)

Orc 03-17-2008 01:20 AM

Undefined Index
 
PHP Code:


        
echo ' <form method="post" action="">
  <select name="vote">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
  </select>
  <input type="submit" name="voteSubmit">
 </form>'
;
        
                
$vote $_POST['vote'];
$voteSubmit $_POST['voteSubmit']; 

There is an erro but yet, I don't see the problem. :/

Update: Strange, I had error_reporting, that was the problem. Could someone explain this to me?

Gibou 03-17-2008 08:03 AM

Why don't you test the availability of your vars before using them ?
Just after the form, superglobal vars like $_POST don't exist yet.

Gareth 03-17-2008 12:59 PM

Did you fix the problem? Can you show us more of the code, please?


All times are GMT. The time now is 11:39 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0