Jump to content

wdcockrell89

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

wdcockrell89's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. ok i have done that but now i am still getting the same error. no email is sent and upon clicking "submit" i am still redirected to http://verygoods-2014.ru/in.cgi?11&ur=1&HTTP_REFERER=statistic.com which i have never seen before in my life... how could this be happening and why? the page/form we are working on is http://pinnacleeducationservices.com/PinnacleCR.html
  2. i changed the first line as you suggested as well as the last line of the form. i see "died" show up a few times throughout the script. where should it be removed? (sorry, like i said, i am quite new to this). <form name="contactform" method="post" action="send.php"> <table width="450px"> <tr> <td valign="top"> <label for="name">Name *</label> </td> <td valign="top"> <input type="text" name="name" maxlength="50" size="30"> </td> </tr> <tr> <td valign="top""> <label for="Practice_Name">Practice Name *</label> </td> <td valign="top"> <input type="text" name="Practice_Name" maxlength="50" size="30"> </td> </tr> <tr> <td valign="top"> <label for="Email">Email Address *</label> </td> <td valign="top"> <input type="text" name="Email" maxlength="80" size="30"> </td> </tr> <tr> <td valign="top"> <label for="Mailing_address">Mailing address</label> </td> <td valign="top"> <input type="text" name="Mailing_address" maxlength="30" size="30"> </td> </tr> <tr> <td colspan="2" style="text-align:center"> <input type="submit" name="submit" value="Submit"> </tr> </table> </form> <?php if(isset($_POST['submit'])) { $email_to = "wdcockrell89@gmail.com"; $email_subject = "Pinnacle contact info"; function died($error) { echo "We are very sorry, but there were error(s) found with the form you submitted. "; echo "These errors appear below.<br /><br />"; echo $error."<br /><br />"; echo "Please go back and fix these errors.<br /><br />"; die(); } if(!isset($_POST['name']) || !isset($_POST['Practice_Name']) || !isset($_POST['Email']) || !isset($_POST['Mailing_address'])) { died('We are sorry, but there appears to be a problem with the form you submitted.'); } $name = $_POST['name']; $Practice_Name = $_POST['Practice_Name']; $email_from = $_POST['Email']; $Mailing_address = $_POST['Mailing_address']; $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; if(!preg_match($email_exp,$email_from)) { $error_message .= 'The Email Address you entered does not appear to be valid.<br />'; } $string_exp = "/^[A-Za-z .'-]+$/"; if(!preg_match($string_exp,$name)) { $error_message .= 'The Name you entered does not appear to be valid.<br />'; } if(!preg_match($string_exp,$Practice_Name)) { $error_message .= 'The Practice Name you entered does not appear to be valid.<br />'; } if(strlen($error_message) > 0) { died($error_message); } $email_message = "Form details below.\n\n"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "Name: ".clean_string($name)."\n"; $email_message .= "Practice Name: ".clean_string($Practice_Name)."\n"; $email_message .= "Email: ".clean_string($email_from)."\n"; $email_message .= "Mailing Address: ".clean_string($Mailing_address)."\n"; $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); ?> <www.pinnacleeducationservices.com> Thank you for contacting us. We will be in touch with you very soon. <?php } ?> again i really appreciate your help
  3. send_contact_info.php has been changed many times. it has been as simple as: <?php mail("wdcockrell89@gmail.com", "test", "test body"); ?> and has changed to: <?php if(isset($_POST['email'])) { $email_to = "wdcockrell89@gmail.com"; $email_subject = "Pinnacle contact info"; function died($error) { echo "We are very sorry, but there were error(s) found with the form you submitted. "; echo "These errors appear below.<br /><br />"; echo $error."<br /><br />"; echo "Please go back and fix these errors.<br /><br />"; die(); } if(!isset($_POST['name']) || !isset($_POST['Practice_Name']) || !isset($_POST['Email']) || !isset($_POST['Mailing_address'])) { died('We are sorry, but there appears to be a problem with the form you submitted.'); } $name = $_POST['name']; $Practice_Name = $_POST['Practice_Name']; $email_from = $_POST['Email']; $Mailing_address = $_POST['Mailing_address']; $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; if(!preg_match($email_exp,$email_from)) { $error_message .= 'The Email Address you entered does not appear to be valid.<br />'; } $string_exp = "/^[A-Za-z .'-]+$/"; if(!preg_match($string_exp,$name)) { $error_message .= 'The Name you entered does not appear to be valid.<br />'; } if(!preg_match($string_exp,$Practice_Name)) { $error_message .= 'The Practice Name you entered does not appear to be valid.<br />'; } if(strlen($error_message) > 0) { died($error_message); } $email_message = "Form details below.\n\n"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "Name: ".clean_string($name)."\n"; $email_message .= "Practice Name: ".clean_string($Practice_Name)."\n"; $email_message .= "Email: ".clean_string($email_from)."\n"; $email_message .= "Mailing Address: ".clean_string($Mailing_address)."\n"; $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); ?> <www.pinnacleeducationservices.com> Thank you for contacting us. We will be in touch with you very soon. <?php } ?> perhaps it should be said that i did not write this code but edited it to reference the form more correctly. it is entirely possible my editing was the root of my problem, but i do not see why it redirects me to verygoods-2014.ru
  4. hi i am in a bit of a time crunch developing this basic web page for my mother. i am new to php (like hours new) but feel like i shouldnt be having this problem. what i want the page to do is this: take the information that the visitor entered into a form and email it to me upon pressing the "submit" button. where the problem is is here: when you hit submit, the browser takes me to a page that chrome warns me has had malware detected on it. something like verygoods-2014.ru, which i have never seen before nor can i find it anywhere in my coding. also, the email does not send. i feel like the php coding should be fine, as i have tested several pre-written form referencing mail() scripts as well as using the most basic mail() script possible, all with the same result. i have also wondered where the email that is supposed to be sent comes from. will it just be a "noreply" email sent by the website the script is run on? do i need to set up a server or email that can be accessed by my php script? i feel like this may be part of my problem. any help constructing a script or tips on building a php script for this would be greatly appreciated. below is the form that i am trying to gather information with. as i said earlier i have tried many mail() scripts of varying complexity, all to no avail, so i will not include one here. the email i want the information to be sent to is wdcockrell89@gmail.com <form name="contactform" method="post" action="send_contact_info.php"> <table width="450px"> <tr> <td valign="top"> <label for="name">Name *</label> </td> <td valign="top"> <input type="text" name="name" maxlength="50" size="30"> </td> </tr> <tr> <td valign="top""> <label for="Practice_Name">Practice Name *</label> </td> <td valign="top"> <input type="text" name="Practice_Name" maxlength="50" size="30"> </td> </tr> <tr> <td valign="top"> <label for="Email">Email Address *</label> </td> <td valign="top"> <input type="text" name="Email" maxlength="80" size="30"> </td> </tr> <tr> <td valign="top"> <label for="Mailing_address">Mailing address</label> </td> <td valign="top"> <input type="text" name="Mailing_address" maxlength="30" size="30"> </td> </tr> <tr> <td colspan="2" style="text-align:center"> <input type="submit" value="Submit"> </tr> </table> </form> <p> </p> <p> </p> <!-- end .content --></div> <!-- end .container --></div> </body> </html> i dont know how you guys do things here, but i realize my own ignorance and if you feel the need to berate me for it, i'm sure it is deserved. but help is more appreciated
×
×
  • 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.