1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Looking for a simple PHP script! Please help me find it!

Discussion in 'Programming' started by sivric.marijan, Jan 4, 2015.

  1. #1
    Hello DP members!

    I am looking for a simple form-based PHP script. The visitor will enter his data and the script will generate HTML code based on his input. For example, a user enters his name and e-mail address and the script creates a HTML code (a web page) with these two values. Can you please help me find the script?

    Thanks in advance!
     
    sivric.marijan, Jan 4, 2015 IP
  2. Anveto

    Anveto Well-Known Member

    Messages:
    697
    Likes Received:
    40
    Best Answers:
    19
    Trophy Points:
    195
    #2
    You could do this with wordpress. But it depends on how complex or simple you want it to be. Another option is to find a simple forum script and maybe modify it a bit. Most people will refrain from doing something like this as it will most likely lead to spam pages.
     
    Anveto, Jan 4, 2015 IP
  3. richie_rich$$$

    richie_rich$$$ Member

    Messages:
    77
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    what are you trying to do with the form? It's very easy to create a form like that in php. But you will have to modify it to suit your needs


    <?php
    if (!isset($_POST['submit'])) {
    ?>
    <form method="post" action="test2.php">

    <p> Please write your name: </p>
    <input type="text" name="name" /> name <br>
    <p> Please write your email address </p>
    <input type="text" name="emailaddress" /> email <br>

    <input type="submit" name="submit" value="submit"/>
    </form>

    <?php
    }else{

    $name1=$_POST['name'];
    $emailaddress1=$_POST['emailaddress'];
    echo $name1; echo '</br>';
    echo $emailaddress1;
    }

    ?>
     
    richie_rich$$$, Jan 8, 2015 IP
  4. Googl

    Googl Active Member

    Messages:
    509
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    75
    #4
    It is not very clear to me what the OP is asking. So you want a script that will take data from a form and create a HTML page on the server? Or does it display the page back to the user or does it store it as HTML?
     
    Googl, Jan 8, 2015 IP
  5. sivric.marijan

    sivric.marijan Active Member

    Messages:
    273
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    80
    #5
    No! The script will create HTML code based on the values from a form and it will display the code to a person who filled the form. This person will copy that code to some text editor, save it as a .html file and upload that page to some web host.
     
    sivric.marijan, Jan 13, 2015 IP
  6. cmscoders

    cmscoders Greenhorn

    Messages:
    2
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    23
    #6
    Hi,
    please try the below code :
    if (!isset($_POST['submit'])) {
    ?>
    <form method="post" action="test2.php">

    <p> Please write your name: </p>
    <input type="text" name="name" /> name <br>
    <p> Please write your email address </p>
    <input type="text" name="emailaddress" /> email <br>

    <input type="submit" name="submit" value="submit"/>
    </form>

    <?php
    }else{

    $name1=$_POST['name'];
    $emailaddress1=$_POST['emailaddress'];

    $message = '
    <html>
    <head>
    <title>'.$name1.'</title>
    </head>
    <body>
    <table>

    <tr>
    <td>Name</td><td>'.$name1.'</td>
    </tr>
    <tr>
    <td>Email id</td><td>'.$emailaddress1.'</td>
    </tr>
    </table>
    </body>
    </html>';

    echo htmlentities($message);
    }
    ?>
    "htmlentities" is the function in php to show all html tags
     
    cmscoders, Jan 16, 2015 IP
    Googl likes this.