Forum Moderators: open
Now i dont know what to add in the "action" tag. I looked through some pages that used forms and there was a "mail.php" or "mailer.php" file. But i dont know how to make one.
And i read that it isnt recommended to use a "mailto=" script.
appreciate your help
When you submit a form, the data is encoded by the browser and processed as a single stream sent to the server. This means special characters are changed; a space, for example, is turned into a %20.
You don't use mailto in a form action because the encoded string is exactly what you get in the email, something like
email=whatever@wherever.com&subject=Welcome%20to%20my%20nightmare&message=Hello%20this%20is%20my%20message
Otherwise known as "gobbledygook."
So as tedster said, the usual action of a form is a server-side processor of some sort to decode the data and organize it in some human-legible format
Subject: Welcome to my nightmare
Email: whatever@wherever.com
Message: Hello this is my message
By any server-side language, the data is decoded, checked for malicious characters, formatted, sometimes even stored in a server database, then emailed on to its destination.
Do a search for perl or php tutorials to get started, the mailer is usually the first server-side project that draws people into programming.
<Sorry, no personal URLs.
See Terms of Service [webmasterworld.com]>
i used "action=mail.php" and im quit sure its right this way since i saw it in the sourcetxt of other sites. But it trys to open "mail.php" as a source. I dont know what i doing wrong here. Any ideas?
And if you need the php i can add it but im sure that the php file is right.
[edited by: tedster at 2:30 am (utc) on Mar. 24, 2005]
//variables (change these)
$youremail = "contact@noyd.net";
// your email address
$subject = "Contact";
// the subject of the email
$thankyou = "/contact02.html";
// thank you page
// don't change anything else
if($email == ""){
?>
<body bgcolor="#55A3DC">
E-mail Has Been Sent.<br/>
<?php
}elseif($name == ""){
?>
No name added. Please go back.<br/>
<?php
}elseif($message == ""){
?>
No message added. Please go back.<br/>
<?php
}else{
$msg = ereg_replace("\\\'", "'", $message);
$msg = ereg_replace('\\\"', "\"", $msg);
$message1 = "from: $name\nemail: $email\nmessage:\n$msg1";
mail($youremail, $subject, $msg, "From: $email\r\nReply-to: $email\r\n");
?>
<meta http-equiv="refresh" content="0; url=<?echo $thankyou;?>"">
<?php
}
?>
<?
phpinfo();
?>
Name it phptest.php or something and upload it. When you open the file in your browser, you should either see loads and loads of configuration info about PHP if it is supported, or the page won't work. If this is the case then you could contact you webhost and ask them to install PHP (which is free), or find a new host!
<Again, no personal URLs.
See Terms of Service [webmasterworld.com]>
[edited by: tedster at 8:32 pm (utc) on Mar. 24, 2005]