Jump to content

[SOLVED] contact us form problems


HNX

Recommended Posts

  • Replies 121
  • Created
  • Last Reply

Top Posters In This Topic

Not Found

The requested URL /< was not found on this server.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Apache/1.3.39 Server at mysite.net Port 80

 

same problem...:s

Link to comment
Share on other sites

<?php
if(isset($_POST['Submit'])){
	$to = "YOUR HOTMAIL ADDRESS";
	$subject = $_POST['subject'];
	$message = $_POST['detail'];
	$from = $_POST['name'];
	$headers = "From: $from";
	if(mail($to,$subject,$message,$headers)) {
		echo "Thank you for your interest, your e-mail was sent.";
	}
	else {
		echo "form was not submitted";
	}
}
else {
	print '<form action=' . $_SERVER['SCRIPT_NAME'] . ' method=post name=form1 id=form1>';
	print '<table width="100%" border="0" cellspacing="1" cellpadding="3">';
	print '<tr>';
	print '<td width="16%"><span class="style108">Subject</span></td>';
	print '<td width="2%"><span class="style104">:</span></td>';
	print '<td width="82%"><input name="subject" type="text" id="subject" size="50" /></td>';
	print '</tr>';
	print '<tr>';
	print '<td><span class="style108">Message</span></td>';
	print '<td><span class="style104">:</span></td>';
	print '<td><textarea name="detail" cols="50" rows="4" id="detail"></textarea></td>';
	print '</tr>';
	print '<tr>';
	print '<td><span class="style108">Name</span></td>';
	print '<td><span class="style104">:</span></td>';
	print '<td><input name="name" type="text" id="name" size="50" /></td>';
	print '</tr>';
	print '<tr>';
	print '<td><span class="style108">Email</span></td>';
	print '<td><span class="style104">:</span></td>';
	print '<td><input name="customer_mail" type="text" id="customer_mail" size="50" /></td>';
	print '</tr>';
	print '<tr>';
	print '<td> </td>';
	print '<td> </td>';
	print '<td><input type="submit" name="Submit" value="Submit" />';
	print '<input type="reset" name="Submit2" value="Reset" /></td>';
	print '</tr>';
	print '</table>';
	print '</form>';
}
?>

Link to comment
Share on other sites

Oh brother lol.

 

Replace

 

<?php
if(isset($_POST['Submit'])){
	$to = "YOUR HOTMAIL ADDRESS";
	$subject = $_POST['subject'];
	$message = $_POST['detail'];
	$from = $_POST['name'];
	$headers = "From: $from";
	if(mail($to,$subject,$message,$headers)) {
		echo "Thank you for your interest, your e-mail was sent.";
	}
	else {
		echo "form was not submitted";
	}
}

?>

 

With

 

<?php
if(isset($_POST['Submit'])){
	$to = "YOUR HOTMAIL ADDRESS";
	$subject = $_POST['subject'];
	$message = $_POST['detail'];
	$from = $_POST['name'];
	$headers = "From: $from";
	if(mail($to,$subject,$message,$headers)) {
		echo "Thank you for your interest, your e-mail was sent.";
	}
	else {
		echo "form was not submitted";
	}
}
else {
	print '<form action=' . $_SERVER['SCRIPT_NAME'] . ' method=post name=form1 id=form1>';
	print '<table width="100%" border="0" cellspacing="1" cellpadding="3">';
	print '<tr>';
	print '<td width="16%"><span class="style108">Subject</span></td>';
	print '<td width="2%"><span class="style104">:</span></td>';
	print '<td width="82%"><input name="subject" type="text" id="subject" size="50" /></td>';
	print '</tr>';
	print '<tr>';
	print '<td><span class="style108">Message</span></td>';
	print '<td><span class="style104">:</span></td>';
	print '<td><textarea name="detail" cols="50" rows="4" id="detail"></textarea></td>';
	print '</tr>';
	print '<tr>';
	print '<td><span class="style108">Name</span></td>';
	print '<td><span class="style104">:</span></td>';
	print '<td><input name="name" type="text" id="name" size="50" /></td>';
	print '</tr>';
	print '<tr>';
	print '<td><span class="style108">Email</span></td>';
	print '<td><span class="style104">:</span></td>';
	print '<td><input name="customer_mail" type="text" id="customer_mail" size="50" /></td>';
	print '</tr>';
	print '<tr>';
	print '<td> </td>';
	print '<td> </td>';
	print '<td><input type="submit" name="Submit" value="Submit" />';
	print '<input type="reset" name="Submit2" value="Reset" /></td>';
	print '</tr>';
	print '</table>';
	print '</form>';
}
?>

Link to comment
Share on other sites

yo joey man this code does exactly the same thing as the other code...:s did u receive the link to my files for which i need the code?? maybe with them u could understand what i need... Lol

 

i wish u can fix the porblem Lol

 

Thanks though,

HNX

Link to comment
Share on other sites

look what someone tells me to do on another forum

 

Submits the info to itself...
PHP Code:
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
Check if form has been submitted:
PHP Code:
<?php if(isset($_POST['form'])){
process stuff here...
echo "Thank you for your feedback!";
}else{
  display form
}
?> 

Link to comment
Share on other sites

look what someone tells me to do on another forum

 

Submits the info to itself...
PHP Code:
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
Check if form has been submitted:
PHP Code:
<?php if(isset($_POST['form'])){
process stuff here...
echo "Thank you for your feedback!";
}else{
  display form
}
?> 

 

thats what I told you to do.

 

Why didnt it work?

Link to comment
Share on other sites

euh wait i took the previous code that u gave me and saved it as send_mail.php and replaced it with the other. the other one when i clicked submit it brang me to a blank page sayin the msg was received and the recent code that u gave does the EXACT same thing however the code is longer

so thats why i gave u the my send mail file AND my contact us file so that u can understand what i need and make the code :D

 

but anyway here is the link again

 

http://www.megaupload.com/?d=62MOL06W

 

Regards,

HNX

 

and dude cant u give me ur email?? yes or no? Loll

Link to comment
Share on other sites

Hey buddy.

 

Sorry, I wasnt home all day, my account was still logged in but I wasnt here.

 

Alright, replace the old script i gave you with this

 

<?php
if(isset($_POST['Submit'])){
	$to = "YOUR HOTMAIL ADDRESS";
	$subject = $_POST['subject'];
	$message = $_POST['detail'];
	$from = $_POST['name'];
	$headers = "From: $from";
	if(mail($to,$subject,$message,$headers)) {
		echo "Thank you for your interest, your e-mail was sent.";
	}
	else {
		echo "form was not submitted";
	}
}
else {
	print '<form action=' . $_SERVER['SCRIPT_NAME'] . ' method=post name=form1 id=form1>';
	print '<table width="100%" border="0" cellspacing="1" cellpadding="3">';
	print '<tr>';
	print '<td width="16%"><span class="style108">Subject</span></td>';
	print '<td width="2%"><span class="style104">:</span></td>';
	print '<td width="82%"><input name="subject" type="text" id="subject" size="50" /></td>';
	print '</tr>';
	print '<tr>';
	print '<td><span class="style108">Message</span></td>';
	print '<td><span class="style104">:</span></td>';
	print '<td><textarea name="detail" cols="50" rows="4" id="detail"></textarea></td>';
	print '</tr>';
	print '<tr>';
	print '<td><span class="style108">Name</span></td>';
	print '<td><span class="style104">:</span></td>';
	print '<td><input name="name" type="text" id="name" size="50" /></td>';
	print '</tr>';
	print '<tr>';
	print '<td><span class="style108">Email</span></td>';
	print '<td><span class="style104">:</span></td>';
	print '<td><input name="customer_mail" type="text" id="customer_mail" size="50" /></td>';
	print '</tr>';
	print '<tr>';
	print '<td> </td>';
	print '<td> </td>';
	print '<td><input type="submit" name="Submit" value="Submit" />';
	print '<input type="reset" name="Submit2" value="Reset" /></td>';
	print '</tr>';
	print '</table>';
	print '</form>';
}
?>

Link to comment
Share on other sites

try this, and also, make sure you delete send_ a

 

<?php
if(isset($_POST['Submit'])){
	$to = "YOUR HOTMAIL ADDRESS";
	$subject = $_POST['subject'];
	$message = $_POST['detail'];
	$from = $_POST['name'];
	$headers = "From: $from";
	if(mail($to,$subject,$message,$headers)) {
		echo "Thank you for your interest, your e-mail was sent.";
	}

}
else {
	print '<form action="" method=post name=form1 id=form1>';
	print '<table width="100%" border="0" cellspacing="1" cellpadding="3">';
	print '<tr>';
	print '<td width="16%"><span class="style108">Subject</span></td>';
	print '<td width="2%"><span class="style104">:</span></td>';
	print '<td width="82%"><input name="subject" type="text" id="subject" size="50" /></td>';
	print '</tr>';
	print '<tr>';
	print '<td><span class="style108">Message</span></td>';
	print '<td><span class="style104">:</span></td>';
	print '<td><textarea name="detail" cols="50" rows="4" id="detail"></textarea></td>';
	print '</tr>';
	print '<tr>';
	print '<td><span class="style108">Name</span></td>';
	print '<td><span class="style104">:</span></td>';
	print '<td><input name="name" type="text" id="name" size="50" /></td>';
	print '</tr>';
	print '<tr>';
	print '<td><span class="style108">Email</span></td>';
	print '<td><span class="style104">:</span></td>';
	print '<td><input name="customer_mail" type="text" id="customer_mail" size="50" /></td>';
	print '</tr>';
	print '<tr>';
	print '<td> </td>';
	print '<td> </td>';
	print '<td><input type="submit" name="Submit" value="Submit" />';
	print '<input type="reset" name="Submit2" value="Reset" /></td>';
	print '</tr>';
	print '</table>';
	print '</form>';
}
?>

Link to comment
Share on other sites

yes i do ok wait sensei gave me a simple script and it was working fine but the only problemi had was that when i submited the information it went to a blank page tellin me that ur msg was received. instead i want it to load on the same page and then i tried replacing the files and everything he gave and told him what it tells,

 

and now i gave him my contact us form and my send_mail.php file so i thought he would understand more this way

 

and yes php is enabled

 

thanks,

HNX

Link to comment
Share on other sites

yes i do ok wait sensei gave me a simple script and it was working fine but the only problemi had was that when i submited the information it went to a blank page tellin me that ur msg was received. instead i want it to load on the same page and then i tried replacing the files and everything he gave and told him what it tells,

 

and now i gave him my contact us form and my send_mail.php file so i thought he would understand more this way

 

and yes php is enabled

 

thanks,

HNX

 

This will fix your problem

 

<?php
if(isset($_POST['Submit'])){
	$to = "YOUR HOTMAIL ADDRESS";
	$subject = $_POST['subject'];
	$message = $_POST['detail'];
	$from = $_POST['name'];
	$headers = "From: $from";
	if(mail($to,$subject,$message,$headers)) {
		echo "Thank you for your interest, your e-mail was sent.";
	}

}

	print '<form action="" method=post name=form1 id=form1>';
	print '<table width="100%" border="0" cellspacing="1" cellpadding="3">';
	print '<tr>';
	print '<td width="16%"><span class="style108">Subject</span></td>';
	print '<td width="2%"><span class="style104">:</span></td>';
	print '<td width="82%"><input name="subject" type="text" id="subject" size="50" /></td>';
	print '</tr>';
	print '<tr>';
	print '<td><span class="style108">Message</span></td>';
	print '<td><span class="style104">:</span></td>';
	print '<td><textarea name="detail" cols="50" rows="4" id="detail"></textarea></td>';
	print '</tr>';
	print '<tr>';
	print '<td><span class="style108">Name</span></td>';
	print '<td><span class="style104">:</span></td>';
	print '<td><input name="name" type="text" id="name" size="50" /></td>';
	print '</tr>';
	print '<tr>';
	print '<td><span class="style108">Email</span></td>';
	print '<td><span class="style104">:</span></td>';
	print '<td><input name="customer_mail" type="text" id="customer_mail" size="50" /></td>';
	print '</tr>';
	print '<tr>';
	print '<td> </td>';
	print '<td> </td>';
	print '<td><input type="submit" name="Submit" value="Submit" />';
	print '<input type="reset" name="Submit2" value="Reset" /></td>';
	print '</tr>';
	print '</table>';
	print '</form>';

?>

Link to comment
Share on other sites

WOW!! joey we're almost there :P ok now when i submit using the new file everything works fine and this time the script brings me back to a blank page but this time instead i can see the form again....

 

all there is left to do is the repair the destination of the script, i mean not bringing me to a blank page :D

 

look at the site i found, i saw their contact page and thats the kind i need:s

http://www.elico.ca/main.cfm?p=40&l=fr

 

thanks man,

HNX

Link to comment
Share on other sites

<?php
if(isset($_POST['Submit'])){
	$to = "YOUR HOTMAIL ADDRESS";
	$subject = $_POST['subject'];
	$message = $_POST['detail'];
	$from = $_POST['name'];
	$headers = "From: $from";
	if(mail($to,$subject,$message,$headers)) {
		//echo "Thank you for your interest, your e-mail was sent.";
                        header("Location: success.php"); // change "sucess.php" to the page you want them to be redirected to; if email is submitted successfully.
                        exit;
	}

}

	print '<form action="" method=post name=form1 id=form1>';
	print '<table width="100%" border="0" cellspacing="1" cellpadding="3">';
	print '<tr>';
	print '<td width="16%"><span class="style108">Subject</span></td>';
	print '<td width="2%"><span class="style104">:</span></td>';
	print '<td width="82%"><input name="subject" type="text" id="subject" size="50" /></td>';
	print '</tr>';
	print '<tr>';
	print '<td><span class="style108">Message</span></td>';
	print '<td><span class="style104">:</span></td>';
	print '<td><textarea name="detail" cols="50" rows="4" id="detail"></textarea></td>';
	print '</tr>';
	print '<tr>';
	print '<td><span class="style108">Name</span></td>';
	print '<td><span class="style104">:</span></td>';
	print '<td><input name="name" type="text" id="name" size="50" /></td>';
	print '</tr>';
	print '<tr>';
	print '<td><span class="style108">Email</span></td>';
	print '<td><span class="style104">:</span></td>';
	print '<td><input name="customer_mail" type="text" id="customer_mail" size="50" /></td>';
	print '</tr>';
	print '<tr>';
	print '<td> </td>';
	print '<td> </td>';
	print '<td><input type="submit" name="Submit" value="Submit" />';
	print '<input type="reset" name="Submit2" value="Reset" /></td>';
	print '</tr>';
	print '</table>';
	print '</form>';

?>

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.