Thread: Php in Html

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2013
    Posts
    16
    Rep Power
    0

    Php in Html


    Sir I have following codes

    [PHPNET]<?php
    if(isset($_POST['button1'])) {
    $aa = $_POST['text1'];
    echo ("My name is " . $aa);
    }
    ?>

    <html>
    <head>
    <title>First form</title>
    </head>
    <body>

    <form name="aa" action="mix.php" method="POST">
    Name<input type="text" name="text1" value="">
    <input type="submit" value="display" name="button1">
    </form>

    </body>
    </html>[/PHPNET]

    These codes have no error message.
    I am beginner so I request you to please check whether I am doing right.

    Second Request:

    Is it possible to use php codes in <html> tag?
    if yes then please adjust my php code in html tag.

    Thanks in advance
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    Cross-posted and answered.

    Don't waste your time with that one.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2013
    Posts
    16
    Rep Power
    0
    Is cross posting a sin?

    A beginner wants to get differnet solutions by different people because everyone has different code writing style.
  6. #4
  7. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    When you have a problem in your person life, do you ask 5 friends at the same time so that you can choose the help you like best? If you did that, they probably wouldn't be your friends for long.

    I understand that the Internet may feel like a gigantic "immediate help for free" service. So why not post the same questions into x forums like the spammers do it? Because the answers you get are from actual people who invest their time into helping you. If you don't value that, don't expect to get help in the future.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".

IMN logo majestic logo threadwatch logo seochat tools logo