Jump to content

Recommended Posts

I have created a form which echos a result easy enough.  :P

But as this is for a quote form i need to be able to use the results of the form not only to echo the result but i hope to be able to get this info input into another form and hopefully the whole result of the form. What i mean is the form selections also so when they order i receive something to the effect of quantity=X Colors=x size=x and the actual echoed price?

The reason is i have a quote page i am making where the customer can get a free quote. Now if there happy with the quote then they move onto the actual order which is why i want to be able to retreive this info.

I have tried breifly the _session but only seemed to output my arrays not the results in them.

Im sure no one wants to see the code but just in case i will post a little of it.  And i have a feeling i may get told off for this also :( as i believe there was better ways to produce the same result. Anyhow.

 

# <?php          
$Colors = $_POST[Colors];
$quantity = $_POST[quantity];
$size = $_POST[size];
?>
  
<?php if ($quantity == "100") if ($Colors == "1col") if ($size == "a6") echo "$231.00"?>
<?php if ($quantity == "250") if ($Colors == "1col") if ($size == "a6") echo "$253.00"?>
<?php if ($quantity == "500") if ($Colors == "1col") if ($size == "a6") echo "$550.00"?>
<?php if ($quantity == "1000") if ($Colors == "1col") if ($size == "a6") echo "$792.00"?>
<?php if ($quantity == "2500") if ($Colors == "1col") if ($size == "a6") echo "$1892.00"?>

 

Thanks if anyone can point me in the correct direction. And please go easy on me. I am a complete noob!!

Link to comment
https://forums.phpfreaks.com/topic/173358-storing-data-from-a-form/
Share on other sites

I'm not quite sure what you want, but you said you wanted to get the data from that form, and post it into another form. Well thats easy enough, using the get variables you have, you can just set the value of the form to that variable like so

 

<input type="text" value="<?php echo $myVar; ?>" />

 

thats assuming you have the variable on the same page of the form however. If not, you will have to pass the variable through a get value, or through a hidden form, or as a session, and use it in whatever page.

Thanks for taking the time to reply mikesta707.

Yes it was for a seperate page i wanted the results to go to.

I am a little confused to be honest.

I understand you can use a post in first form and a get in second but how is the data stored?

If they are moving away from first form page and going to a complete new one.

Does it have to be in a session or a cookie or am i missing something?

Once again. I am a noob and my questions and termanology can and will be wrong from time to time.

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.