I’ll try and explain this as good as i can.

on the front page i got a "subscribe " form for a mailinglist and a "send" button. you can enter your email in to that form. the code looks like this:

<form action="mailing_list.php" method="post" style="margin-bottom:0; margin-right:0">
		  <font class="font_overall">Newsletter:</font>
		  <input type="text" value="your email" name="email" maxlength=50 size=16 style="height:18px; font-size: 8pt;"><input type="Submit" value="Send" style="height:18px; font-size: 8pt;"></form>

After pressing the send button a page will load with: "first name", "last name" and a "email" form. now the first and last name form will be empty. but i want the email form to show the email the user entered on the front page before pressing the send button.

So basically i want to: show the email that was entered in the form on the front page, to show in the email form of the mailing list page.

I’ve tried using value but that shows the vars as text. any idea how to get this done? if more explanation is needed just ask.

Thanks.

    "that shows the vars as text."

    How else would it/could it/should it show???

      This should do it:

      <p>e-mail address:<input name="email" size="30" value="<?php print $_POST['email']; ?>"></p>

      obviously the page will have to be parsed through the php engine for it to work.

        a simple example:

        <?php
        function form($step)
        {
        	$fields = array();
        	$next_step = $step + 1;
        
        echo '<form action="" method="POST">';
        
        if ($step == 1)
        {
        	$fields[] = 'email';
        }
        
        if ($step == 2)
        {
        	$fields[] = 'first_name';
        	$fields[] = 'last_name';
        	$fields[] = 'email';
        }
        
        foreach ($fields as $value)
        {
        	echo $value . ': <input type="text" name="' . $value . '" value="'; if (isset($_POST[$value])) {echo $_POST[$value];} echo '"><br>';
        }
        
        echo '
        <input type="submit" name="submit" value="goto step ' . $next_step . '">
        </form>
        ';
        }
        
        if (!isset($_POST['submit']))
        {
        	form(1);
        }
        
        if (isset($_POST['submit']) && $_POST['submit'] == 'goto step 2')
        {
        	form(2);
        }
        
        if (isset($_POST['submit']) && $_POST['submit'] == 'goto step 3')
        {
        	echo 'thank you ' . $_POST['first_name'];
        }
        ?>
        

          Repetitive information, everything stated above.

          🙂

            rincewind456 wrote:

            This should do it:

            <p>e-mail address:<input name="email" size="30" value="<?php print $_POST['email']; ?>"></p>

            obviously the page will have to be parsed through the php engine for it to work.

            yup and it worked swell. guess i also learnt today that you can start <? php ?> about anywhere in a document. thanks =D !

            a simple example:

            i just might use that, looks better then what i've got.

            thanks again ppl!

              Write a Reply...