Submission Problems

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Subfusion
Forum Newbie
Posts: 18
Joined: Mon Aug 15, 2005 6:53 am
Location: Spain

Submission Problems

Post by Subfusion »

I've been working on an application form where users fill out an application and it's send to my email address, the whole form is AJAX and the AJAX part seems to be working. There's only one problem, for some reason the PHP just doesn't seem to send, there's something wrong with the PHP. Could anyone point our where I'm going wrong?

Code: Select all

<?php
// Change the 4 variables below
$yourName = 'Prashant';
$yourEmail = '********@gmail.com';
$yourSubject = 'User Application';
$referringPage = 'http://www.domain.com/application/index.php';

// No need to edit below unless you really want to. It's using a simple php mail() function. Use your own if you want
function cleanPosUrl ($str) {
return stripslashes($str);
}
	if ( isset($_POST['sendContactEmail']) )
	{
	$to = $yourEmail;
	$subject = $yourSubject.': '.$_POST['posName'];
	$message = 	'Name: '.cleanUrl($_T['posName'])."\n"
				.'Email: '.cleanUrl($_T['posEmail'])."\n"
				.'Portfolio: '.cleanUrl($_T['posPortfolio'])."\n"
				.'Experience: '.cleanUrl($_T['posExperience'])."\n"
				."Statement: \n".cleanUrl($_T['posStatement'])."\n";
	$headers = "From: ".cleanPosUrl($_POST['posName'])." <".$_POST['posEmail'].">\r\n";
	$headers .= 'To: '.$yourName.' <'.$yourEmail.'>'."\r\n";
	$mailit = mail($to,$subject,$message,$headers);
		if ( @$mailit ) {
		header('Location: '.$referringPage.'?success=true');
		}
		else {
		header('Location: '.$referringPage.'?error=true');
		}
	}
?>
Also, when I click "Submit" I don't get any sort of parse errors, the page is blank.
Subfusion
Forum Newbie
Posts: 18
Joined: Mon Aug 15, 2005 6:53 am
Location: Spain

Post by Subfusion »

It's okay, I fixed it!
Post Reply