Jump to content

PHP Form Help


phpforsilk

Recommended Posts

Hey Anyone....I am having an issue with a form on my website that is supposed to email selected pdf files to a user when they select something, enter their email address and then hit submit.  The "thank you" page appears when the submit button is clicked but nothing else happens.  Any suggestions?  Thanks

Link to comment
Share on other sites

Sorry, Here's the code....I'm new to all of this so please bear with me.  Thanks to anyone that can help.

 

Cheers,

 

<?

/* Required Files */

require_once('../common/application.php');

require_once('../common/functions.php');



/* set defaults */



if ($_POST['email_type'] == "demorequest"){
	if ($_POST['email_type'] == "inforequest"){


// generate CORE Software Corp. email content

	$content = "The following person has completed the form to access the Renaissance Architect Demo.\n\n";

	$content .= "{$_POST['firstname']} {$_POST['lastname']}\n";

	$content .= "{$_POST['company']}\n";

	$content .= "{$_POST['email']}\n\n";

	$to = "wlucky@coresoftwarecorp.com" . ", ";

	$to .= "lwallace@coresoftwarecorp.com";

	$subject = "Renaissance Architect Demo request";

	// sending email

	mail($to, $subject, "{$content}","From: webmaster@coresoftwarecorp.com");

}

/* Send the potential customer to the demo now.  */

header("Location: http://www.coremigration.com/demo/interface.html");


/* set defaults */

setPOST("wp_bus", 0);

setPOST("wp_tech", 0);

setPOST("cs_npb", 0);

setPOST("cs_vis", 0);

setPOST("bro_core", 0);

setPOST("ebul", 0);



$date = date("Ymd");




	/* Create DB reference */

	$db = &$_APP['masterdb'];

	$db->connect();



	// insert fields

	$sql = "INSERT INTO t_inforequests (salutation, name, company, telephone, title, email, migration, migration_start, 

				findus, wp_bus, wp_tech, cs_npb, cs_vis, bro_core, requestedon, ebul, isdeleted) 

			VALUES ('{$_POST['salutation']}', '{$_POST['name']}', '{$_POST['company']}', '{$_POST['telephone']}', '{$_POST['title']}','{$_POST['email']}',

					'{$_POST['migration']}', '{$_POST['migration_start']}', '{$_POST['findus']}', {$_POST['wp_bus']}, 

					{$_POST['wp_tech']}, {$_POST['cs_npb']}, {$_POST['cs_vis']}, {$_POST['bro_core']}, '{$date}',{$_POST['ebul']},0)";

	$req_insert = $db->query($sql);



	// generate client email content

	$content = "To view the documents that you requested, please go to\n\n";

	if ($_POST['wp_bus']) $content .= "http://www.coremigration.com/pdf/Core_Migration_Business_WP.pdf\n";

	if ($_POST['wp_tech']) $content .= "http://www.coremigration.com/pdf/Core_Migration_Technical_WP.pdf\n";

	if ($_POST['cs_npb']) $content .= "http://www.coremigration.com/pdf/CORE_study_NPB.pdf\n";

	if ($_POST['cs_vis']) $content .= "http://www.coremigration.com/pdf/CORE_study_VISaer.pdf\n";

	if ($_POST['bro_core']) $content .= "http://www.coremigration.com/pdf/COREbrochure.pdf\n";

	if ($_POST['ebul']) $content .= "\n\nYou have also been signed up for our monthly e-bulletin as per your request.\n\n";

	$content .= "\nIf you have any questions, please contact us directly.\n\n";

	$content .= "Or, if you would like to know how long it will take to migrate your legacy PowerHouse application, or how much will it cost, please go to our free estimate at the following URL http://www.coremigration.com/options_estimate.html\n\n";

	$content .="Thank you.\nCORE Migration - The proven PowerHouse migration method\n";

	$content .="Tel: 613.727.5051\n";

	$content .="Fax: 613.727.2603\n";

	$content .="Toll-free: 1-877-768-2673 (in Canada, United States)\n\n";

	$content .="Sales: sales@coremigration.com\n";

	$content .="Career Opportunities: careers@coremigration.com\n";

	$content .="General Inquiries and comments: info@coremigration.com\n";

	// sending email

	mail("{$_POST['email']}", "The CORE Migration documents that you requested", "{$content}","From: sales@coremigration.com");



	// generate CORE email content

	$content = "The following person has requested documents from the CORE website.\n\n";

	$content .= "These documents were automatically forwarded to them.\n\n";

	if ($_POST['ebul']) $content .= "The client was also signed up for the monthly e-bulletin\n\n";

	$content .= "{$_POST['salutation']} {$_POST['name']}\n";

	$content .= "{$_POST['company']}\n";

	$content .= "{$_POST['telephone']}\n";

	$content .= "{$_POST['email']}\n\n";

	$content .= "The administrative section of the CORE website has been updated accordingly.\n";

	$content .= "http://www.coremigration.com/admin/index.php\n";

	// sending email

	mail("sales@coremigration.com", "Website Document request", "{$content}","From: webmaster@coremigration.com");

}



header("Location: http://www.coremigration.com/resources_thankyou.html");



exit;


?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.