Jump to content

lazerbrains

Members
  • Posts

    29
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

lazerbrains's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have been looking everywhere, and can't find a simple example of scripting a confirmation email. Basically, I have a form that is submitting to a database. But when the user submits the form successfully (I already have the validation in place), it sends their submitted email address a confirmation email. Currently the form submits, fills in fields in a database, and sends the user to a static thank you page. At this time I would like to send them the email. How can this be done somewhat simply?
  2. Actually, it is a few of sites that are being combined under one new domain. So one of the sites is Joomla, and the other is just a standard HTML based site, a third, but not as important one is using Symfony (PHP framework). It would be nice to have a redirect that could work on all 3, redirect them to the new domain, which announces the change. (only once) After the first time they are redirected, it should allow them to go to the old domain uninterrupted. I was thinking a cookie might be the right tool for the job. Any help would be appreciated.
  3. Have a site, and when people come to it, I would like to redirect them to a page on a different site, the first time they visit. (I am switching domain names, and would like to introduce the new site this way) So when they go to my current domain, I would like to redirect them to the new one, and also create a cookie. Then if they try to go back to my old domain again, it will recognize the cookie, and allow them to proceed as normal. However, I am new to setting cookies, and am not sure how to do this. Or if javascript is even the right choice. Does anyone know how to do this, or have an example they can show me?
  4. I have a site that I have an about page with pictures of people on it. I would like to create something that would do the following: * When you click on one of the images, i need text for that image to load in a text area. I would like to do this rather than have to make a different HTML page for each person, but I am not sure how to go about doing it. I do not have a database for this site, so I will need to pull the text from a text file or something like that. Any ideas on how to get started would be helpful. Thanks in advance!
  5. I tried that, but with that code, the email sent has only this content: Date: There is no error message, but I get less transmitted than the original. Weird. Any other ideas?
  6. <?php if($_POST){ $to = $_POST['First_and_Last_Name']; $subject = "WHAT SHOULD THIS BE"; $message = "Date: $date\n\r". LINE 31 echo "Dear "; echo "$array["First_Name"]; echo " "; //space echo "$array["Last_Name"]; "" .$_POST['comment']. "\n\r". "Sincerely,\n". "From: " .$_POST['from']. "\n". "Street: " .$_POST['street']. "\n". "City: " .$_POST['city']. "\n". "Zip: " .$_POST['zip']. "\n". "Email: " .$_POST['email']. "\n". $headers = "From: " .$_POST['from']. "<".$_POST['email'].">"."\n"; mail($to, $subject, $message, $headers); // SUCCESS! echo '<p class="notice">'. 'Thank you for your submission. '. '</p>'; // clear out the variables for good-housekeeping unset($date,$bill,$name,$street,$city,$zip,$email); $_POST = array(); } ?>
  7. I did that. Added into this: <?php if($_POST){ $to = $_POST['First_and_Last_Name']; $subject = "WHAT SHOULD THIS BE"; $message = "Date: $date\n\r". echo "Dear "; echo "$array["First_Name"]; echo " "; //space echo "$array["Last_Name"]; "" .$_POST['comment']. "\n\r". "Sincerely,\n". "From: " .$_POST['from']. "\n". "Street: " .$_POST['street']. "\n". "City: " .$_POST['city']. "\n". "Zip: " .$_POST['zip']. "\n". "Email: " .$_POST['email']. "\n". $headers = "From: " .$_POST['from']. "<".$_POST['email'].">"."\n"; mail($to, $subject, $message, $headers); // SUCCESS! echo '<p class="notice">'. 'Thank you for your submission. '. '</p>'; // clear out the variables for good-housekeeping unset($date,$bill,$name,$street,$city,$zip,$email); $_POST = array(); } ?> and got this: Parse error: syntax error, unexpected T_ECHO in /home5/windfal2/public_html/ledge/wp-content/themes/arras/letter.php on line 31 Still sent when the code was this: <?php if($_POST){ $to = $_POST['First_and_Last_Name']; $subject = "WHAT SHOULD THIS BE"; $message = "Date: $date\n\r". "Dear " . $array["First_Name"] . " " . $array["Last_Name"]. ",\n\r". "" .$_POST['comment']. "\n\r". "Sincerely,\n". "From: " .$_POST['from']. "\n". "Street: " .$_POST['street']. "\n". "City: " .$_POST['city']. "\n". "Zip: " .$_POST['zip']. "\n". "Email: " .$_POST['email']. "\n". $headers = "From: " .$_POST['from']. "<".$_POST['email'].">"."\n"; mail($to, $subject, $message, $headers); // SUCCESS! echo '<p class="notice">'. 'Thank you for your submission. '. '</p>'; // clear out the variables for good-housekeeping unset($date,$bill,$name,$street,$city,$zip,$email); $_POST = array(); } ?>
  8. Well the array is already pulling the correct values from the database. I is pulling them in the Form: <form method="post" action="" id="letter"> <p><label for="date">Date</label> <input type="text" name="date" id="date" value="<?php echo $_POST['date'];?>"/></p> <p>Dear Person, <?php echo '<select name="First_and_Last_Name">'; while( $array = mysql_fetch_assoc($result) ) { $text_for_select = $array["First_Name"] . " " . $array["Last_Name"]. " " . $array["District"]; $value_for_select = $array["Email"]; echo "<option></option>\n"; echo "<option value=\"$value_for_select\">$text_for_select</option>\n"; } echo '</select>';?> </p> That is currently pulling the First Name and Last name into a drop down menu. It is working fine. I just want to pull the name of the person selected into the Greeting of the email. SO that it says "Dear 'Name from $text_for_select'. Isn't there a better way to do that?
  9. OK. I did what you said and this is the code. It still sends the email fine, but I get blank space after the "Dear". Here's the code: "Dear " . $array["First_Name"] . " " . $array["Last_Name"]. ",\n\r". Is something wrong with my syntax. Does anyone have any ideas?
  10. I have an email form that is working wonderfully. I have a select box that has a list of names of people that you can email. That list is being pulled from a database. It is currently sending to the email related to the name selected in the dropdown menu. However, in the email that sends, I would like the name of the recipient to show up in the greeting. I.E. Dear "name from dropdown". How do I go about doing this. My select box that holds the query for the name is as folows: <?php echo '<select name="First_and_Last_Name">'; while( $array = mysql_fetch_assoc($result) ) { $text_for_select = $array["First_Name"] . " " . $array["Last_Name"]. " " . $array["District"]; $value_for_select = $array["Email"]; echo "<option></option>\n"; echo "<option value=\"$value_for_select\">$text_for_select</option>\n"; } echo '</select>';?> No, this is querying the First and Last Name and another variable called district in to a new variable called "text_for_select". I just want to either print the "text_for_select" after the "Dear", or better yet, just the "First_Name" and "Last_Name". How would I get this to print there?
  11. For instance how would I pass the "from" field into this header? $headers = "From: "; I need the Name that the person enters in the Name input box to go to the header, and I am not sure of the syntax.
  12. I have an email form that is sending to an email address. There are five fields where the person sending can input their Name, Address, City, State, and Zip. Everything is working, except I want the input from these fields to be the the headers in the PHP email. For instance it submits and send the letter, but I want the senders Name, Address, City, State, and Zip to be posted after the "Sincerely" in the letter sent. Here is what the input boxes of the form looks like: <p>Sincerely,<br /> <label for="from">Name:</label> <input type="text" name="from" id="name" value="<?php echo $_POST['from'];?>"/><br /> <label for="street">Street:</label> <input type="text" name="street" id="street" value="<?php echo $_POST['street'];?>"/><br /> <label for="city">City:</label> <input type="text" name="city" id="city" value="<?php echo $_POST['city'];?>"/><br /> <label for="zip">Zip:</label> <input type="text" name="zip" id="zip" value="<?php echo $_POST['zip'];?>"/><br /> <label for="email">E-mail:</label> <input type="text" name="email" id="email" value="<?php echo $_POST['email'];?>"/></p> <input type="submit" class="button" value="Submit" /> How do I go about posting the PHP headers in the email upon submission?
  13. Thank you!!! That seemed to work. Now I have the form working. Here is the final code! <?php echo '<select name="First_and_Last_Name">'; while( $array = mysql_fetch_assoc($result) ) { $text_for_select = $array["First_Name"] . " " . $array["Last_Name"]. " " . $array["District"]; $value_for_select = $array["Email"]; echo "<option></option>\n"; echo "<option value=\"$value_for_select\">$text_for_select</option>\n"; } echo '</select>';?> And the $to field is formatted as: $to = $_POST['First_and_Last_Name']; Thank you sooooooo much!
  14. That is fantastic. now I have a much better idea of what needs to happen. I have modified the code as per your instructions, however it is still not passing the email. Here is what I changed it to be. What did I do wrong? <?php echo '<select name="First_and_Last_Name">'; while( $array = mysql_fetch_assoc($result) ) { $text_for_select = $array["First_Name"] . " " . $array["Last_Name"]. " " . $array["District"]; $value_for_select = $array["id"]; echo "<option></option>\n"; echo "<option value=\"$value_for_select\">$text_for_select</option>\n"; } echo '</select>';?>
  15. I'm sorry. I screwed up when naming this thread. I am trying to send it TO the selected person email address, not From. So I am not overly concerned on the "From" field, but want to populate the the $to field with the mail address of the person that is selected in the drop-down. ANy ideas on how to so that?
×
×
  • 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.