Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 03-07-2009, 06:10 PM E-Mail form
Novice Talker

Posts: 7
Name: jordan
Trades: 0
Is something wrong with this email form code? It won't send to my email when I click submit.

HTML Code:
        <form method="post" action="send.php">
  Name: <input name="name" type="text" /><br />  <br />                 
  Email: <input name="email" type="text" /><br /><br />  
  Subject: <input name="subject" type="text" /><br /><br />  
  Message:<br />
  <textarea name="message" rows="15" cols="40">
  </textarea><br />
  <input type="submit" />
</form>
PHP Code:
<?php
  $name 
$_REQUEST['name'] ;
  
$email $_REQUEST['email'] ;
  
$subject $_REQUEST['subject'] ;
  
$message $_REQUEST['message'] ;

  
mail"jvizion@gmail.com""$subject",
    
$message"From: $name - $email);
  
header"Location: /index.html" );
?>
iMod0711 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-07-2009, 06:39 PM Re: E-Mail form
stevej's Avatar
Professional Multitasker

Posts: 996
Location: Not positive
Trades: 0
There don't appear to be any problems with the code. Are you sure that the code is in the right files (e.g. php code in send.php)? It may be an issue with the server, since some hosts don't support the mail() function. Especially free hosts, because of spammers.

- Steve
__________________
if($stevej == "helpful") { $talkupation += $user_power; }
stevej is offline
Reply With Quote
View Public Profile
 
Old 03-07-2009, 06:57 PM Re: E-Mail form
Knight13's Avatar
Defies a Status

Posts: 10,289
Name: Knight13
Location: Cleveland, Ohio
Trades: 0
Are you using wampserver to build your site on, or are you using a free hosting account?
Knight13 is offline
Reply With Quote
View Public Profile
 
Old 03-08-2009, 04:46 AM Re: E-Mail form
Novice Talker

Posts: 7
Name: jordan
Trades: 0
I'm using MAMP.
iMod0711 is offline
Reply With Quote
View Public Profile
 
Old 03-08-2009, 05:10 AM Re: E-Mail form
Junior Talker

Posts: 4
Name: Frederick Wright
Location: Bulgaria
Trades: 0
HI
i suggest using formto email from FormToEmail.com as it will work right away. I spent hours trying to get php email to work and seconds with form2email.
best
F
phobia1 is offline
Reply With Quote
View Public Profile Visit phobia1's homepage!
 
Old 03-08-2009, 06:12 PM Re: E-Mail form
stevej's Avatar
Professional Multitasker

Posts: 996
Location: Not positive
Trades: 0
Quote:
Originally Posted by iMod0711 View Post
I'm using MAMP.
Therein lies the problem. Local servers (like MAMP, WAMP, XAMP etc.) don't support the mail() function because of spammers that can use it to their advantage. As far as I know, there isn't a local server that does support the function. If you want to test this code out, you may have to do it on a real server.

- Steve
__________________
if($stevej == "helpful") { $talkupation += $user_power; }
stevej is offline
Reply With Quote
View Public Profile
 
Old 03-09-2009, 06:31 AM Re: E-Mail form
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
stevej is right. MAMP, WAMP etc. gives you Apache, MySQL and PHP. To send e-mails you must also have a mail server, which isn't as easy to get.
lizciz is offline
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Reply     « Reply to E-Mail form
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18866 seconds with 12 queries