Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Web Coding › Contact HTML 5 PHP form is not working :(
New Posts  All Forums:Forum Nav:

Contact HTML 5 PHP form is not working :(

post #1 of 4
Thread Starter 
For some reason, I just can not figure this out! The form does not email to my email or anything.

Here are the codes:
php
Code:
<?php
       $name = $_POST['name'];
       $email = $_POST['email'];
       $message = $_POST['message'];
       $from = 'From: My Contact Form';
       $to = 'pxs22559@rit.edu';
       $subject = 'Wassup?';

       $body = "From: $name\n E-Mail: $email\n Message:\n $message";

       if ($_POST['submit']) {
           if (mail ($to, $subject, $body, $from)) {
           echo '<p>Message Sent Successfully!</p>';
           } else {
           echo '<p>Ah! Try again, please?</p>';
           }
       }
    ?>

Html:
Code:
<form id="contactform" action="php/processForm.php" method="post">
                                        <table width="100%" class="tableless">
                                                <tr><td><input type="text" id="name" name="name" placeholder="What's your name" autofocus /></td></tr>
                                                <tr><td><input type="email" id="email" name="email" placeholder="Email goes here" /></td></tr>
                                                <tr><td><textarea id="message" name="message" rows="5" cols="20" placeholder="Whats this about?"></textarea></td></tr>
                                                                
                                                <tr><td><input name="button" class="btn" type="submit" value="Send Message" id="send" /><br/></td></tr>
                                        </table>
                                </form>

Yes the php is in the right place and named accordingly.
    
CPUMotherboardGraphicsRAM
Phenom II x4 955BE @3.8ghz Asus M4A79XTD Evo Sapphire 5870 2GB E6 4GB Mushkin Blackline 1600mhz 
Hard DriveOptical DriveCoolingOS
640gb WD | 250gb WD LG dvd reader Prolimatech Megahalems Windows 7 Ultimate x64 
MonitorKeyboardPowerCase
Dell S2209W 22" Lenovo Keyboard (k4803A) SilverStone Decathlon DA700 CM 690 II Advanced 
MouseAudio
Logitech G500 Cochlear Implants and JVC HA-RX700 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Phenom II x4 955BE @3.8ghz Asus M4A79XTD Evo Sapphire 5870 2GB E6 4GB Mushkin Blackline 1600mhz 
Hard DriveOptical DriveCoolingOS
640gb WD | 250gb WD LG dvd reader Prolimatech Megahalems Windows 7 Ultimate x64 
MonitorKeyboardPowerCase
Dell S2209W 22" Lenovo Keyboard (k4803A) SilverStone Decathlon DA700 CM 690 II Advanced 
MouseAudio
Logitech G500 Cochlear Implants and JVC HA-RX700 
  hide details  
Reply
post #2 of 4
Code:
$from = 'From: My Contact Form';

Doesn't look like a valid email. tongue.gif

What are your global SMTP default settings?
Lee XT
(17 items)
 
  
CPUMotherboardGraphicsRAM
AMD FX-6300 Asus M5A97 SAPPHIRE Radeon HD 7850 AMD 4GB DDR3 1333MHZ 
RAMRAMRAMHard Drive
AMD 4GB DDR3 1333MHZ AMD 4GB DDR3 1333MHZ AMD 4GB DDR3 1333MHZ OCZ Vertex 4 256GB 
CoolingOSMonitorKeyboard
Corsair H80 Windows 8.1 Pro MCE Dell P2414H WHXV7  Microsoft Generic 
PowerCaseMouseMouse Pad
Ultra 600W Limited Edition NZXT Black Steel Razer Deathadder Razer Goliath 
Audio
Realtek HD Audio 
  hide details  
Reply
Lee XT
(17 items)
 
  
CPUMotherboardGraphicsRAM
AMD FX-6300 Asus M5A97 SAPPHIRE Radeon HD 7850 AMD 4GB DDR3 1333MHZ 
RAMRAMRAMHard Drive
AMD 4GB DDR3 1333MHZ AMD 4GB DDR3 1333MHZ AMD 4GB DDR3 1333MHZ OCZ Vertex 4 256GB 
CoolingOSMonitorKeyboard
Corsair H80 Windows 8.1 Pro MCE Dell P2414H WHXV7  Microsoft Generic 
PowerCaseMouseMouse Pad
Ultra 600W Limited Edition NZXT Black Steel Razer Deathadder Razer Goliath 
Audio
Realtek HD Audio 
  hide details  
Reply
post #3 of 4
Thread Starter 
I do not know my global smtp settings, how do i find this?
also what should i change it too then? $from='pxs2259@rit.edu'; ?
    
CPUMotherboardGraphicsRAM
Phenom II x4 955BE @3.8ghz Asus M4A79XTD Evo Sapphire 5870 2GB E6 4GB Mushkin Blackline 1600mhz 
Hard DriveOptical DriveCoolingOS
640gb WD | 250gb WD LG dvd reader Prolimatech Megahalems Windows 7 Ultimate x64 
MonitorKeyboardPowerCase
Dell S2209W 22" Lenovo Keyboard (k4803A) SilverStone Decathlon DA700 CM 690 II Advanced 
MouseAudio
Logitech G500 Cochlear Implants and JVC HA-RX700 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Phenom II x4 955BE @3.8ghz Asus M4A79XTD Evo Sapphire 5870 2GB E6 4GB Mushkin Blackline 1600mhz 
Hard DriveOptical DriveCoolingOS
640gb WD | 250gb WD LG dvd reader Prolimatech Megahalems Windows 7 Ultimate x64 
MonitorKeyboardPowerCase
Dell S2209W 22" Lenovo Keyboard (k4803A) SilverStone Decathlon DA700 CM 690 II Advanced 
MouseAudio
Logitech G500 Cochlear Implants and JVC HA-RX700 
  hide details  
Reply
post #4 of 4
Quote:
Originally Posted by bbaseballboy1234 View Post

I do not know my global smtp settings, how do i find this?
also what should i change it too then? $from='pxs2259@rit.edu'; ?

Change it to the email you're sending from. Remember that if you're using an SMTP server like Gmail or Office 365 you're outgoing email will need to match the email you authenticated for.

If what I said above doesn't make sense, you probably haven't configured your mail settings in php.ini. Are you running this on your PC or from a web hosting account?
Lee XT
(17 items)
 
  
CPUMotherboardGraphicsRAM
AMD FX-6300 Asus M5A97 SAPPHIRE Radeon HD 7850 AMD 4GB DDR3 1333MHZ 
RAMRAMRAMHard Drive
AMD 4GB DDR3 1333MHZ AMD 4GB DDR3 1333MHZ AMD 4GB DDR3 1333MHZ OCZ Vertex 4 256GB 
CoolingOSMonitorKeyboard
Corsair H80 Windows 8.1 Pro MCE Dell P2414H WHXV7  Microsoft Generic 
PowerCaseMouseMouse Pad
Ultra 600W Limited Edition NZXT Black Steel Razer Deathadder Razer Goliath 
Audio
Realtek HD Audio 
  hide details  
Reply
Lee XT
(17 items)
 
  
CPUMotherboardGraphicsRAM
AMD FX-6300 Asus M5A97 SAPPHIRE Radeon HD 7850 AMD 4GB DDR3 1333MHZ 
RAMRAMRAMHard Drive
AMD 4GB DDR3 1333MHZ AMD 4GB DDR3 1333MHZ AMD 4GB DDR3 1333MHZ OCZ Vertex 4 256GB 
CoolingOSMonitorKeyboard
Corsair H80 Windows 8.1 Pro MCE Dell P2414H WHXV7  Microsoft Generic 
PowerCaseMouseMouse Pad
Ultra 600W Limited Edition NZXT Black Steel Razer Deathadder Razer Goliath 
Audio
Realtek HD Audio 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Web Coding
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Web Coding › Contact HTML 5 PHP form is not working :(