CabConModding
Facebook
Twitter
youtube
Discord
Contact us
RSS
Menu
CabConModding
Home
New
Top
Premium
Rules
FAQ - Frequently Asked Questions
Games
Fornite
Call of Duty: Black Ops 3
Clash of Clans
Grand Theft Auto 5
Apex Legends
Assassin’s Creed Origins
Forums
Premium
Latest posts
What's new
Latest posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Log in
Register
What's new
Premium
Latest posts
Menu
Log in
Register
Navigation
Install the app
Install
More options
Dark Theme
Contact us
Close Menu
Forums
Tech Boards
Web Development
PHP
PHP Tutorials
Simple PHP Contact Form
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Kyle Fardy" data-source="post: 26462" data-attributes="member: 12678"><p>Hello CCM!</p><p></p><p>Today I’m Going To Show A Quick Tutotial On How To Make A Simple PHP Contact Form!</p><p></p><p>So Let’s Get Into It.</p><p></p><p>First You Will Need To Open A IDE Of Your Choice!</p><p></p><p>I Highly Recommend Sublime Or NotePad++</p><p></p><p></p><p>Once You Have Opened Your IDE Of Choice Create A File Called</p><p></p><p>contact.php</p><p></p><p>In That File Add The Following Code</p><p></p><p>[HTML]</p><p><table width="400" border="0" align="center" cellpadding="3" cellspacing="1"></p><p><tr></p><p><td><strong>Contact Form </strong></td></p><p></tr></p><p></table></p><p><table width="400" border="0" align="center" cellpadding="0" cellspacing="1"></p><p><tr></p><p><td><form name="form1" method="post" action="send.php"></p><p><table width="100%" border="0" cellspacing="1" cellpadding="3"></p><p><tr></p><p><td width="16%">Subject</td></p><p><td width="2%">:</td></p><p><td width="82%"><input name="subject" type="text" id="subject" size="50"></td></p><p></tr></p><p><tr></p><p><td>Detail</td></p><p><td>:</td></p><p><td><textarea name="detail" cols="50" rows="4" id="detail"></textarea></td></p><p></tr></p><p><tr></p><p><td>Name</td></p><p><td>:</td></p><p><td><input name="name" type="text" id="name" size="50"></td></p><p></tr></p><p><tr></p><p><td>Email</td></p><p><td>:</td></p><p><td><input name="customer_mail" type="text" id="customer_mail" size="50"></td></p><p></tr></p><p><tr></p><p><td>&nbsp;</td></p><p><td>&nbsp;</td></p><p><td><input type="submit" name="Submit" value="Submit"> <input type="reset" name="Submit2" value="Reset"></td></p><p></tr></p><p></table></p><p></form></p><p></td></p><p></tr></p><p></table></p><p>[/HTML]</p><p></p><p>Now Once You Have Done That, Save The File!</p><p></p><p></p><p>But Hold Up, Were Not Done Yet</p><p></p><p>Now You Need To Create Another File Called send.php</p><p></p><p>In That File Add The Following Code (Edit It To Your Needs & Add Your Email Address In The $to Part)</p><p></p><p>[PHP]</p><p><?php</p><p></p><p>// Contact subject</p><p>$subject ="$subject";</p><p></p><p>// Details</p><p>$message="$detail";</p><p></p><p>// Mail of sender</p><p>$mail_from="$customer_mail";</p><p></p><p>// From</p><p>$header="from: $name <$mail_from>";</p><p></p><p>// Enter your email address</p><p>$to ='someone@somewhere.com';</p><p>$send_contact=mail($to,$subject,$message,$header);</p><p></p><p>// Check, if message sent to your email</p><p>// display message "We've recived your information"</p><p>if($send_contact){</p><p>echo "We've recived your contact information";</p><p>}</p><p>else {</p><p>echo "ERROR";</p><p>}</p><p>?></p><p>[/PHP]</p><p></p><p></p><p>Now Save That File Aswell And Upload Them To Your Website / Server</p><p></p><p>Now Send A Test Message And Make Sure It All Works!</p><p></p><p>That’s All For This Quick Tutorial!</p><p></p><p>Thanks For Looking Guys, Hope You Have A Nice Day!</p><p></p><p>If You Need Any Help Feel Free To Contact Me!</p><p></p><p></p><p>PS. Sorry About The Formatting, I Wrote This On My Phone Using An App</p></blockquote><p></p>
[QUOTE="Kyle Fardy, post: 26462, member: 12678"] Hello CCM! Today I’m Going To Show A Quick Tutotial On How To Make A Simple PHP Contact Form! So Let’s Get Into It. First You Will Need To Open A IDE Of Your Choice! I Highly Recommend Sublime Or NotePad++ Once You Have Opened Your IDE Of Choice Create A File Called contact.php In That File Add The Following Code [HTML] <table width="400" border="0" align="center" cellpadding="3" cellspacing="1"> <tr> <td><strong>Contact Form </strong></td> </tr> </table> <table width="400" border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <td><form name="form1" method="post" action="send.php"> <table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr> <td width="16%">Subject</td> <td width="2%">:</td> <td width="82%"><input name="subject" type="text" id="subject" size="50"></td> </tr> <tr> <td>Detail</td> <td>:</td> <td><textarea name="detail" cols="50" rows="4" id="detail"></textarea></td> </tr> <tr> <td>Name</td> <td>:</td> <td><input name="name" type="text" id="name" size="50"></td> </tr> <tr> <td>Email</td> <td>:</td> <td><input name="customer_mail" type="text" id="customer_mail" size="50"></td> </tr> <tr> <td> </td> <td> </td> <td><input type="submit" name="Submit" value="Submit"> <input type="reset" name="Submit2" value="Reset"></td> </tr> </table> </form> </td> </tr> </table> [/HTML] Now Once You Have Done That, Save The File! But Hold Up, Were Not Done Yet Now You Need To Create Another File Called send.php In That File Add The Following Code (Edit It To Your Needs & Add Your Email Address In The $to Part) [PHP] <?php // Contact subject $subject ="$subject"; // Details $message="$detail"; // Mail of sender $mail_from="$customer_mail"; // From $header="from: $name <$mail_from>"; // Enter your email address $to ='someone@somewhere.com'; $send_contact=mail($to,$subject,$message,$header); // Check, if message sent to your email // display message "We've recived your information" if($send_contact){ echo "We've recived your contact information"; } else { echo "ERROR"; } ?> [/PHP] Now Save That File Aswell And Upload Them To Your Website / Server Now Send A Test Message And Make Sure It All Works! That’s All For This Quick Tutorial! Thanks For Looking Guys, Hope You Have A Nice Day! If You Need Any Help Feel Free To Contact Me! PS. Sorry About The Formatting, I Wrote This On My Phone Using An App [/QUOTE]
Verification
Post reply
Forums
Tech Boards
Web Development
PHP
PHP Tutorials
Simple PHP Contact Form
CabConModding is now on facebook! Check the latest Updates, the Site Status and much more now!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top