vozzek Posted December 11, 2007 Share Posted December 11, 2007 Hi all, I've got a checkout page on my website that contains $_POSTed information from the previous page (shipping and billing address). The page also shows the user's shopping cart, by looping though one of my mySQL tables. On this page, I have a form that allows the user to add a gift certificate to the cart. A radio button selects the denomination, and they click submit. From here, I launch into another .php page to do some SQL checks and updates. Once done, I'd like to automatically return to the checkout page... but now, I need to re-pass the previously $_POSTed data. Is there an automatic way to pass this data from page 1, to page 2, and then back to page 1 again - without a 'submit' button? That's my first question. Second question: Is there an easier/better way to do this that doesn't include AJAX I know I could write the php code to do the SQL stuff right on the checkout page, but in order for the shopping cart to show the newly added gift certificate it would have to do an automatic page update when done. I don't want the user to see a "RE-POST FORM DATA?" question pop up and then have to click "OK" - that's just sloppy. (Perhaps there's a command to automatically re-post form data when the page loads that I don't know about yet?) Anyway, any advice on this would be greatly appreciated. I've found a hell of a lot of help on these boards from some real savvy people - you guys rock, and I mean that. Thanks. Quote Link to comment Share on other sites More sharing options...
mrdamien Posted December 11, 2007 Share Posted December 11, 2007 Sessions. You can do index.php <? session_start(); $_SESSION['varname'] = "data"; $_SESSION['address'] = "11111 blue street"; ?> page2.php <? session_start(); echo $_SESSION['varname'] . " " . $_SESSION['address']; ?> data 11111 blue street Check the php website for more info Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.