Need help - I am a PHO beginner:::

Discussion in 'PHP' started by ServiceCube, Apr 8, 2008.

  1. #1
    Hi all,

    I am trying to write a small PHP code where I am trying to post a few data from one .html page and want to see all those information in another .php page. But I am getting the weird error which asks me to download the .php file rather opening it in the browser. I can't really find the reason behind that. Can anyone help me resolving this?

    The PHP and HTML files are named: loan.html and name.php and the codes into those files are:

    -----------------------------loan.html-------------------------
    <html>
    <title>National Bank - Loan Application Form</title>
    <body><font face="Tahoma" size="2">
    <Font size="3">National Bank - Loan Application Form</font>
    <br>-------------------------------------------------------------------------------------------------<br>
    <form method="POST" action="name.php">
    First name
    <input name="FirstName" type="text">
    Last name
    <input name="LastName" type="password">
    <!--Age
    <input name="Age" type="text" size="1">
    <br>-->
    <input type="submit" value="Submit to apply for loan">
    <input type="reset" value="Reset this form">

    </form>
    </font>
    </body>
    </html>



    ----------------------name.php--------------------

    <html>
    <body>
    test
    <?php
    $F_Name = $_POST['FirstName'];
    echo $F_Name;
    ?>
    </body>
    </html>

    ----------------------

    Thanks for the help in advance.
     
    ServiceCube, Apr 8, 2008 IP
  2. makubex

    makubex Peon

    Messages:
    292
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    the code looks fine... did u run the apache server?
     
    makubex, Apr 8, 2008 IP
  3. ServiceCube

    ServiceCube Peon

    Messages:
    340
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I am running php on IIS. Its working fine independently. Like: this code works fine for me which proves my PHP compiler is running fine and well:

    <html>
    <body>
    <?php
    $a = 5;
    echo $a;
    ?>
    </body>
    </html>

    Don't know what exactly the trouble is in the 1st code:
     
    ServiceCube, Apr 8, 2008 IP
  4. makubex

    makubex Peon

    Messages:
    292
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    i tested u'r main code... its working fine for me using WAMP server..(apache for windows)
    i have not used IIS, i think someone can help u.
     
    makubex, Apr 8, 2008 IP
  5. ServiceCube

    ServiceCube Peon

    Messages:
    340
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Anyone else can have a look and sort this out for me? I am not switching to the next codes because i really want to know what is happening here and I don't even think this is wise to move to next lessons before I solve this one.

    Thanks in advance if anyone is helping me...

    Cheers guys...
     
    ServiceCube, Apr 12, 2008 IP
  6. eTechDude.com

    eTechDude.com Member

    Messages:
    205
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #6
    Looks fine!:)
     
    eTechDude.com, Apr 12, 2008 IP