Hey guys, hope you don't mind me jumping on the back of your little discussion there- however long ago it might have been!
In answer to Pittiman's question:
"What would be the use of it? No user had a chance to enter data, so it must be you to prefill the form. The data for prefilling are already known to you, so why send them?"
...my response is this:
I'm using a thrid-party web-service for auto-response e-mail and newsletter services.
Normally a user enters their info into a form and clicks submit. This gets sent to the third-party who send my user back to my site to a pre-defined landing page set by me (i.e.
Thing is, I'm trying to take my data-collection to another level! :eek:
I have a new-user registration form, part of which is the classic 'Tick here to get our newsletter'
When they submit the form, all of their data is inserted into MY database for my use for everything my web-system is doing, but if 'optIN' is set to 1, I send them to an invisible page that sends their name and e-mail to the third-party, who then sends the usr back invisibly... nice!
For anyone who wants it, my invisible auto-submitted form looks like this:
// initialise the session:
// I set $_session['optIn'] when they first entered their info,
// as well as email and names (see below)
// ...I call it now!
// user requested to NOT be added to the newsletter
// send them to the page the 3rd-party service provider sends them to:
// run the page!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<title>You're Not Gonna See This!</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<form method="post" action="http://www.thirdPartyServiceProvider.whatever" name="myForm" id="myForm">
IMPORANT NOTE: DO NOT re-name the form- it is called by the name 'myForm'!
<input type="hidden" name="whatever" value="1234" />
<input type="hidden" name="redirect" value="http://www.backtomysite.com/editPersonal.php" />
<input type="hidden" name="meta_required" value="from,name" />
<input type="hidden" name="meta_forward_vars" value="0" />
<input type="hidden" name="name" value="<? echo $_SESSION['firstname']; ?> <? echo $_SESSION['lastname']; ?>" />
<input type="hidden" name="from" value="<? echo $_SESSION['email']; ?>" />
<!-- now send the form! -->
And that's it!
Hope this helps!