Go Back   DevHunters.com l Webmaster Forum - Web Advertising - Web Design - SEO Forums > Webmaster / Coding / Web Design Discussion > PHP, CGI, ASP, Server-Side Programming

PHP, CGI, ASP, Server-Side Programming Discuss server-side programming such as PHP, CGI, ASP, and others.

Have A Look At Some Of Our Webmaster Related Sponsors!


Script Directory


Advertise Here


Market Leverage


Free Templates

3D Guide-Characters
3D Guide-characters


Advertise Here

Reply
 
LinkBack Thread Tools Display Modes
Old 05-27-2008, 03:02 PM   #1 (permalink)
New Hunter
 

Join Date: Sep 2007
Posts: 39
iTrader: 0 / 0%
Hunter Bux: 0
deatle is on a distinguished road
Default what's wrong with my script?!??!?

well i created a contact us page with mail() function!! but something wrong's happening!:S i created an if/elseif statement to allow name, email... checking... and then i inserted if(mail(....)){echo"...."} but everytime i refresh the page an email is sent:S and without even writing anything in the text areas an alert appears saying( please enter you full name)!!! please any help would be appreciated! thanks!
__________________
Anthony.Riachy
deatle is offline   Reply With Quote
Old 05-28-2008, 04:33 AM   #2 (permalink)
New Hunter
 
Bagi Zoltán's Avatar
 

Join Date: May 2008
Location: Hungary
Posts: 5
iTrader: 0 / 0%
Hunter Bux: 0
Bagi Zoltán is on a distinguished road
Default

Without having a deep look into your code all i can help is to direct you to this contact form tutorial, i hope it will give some useful idea about the solution.
__________________
custom eCommerce software development
Bagi Zoltán is offline   Reply With Quote
Old 05-28-2008, 06:12 AM   #3 (permalink)
Senior Moderator
 
SpOrTsDuDe.Reese's Avatar
Default

Post your whole code. And then provide us with a link to the site to test it out myself.
__________________
+-(X)HTML, CSS, JavaScript, SEO, PHP, Flash-+
Code:
<style type="text/css"> u { text-decoration: none; } </style>
GameYin. Redesigning for DevPlooth.
SpOrTsDuDe.Reese is offline   Reply With Quote
Old 05-28-2008, 01:11 PM   #4 (permalink)
New Hunter
 

Join Date: Sep 2007
Posts: 39
iTrader: 0 / 0%
Hunter Bux: 0
deatle is on a distinguished road
Default

<form method="post" action="contact_us.php"><font color="#FFFFFF"><?
$name=$_POST['name'];
$email=$_POST['email'];
$subject=$_POST['subject'];
$txt=$_POST['txt']?>
<?
if (!$name){echo ("Please Insert Your Full Name") ;
}
elseif (!preg_match("/^.+?@.+?\..+?/i" , $email)){echo ("Please Enter A Correct Email");
}
elseif (!$subject){echo (" Please Type a Subject");
}
elseif(!$txt){echo("Please Write Your E-mail Text");
} ?> </font>
<td width="144"><span class="style19"><u>Your Name:</u></span></td>
<td width="278"><input type="text" name="name" /></td>
</tr>
<tr>
<td><span class="style19"><u>Your E-mail:</u></span></td>
<td><input type="text" name="email" /></td>
</tr>
<tr> </tr>
<tr>
<td><span class="style19"><u>Subject:</u></span></td>
<td><input type="text" name="subject" /></td>
</tr>
<tr>
<td height="111"><span class="style19"><u>Your Message:</u></span></td>
<td><textarea style="width:17.5em; height:7em" name="txt"></textarea> </td>
</tr>
</table>
<br />
<div align="center"><input type="submit" value="Send Message" /></div></form>
<? $to="info@rz-group.com";
$headers .= 'From: $email' . "\r\n";
$headers .= 'Name: $name' . "\r\n";?><?
if(mail($to,$subject,$txt,$headers)){ echo ("
<div align='center'>Your message has successfully been sent, We'll try to get back to you as soon as possible. <br />");}
else { echo("<div align=\'center\'>Your message couldn\'t be sent. Please try again at a later time. Thanks. </div><br />");}
?>


Sorry inserting them into php and html tags wasnt working!:S hope u would helpo me!:D
__________________
Anthony.Riachy
deatle is offline   Reply With Quote
Old 05-28-2008, 02:36 PM   #5 (permalink)
New Hunter
 

Join Date: Sep 2007
Posts: 39
iTrader: 0 / 0%
Hunter Bux: 0
deatle is on a distinguished road
Default

it finally worked! thanks anuyway!:D
__________________
Anthony.Riachy
deatle is offline   Reply With Quote
Old 05-29-2008, 09:11 AM   #6 (permalink)
Field Master
 
sb225's Avatar
 

Join Date: Jun 2007
Posts: 918
iTrader: 2 / 100%
Hunter Bux: 4.00
sb225 has a spectacular aura aboutsb225 has a spectacular aura about
Default

thats geat you finally fixed withut any bodies help
sb225 is offline   Reply With Quote
Old 05-29-2008, 12:09 PM   #7 (permalink)
Senior Moderator
 
SpOrTsDuDe.Reese's Avatar
Default

Figuring something out your own is the best. Try not to go to forums unless you absolutely are stumped.
__________________
+-(X)HTML, CSS, JavaScript, SEO, PHP, Flash-+
Code:
<style type="text/css"> u { text-decoration: none; } </style>
GameYin. Redesigning for DevPlooth.
SpOrTsDuDe.Reese is offline   Reply With Quote
Reply

Bookmarks

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 On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT -5. The time now is 12:03 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios