Link to home
Start Free TrialLog in
Avatar of jones_bones
jones_bones

asked on

Problem with PHP mailing script

Hi,

I got this PHP mailing script from the internet and want to use it on my site. I have made the adjustments suggested by the help file but can't seem to figure out why the page does not redirect to the page I have assigned in the $thanksmessage variable.

Also I'm unsure as to why I am unable to change the text size in the text area (yourmessage). I know I'm using CSS on the page but i've tried to change the font size in numerous places but can't figure out why it isn't changing.

Any help would be greatly appreciated.

Thanks guys
<?php
error_reporting(7);
/*
//================================================================================
* phphq.Net Custom PHP Scripts *
//================================================================================
:- Script Name: phMailer
:- Version: 1.5
:- Release Date: Jan 27th 2004
:- Last Update: Dec 9th 2005
:- Author: Scott L. <scott@phphq.net> http://www.phphq.net
:- Copyright(c) 2005 All Rights Reserved
:-
:- This script is free software; you can redistribute it and/or modify
:- it under the terms of the GNU General Public License as published by
:- the Free Software Foundation; either version 2 of the License, or
:- (at your option) any later version.
:-
:- This script is distributed in the hope that it will be useful,
:- but WITHOUT ANY WARRANTY; without even the implied warranty of
:- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
:- GNU General Public License for more details.
:-http://www.gnu.org/licenses/gpl.txt
:-
//================================================================================
* Description
//================================================================================
:- phMailer is a very simple php mail script. It can be used on your site as a contact form. This is very helpful if you want your visitors to be
:- able to contact you without them knowing your real email address. On great feature of this script is the ability to allow users
:- to attach multiple files when sending an email directly from your site. Of course, you can disable this feature if you wish.
:- Any file type is accepted as long as they are included in your file extension list. Another popular use for a php email form is 
:- protection against spam bots. Spam, is a major downside of email, and placing your email publicly on your website is asking
:- for spam. Spam bots can take your email address right off your site and add it to thousands of spam databases, resulting in a 
:- never ending supply of spam for you. I coded this script, because I couldn't find a simple mail script that would allow my visitors
:- to send me attachments while keeping my email hidden from spam bots. Enjoy another easy but advanced script from phphq.Net Customs!
//================================================================================
* Setup
//================================================================================
:- To setup this script, simply drop this file anywhere in your website. Then edit the variables in phMailer.php (Variables can be found below this readme).
//================================================================================
* Frequently Asked Questions
//================================================================================
:- Q1: I never receive any mail, but people say they have emailed me through the form.
:-		A1: Try the mailtest.php file that came with this script. If that fails, then mail() is not setup right. Please contact your host
:-		A2: Did you change anything within the file? Are you sure your email is correct?
:-		A3: Try using the form with $allowattach set to 0. It could be your mail server rejecting the mail because of attachments.
:-		A4: If you are on windows, make sure your SMTP is set to your mail server. If you are on Linux, make sure your sendmail path if correct. Again, ask your host.
:-
:- Q2: I never receive any attachments.
:-		A1: Maybe your server has some security against uploading files or sending attachments through mail, check with your host on this issue. This script does send attachments, it's been tested many times on many different platforms and versions of php with safe mode on and off.
:-		A2: Maybe the files people are submitting are too big. Check php.ini for the post_max_size, upload_max_filesize, file_uploads, max_execution_time you may have to check with your host on this.
:-
:- Q3: The page takes forever to load and then times out bringing me to a page cannot be displayed! Stupid script!
:-		A1: This is usually due to a low value in php.ini for max_execution_time. Ask your host to increase the value. Be aware that the time needed depends on the size the file(s) users are sending and the speed of THERE internet connection for uploading the files. If they are on 56k uploading 1mb will take forever, so the value may need to be set very high!
:-		A2: You really can have as many attachments as you want. I tested up to 10 attachments on Windows 2003 Server / XP & Red Hat 9/ Enterprise Linux 3/4. Several reasons could cause this. Your mail server could be rejecting that many at one time, your post_max_size, upload_max_filesize, file_uploads, max_execution_time in php.ini might be set to low or off. Contact your host to resolve this.
:-
:- Q4: How do I edit the colors of the form?
:-		A1: Due to many requests I used CSS instead of hard coding it into the php. I also made it easier to understand. The only bad part is if you are extremely novice you may have problems editing the CSS. Check http://www.w3schools.com/css/default.asp to brush up on CSS to change the colors of this script. The CSS is located near the end of this script.
:-
:- Q5: Can I add more fields for the users to enter information in?
:-		A1: That's the beauty of php! It's open source, you can edit it all you want, change whatever you don't like etc. Just please leave in my copyright. So many times I see my script without it and it makes me sad. 
:-
:- Q6: Dude! Can you add more fields for me? I don't know php!
:-		A1: Maybe, but I do usually charge a fee depending on what you want done. Don't freak out! It's usually a very small one. If I'm having a very good day and feel rich (ha-ha) I might do it for free..
:-
:- Q7: Can I remove your copyright?
:-		A1: I can't really physically stop you. But it's much appreciated by the people that leave it on there. Some people donate me $15-$20 to take it off. If you donate a small amount to me I might just not care as much.
:-		A2: When I go to your site and see this script no matter how much you tried to edit it to hide the fact, I usually know it's mine and will usually report it to your host if I'm not to busy. ~35 down and counting!
:-		A3: So basically unless I say it's ok just leave it on there.. It doesn't hurt you at all does it? Does that little bit of text just make your balls itch? If it's that bad then go ahead...
:-
:- Q8: You never respond to my emails or in your forums (http://www.phphq.net/forums/)!
:-		A1: I know and I'm sorry. I'm a very busy guy. I'm out of town a lot, and at any given time I have several projects going on. I get a lot of emails about this script, not to mention my other ones. Sometimes I just get too many of the same emails.. I usually clear out my inbox every week on a non specific day.
:-		A2: I only understand English. If you do know English but it's very bad please write in your native language and then translate it to English using http://babelfish.altavista.com/babelfish/tr
:-		A3: You will get a much faster and much more detailed response if you write a decent message. "dude me form don't work see it at blah.com what's wrong??!?!" will get no response, ever. Write in detail what the problem is and what you did to try and fix it. Spend a minute on it, and I'll take some of my time to reply.
:-		A4: Please don't speak in h4x0r language. I do understand it but it's very annoying to me. I will most likely just chuckle and delete it.
:-
*/
 
 
/*
//================================================================================
* ! ATTENTION !
//================================================================================
:- Please read the above FAQ before giving up or emailing me. It may sort out your problems!
*/
 
 
// This will show in the <title></title> and the form name
$websitename="phMailer 1.5"; 
 
// Allowed file types. Please remember to keep the format of this array, add the file extensions you want WITHOUT the dot. Please also be aware that certain file types may cause harm to your website and/or server.
$allowtypes=array("zip", "rar", "txt", "doc", "jpg", "png", "gif","odt","xml");
 
// What's your email address? Seperate email addresses with commas for multiple email addresses.
$myemail="info@whatyouseeyoucannotbe.com";
 
// What priority should the script send the mail? 1 (Highest), 2 (High), 3 (Normal), 4 (Low), 5 (Lowest).
$priority="3"; 
 
// Should we allow visitors to attach files? How Many? 0 = Do not allow attachments, 1 = allow only 1 file to be attached, 2 = allow two files etc.
$allowattach="0"; 
 
// Maximum file size for attachments in KB NOT Bytes for simplicity. MAKE SURE your php.ini can handel it, post_max_size, upload_max_filesize, file_uploads, max_execution_time!
// 2048kb = 2MB,       1024kb = 1MB,     512kb = 1/2MB etc..
$max_file_size="1024";
 
// Maximum file size for all attachments combined in KB NOT Bytes! MAKE SURE your php.ini can handel it, post_max_size, upload_max_filesize, file_uploads, max_execution_time!
// 2048kb = 2MB,       1024kb = 1MB,     512kb = 1/2MB etc..
$max_file_total="2048";
 
// Value for the Submit Button
$submitvalue=" Send Email "; 
 
 
// Default subject? This will be sent if the user does not type in a subject
$defaultsubject="From Site"; 
 
// Because many requested it, this feature will add a drop down box for the user to select a array of subjects that you specify below. 
// True = Use this feature, False = do not use this feature
$use_subject_drop=false;
 
// This is an array of the email subjects the user can pick from. Make sure you keep the format of this array or you will get errors!
// Look at http://phphq.net/forums/viewtopic.php?p=836 for examples on how to use this feature.
$subjects=array("Department 1","Department 2","Department 3");
 
// This is an array of the email address for the array above. There must be an email FOR EACH array value specified above. You can have only 1 department if you want.
//YOU MUST HAVE THE SAME AMMOUNT OF $subjects and $emails or this WILL NOT work correctly! The emails also must be in order for what you specify above!
// You can also seperate the emails by a comma to sent 1 department to multiple email addresses.
$emails=array("dept_1@domain.com","dept_2@domain.com","dept_3@domain.com");
 
// This is the message that is sent after the email has been sent. You can use html here.
// If you want to redirect users to another page on your website use this: <script type=\"text/javascript\">window.location=\"http://www.YOUR_URL.com/page.html\";</script>
 
//$thanksmessage="Thank you! Your email has been sent, we will respond shortly."; 
$thanksmessage="<script type=\"text/javascript\">window.location=\"http://www.whatyouseeyoucannotbe.com/teachers.html\";</script>"; 
// Uncomment (remove the //'s) above to use redirect
 
 
 
/*
//================================================================================
* ! ATTENTION !
//================================================================================
: Don't edit below this line unless you know some php. Editing some variables or other stuff could cause undeseriable results!!
*/
 
// Will get the extension of the users file. For some reason trying to get the actual type of the file caused problems with certain browsers.
 
function get_ext($key) { 
	$key=strtolower(substr(strrchr($key, "."), 1));
	// Cause there the same right?
	$key=str_replace("jpeg","jpg",$key);
	return $key;
}
 
function phattach($file,$name) {
	global $boundary;
	
	$fp=@fopen($file,"r");
	$str=@fread($fp, filesize($file));
	$str=@chunk_split(base64_encode($str));
	$message="--".$boundary."\n";
	$message.="Content-Type: application/octet-stream; name=\"".$name."\"\n";
	//$message.="Content-disposition: attachment\n"; Thanks goes to someone named Chris (I think, it was awhile ago) for his fix below!
	$message.="Content-disposition: attachment; filename=\"".$name."\"\n"; 
	$message.="Content-Transfer-Encoding: base64\n";
	$message.="\n";
	$message.="$str\n";
	$message.="\n";
 
	return $message;
}
 
//Little bit of security from people forging headers. People are mean sometimes :(
function clean($key) {
	$key=str_replace("\r", "", $key);
	$key=str_replace("\n", "", $key);
	$find=array(
		"/bcc\:/i",
		"/Content\-Type\:/i",
		"/Mime\-Type\:/i",
		"/cc\:/i",
		"/to\:/i"
	);
  $key=preg_replace($find,"",$key);
  return $key;
}
 
// Safe for register_globals=on =)
 
$error="";
$types="";
$sent_mail=false;
 
// Do some loopy stuff for the valid file types so people can see what types are valid before they try and upload invalid ones.
 
$ext_count=count($allowtypes);
$i=0;
 
foreach($allowtypes AS $extension) {
	
	//Gets rid of the last comma
	
	If($i <= $ext_count-2) {
		$types .="*.".$extension.", ";
	} Else {
		$types .="*.".$extension;
	}
	$i++;
}
unset($i,$ext_count); // why not
 
 
// If they post the form start the mailin'!
 
If($_POST['submit']==true) {
	extract($_POST, EXTR_SKIP);
 
		// Check the form for errors
	
		If(trim($yourname)=="") { 
			$error.="You did not enter your name!<br />";
		}
		
		If(trim($youremail)=="") { 
			$error.="You did not enter your email!<br />";
		} Elseif(!eregi("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}\$",$youremail)) {
			$error.="Invalid email address.<br />";
		}
 
		If(trim($emailsubject)=="") {
			$emailsubject=$defaultsubject;
		}
 
		If(trim($yourmessage)=="") { 
			$error.="You did not enter a message!<br />";
		}
		
		// Verify Attchment info
		
		If($allowattach > 0) {
			
			//Loopish
			
			For($i=0; $i <= $allowattach-1; $i++) {
				
				If($_FILES['attachment']['name'][$i]) {
					
					$ext=get_ext($_FILES['attachment']['name'][$i]);
					$size=$_FILES['attachment']['size'][$i];
					$max_bytes=$max_file_size*1024;
					
					//Check if the file type uploaded is a valid file type. 
					
					If(!in_array($ext, $allowtypes)) {
						
						$error.= "Invalid extension for your file: ".$_FILES['attachment']['name'][$i].", only ".$types." are allowed.<br />";
						
						//Check the size of each file
						
					} Elseif($size > $max_bytes) {
						$error.= "Your file: ".$_FILES['attachment']['name'][$i]." is to big. Max file size is ".$max_file_size."kb.<br />";
					}
					
				} // If Files
				
			} // For
 
			//Tally the size of all the files uploaded, check if it's over the ammount.
			
  			$total_size=array_sum($_FILES['attachment']['size']);
  			
			$max_file_total_bytes=$max_file_total*1024;
			
			If($total_size > $max_file_total_bytes) {
				$error.="The max size allowed for all your files is ".$max_file_total."kb<br />";
			}
			
		} // If Allowattach
 
	If($error) {
	
		$display_message=$error;
 
	} Else {
		
		If($use_subject_drop AND is_array($subjects) AND is_array($emails)) {
			$subject_count=count($subjects);
			$email_count=count($emails);
			
			If($subject_count==$email_count) {
				
				$myemail=$emails[$emailsubject];
				$emailsubject=$subjects[$emailsubject];
				
			}
			
		}
		
		
		$boundary=md5(uniqid(time()));
		
		//Little bit of security from people forging headers. People are mean sometimes :(
		
		$yourname=clean($yourname);
		$yourmessage=clean($yourmessage);
		$youremail=clean($youremail);
		
		//Headers
		
		$headers="From: ".$yourname." <".$youremail.">\n";
		$headers.="Reply-To: ".$yourname." <".$youremail.">\n";
		$headers.="MIME-Version: 1.0\n";
		$headers.="Content-Type: multipart/mixed; boundary=\"".$boundary."\"\n";
		$headers.="X-Sender: ".$_SERVER['REMOTE_ADDR']."\n";
		$headers.="X-Mailer: PHP/".phpversion()."\n";
		$headers.="X-Priority: ".$priority."\n"; 
		$headers.="Return-Path: <".$youremail.">\n";
		$headers.="This is a multi-part message in MIME format.\n";
 
		//Message
			
		$message = "--".$boundary."\n";
		$message.="Content-Type: text/plain; charset=\"iso-8859-1\"\n";
		$message.="Content-Transfer-Encoding: quoted-printable\n";
		$message.="\n";
		$message.="$yourmessage";
		$message.="\n";
 
		//Lets attach to something! =)
		
		If($allowattach > 0) {
			
			For($i=0; $i <= $allowattach-1; $i++) {
				
				If($_FILES['attachment']['name'][$i]) {
					
					$message.=phattach($_FILES['attachment']['tmp_name'][$i],$_FILES['attachment']['name'][$i]);
					
				}
				
			} //For
			
		} // If
		
		
		// End the message
		
		$message.="--".$boundary."--\n";
		
		// Send the completed message
		
		If(!mail($myemail,$emailsubject,$message,$headers)) {
			
			Exit("An error has occured, please report this to the website administrator.\n");
			
		} Else {
		
			$sent_mail=true;
			
		}
 
	} // Else
 
} // $_POST
 
/*
//================================================================================
* Start the form layout
//================================================================================
:- Please know what your doing before editing below. Sorry for the stop and start php.. people requested that I use only html for the form..
*/
?>
<html><head><title>What You See...Feedback</title>
 
 
<link href="register_files/style_whatyousee.css" rel="stylesheet" type="text/css">
<link type="text/css" href="register_files/styleprint.css" rel="stylesheet" media="print"><!--[if IE]>
<style>
a.gwbtn, a.gwbtn_ie6 {cursor:hand;}
</style>
<![endif]-->
 
<script type="text/javascript" language="javascript" src="register_files/utility.js" charset="UTF-8"></script>
<script type="text/javascript" language="javascript" src="register_files/popup.js" charset="UTF-8"></script>
<script type="text/javascript" src="../register_files/overlib.js"></script><!-- Any Extra Headers Here -->
 
 
 
 
 
 
 
 
<script src="register_files/urchin.js" type="text/javascript"></script><script type="text/javascript">_uacct = "UA-289919-1";urchinTracker();</script>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<style type="text/css">
<!--
#Layer1 {
	position:absolute;
	left:1px;
	top:296px;
	width:772px;
	height:96px;
	z-index:1;
}
#login {
	position:absolute;
	left:715px;
	top:143px;
	width:142px;
	height:65px;
	z-index:1;
}
.style1 {color: #7297D7}
.style2 {color: #999999}
.style3 {
	color: #FFFFFF;
	font-size: 9px;
}
.style5 {font-size: 9px}
 
-->
</style>
 
 
 
 
<script type="text/javascript">
var error="";
e_regex = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/;
 
function Checkit(theform) {
	
	if(theform.yourname.value=="") {
		error+="You did not enter your name\n";
	}
	
	if(theform.youremail.value=="") {
		error+="You did not enter your email\n";
	} else if(!e_regex.test(theform.youremail.value)) {
		error+="Invalid email address\n";
	}
		
	if(theform.yourmessage.value=="") {
		error+="You did not enter your message\n";
	}
	
	if(error) {
		alert('**The form returned the following errors:**\n\n' + error);
		error="";
		return false;
	} else {
		return true;
	}
}
</script>
</head>
<body topmargin="0" leftmargin="0" marginwidth="0">
 
<table summary="major layout" style="border-style: solid; border-color: rgb(236, 236, 236); border-width: 0pt 1px 1px;" align="center" border="0" cellpadding="0" cellspacing="0" width="770">
<tbody><tr><td width="169"></td>
<td width="606"></td>
<td width="1"></td>
</tr>
<!--banner--><tr class="noprint"><td colspan="3"><table style="background: transparent url(/i/banner_bg.jpg) no-repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" cellpadding="0" cellspacing="0" height="186" width="770">
 
<!-- TOPLINE BANNER --><tbody><tr><td align="right" height="20" valign="top">
<table summary="" class="topline_menu" border="0" cellpadding="0" cellspacing="0"><tbody><tr>
  <td><a href="http://www.whatyouseeyoucannotbe.com/about.html">about </a></td>
  <td bgcolor="#565656" width="1"><img src="register_files/spacer.gif" width="1"></td>
  <td><a href="http://www.whatyouseeyoucannotbe.com/contact.html">contact </a></td>
  <td bgcolor="#565656" width="1"><img src="register_files/spacer.gif" width="1"></td>
<td>
 
<a href="http://www.whatyouseeyoucannotbe.com/feedback.html">feedback</a></td>
</tr></tbody></table></td></tr>
<!-- SECONDLINE BANNER --><tr>
  
</tr>
<!-- THIRD LINE --><tr>
 
<td align="left"><table summary="" style="background: transparent url(/i/banner_login.jpg) no-repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" class="banner_login_inset" cellpadding="0" cellspacing="0" height="0" width="0">
<tbody><tr></tr>
</tbody></table>
  <table width="766">
    <tr>
      <td width="758" height="56"><script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','761','height','50','src','register_files/headerwys','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','register_files/headerwys' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="764" height="50">
        <param name="movie" value="register_files/headerwys.swf">
        <param name="quality" value="high">
        <embed src="register_files/headerwys.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="764" height="50"></embed>
      </object></noscript></td>
    </tr>
  </table>
  <table width="767" height="71">
    <tr>
      <td height="65"><img src="register_files/register_new_2.png" width="766" height="124"></td>
    </tr>
  </table></td></tr>
</tbody></table></td></tr><!-- END OF BANNER -->
<tr>
  <td height="10"><img src="register_files/spacer.gif" alt=""></td>
</tr>
<tr>
<!-- LEFT HAND COLUMN --><td align="center" valign="top">
 
<!-- MENU -->
 
 
<div class="noprint" style="margin: 0pt; padding: 0pt;"><!-- dont' print these ads -->
 
 
<table summary="" class="lhs_box" cellpadding="0" cellspacing="0"><tbody><tr><td>
<table width="143"" cellspacing="0" class="lhs_box_hdr" cellpadding=" summary=""0>
<tbody><tr><td width="138"><div align="center" class="style3">INVESTIGATIONS</div></td>
</tr></tbody></table>
<table summary="" class="lhs_box_body" cellpadding="0" cellspacing="0">
<tbody><tr><td style="font-size: 10px;">
<div class="faqlink">
Do We Really Have Free Will ?</div>
<div class="faqlink">
What The Hell Am I?</div>
<div class="faqlink">
Whats At The Centre ?</div>
<div class="faqlink">
What is Time and Space ?</div>
</td></tr></tbody></table>
</td></tr>
    
</tbody></table>
 
 
<table summary="" class="lhs_box" cellpadding="0" cellspacing="0"><tbody><tr><td>
<table summary="Menu" class="lhs_box_hdr" cellpadding="0" cellspacing="0">
<tbody><tr>
  <td width="142"> <div align="center"><span class="style5">LINKS</span></div></td>
</tr></tbody></table>
<table summary="Menu" class="section_menu_body" cellpadding="0" cellspacing="0">
<tbody><tr>
<td class="current">
<a href="http://www.whatyouseeyoucannotbe.com">Interesting Excerpts </a></td>
</tr>
<tr>
<td class="">
<a href="http://www.whatyouseeyoucannotbe.com">Papers</a></td>
</tr>
<tr>
<td class="">
  <p><a href="http://www.whatyouseeyoucannotbe.com">Fun Stuff </a></p>
  </td></tr>
</tbody></table></td></tr>
</tbody></table>
 
 
 
 
 
 
 
 
 
 
<table summary="" class="lhs_box" cellpadding="0" cellspacing="0"><tbody><tr><td>
<table summary="" class="lhs_box_hdr" cellpadding="0" cellspacing="0">
<tbody><tr><td width="142" valign="middle"><div align="center" class="style5"> FAVOURITE TEACHERS </div></td>
</tr></tbody></table>
<table summary="" class="lhs_box_body" cellpadding="0" cellspacing="0">
<tbody><tr>
  <td style="font-size: 10px;"> Here is a list of some of my favourite teachers
<br>
<div align="right"><a href="http://www.whatyouseeyoucannotbe.com/teacher.html" class="grey_arrow_link">read more <img src="register_files/grey_arrow.gif" alt="&gt;&gt;" border="0"></a></div>
</td></tr></tbody></table>
</td></tr>
<tr><td style="background: transparent url(register_files/lhs_box_footer.gif) repeat scroll 0%; height: 3px; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><img src="register_files/spacer.gif" alt=""></td></tr>
</tbody></table>
</div> <!-- noprint -->
</td><!-- LEFT HAND COLUMN ENDS -->
 
<!-- MAIN AREA --><td valign="top"><span> 
<!-- Page Body Here -->
<table class="mainbox" border="0" cellpadding="0" cellspacing="0" width="596">
<tbody><tr><td width="596" height="22" class="header" style="background: transparent url(register_files/h1_bg_extend.gif) no-repeat scroll 0px; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
 
<h1 align="center">WELCOME</h1>
 
</td></tr>
<tr><td height="211" class="body">
<!-- BODY GOES HERE -->
<form method="post" action="<?=$_SERVER['PHP_SELF'];?>" enctype="multipart/form-data" name="phmailer" onSubmit="return Checkit(this);">
  <p>&nbsp;</p>
  <table align="center" class="table">
	<?If($allowattach > 0) {?>
		<tr>
			<td width="100%" class="attach_info" colspan="2">
				<b>Valid Attachment Types:</b> <?=$types?><br />
				<b>Max size per file:</b> <?=$max_file_size?>kb.<br />
				<b>Max combined file size:</b> <?=$max_file_total?>kb.
			</td>
		</tr>
	<?}?>
	
	<tr>
		<td width="30%">Your Name<span class="error_message">*</span>:</td>
		<td width="70%"><input name="yourname" type="text" size="30" value="<?=stripslashes(htmlspecialchars($yourname));?>" /></td>
	</tr>
	<tr>
		<td width="30%">Your Email<span class="error_message">*</span>:</td>
		<td width="70%"><input name="youremail" type="text" size="30" value="<?=stripslashes(htmlspecialchars($youremail));?>" /><span class="error_message"><a onMouseOver="overlib('In order to respond your email address is necessary.', CAPTION, 'Your Moving Date', WIDTH, 300)" onMouseOut="return nd();"><img src="images/infoicon.gif" width="11" height="11" border="0"></a></span></td>
	</tr>
	<tr>
		<td width="30%">Subject:</td>
		<td width="70%">
		
			<?If($use_subject_drop AND is_array($subjects)) {?>
					<select name="emailsubject" size="1">
						<?while(list($key,$val)=each($subjects)) {?>
 
							<option value="<?=intval($key);?>"><?=htmlspecialchars(stripslashes($val));?></option>
						
						<?}?>
					</select>
				
			
			<?} Else {?>
				
				<input name="emailsubject" type="text" size="30" value="<?=stripslashes(htmlspecialchars($emailsubject));?>" />
				
			<?}?>
			
		</td>
	</tr>
 
<?For($i=1;$i <= $allowattach; $i++) {?>
	<tr>
		<td width="30%">Attach File:</td>
		<td width="70%"><input name="attachment[]" type="file" size="30" /></td>
	</tr>
<?}?>
 
	<tr>
		<td colspan="2" width="100%">Your Message:<span class="error_message">*</span><br />
			<div align="center">
				<p>
				  <textarea name="yourmessage" size="28" rows="8" cols="60" font-size="3"><?=stripslashes(htmlspecialchars($yourmessage));?>
				</textarea>
				  </p>
				<br>
				<p>&nbsp;</p>
				<p>&nbsp;    </p>
			</div>
		</td>
	</tr>
	<tr>
		<td colspan="2" width="100%" class="table_footer">
			<p>
			  <input type="hidden" name="submit" value="true" />
			  <input type="submit" value="<?=$submitvalue;?>" /> 
&nbsp;			  </p>
			<p>&nbsp;</p>
			<p>Prefer to leave a voice comment? <a href="voice.html">Click Here   </a></p></td>
	</tr>
</table>
</form>
<p><!-- end of main box -->
 
</td></tr>
<tr><td><div class="dwb"><div class="dwbl"><div class="dwbr"><img src="/i/spacer.gif" height="5" alt=""></div></div></div></td></tr>
 
 
</table>
 
 
 
 
 
<!-- Mover Guide stuff moved to moverguide.html -->
<div class="main_linkline"><a href="http://www.newaddress.ie/p/login.html" class="main_link"></a></div>
 
<!-- end of main box --></form></td></tr>
<tr><td><div class="dwb"><div class="dwbl"><div class="dwbr"><img src="register_files/spacer.gif" alt="" height="5"></div></div></div></td></tr>
</tbody></table>
 
<!-- End of Page Body --><!-- PAGE AREA ENDS-->
 
</tr>
<tr class="noprint"><td height="4"><img src="register_files/spacer.gif" alt=""></td></tr>
<tr class="noprint"><td colspan="3"><!-- FOOTER -->
<table summary="" align="center" cellpadding="0" cellspacing="0" width="720"><tbody><tr><td><table summary="" class="footer_menu" border="0" cellpadding="0" cellspacing="0"><tbody><tr>
  <td><a href="http://www.whatyouseeyoucannotbe.com/about.html">about&nbsp;&nbsp;&nbsp;</a></td>
  <td bgcolor="#565656" width="1"><img src="register_files/spacer.gif" width="1"></td>
<td><a href="http://www.whatyouseeyoucannotbe.com/contact.html">contact&nbsp;&nbsp;&nbsp;</a></td>
<td bgcolor="#565656" width="1"><img src="register_files/spacer.gif" width="1"></td>
<td><a href="http://www.whatyouseeyoucannotbe.com/feedback.html">feedback&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>
</tr></tbody></table></td>
<td align="centre">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<img src="register_files/bottom_flowers_now2.png"  alt="What You See..." width="190" height="55"></td>
<td align="right"><span class="style2">whatyouseeyoucannotbe&copy; Copyright 2008 </span></td>
</tr></tbody></table>
</td>
</tr>
</tbody></table>
<!-- END OF MAJOR LAYOUT -->
 
<div id="popup" style="visibility: hidden; position: absolute; left: 200px; width: 500px; top: 100px;">
<table bgcolor="#6e7ad7" border="1" cellpadding="3" cellspacing="0" width="100%">
<tbody><tr><td width="100%">
<table border="0" cellpadding="0" cellspacing="0" height="36" width="100%">
<tbody><tr><td id="titleBar" height="20" width="100%">
  <layer width="100%">
  <font color="#ffffff" face="Verdana"><b><div id="popupTitle">Popup Title</div></b></font>
  </layer></td>
  <td style="" valign="top">
  <a href="#" onClick="popupClose('close');return false">
	<font style="text-decoration: none;" color="#ffffff" size="2"><b>X</b></font></a>
  </td></tr>
  <tr>
  <td style="padding: 1px;" colspan="2" bgcolor="#999999" width="100%">
<table bgcolor2="#d9ebf7" align="center" bgcolor="#ffffff" border="0" cellpadding="0" width="100%">
<tbody><tr><td valign="top"><div id="popupBody">
The body of the popup
</div>
</td></tr></tbody></table>
</td></tr></tbody></table> 
</td></tr></tbody></table>
</div>
<center class="noprint">
  <a href="http://www.newaddress.ie/" style="color: #999999;"></a>
</center>
</body></html>

Open in new window

Avatar of Phatzer
Phatzer
Flag of United Kingdom of Great Britain and Northern Ireland image

The text-area issue:

Replace:
<textarea name="yourmessage" size="28" rows="8" cols="60" font-size="3"><?=stripslashes(htmlspecialchars($yourmessage));?>

With:
<textarea name="yourmessage" size="28" rows="8" cols="60" style="font-size: 3;"><?=stripslashes(htmlspecialchars($yourmessage));?>

Just looking at the redirect now.
ASKER CERTIFIED SOLUTION
Avatar of Phatzer
Phatzer
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jones_bones
jones_bones

ASKER

Thanks thats great. Just wondering why the message area is always tabbed in one when I click on it? I've tried align="left" but no joy. Has it got something to do with the stripslashes call?

<textarea name="yourmessage" size="28" rows="8" cols="60" align="left" style="font-size: 14;"><?=stripslashes(htmlspecialchars($yourmessage));?>
                        </textarea>

Thanks,

D
I see, make sure its all on one line:

<textarea name="yourmessage" size="28" rows="8" cols="60" style="font-size: 3;"><?=stripslashes(htmlspecialchars($yourmessage));?></textarea>

Instead of
<textarea name="yourmessage" size="28" rows="8" cols="60" align="left" style="font-size: 14;"><?=stripslashes(htmlspecialchars($yourmessage));?>
                        </textarea>

See the tabbed gap and line break between ?> and </textarea> ?
Thanks for your help. Thats great. For some reason the script is not sending emails consistantly at the moment but I guess if the problem persists I'll post a new question.