dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: Notice: Undefined index:

Hybrid View

  1. #1
    Join Date
    Jun 2013
    Posts
    3

    Notice: Undefined index:

    i m new in php i make two pages first was first.php
    the second was insert.php the codes are below but it show Notice: Undefined index:
    how to remove this error
    thanks

    first page

    <!DOCTYPE html>
    <html>
    <body>
    <form id="firstform" action="insert.php" method="post">
    <center> My First Page in PHP </center>
    <center>Name:<input type="text" id="name" size=20>
    FatherName: <input type="text" id="fname" size=20>
    Address:<input type="text" id="add" size=20>
    <input type="submit" name="sub">
    </form>
    </body>
    </html>

    insert page

    <html>
    <body>
    <?php

    $con=mysqli_connect("localhost","root","khan","first");
    // Check connection
    if (mysqli_connect_errno())
    {
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
    }
    $sql="INSERT INTO bio(name, fathername , address)
    VALUES
    ('$_POST[name]','$_POST[fname]','$_POST[add]')";

    if (!mysqli_query($con,$sql))
    {
    die('Error: ' . mysqli_error($con));
    }
    echo "1 record added";

    mysqli_close($con);
    ?>
    </body>
    </html>

  2. #2
    Join Date
    Jun 2013
    Posts
    3
    some one reply how to make it

  3. #3
    Join Date
    Aug 2012
    Location
    TX
    Posts
    293
    change the name of first.php to index.php

  4. #4
    Join Date
    Aug 2012
    Location
    TX
    Posts
    293
    im a goof ball sorry i think this is what your looking for

    http://en.kioskea.net/faq/3140-php-n...ndefined-index

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles