Jump to content

srcfresno

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

srcfresno's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you. I kinda thought so but wanted to run by the experts. Thanks again.
  2. I get this error message and no email when I test this form Warning: mail() [function.mail]: Failed to connect to mailserver at "127.0.0.1" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() ini_set() in \\boswinfs02\home\users\web\b1835\ez.srcfresnocom\PCHSubscomplete.php on line 28 Line 28 is the $send = and the web address is assigned by the webhosting service. Is the problem with my mail function code? <?php $to = 'survey@srcfresno.com'; $subject = 'PCH subs'; if (get_magic_quotes_gpc()) { $_POST = array_map('stripslashes',$_POST); } $fields = array( 'firstname' => 'First Name', 'lastname' => 'Last Name', 'email' => 'Email', 'phone' => 'Phone', 'muchspend' => 'How much did you spend on your purchase today?' ); $body = "PCH subs:\n\n"; foreach($fields as $a => $b) { if(array_key_exists($a,$_POST)) { $body .= sprintf("%s: %s\n",$b,$_POST[$a]); } } $send = mail($to, $subject, $body); if($send) {print ""; } else {print "We encountered an error sending your mail, please notify webmaster@srcfresno.com"; } ?>
  3. that totally worked, thank you.
  4. excuse my ignorance... so like that <?php function genRandomString($length, $characters, $string) { $length = 5; $characters = array_merge(range(0,9),range('a','z'),range('A','Z')); $string = ""; for ($p = 0; $p < $length; $p++) { $string .= $characters[mt_rand(0, count($characters)-1)]; } return $string; } ?>
  5. can you be a little more descriptive please
  6. So I found this code from someone else on here who posted about creating a random string. I've copied the code for myself but when I upload php page to my server and view source... there is no php code. Essentially, i see no randomly generated text. what am i missing? <?php function genRandomString() { $length = 5; $characters = array_merge(range(0,9),range('a','z'),range('A','Z')); $string = ""; for ($p = 0; $p < $length; $p++) { $string .= $characters[mt_rand(0, count($characters)-1)]; } return $string; } ?>
  7. Worked! Thank you... I was going crazy with this. I don't get the if (get_magic_quotes_gpc( and array_map('stripslashes' but whatever, it worked.
  8. <body><form action="contact.php" method="post" enctype="multipart/form-data" name="input" target=_blank> <h2><span class="style14">Contact Inquiry Form </span></h2> <p> </p> <p> <span class="style24 style2">Customer Name</span> <br> <input name="textfield" type="text" size="50"> First Name<br> <br> <input name="textfield" type="text" size="50"> Last Name</br> </p> <p> <span class="style24 style2">Email</span><br> <input name="textfield" type="text" size="50"> </br> </p> <p> <span class="style24 style2">Phone</span> <br> <input name="textfield" type="text" size="50"> </br> </p> <p> <span class="style24 style2">Company Website (if applicable)</span> <br> <input name="textfield" type="text" size="50"> </br> </p> <p> <span class="style24 style2">Please describe your interest in Statistics & Research Consulting</span> <br> <textarea name="textarea" cols="50" rows="10"></textarea> </br></p> <p> <input type="submit" name="Submit" value="Submit"> </p> </form>
  9. If anyone has an easier way to write the code i'm open to it. I just want the text in the fields listed emailed.
  10. This is the correct php code <?php $to = 'inquiry@srcfresno.com'; $subject = 'Contact Inquiry form'; $firstname = $_REQUEST['First Name'] ; $lastname = $_REQUEST['Last Name'] ; $from = $_REQUEST['Email'] ; $phone = $_REQUEST['Phone'] ; $company = $_REQUEST['Company Website (if applicable)'] ; $messege = $_REQUEST['Please describe your interest in Statistics & Research Consulting'] ; $fields = array( 'firstname' => 'First Name', 'lastname' => 'Last Name', 'from' => 'Email', 'phone' => 'Phone', 'company' => 'Company Website (if applicable)', 'message' => 'Please describe your interest in Statistics & Research Consulting' ); $body = "We have received the following information:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } $send = mail($to, $subject, $body); if($send) {print "Thank you for contacting us. We have received your information and a SRC Consultant will respond shortly."; } else {print "We encountered an error sending your mail, please notify webmaster@srcfresno.com"; } ?>
  11. Below is my php file from my website srcfresno.com/inquiry2.htm When I go to the website and enter information in the form fields, it submits to my email fine but the email I receive has no information filled in. Please help. Not sure why !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Statistics & Research Consulting</title> </head> <?php $to = 'inquiry@srcfresno.com'; $subject = 'Contact Inquiry form'; $firstname = $_REQUEST['First Name'] ; $lastname = $_REQUEST['Last Name'] ; $from = $_REQUEST['Email'] ; $phone = $_REQUEST['Phone'] ; $company = $_REQUEST['Company Website (if applicable)'] ; $messege = $_REQUEST['Please describe your interest in Statistics & Research Consulting'] ; $fields = array( 'firstname' => 'First Name', 'lastname' => 'Last Name', 'from' => 'Email', 'phone' => 'Phone', 'company' => 'Company Website (if applicable)', 'message' => 'Please describe your interest in Statistics & Research Consulting' ); $body = "We have received the following information from $_SESSION[username]:\n\n"; foreach($_REQUEST as $a => $b){ if(array_key_exists($a, $fields) && !empty($b)){ $part1 .= sprintf("%20s: %s\n", $fields[$a], $b); } $send = mail($to, $subject, $body); if($send) {print "Thank you for contacting us. We have received your information and a SRC Consultant will respond shortly."; } else {print "We encountered an error sending your mail, please notify webmaster@srcfresno.com"; } ?> <body> </body> </html>
×
×
  • 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.