Jump to content

ttomnmo

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ttomnmo's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. What I have done, and somewhere I went wrong, was change the input feilds in the form>php and also the <td align="left" width="78%"><input name="honoree" type="text" value="<? echo $_POST['honoree']; ?>" size="30"></td> Then in the web2mail.php I added the same variables and did for example $honoree = cleanUp($_POST['honoree']); Then on the mailfunction.php I added, at least I think I added, the $honoree to be included in the email both for text and html. $html_version="<html>\n<head>\n<style>\nA:link {text-decoration: none; color: $alink_color;}\nA:visited {text-decoration: none; color: $vlink_color;}\nA:hover {font-style: normal; color: $hlink_color; text-decoration: underline;}\nBODY{font-family: $html_font; font-size: $html_font_size;}TD {font-family: $html_font; color: #000000; font-size: $html_font_size;}\n</style>\n</head>\n<body>\n\n<table border=\"0\" cellpadding=\"6\" cellspacing=\"0\" width=\"100%\">\n<tr>\n <td nowrap width=\"1%\">\n<b>Submitted</b>\n</td>\n<td width=\"99%\">$date - $time</td>\n</tr>\n<tr>\n<td nowrap width=\"1%\">\n<b>From</b></td>\n<td width=\"99%\">$name - <A HREF=\"mailto:$email\">$email</A></td>\n</tr>\n<tr>\n<td nowrap width=\"1%\" valign=\"top\">\n<b>Honoree</b>\n</td>\n<td width=\"99%\">$honoree</td></tr>\n<tr><td nowrap width=\"1%\" valign=\"top\">\n<b>Comments</b></td>\n<td width=\"99%\">".nl2br($comments)."</td>\n</tr>\n<tr>\n<td nowrap width=\"1%\"><b><small>IP Address</small></b></td>\n<td width=\"99%\"><small>$ip</small></td>\n</tr>\n</table><br>\n<br>\n<div align=\"right\"><i>Powered by <A HREF=\"http://www.cj-design.com\">CJ Web2Mail V3.0</A></i></div></body></html>"; Where am I going wrong?
  2. The email I am recieving look s like Submitted  11:21:33 pm -  From dtuy - seru@ftuk.ru Honoree  Comments  IP Address Wednesday 08 November 2006 I am getting the info provided by the form for the dateand time, for the name and email, and for the IP address. What i am not getting is the info input for the honoree and the comments on the form. I am new to php and trying to learn so I don't know what all the code means, but i think the web2mail.php handles the form and the mailfunction.php handles what becomes my email (along with some auto replies that are fine). Thanks for your help!
  3. I am having a little trouble fitting this to my needs. I got this script on a free download from CJ designs. It works but I am having troubles adjusting it. It is just a form that when filled out and sent, sends the info to the recipient in an email.  I wanted to change some of the form entries and have gotten the subject titles to show up on the email, but where the info from the form should be there is nothing. I am trying to add the honorees name, and the comments. Can someone help me? The code is divided into the following four pages. web2mailconfig.php <? $yourname = "Sharon Roberts Cancer Foundation"; $your_website = "Sharons Hope"; $your_webaddress = "http://sharonshope.org"; $admin_email = "ttomnmo@msn.com"; $subject = "Honor Roll Submision"; $show_ip = "no"; $auto_responder = "no"; $auto_subject = "Auto Responder"; $error_messages = "yes"; $multipart_emails = "yes"; $html_font = "verdana"; $html_font_size = "10pt"; $alink_color = "#11116E"; $vlink_color = "#11116E"; $hlink_color = "#000000"; $default_thank_msg = "yes"; $thankyou_message_url = "http://sharonshope.org/index.html"; ?> web2mail.php <? include "web2mail_config.php"; $path =  __FILE__; $path = preg_replace( "'\\\web2mail\.php'", "", $path); $path = preg_replace( "'/web2mail\.php'", "", $path); $send = false; if(isset($_POST['submit'])){ $date = date("l d F Y"); $time = date("g:i:s a"); $ermsg = ""; $send = true; $ip = $_SERVER['REMOTE_ADDR']; $name = cleanUp($_POST['name']); $email = cleanUp($_POST['email']); $honoree = cleanUp($_POST['honoree']); $comments = cleanUp($_POST['comments']); $emailvalid = is_valid_email($email); if (!isset($name) || $name == ""){ $emsg = "<li>Please enter your name"; $send = false; } if (!isset($email) || $email == "" || $emailvalid == 1){ $emsg .= "<li>Your email address is missing or incorrect"; $send = false; } if  (!isset($honoree) ||  $honoree == ""){     $emsg = "<li>Please enter the name of the person you wish to honor"; $send = false; } if($send){ $sent = false; include("mail_functions.php"); $message = strip_tags($message); $message = stripslashes($message); if($multipart_emails == "yes"){ if(sendHTMLEmail($name, $email, $message, $subject, $recipient, $ip, $date, $time)){ $sent = true; } } else{ $recipient = "$yourname <$admin_email>"; $headers = "From: $name <$email>\r\nReply-To: $email\r\n"; $msg = "Submitted: $date - $time\nFrom: $name - $email\n\n\n$message\n\nIP: $ip\n\n\nPowered by CJ Web2Mail V3.0 © http://www.cj-design.com"; if(mail ($recipient, $msg, $headers)){ $sent = true; } } if($sent){ if($auto_responder == "yes"){ if($multipart_emails == "yes"){ sendHTMLEmailAuto($name, $email, $subject); } else{ sendTextEmailAuto($name, $email, $subject); } } if($default_thank_msg == "yes"){ include($path."/thankyou.php"); } else{ header("Location: $thankyou_message_url"); } } else{ include($path."/thankyou.php"); } } } if(!$send){ if(strlen($emsg) > 0 && $error_messages == "yes"){ echo "Your submission had the following errors:<br><br><FONT COLOR=\"red\">$emsg</FONT><br><br>"; } include($path."/form.php"); } function cleanUp($field) { //Remove line feeds $ret = str_replace("\r", "", $field); $ret = str_replace("\n", "", $ret); // Remove injected headers $find = array("/bcc\:/i",         "/Content\-Type\:/i",         "/Mime\-Type\:/i",         "/cc\:/i",         "/to\:/i"); $ret = preg_replace($find, "", $ret); return $ret; } function is_valid_email($sender_mail) {     if(ereg("([[:alnum:]\.\-]+)(\@[[:alnum:]\.\-]+\.+)", $sender_mail)) { return 0;     } else{         return 1;     } } ?> form.php <form action="<? echo $_SERVER['PHP_SELF']; ?>" method="POST"> <table width="100%"> <tr>   <td align="left" width="22%"><div align="right">Your Name: </div></td>   <td align="left" width="78%"><input type="text" name="name" size="30" value="<? echo $_POST['name']; ?>"></td></tr> <tr><td align="left" width="22%"><div align="right">Your E-mail:</div></td> <td align="left" width="78%"><input type="text" name="email" size="30" value="<? echo $_POST['email']; ?>"></td></tr> <tr>   <td align="left" width="22%"><div align="right">Honoree's Name: </div></td>   <td align="left" width="78%"><input name="honoree" type="text" value="<? echo $_POST['honoree']; ?>" size="30"></td></tr> <tr>   <td width="22%" height="" align="left"><div align="right">Comments:</div></td>   <td width="78%" align="left">   <p align="left">     <textarea cols="40" rows="3" name="comments"><? echo $_POST['comments']; ?></textarea>   </p>   <p align="left"></td> </tr> <tr>   <td height="" align="left">&nbsp;</td>   <td width="78%" align="left"><input type="submit" name="submit" value="Send" />     <input name="reset" type="reset" value="Reset" /></td> </tr> <tr>   <td width="22%" height="104" align="left">&nbsp;</td>   <td align="left"><p>&nbsp;</p>     <p>&nbsp;</p></td> </tr> </table> </form> and mailfunctions.php <? function sendHTMLEmail($name, $email, $subject, $comments, $honoree, $recipient, $ip, $date, $time){ include("web2mail_config.php"); $recipient = "$yourname <$admin_email>"; $rand = md5(time()); $mime_boundary = "CJ Web2Mail V3.0_". $rand; $text_version = "Submitted: $date - $time\nFrom: $name - $email\n\n\n$honoree\n\n\n$comments\n\nIP: $ip\n\n\nPowered by CJ Web2Mail V3.0 © http://www.cj-design.com"; $html_version="<html>\n<head>\n<style>\nA:link {text-decoration: none; color: $alink_color;}\nA:visited {text-decoration: none; color: $vlink_color;}\nA:hover {font-style: normal; color: $hlink_color; text-decoration: underline;}\nBODY{font-family: $html_font; font-size: $html_font_size;}TD {font-family: $html_font; color: #000000; font-size: $html_font_size;}\n</style>\n</head>\n<body>\n\n<table border=\"0\" cellpadding=\"6\" cellspacing=\"0\" width=\"100%\">\n<tr>\n <td nowrap width=\"1%\">\n<b>Submitted</b>\n</td>\n<td width=\"99%\">$date - $time</td>\n</tr>\n<tr>\n<td nowrap width=\"1%\">\n<b>From</b></td>\n<td width=\"99%\">$name - <A HREF=\"mailto:$email\">$email</A></td>\n</tr>\n<tr>\n<td nowrap width=\"1%\" valign=\"top\">\n<b>Honoree</b>\n</td>\n<td width=\"99%\">$honoree</td></tr>\n<tr><td nowrap width=\"1%\" valign=\"top\">\n<b>Comments</b></td>\n<td width=\"99%\">".nl2br($comments)."</td>\n</tr>\n<tr>\n<td nowrap width=\"1%\"><b><small>IP Address</small></b></td>\n<td width=\"99%\"><small>$ip</small></td>\n</tr>\n</table><br>\n<br>\n<div align=\"right\"><i>Powered by <A HREF=\"http://www.cj-design.com\">CJ Web2Mail V3.0</A></i></div></body></html>"; $headers = "From: $name <$email>\r\n"; $headers .= "Reply-to: $email\r\n"; $headers .= "Return-Path: $email\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: multipart/alternative; charset=\"iso-8859-1\"; boundary=\"$mime_boundary\";\r\n\r\n"; // added ; before boundary $headers .= "This is a multi-part message in MIME format.\r\n\r\n"; $msg .= "--$mime_boundary\r\n"; $msg .= "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n"; // deleted boundary $msg .= "Content-Transfer-Encoding: 8bit\r\n\r\n"; $msg .= $text_version."\r\n\r\n"; $msg .= "--$mime_boundary\r\n"; $msg .= "Content-Type: text/html; charset=\"iso-8859-1\"\r\n"; $msg .= "Content-Transfer-Encoding: 8bit\r\n\r\n"; $msg .= $html_version."\r\n\r\n"; $msg .= "--$mime_boundary--\r\n\r\n\r\n"; return mail($recipient, $subject, $msg, $headers); } function sendHTMLEmailAuto($name, $email, $subject){ include("web2mail_config.php"); $recipient = "$name <$email>"; $rand = md5(time()); $mime_boundary = "CJ Web2Mail V3.0_". $rand; $sub = "$auto_subject to $name"; $text_version = "$name, thank you for emailing $your_website.\n\nWe will get back to you soon concerning '$subject'.\n\nKind Regards\n$yourname\n\n\nNote: This is an automated response, please do not reply to this\n\n\nPowered by CJ Web2Mail V3.0 © http://www.cj-design.com"; $html_version = "<html>\n<head>\n<style>\nA:link {text-decoration: none; color: $alink_color;}\nA:visited {text-decoration: none; color: $vlink_color;}\nA:hover {font-style: normal; color: $hlink_color; text-decoration: underline;}\nBODY{font-family: $html_font; font-size: $html_font_size;}TD {font-family: $html_font; color: #000000; font-size: $html_font_size;}\n</style>\n</head>\n<body>\n\n<B>$name</B>, thank you for emailing $your_website.\n\n<br><br>We will get back to you soon concerning '<I><B>$subject</B></I>'.\n<br><br>\nKind Regards<br>\n$yourname<br>\n<br>\n<br>\n<small>Note: This is an automated response, please do not reply to this</small><br>\n<br><div align=\"right\"><i>Powered by <A HREF=\"http://www.cj-design.com\">CJ Web2Mail V3.0</A></i></div>"; $headers = "From: $your_website <$admin_email>\r\n"; $headers .= "Reply-to: $admin_email\r\n"; $headers .= "Return-Path: $admin_email\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: multipart/alternative; charset=\"iso-8859-1\"; boundary=\"$mime_boundary\";\r\n\r\n"; // added ; before boundary $headers .= "This is a multi-part message in MIME format.\r\n\r\n"; $msg .= "--$mime_boundary\r\n"; $msg .= "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n"; // deleted boundary $msg .= "Content-Transfer-Encoding: 8bit\r\n\r\n"; $msg .= $text_version."\r\n\r\n"; $msg .= "--$mime_boundary\r\n"; $msg .= "Content-Type: text/html; charset=\"iso-8859-1\"\r\n"; $msg .= "Content-Transfer-Encoding: 8bit\r\n\r\n"; $msg .= $html_version."\r\n\r\n"; $msg .= "--$mime_boundary--\r\n\r\n\r\n"; $msg = stripslashes($msg); mail ($recipient, $sub, $msg, $headers); } function sendTextEmailAuto($name, $email, $subject){ include("web2mail_config.php"); $recipient = "$name <$email>"; $sub = "$auto_subject to $name"; $msg = "$name, thank you for emailing $your_website.\n\nWe will get back to you soon concerning '$subject'.\n\nKind Regards\n$yourname\n\n\nNote: This is an automated response, please do not reply to this\n\n\nPowered by CJ Web2Mail V3.0 © http://www.cj-design.com"; $headers = "From: $your_website <$admin_email>\r\nReply-To: $admin_email\r\n"; $msg = stripslashes($msg); mail ($recipient, $sub, $msg, $headers); } ?> I hope this isn't too much to ask!
  4. I have a sight hosted on godaddy. I would like to have the ability to upload music on an upload page. The max upload file size on the php.ini is 8mb. I need much bigger. I can't change the php.ini, godaddy said no way. Is there a way I can write something so that that max file size, or is that not possible? Thanks for any help  :)
  5. I really appriciate all your help. I'm trying to do this as best I can without hastleing you guys cause your time is important. I was looking around and found an older code for displaying the files <? $file_dir="/upload_dir"; $dir=opendir($file_dir);     while ($file=readdir($dir))     {         if ($file != "." && $file != "..")         {           echo "<a href=".$file_dir."/".$file." target=_blank>".$file."</a>";             echo "<br>";         }     } ?> and I get the files to display as links, but when I try to view them I get a window saying page cannot be found or save target as I get IE unable to download. Am I better off trying to go back to what I had before and setting up a read directory function or continueing with this new thing here? Thanks for your help, I need it!
  6. I put on my glasses and got passed another parsing error, but I ran into a Call to a member function on a non-object error with while(($file = $mydir->read()) !== false) {  I am trying to have the files in the upload_dir shown on the page with the ability to download them, how can I get the directory files displayed on the page?
  7. Thanks Maybe i need glasses!
  8. I gratefully recieved some help a few days ago on a file upload page. I am now trying to write something that will show files that have been uploaded to a directory and allow them to be viewed or downloaded. A friend helped me with this <?   $mydir = 'upload_dir/';   while(($file = $mydir->read()) !== false) {          //echo "Filename: $file<BR>";   if ((strLen($file) > 2)    echo "<tr><td>Filename: <a href= 'upload_dir/$file' target=_blank>$file</a></td></tr>";   }   $mydir->close();   print("</table>"); ?> <h3>Please click on file name to download or view.</h3> </div> <div id="content"> <? } else { ?> <div id="column_left"> <? } ?> and I am getting a parsing error  right around here  if ((strLen($file) > 2) I am having trouble finding info on what I am trying to do. Can anyone help or point me towards help?
  9. I hope you check back to see, cause I do thank you. I am trying to read your code and see all that you did and why, and I understand some of it. Thanks!
  10. I am very new to this whole deals and was hoping to get some help. I used a script that I found online to do a very simple upload page, but it only works for gif files. <form name="form1" method="post" action="" enctype="multipart/form-data"> <input type="file" name="imagefile"> <br> <input type="submit" name="Submit" value="Submit"> <form name="form1" method="post" action="" enctype="multipart/form-data"> <input type="file" name="imagefile"> <br> <input type="submit" name="Submit" value="Submit"> <? if(isset( $Submit )) { if ($_FILES['imagefile']['type'] == "image/gif"){         copy ($_FILES['imagefile']['tmp_name'], "files/".$_FILES['imagefile']['name'])      or die ("Could not copy"); echo "";          echo "Name: ".$_FILES['imagefile']['name']."";          echo "Size: ".$_FILES['imagefile']['size']."";          echo "Type: ".$_FILES['imagefile']['type']."";          echo "Copy Done....";          } else {             echo "<br><br>";             echo "Could Not Copy, Wrong Filetype (".$_FILES['imagefile']['name'].")<br>";         } } ?> </form> I was hoping that I could change the  if ($_FILES['imagefile']['type'] == "image/gif"){    line to some how copy any type of file. Is this possible? And if so, how? Thanks much!
×
×
  • 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.