Free Web Hosting Forum
(#1 (permalink))
Old
Senior Member
littleoly is on a distinguished road
 
Posts: 106
Join Date: Oct 2009
Location: England, UK but want to move to America
Default Form Validation - 07-23-2010, 10:08 PM

I have prepared this script for a contact form but when i tried it i never recieved the email... could you please check it...

HTML:
HTML Code:
<form method="post" action="admail.php">
  Email: <input name="email" type="text" /><br />
  Website: <input name="webaddress" type="text" /><br />
  Image Address: <input name="image" type="text" /><br />
  will you advertise us? Yes<input type="radio" name="adforus" /> No<input type="radio" name="adforus" /><br />
  Please Describe what your website is about and the purpose<br />
  <textarea name="aboutusersite" rows="15" cols="40">
  </textarea><br />
 <input type="submit" value="Submit Request" />
</form>
PHP:
PHP Code:
<?php
  $email 
$_REQUEST['email'] ;
  
$website $_REQUEST['webaddress'] ;
  
$imageurl $_REQUEST['image'] ;
  
$adforus $_REQUEST['adforus'] ;
  
$aboutusersite $_REQUEST['aboutusersite'] ;

   if (!isset(
$_REQUEST['email'])) {
    
header"Location: http://andrew.comyr.com/index.php?p=1_16" );
  }
  elseif (empty(
$email) || empty($website) || empty($imageurl) || empty($adforus) || empty($aboutusersite)) {
    
header"Location: http://andrew.comyr.com/index.php?p=1_17" );
  }
  else {


  
mail"littleoly@hotmail.co.uk""Advertisment Enquiries",
    
$website$imageurl$adforus$aboutusersite"From: $email" );
  
header"Location: http://andrew.comyr.com/index.php?p=1_16" );
 }
?>
Thanks in advance,
littleoly

P.s please dont spam my email
Reply With Quote
Sponsored Links
(#2 (permalink))
Old
d3iti's Avatar
Super Moderator
d3iti is on a distinguished road
 
Posts: 6,525
Join Date: Jul 2009
Location: Spain
Default 07-24-2010, 08:05 AM

At first glance, I see that you are misusing the mail function.
You're spending too much parameters(7) to this function, it is normal when you pass three or four parameters:
PHP Code:
bool mail  (  string $to  ,  string $subject  ,  string $message  [,  string $additional_headers  [,  string $additional_parameters  ]] ) 
I would add the following line just before calling the mail function.
PHP Code:
else {
  
$message =$website ."\n".$imageurl."\n".$aboutusersite;
  
mail"yourmail(at)yourmailserver.co.uk""Advertisment Enquiries",
    
$message"From: $email" );
 
header"Location: http://andrew.comyr.com/index.php?p=1_16" );
 }
?> 


Recuerda realizar copias de seguridad de tus sitios web. Si este mensaje te ayudó puedes pulsar sobre el botón karma

Last edited by d3iti; 07-24-2010 at 04:58 PM. Reason: Deleted/changed your email
Reply With Quote
(#3 (permalink))
Old
Senior Member
Jasper is on a distinguished road
 
Posts: 165
Join Date: Jun 2010
Default 07-24-2010, 01:52 PM

Quote:
Originally Posted by littleoly View Post
P.s please dont spam my email
You are a lot better off not posting it here (just cross it out) as the real offenders are Mail Searcher Bots by Evil People(c), not forum users.
Reply With Quote
(#4 (permalink))
Old
Banned
probannerdesigns is on a distinguished road
 
Posts: 44
Join Date: May 2009
Default 07-24-2010, 02:09 PM

yourname (at) sitename dot com is one option to avoid the spam bots
Reply With Quote
(#5 (permalink))
Old
Senior Member
Jasper is on a distinguished road
 
Posts: 165
Join Date: Jun 2010
Default 07-24-2010, 02:16 PM

Quote:
Originally Posted by probannerdesigns View Post
yourname (at) sitename dot com is one option to avoid the spam bots
Yes, but that's for when we need to know your email address, but here we don't, so simply replacing it with meyemail@mydomain.com is a superior option.

(note that when such a method as you are mentioning becomes common, spam bots can be adjusted to pick up on it anyway, so the best suggestion is to use some creativity - use a mix of "(", "<", "[", "-" and other symbols you think are clear, replace both the @ and the .s, if you are using a common email provider, leave out the the TLD (eg. [at> gmail - without the com-part), and one of the more extreme meaures is to add something like <remove this> or -NoSPaM- to your email address, which humans can pick up, but bots can't)
Reply With Quote
(#6 (permalink))
Old
Senior Member
littleoly is on a distinguished road
 
Posts: 106
Join Date: Oct 2009
Location: England, UK but want to move to America
Default 07-29-2010, 08:55 PM

I have tried them but no joy would one of you be able to create a .php script for the form?
Reply With Quote
(#7 (permalink))
Old
lobrc's Avatar
Administrator
lobrc is on a distinguished road
 
Posts: 5,037
Join Date: Jan 2010
Location: http://www.lobrc.net
Default 07-29-2010, 09:08 PM

Have a look at who I've write this contact form here and just edit it to suit your needs: http://www.free-installations.info/f...tact-form.html


FREE SCRIPT INSTALLATION SERVICE | PREMIUM HOSTING* | LOBRC.NET

*All packages include Quality Support, Website Builder, Free Site Migration, 30 Day Money Back Guarantee, Official cPanel and Fantastico Autoinstaller.

Plus get 20% off with promo code 000WH20. Contact sales for more information.
Reply With Quote
(#8 (permalink))
Old
Senior Member
littleoly is on a distinguished road
 
Posts: 106
Join Date: Oct 2009
Location: England, UK but want to move to America
Default 07-31-2010, 11:07 PM

Ok thanks for the help. i got it working ...well sort of, It send me an email but all the email contains is
, , ,

Three commas... could nayone tell me why? also could you tell me if its possible how to add more parameters because i need 7 but i only have 5

PHP Code:
<?php
$subject 
="Advertise from your site";
$message="$webaddress, $image, $adforus, $aboutusersite";
$mail_from="$email";
$header="from: $name <$mail_from>";
$to ='littleoly@hotmail.co.uk';
$send_contact=mail($to,$subject,$message,$header);
if(
$send_contact){
echo 
"Thank you for submiting your request.";
}
else {
echo 
"Unfortunately an error occurred while trying to send this message. Please try again later";
}
?>
Reply With Quote
(#9 (permalink))
Old
lobrc's Avatar
Administrator
lobrc is on a distinguished road
 
Posts: 5,037
Join Date: Jan 2010
Location: http://www.lobrc.net
Default 08-01-2010, 08:01 AM

Quote:
Originally Posted by littleoly View Post
PHP Code:
$message="$webaddress, $image, $adforus, $aboutusersite"


Replace the above with this:
PHP Code:
$message="$webaddress""$image""$adforus""$aboutusersite"
Just thought from first glance :/


FREE SCRIPT INSTALLATION SERVICE | PREMIUM HOSTING* | LOBRC.NET

*All packages include Quality Support, Website Builder, Free Site Migration, 30 Day Money Back Guarantee, Official cPanel and Fantastico Autoinstaller.

Plus get 20% off with promo code 000WH20. Contact sales for more information.
Reply With Quote
(#10 (permalink))
Old
Senior Member
littleoly is on a distinguished road
 
Posts: 106
Join Date: Oct 2009
Location: England, UK but want to move to America
Default 08-02-2010, 10:36 AM

Quote:
Originally Posted by lobrc View Post
Replace the above with this:
PHP Code:
$message="$webaddress""$image""$adforus""$aboutusersite"
Just thought from first glance :/
I done that but now i get an error message...
Parse error: syntax error, unexpected ',' in /home/username/public_html/send_contact.php on line 3

PHP Code:
<?php
$subject 
="Advertise from your site";
$message="$webaddress""$image""$adforus""$aboutusersite";
$mail_from="$email";
$header="from: $name <$mail_from>";
$to ='myemail@hotmail.co.uk';
$send_contact=mail($to,$subject,$message,$header);
if(
$send_contact){
echo 
"Thank you for submiting your request.";
}
else {
echo 
"Unfortunately an error occurred while trying to send this message. Please 

try again later"
;
}
?>
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com