How to post var values in to php page...

Discussion in 'Programming' started by uma mahesh, Jan 19, 2010.

  1. #1
    How to post var values in to php page...

    CAN I GET QUICK ANSWER PLZ......
     
    uma mahesh, Jan 19, 2010 IP
  2. digital29

    digital29 Peon

    Messages:
    462
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    i don`t quite understand what you want...
    you mean....the var`s content to appear on page? it is like this:

    $var = "hello world!";
    echo var;

    This will write "hello world!" on the page
     
    digital29, Jan 19, 2010 IP
  3. WebWorth

    WebWorth Greenhorn

    Messages:
    89
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    20
    #3
    If you mean post vars then

    the post form
    <form action="welcome.php" method="post">
    Name: <input type="text" name="fname" />
    Age: <input type="text" name="age" />
    <input type="submit" />
    </form> 
    PHP:

    on the welcome.php page
    Welcome <?php echo $_POST["fname"]; ?>!<br />
    You are <?php echo $_POST["age"]; ?> years old.
    PHP:
    post variables are accessed by $_POST["VAR"]
     
    WebWorth, Jan 19, 2010 IP
  4. akhil1311

    akhil1311 Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    What u mean actually?
    You can post by giving the form method =post. And you can read it in the php page by $_POST["var_name"].. If you want more, please specify the details
     
    akhil1311, Jan 20, 2010 IP