PDA

View Full Version : Forum results to url (not email)


Finland Blue
09-29-2011, 10:52 AM
I have a simple form which sends results (using php) to my email. It works fine.

I want to make a similar form, and send the results not to email but to another web page, showing a summary of the form results, so user can check if all is entered correctly before continuing.

Is this possible, can anyone advise how, or a link? I searched a lot but just cannot find anything, though I think it should be simple :-)

Corrosive
09-29-2011, 12:35 PM
Look into using 'GET' rather than 'POST' on your form. That will push the results through the URL for users to check on page two. My PHP isn't all that good but I am pretty sure that is the avenue you want to be heading down.

Finland Blue
09-29-2011, 01:08 PM
I have added 2 attachments to show what I am trying to do.

1. Create a simple form - this is not problem :-)

2. Have the simple form display its results on another web page - this is the problem - HOW to I achieve this?

edbr
09-30-2011, 01:12 AM
you can use$_ POST, i
heres an example on one page using a blank action so it calls itself. then the second form once receiving the details to be verified, can be 'actioned ' to send on
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>

<body>
<form action="" method="post" name="form">
<input name="info" type="text">

<input name="info2" type="text">
<input name="send" type="submit" value="Submit">
</form>

<form action="" method="post" name="newform">
<input name="newinfo" type="text" value="<?php echo $_POST['info'];?>">

<input name="newinfo2" type="text" value="<?php echo $_POST['info2'];?>">
<input name="send" type="submit" value="Submit">
</form>
</body>
</html>

Finland Blue
09-30-2011, 04:24 AM
Thanks - I tried this, but it did not work.

Can you check my page - did I do something wrong?
http://www.travel-experience.net/post.htm

Also for the purposes of the ecommerce I need the fields in the "results" form to be hidden :

eg <input type="hidden" name="Amount" value="33" />

where the "value" is taken from what the user has inputted.

Can your solution also work this way?

edbr
09-30-2011, 05:32 AM
it has to be a php page (the results page) or it wont work

Finland Blue
09-30-2011, 06:35 AM
I changed now to http://www.travel-experience.net/post.php and it did work, although when the page opens up (before user has entered data) the results fields have some text in them ... should they not be blank?

Could I also use this same technique to show results on a seperate web page - by putting an address in the form action=""??

And the input type= hidden question - is it possible?

edbr
09-30-2011, 07:11 AM
its an error reporting as nothing is submitted you can put it in a if condition to get rid of that .
if you use hidden it wont be seen on page so what do you want? to check it or not? if it is for visitor verification this i how you want it, it can then be sent on if ok and the next part can be hidden if thats what you need

Finland Blue
09-30-2011, 07:48 AM
I am making a credit card payment form. Customer inouts their basic details into the form (name, booking numbers, amount etc) - on pressing submit they are taken to a 2nd page which displays their results. The credit card company advised this, that the fields on the page which shows the results should be hidden, like this :

<INPUT TYPE=HIDDEN NAME="Guest name" value="whatever the guest typed in">
<INPUT TYPE=HIDDEN NAME="Booking number" value="whatever the guest typed in">
<INPUT TYPE=HIDDEN NAME="Amount" value="whatever the guest typed in">

... then this form on the results page has a Form Action which sends the results further.

This is what I want to achieve.

edbr
09-30-2011, 07:55 AM
if its hidden it wont show in form filds ,but you could just echo the $_post values also om the page

Finland Blue
09-30-2011, 11:43 AM
Users won't be able to INPUT into the hidden fields, but what the user typed into the original form will DISPLAY there.

domedia
09-30-2011, 01:10 PM
That makes no sense :) a hidden input field does not display.

Finland Blue
09-30-2011, 02:27 PM
I'm obviously not good at explaining this stuff :-)

Go to : (still under work ...)
http://www.travel-experience.net/creditcard.html

Fill out anything in the 3 fields, press submit and you go to the results page
http://www.travel-experience.net/verify_details.php

View the source on this page, and you will see (hopefully) what I mean ...

... the actual Hidden fields don't display, but the results themselves do, and those results are put into Hidden fields as well, which are needed when moving on to the Payment Gateway ... as I said, I'm not good at explaining ...

edbr
10-01-2011, 01:07 AM
then echo them on the page also
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>

<body>
<form action="" method="post" name="form">
<input name="info" type="text">
<br>
<input name="info2" type="text">
<input name="send" type="submit" value="Submit">
</form>
<p>Please check your details are correct<br>

<?php
echo $_POST['info']."<br>";
echo $_POST['info2']."<br>";

?>
</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp; </p>
<form action="" method="post" name="newform">
<input name="newinfo" type="hidden" value="<?php echo $_POST['info'];?>">
<br>
<input name="newinfo2" type="hidden" value="<?php echo $_POST['info2'];?>">
<input name="send" type="submit" value="Proceed to payment">
</form>
</body>
</html>