PHP Form help

following error occur in underneath code.

Notice: Undefined index: inputdata in C:\wamp\www\todo\index.php on line 1

<?php echo $_POST['inputdata']; ?>

That error means that…

does not have a value.

if you don’t want the error to show up when you first visit the page you will need to either…

  1. turn error reporting off using " error_reporting(0); "
  2. use an if(isset())…
    echo $_POST[‘inputdata’];
    else {

} [/php]

if the form is in the same file as the PHP script then your form tag should look like so…

<form action="" method="post">

Thanks i get the logic,
and also get my code working.

may God keep you happy.


So you got your code working?

Or just set it to NULL before the first line…

Sponsor our Newsletter | Privacy Policy | Terms of Service