Form to Form?

liunx

Guest
Right I need help with some php form stuff, <img src="http://www.webdesignerforum.co.uk/style_emoticons/default/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> <br /><br />I'd like a form where I can submit say <br /><br />Name:<br /><br />Age:<br /><br />Location:<br /><br />That will then generate url's with which I can open another page (that has a form), and these fields will be filled in automatically style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
How much PHP do you know?<br /><br />To use the values entered in the first form you use the superglobal $_POST variable. You then insert these into the appropriate form fields in the next form. (Don't forget to sanitise the $_POST variables before using them in your code flow.)<br /><br />I'm not sure what you mean by "generating URLs"... Do you want the first form to create a file?<!--content-->
I'm getting there with php but I'm definitely no expert yet!<br /><br />The forms that the captured info will go to will be for an external site, for example to sign up for 2 email accounts which require all the same information, you just enter your info target="_blank">http://www.justfigures.co.uk/javascriptcookies.php<br /><br />Because it has been so useful to me:<br /><br />Script number 6. "Passing cookie values from page to page using multiple cookies. Using a form to collect the values from the user." Does that sound like what you require?<br /><br /><br />I shall attempt to place the code here but it involves a couple of functions:<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><!-- java script:Cookies snippet 6. --><br /><!-- Passing cookie values from page to page using multiple cookies. --><br /><br /><!-- Place the following in the head of the first page. --><br /><script language="JavaScript" type="text/javascript"><br />// create a new Date object<br />var expiryDate=new Date()<br />// set the expiry date of the cookie to 100 days in the future<br />expiryDate.setTime(expiryDate.getTime() + (1000*60*60*24*100))<br /><br />/* function to add the values of the form elements to individual cookies,<br />this function calls setCookie() which can be in your function library */<br />function setValues(aForm){<br />setCookie("petNameCookie",aForm.txtPetName6a.value,expiryDate)<br />setCookie("petSpeciesCookie",aForm.txtPetSpecies6a.value,expiryDate)<br />}<br /></script><br /><br /><!--<br />Place the following in the body of the first page.<br />--><br /><form name="frmTestCookie6a" id="frmTestCookie6a"><img src='http://www.webdesignerforum.co.uk/style_images/1/post_snapback.gif' alt='*' border='0' /></div><div class='quotemain'><!--quotec-->hm... have you tried getting the action property of the target form and use that URL in your own form's action property?<!--QuoteEnd--></div><!--QuoteEEnd--><br /><br />Haha - try going to hotmail.com like I just did, you'll probably be redirected to login.live.com. Have a look in the source for their login form. You won't see it, because <i>the entire page is javascript</i>.<br /><br />That's just insane. I can't imagine why you'd want to do that.<!--content-->
<!--quoteo(post=15709:date=Nov 7 2007, 22:07:name=Nathan Reynolds)--><div class='quotetop'>QUOTE(Nathan Reynolds @ Nov 7 2007, 22:07) <img src='http://www.webdesignerforum.co.uk/style_images/1/post_snapback.gif' alt='*' border='0' /></div><div class='quotemain'><!--quotec-->Haha - try going to hotmail.com like I just did, you'll probably be redirected to login.live.com. Have a look in the source for their login form. You won't see it, because <i>the entire page is javascript</i>.<br /><br />That's just insane. I can't imagine why you'd want to do that.<!--QuoteEnd--></div><!--QuoteEEnd--><br /><br />Why am I not surpriced... For some reason I've noticed that ASP sites more often tend to rely on JS for navigation. Anyone got a clue to why? I've never used ASP myself but surely the language itself can't rely on JS? Must be bad design from the developers.<br />/me looks for some naughty developers to thump!<!--content-->
i figured it out<br /><br />use the first form to generate a url like <!-- w --><a class="postlink" href="http://www.site.com/submit?name=yournamehere&message=yourmessage">www.site.com/submit?name=yournamehere&m ... ourmessage</a><!-- w --> <br /><br />then follow that url and it fills em in on the second site<!--content-->
 
Top