I have form that submits to a mysql database. After clicking submit, the user is taken to a confirm page that sends an email to me that a new item is in the database. What's the best way to get the values to pass from the one php page to the next so that I can use them in the email? I don't really know php, I've just used dreamweaver to supply the code so far, so details would be very helpful. I've seen people talk about cookies, but I also don't have experience there either.

Thanks

    Use the $_POST array

    To see what i mean on the confirmation page put this code in

    print_r($_POST);

      OK, so I've added some _Post to the email tag. I figured out how to adjust the $message variable to add variables (hey, I don't know anything about php so that made me happy I got that).

      So here's the question, I have an html form that uses these fields that insert a record into the mysql databse. How do I utilize that _post array to set those fields in the form into the array so that I can pull them out in the php script to email? I would like to pull the information entered in the form into the email message.

      Here's the email message so far:
      <?php
      $to = "email@mydomain.com";
      $subject = "New Form has been submitted";
      $extra = "From: Test System";
      $POST['test'] = 'post string;
      $var1 = $
      POST['test'];
      $var2 = "var 2 string";
      $mess = "A form has been submitted.\n"."Variable is as follows ".$var1." and ".$var2.$message;
      mail($to, $subject, $mess, $extra);
      ?>">

      So that part is pretty straight forward and simple, but I'm just not sure how to grab the data from the form to put it in the array.

        Write a Reply...