Results 1 to 3 of 3

Thread: [RESOLVED] What is error in this code of variable passing

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2010
    Posts
    965

    Resolved [RESOLVED] What is error in this code of variable passing

    hi, i have the following code on my send.php page.

    <html>

    </body>

    <form method = "POST" action = "receive.php">

    Username <input type = "text" name = "Uname"></br>
    Password <input type = "password" name = "pwd"></br>

    <input type = "Button" value = "Send"></br>
    <input type = "Reset" value = "Clear">

    </form>

    </body>
    </html>


    and the following code is on receiving page.


    <?php

    $name = $_POST['Uname'];
    $pass = $_POST['pwd'];

    echo $name;
    echo $pass;

    ?>


    when i press the send button on sending page so data does not go another page and when i individually open the receiving data page, so it gives error

    ( ! ) Notice: Undefined index: Uname in C:\wamp\www\receive.php on line 3
    Call Stack
    # Time Memory Function Location
    1 0.0015 362360 {main}( ) ..\receive.php:0

    Why i am hving this problem

  2. #2
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: What is error in this code of variable passing

    Change the send button type from "button" to "submit"

  3. #3

Posting Permissions

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



Click Here to Expand Forum to Full Width