Jump to content
Killersites Forums

how to make a xml registration form


Recommended Posts

i have a simple html registration form i am trying to submit the collected data as xml please let me know can i do this. this is my send.php please advise

 

 

<?

include_once "connect.php";

include_once "functions.php";

 

if (isset($_POST['name']) && !isset($_POST['freequote'])) {

$MSG = 'Contact Us:<br>';

$MSG .= (isset($_POST['name']))? 'Name = '.$_POST['name']."<br>" : '';

$MSG .= (isset($_POST['phone']))? 'Phone = <span dir=ltr>'.$_POST['phone']."</span><br>" : '';

$MSG .= (isset($_POST['email']))? 'Email = <span dir=ltr>'.$_POST['email']."</span><br>" : '';

$MSG .= (isset($_POST['comment']))? 'Comments = '.nl2br($_POST['comment'])."<br>" : '';

$MSG = "<div>$MSG</div>";

$headers = "MIME-Version: 1.0\n";

$headers .= "Content-type: text/html; charset=windows-1255\n";

$headers .= "From: Movers Community <info@moverscommunity.com>\n";

$subject = "From Website: ".$_SERVER['REMOTE_ADDR'];

$st = mail('avidanbanks@gmail.com ', $subject, $MSG, $headers);

header('location: thanks.php');

exit();

}

 

if (isset($_POST['freequote'])) {

$phone = fixquotes($_REQUEST['phone']);

$phone2 = fixquotes($_REQUEST['phone2']);

$name = fixquotes($_REQUEST['name']);

$Last_Name = fixquotes($_REQUEST['Last_Name']);

$email = fixquotes($_REQUEST['email']);

$How_Quotes = intval($_REQUEST['How_Quotes']);

$contactTime = fixquotes($_REQUEST['Contact_Time']);

$contactPref = fixquotes($_REQUEST['Contact_Preference']);

$From_City = fixquotes($_REQUEST['From_City']);

$To_City = fixquotes($_REQUEST['To_City']);

$From_State = fixquotes($_REQUEST['From_State']);

$To_State = fixquotes($_REQUEST['To_State']);

$From_Zip = fixquotes($_REQUEST['From_Zip']);

$To_Zip = fixquotes($_REQUEST['To_Zip']);

$Move_Date = strtotime($_REQUEST['MoveMonth']."/".$_REQUEST['MoveDay']."/".$_REQUEST['MoveYear']);

$Move_Size = fixquotes($_REQUEST['Move_Size']);

$comment = fixquotes($_REQUEST['comment']);

$dater = strtotime("now");

 

$sql = "

INSERT INTO leads (

homePhone, workPhone, firstName, lastName, email, origQuotes, contactPref, contactTime,

From_City, To_City, From_State, To_State, From_Zip, To_Zip, Move_Date, Move_Size, comment, dater

)

VALUES(

'$phone','$phone2','$name','$Last_Name','$email','$How_Quotes', '$contactPref', '$contactTime',

'$From_City', '$To_City', '$From_State', '$To_State', '$From_Zip', '$To_Zip', '$Move_Date', '$Move_Size', '$comment', '$dater'

)";

 

$rs = mysql_query($sql);

 

$MSG = 'Free Quote:<br>';

$MSG .= (isset($_POST['name']))? 'Name = '.$_POST['name']."<br>" : '';

$MSG .= (isset($_POST['Last_Name']))? 'Last Name = '.$_POST['Last_Name']."<br>" : '';

$MSG .= (isset($_POST['phone']))? 'Home Phone = <span dir=ltr>'.$_POST['phone']."</span><br>" : '';

$MSG .= (isset($_POST['phone2']))? 'Work Phone = <span dir=ltr>'.$_POST['phone2']."</span><br>" : '';

$MSG .= (isset($_POST['email']))? 'Email = <span dir=ltr>'.$_POST['email']."</span><br>" : '';

$MSG .= 'Contact Preference = <span dir=ltr>'.$_POST['Contact_Preference']."</span><br>";

$MSG .= 'Contact Time = <span dir=ltr>'.$_POST['Contact_Time']."</span><br>";

$MSG .= 'How many quotes = <span dir=ltr>'.$_POST['How_Quotes']."</span><br>";

$MSG .= 'From City = <span dir=ltr>'.$_POST['From_City']."</span><br>";

$MSG .= 'To City = <span dir=ltr>'.$_POST['To_City']."</span><br>";

$MSG .= 'From State = <span dir=ltr>'.$_POST['From_State']."</span><br>";

$MSG .= 'To State = <span dir=ltr>'.$_POST['To_State']."</span><br>";

$MSG .= 'From Zip = <span dir=ltr>'.$_POST['From_Zip']."</span><br>";

$MSG .= 'To Zip = <span dir=ltr>'.$_POST['To_Zip']."</span><br>";

$MSG .= 'Move Date = <span dir=ltr>'.$_POST['MoveMonth']."/".$_POST['MoveDay']."/".$_POST['MoveYear']."</span><br>";

$MSG .= 'Move Size = <span dir=ltr>'.$_POST['Move_Size']."</span><br>";

$MSG .= (isset($_POST['comment']))? 'Comments = '.nl2br($_POST['comment'])."<br>" : '';

$MSG = "<div>$MSG</div>";

$headers = "MIME-Version: 1.0\n";

$headers .= "Content-type: text/html; charset=windows-1255\n";

$headers .= "From: Movers Community <info@moverscommunity.com>\n";

$subject = "From Website: ".$_SERVER['REMOTE_ADDR'];

 

$st = mail('avidanbanks@gmail.com ', $subject, $MSG, $headers);

 

/*echo $sql;

echo "<br>";

die($MSG);*/

header('location: thanks.php');

exit();

}

 

?>

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...