Jump to content

twhicher

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Posts posted by twhicher

  1. Hi guys, I'm brand new to PHP, and this type of coding. I've been working on a simple example from a tutorial where a form is used to update information on the same page;
    [i]
    <form name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    <input type="text" name="textfield">
    <input type="submit" name="Submit" value="Submit">
    </form>

    <?PHP
    echo $_POST['textfield'];
    ?>[/i]
    However, i get the notice :" Undefined index: textfield in E:\web\northey\test6.php on line 14" when the form is first run - after a value has been submitted this goes, so it all works but i suffer from this unsightly error.

    I guess i need to somehow define $_post['textfield'] originally, but however i try to do this it either overrules the value comming in from the form, or appears to do nothing but duplicate the above error.

    Sorry for being a total No0b - I've searched and searched for a solution and am my wits end.
    PS the URL is [a href=\"http://www.northey.net/test6.php\" target=\"_blank\"]http://www.northey.net/test6.php[/a] and ive enabled phpinfo() to help out.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.