Jump to content

Iron Bridge

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Everything posted by Iron Bridge

  1. It would be helpful if you could post your solution so as to help people in teh future with the same problem IB
  2. You guys are absolutely awesome. I finally got it woked out. I just had to change my $thanks .= "\n\n"; to $thanks .= "<br></br>; An example of the final code that I am using is listed below. This code delivers variables from a form via actionscrript 2.0 to a PHP script. The variables are then emailed to both me and the sender. I have designed the script to also implement the variables into an SQL DB but have left that part out. I hope this helps somebody in the future. $sendTo = "me@myemailaddress"; $subject = "whatever I would like it to be"; //All of the variable here are defined in flash through the variables dialog and not the instance name //I have found that using instance names produces less reliable results $headers = "From: " . $_POST["name"] ." <" . $_POST["email"] .">\r\n"; $headers .= "Reply-To: " . $_POST["email"] . "\r\n"; $headers .= "Return-path: " . $_POST["email"]; // now add the content of the flash message to a body variable. This creates a plain text email message $message = $_POST["message"]; $message .= "\n\n---------------------------\n"; $message .= "Mail sent by: " . $_POST['name'] . " <" . $_POST['email'] . ">\n"; $message .= "Our Address is: " . $_POST['address'] . " " . $_POST['city'] . "\n"; //HTML email with animated gif for signature $thanks = "<html><body>"; $thanks .= "Dear " . $_POST['name'].","; $thanks .= "<br></br>"; $thanks .= "Thank you for visiting our website........."; $thanks .= "<br></br>"; $thanks .= "Sincerely,"; $thanks .= "<br></br>"; $thanks .= '<img src="http://www.OurURL/images/ourGIF.gif"/>'; $thanks .= "<br></br>"; $thanks .= "Alene and Sage"; $thanks .= "</body></html>"; $ouremail = "From: Us <[email protected]>"; $ouremail .= "\r\nContent-type: text/html"; mail($sendTo, $subject, $message, $headers); mail ($_POST["email"], "Thank you for adding your address", $thanks, $ouremail); Of course you could also add additional headers to the $thanks variable if you would like. I would like to tip my hat to the people who assisted me with this. I really appreciate the help. Sage http://www.aleneandsage.us http://www.ironbridge.vox.com http://www.sensationalsmyles.com
  3. So, I have placed: $thanks = "<html><body>"; $thanks .= .... $thanks .= "</body></html>; $ouremail .= "Content-type: text/html"; and I am still not getting the image. I know my mail client (Apple Mail) supports HTML email since I have made and received HTML emails before. Any more ideas?
  4. The <img> tag is not being read as HTML but rather plain text. Is there a PHP command to change this and have the $html read as HTLM and not text?
  5. Thanks for the timely reply. When I do this (place $html =... earlier in the script and $thanks .= "$html" the email displays: The actual image does not who up. Any ideas as to why?
  6. Try using something like this: $DBhost = "myserver.com"; // Replace myServer.com with the url (without http://) for your Database Server $DBuser = "myLogin"; // Replace myLogin with your login $DBpass = "myPassword"; // Replace myPassword with your password $DBName = "myDataBaseName"; // Replace myDatabaseName with your DB name $table = "myTableName"; // I think you get the idea // Connect to mySQL Server $DBConn = mysql_connect($DBhost,$DBuser,$DBpass) or die("Error1 in Guest List Application: " . mysql_error()); // Select mySQL Database mysql_select_db($DBName, $DBConn) or die("Error2 in Guest List Application: " . mysql_error());
  7. I feel like a nuisance for asking such simple questions. I have a flash site for my upcoming wedding and within the site I have a guest form to collect addresses of our guests (for traditional invitations). The variables are sent via actionscript to a PHP script which then inserts the information into an SQL DB and emails both myself and the guest. In the email to the guest I would like to insert an animated .gif file as a signature. I know this is really simple yet I can't seem to get it to work. I have looked at the PHP manual and spent a good amount of time browsing forums and tutorials but to no avail. It comes down to my lack of knowledge of PHP syntax. I have pasted a sample of the code I am using with both email functions. Hopefully somebody can point out my error. I appreciate the help. As somone with essentially no PHP knowledge this forum has helped me tremendously. I find myself spending much more time in flash forums to help others as this forum has helped me. Anyways, I am off to go and click some advertisements. $thanks = "Dear " . $_POST['name'].","; $thanks .= "\n\n"; $thanks .= "Thank you for visiting our website........."; $thanks .= "\n\n"; $thanks .= "Sincerely,"; $thanks .= "\n\n"; $thanks .= $html; $thanks .= "\n\n"; $thanks .= "Alene and Sage"; $ouremail = "From: Alene and Sage <[email protected]>"; $html = '<img src="images/ansSignature.gif">'; mail($sendTo, $subject, $message, $headers); mail ($_POST["email"], "Thank you for adding your address", $thanks, $ouremail);
  8. I usually do just try. I'll spare you the long story as to why I didn't this time. Nonetheless, I appreciate the help!
  9. I am almost embarrassed to ask this question but, as a newb, you must swallow your pride. Anyways, can you use the mail function multiple times in succession? Specifically, I have a flash site with a contact form and the variables are sent to a PHP script via actionscript and then inserted into a SQL DB and emailed to me. I was wondering if I can add another mail function to send a message back to the sender. For example (although over simplified): $me ="[email protected]"; $you = "[email protected]"; mail($me, $subject, $body); mail($you, $subject, $body); I looked around for the answer but wasn't able to find it. Hopefully somebody can answer this quite easily. Thanks for the help!
  10. Seems as though I got the url thing straightened out. Thanks for viewing I appreciate the effort. As for the other question, does anybody have any recommendations for browser and OS info?
  11. Well, I have been using Flash, HTML and CSS for some time and just began implementing SQL and PHP (yesterday). I had started using PHP in a guest info form that I created in a flash site. Since fishing that form I have emmersed myself in PHP for the last day or so and decided to change my index page from .html to .php so as to store some traffic information into an SQL DB. The only problem is that when I type in my URL I am not automactically directed to my index.PHP page. I have pulled the index.html down. I suspect that this is fairly easy to fix. I am using Dreamweaver 8 to put my files and my host is GoDaddy (if that makes a differnece) I would really appreciate the help. Also does anybody have any good OS/Broswer detection scripts that they recommend. I would love to insert that information into an SQL DB just for fun. If anybody is interested you can check out my site at http://www.aleneandsage.us/index.php. It is a site that I have created for my upcoming wedding as a resource for our guests.
  12. It is on goDaddy. I had just tried that before checking back. The response I got was: No input file specified. I assumed that this meant it was connecting correctly. So, I went to my form and inputted some data and....... It worked. Thank you so much. Sometimes, it just helps to communicate with someone (even if it is via forum). I can't tell you how much this will help me. I really appreciate it, you are AWESOME!
  13. OK so this is what I get back Warning: mysql_connect(): Unknown MySQL Server Host 'http' (0) in /home/content/I/r/o/Ironwebmaster/html/sendmail2.php on line 12 Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/content/I/r/o/Ironwebmaster/html/sendmail2.php on line 14 Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/content/I/r/o/Ironwebmaster/html/sendmail2.php on line 39 output=error I am assuming this all means that I am having a mysql_connect problem. Do I have the DBhost wrong? Do I need the actual IP address (I don't think so)? I appreciate the help thus far. At least I can now trace as I do in flash.
  14. I originally had those, but as I said I am a total PHP newb. How can I see where it is breaking when my data is coming from flash?
  15. I have created a flash site for my upcoming wedding. In the site I have created a form to collect the addresses of guests. Currently that form is emailed to me via PHP. I would like to have the contents of that form inserted into a mySQL DB. The error appears to be in my PHP script. My PHP and SQL knowledge are quite limited as this is the first SQL DB I have set up. The database is quite simple and consits of id (auto incremented), name, address, and email. Below is my latest version of my PHP script. The only thing changed is my $DBuser, and $DBpass. I am wondering if the answer is something as simple as having the wrong $DBhost. Do I need to place the actual IP address? The email portion of the script works fine, which leads me to believe that my problem is with the SQL connection or the INSERT INTO portion of the script. Maybe it is my sytax. Hopefully somebody can help <? //SQL PORTION OF SCRIPT // Database Connectivity Variables and other Variables $DBhost = "http://mysql299.secureserver.net"; // Database Server $DBuser = "myUserName"; // Database User $DBpass = "myPassword"; // Database Pass $DBName = "febridge"; // Database Name $table = "guestList"; // Database Table // Connect to mySQL Server $DBConn = mysql_connect($DBhost,$DBuser,$DBpass); // Select mySQL Database mysql_select_db($DBName, $DBConn); // Recieve Variables From Flash $name = stripslashes($HTTP_POST_VARS['sender_name']); $email = stripslashes($HTTP_POST_VARS['sender_mail']); $comments = stripslashes($HTTP_POST_VARS['sender_message']); // Insert the data into the mysql table $sql = "INSERT INTO guestList (name ,email) VALUES ('$name','$email')"; $insert = mysql_query($sql, $DBConn); //EMAIL PORTION OF SCRIPT if(!empty($HTTP_POST_VARS['sender_mail']) || !empty($HTTP_POST_VARS['sender_message']) || !empty($HTTP_POST_VARS['sender_subject']) || !empty($HTTP_POST_VARS['sender_address']) || !empty($HTTP_POST_VARS['sender_name'])) { $to = "febridge@myEmailAddress"; $subject = "wedding guest address"; $body = stripslashes($HTTP_POST_VARS['sender_message']); $body .= "\n\n---------------------------\n"; $body .= "Mail sent by: " . $HTTP_POST_VARS['sender_name'] . " <" . $HTTP_POST_VARS['sender_mail'] . ">\n"; $body .= "Our Address is: " . $HTTP_POST_VARS['sender_address'] . ""; $header = "From: " . $HTTP_POST_VARS['sender_name'] . " <" . $HTTP_POST_VARS['sender_mail'] . ">\n"; $header .= "Reply-To: " . $HTTP_POST_VARS['sender_name'] . " <" . $HTTP_POST_VARS['sender_mail'] . ">\n"; $header .= "X-Mailer: PHP/" . phpversion() . "\n"; $header .= "X-Priority: 1"; if(@mail($to, $subject, $body, $header)) { echo "output=sent"; } else { echo "output=error"; } } else { echo "output=error"; } ?>
×
×
  • 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.