Script To Insert Text

Discussion in 'PHP' started by Twisted., Jun 4, 2009.

  1. #1
    Hi,

    Please forgive me if this is in the wrong place. This is my first post.

    I need a script.

    Basically. I need it so that you can type in some text in a small box. Then on the next page the text typed into the small box comes up inbetween other text.

    So. If i typed in Hi in the small text box then clicked the submit button. On the next page a big text box would come up with default text. with Hi inserted in it somewhere.

    Default text : HOW ARE YOU TODAY.
    I Type In : HI
    I Click Submit.
    The Next Page Comes Up With: HI HOW ARE YOU TODAY.

    Please Help.
    I hope i havnt confused you.

    Cheers,
    Tom
     
    Twisted., Jun 4, 2009 IP
  2. SHOwnsYou

    SHOwnsYou Peon

    Messages:
    209
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    
    Page 1:
    <?php
    echo "<form method='post' action='nextpage.php'>";
    echo "Type your text: ";
    echo "<input name='text' />";
    echo "<input type='submit' value='Submit' />";
    ?>
    
    nextpage.php:
    <?php
    $text = $_POST['text'];
    echo "Whatever text you want first  $text  Whatever the other text is that you want";
    ?>
    
    
    Code (markup):
     
    SHOwnsYou, Jun 4, 2009 IP