markco1
07-10-2007, 11:03 PM
I am a newbie and am having an issue making this work or even where to start.
I have the following php script that is currently functioning properly and posting to my DB.
I am using Flash to gather the information and send the info to the php script
My issue is now I need to fill out the form at the bottom with name, email and send to a site in order to populate a mailing list with subscribers.
In order for this to work I would need to pass just the email and name to the site and auto submit.
Thanks in adavance for your help
Any suggestions?
Mark
<?php
$con = mysql_connect('DBINFO', 'DBINFO', 'pASSWD') or die ("Could not connect to the Database");
mysql_select_db('dbinfo', $con) or die (mysql_error());
/*php variables to be used for next php script*/
$firstName = $_POST['firstName'];
$lastName = $_POST['lastName'];
$email = $_POST['email'];
$city = $_POST['city'];
$stateLoc = $_POST['stateLoc'];
$age = $_POST['age'];
$timestamp = date("n, j, Y");
/* Strip any escape characters etc */
$firstName = stripslashes($firstName);
$lastName = stripslashes($lastName);
$email = stripslashes($email);
$city = stripslashes($city);
$stateLoc = stripslashes($stateLoc);
$age = stripslashes($age);
$timestamp = stripslashes($timestamp);
$q1 = "INSERT INTO subscription (
first_name,
last_name,
email,
city,
state_loc,
age,
date
) VALUES (
'$firstName',
'$lastName',
'$email',
'$city',
'$stateLoc',
'$age',
'$timestamp'
)";
if (!mysql_query($q1,$con))
{
echo 'Error';
}else
{
echo 'Done';
}
mysql_close($con);
?>
//Form that needs to be submitted
<form method="post" action="http://scripts.company.com/add_list.cgi">
<input type="hidden" name="list" value="FromEmailAddress" />
<input type="hidden" name="domain" value="DomainName" />
<input type="hidden" name="url" value="SubscribedURL" />
<input type="hidden" name="unsuburl" value="UnsubscribedURL" />
<input type="hidden" name="alreadyonurl" value="AlreadyOnURL" />
<input type="hidden" name="notonurl" value="NotOnURL" />
<input type="hidden" name="invalidurl" value="InvalidURL" />
<input type="hidden" name="emailconfirmurl" value="EmailConfirmURL" />
<input type="hidden" name="emailit" value="1" />
Name: <input name="name" /> E-mail: <input name="email" /><br />
<input type="submit" name="submit" value="Join Our Announcement List" />
<input type="submit" name="unsub" value="Unsubscribe" />
</form>
I have the following php script that is currently functioning properly and posting to my DB.
I am using Flash to gather the information and send the info to the php script
My issue is now I need to fill out the form at the bottom with name, email and send to a site in order to populate a mailing list with subscribers.
In order for this to work I would need to pass just the email and name to the site and auto submit.
Thanks in adavance for your help
Any suggestions?
Mark
<?php
$con = mysql_connect('DBINFO', 'DBINFO', 'pASSWD') or die ("Could not connect to the Database");
mysql_select_db('dbinfo', $con) or die (mysql_error());
/*php variables to be used for next php script*/
$firstName = $_POST['firstName'];
$lastName = $_POST['lastName'];
$email = $_POST['email'];
$city = $_POST['city'];
$stateLoc = $_POST['stateLoc'];
$age = $_POST['age'];
$timestamp = date("n, j, Y");
/* Strip any escape characters etc */
$firstName = stripslashes($firstName);
$lastName = stripslashes($lastName);
$email = stripslashes($email);
$city = stripslashes($city);
$stateLoc = stripslashes($stateLoc);
$age = stripslashes($age);
$timestamp = stripslashes($timestamp);
$q1 = "INSERT INTO subscription (
first_name,
last_name,
email,
city,
state_loc,
age,
date
) VALUES (
'$firstName',
'$lastName',
'$email',
'$city',
'$stateLoc',
'$age',
'$timestamp'
)";
if (!mysql_query($q1,$con))
{
echo 'Error';
}else
{
echo 'Done';
}
mysql_close($con);
?>
//Form that needs to be submitted
<form method="post" action="http://scripts.company.com/add_list.cgi">
<input type="hidden" name="list" value="FromEmailAddress" />
<input type="hidden" name="domain" value="DomainName" />
<input type="hidden" name="url" value="SubscribedURL" />
<input type="hidden" name="unsuburl" value="UnsubscribedURL" />
<input type="hidden" name="alreadyonurl" value="AlreadyOnURL" />
<input type="hidden" name="notonurl" value="NotOnURL" />
<input type="hidden" name="invalidurl" value="InvalidURL" />
<input type="hidden" name="emailconfirmurl" value="EmailConfirmURL" />
<input type="hidden" name="emailit" value="1" />
Name: <input name="name" /> E-mail: <input name="email" /><br />
<input type="submit" name="submit" value="Join Our Announcement List" />
<input type="submit" name="unsub" value="Unsubscribe" />
</form>