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 10-18-2007, 01:27 PM E-mail form..
l3lueMage's Avatar
Skilled Talker

Posts: 73
Location: San Jose, California
Trades: 0
Okay I'm new to PHP/MySQL...Somewhat xD I know a lot cause of C++ and stuff but the MySQL part is all crazy for me.

Anyways before I start asking questions about MySQL I want to get this simple e-mail form down.

Theres two things I want:
1. To have the 'from' say their e-mail address when sent, and have the Subject show...the subject when it comes in my e-mail.
2. I want a "Message has been succesfully sent" Appear above the e-mail form, but fade in like when you digg something on digg I guess is the best example.

Heres the code so far.

Code:
<td class="newsbody"><table width="100%" border="1">
  <tr>
    <td><?php
//Variable Definitions from contact.php
$subject = $_POST['subject'];
$message = $_POST['message'];
$email = $_POST['email'];
$name = $_POST['name'];
$header ="From $name <$email>";
$to = 'email@email.net';
//send the e-mail
$send_contact = mail($to,$subject,$message,$header);
if($send_contact) { //Checks if E-mail was sent succesfully
echo "Message has been sent Succesfully";
} else {
echo "Error recieving Message";
}
?></td>
  </tr>
</table>

          <form id="form1" name="form1" method="post" action="contact.php">
            <table width="100%" border="0" cellpadding="3">
              <tr>
                <td width="25%"><label>
                  <input name="Name" type="text" class="tbl" id="Name" />
                </label>
                  <label></label></td>
                <td width="75%">Name</td>
              </tr>
              <tr>
                <td><input name="email" type="text" class="tbl" id="email" /></td>
                <td>E-mail</td>
              </tr>
              <tr>
                <td><input name="subject" type="text" class="tbl" id="subject" /></td>
                <td>Subject</td>
              </tr>
              <tr>
                <td colspan="2"><textarea name="message" cols="45" rows="8" class="tbl" id="message">Enter Message here...</textarea></td>
                </tr>
              <tr>
                <td colspan="2"><input type="submit" name="submit" id="submit" value="Submit" />
                  <label>
                  <input type="reset" name="Reset" id="button" value="Reset" />
                  </label></td>
                </tr>
            </table>
            <label></label>
            <br />
          </form>          </td>
        </tr>
      </table>
I think the fade in prob needs ajax or something? still the table is always showing even before they sent the message...and ya :/

Last edited by l3lueMage; 10-18-2007 at 01:56 PM..
l3lueMage is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-18-2007, 01:40 PM Re: E-mail form..
247SiteAlert's Avatar
Average Talker

Posts: 28
Trades: 0
Put up two fields on your web page and have them type in their email address and subject and then they click submit and the email is sent. Is that what you mean?

You posted code but you didn't say if it is working - is it working?

As for the fading, no you don't need ajax for that: use an animated gif with the text you want and fade it that way.
__________________
Free Website Uptime Monitoring

Please login or register to view this content. Registration is FREE

Last edited by 247SiteAlert; 10-18-2007 at 01:42 PM..
247SiteAlert is offline
Reply With Quote
View Public Profile
 
Old 10-18-2007, 01:49 PM Re: E-mail form..
l3lueMage's Avatar
Skilled Talker

Posts: 73
Location: San Jose, California
Trades: 0
It does work, And if you look at the code there is a spot for them to enter their email, and stuff but how do you make it so it actually says its from THEIR email and not my webhosts server e-mail? and how do you put a subject line when sent...look at the code? xD
l3lueMage is offline
Reply With Quote
View Public Profile
 
Old 10-18-2007, 06:45 PM Re: E-mail form..
Average Talker

Posts: 17
Trades: 0
interesting question and that the answer I will also like to know being a hosting provider have faced a lot of problem with nobody email stuff.
__________________
RSHosting- UK & US based reseller & dedicated hosting.
100% anonymous reseller hosting
+ FFMPEG + 10 min support

Please login or register to view this content. Registration is FREE
rshosting is offline
Reply With Quote
View Public Profile
 
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.30823 seconds with 12 queries