Help with Code
2015-12-06, 03:11 AM,
#1
here is the code for a submit for my website but i never did a submit code and i dont know where to actually put my email at so the submit comes to me.

<section id="contact-full-2" class="dark-bg bg-color1 cover-bg" style="background-image:url(images/bg29.jpg)">
<div class="container">
<h2 class="title">Order Service</h2>
<p class="sep-bottom">Paypal will hold the money until both parties agree to full satisfaction.<br>Lets begin! </p>
<form action="scripts/contact.php" role="form" id="contact_form">
<div class="form-group">
<input type="text" class="form-control" id="contact_name" placeholder="Full name" name="name">
</div>
<div class="form-group">
<input type="email" class="form-control" id="contact_email" placeholder="Email Address" name="email">
</div>
<div class="form-group">
<textarea class="form-control" rows="4" placeholder="Your message or question" id="contact_message" name="message"></textarea>
</div>
<button type="submit" id="contact_submit" data-loading-text="&bull;&bull;&bull;" class="btn btn-lg btn-block btn-primary">Order</button>
Reply
2015-12-06, 03:28 AM,
(This post was last modified: 2015-12-06, 03:29 AM by MoneyCashers.)
#2
You would do that on the "scripts/contact.php" script you have.

But read this: http://www.w3schools.com/html/html_forms.asp

I think that will save you a lot of time.

If you still need help after reading that let me know :)

~MoneyCashers

Even if you don't believe in yourself... I will. :)

[Image: banner3.jpg]
Reply
2015-12-06, 03:31 AM,
#3
($_SERVER['REQUEST_METHOD'] == 'POST') {
if(!empty($_POST['contactname']) && !empty($_POST['contactemail']) && !empty($_POST['contactmessage'])) {
$to = 'your@email.com'; // Your e-mail address here.
$body = "\nName: {$_POST['contactname']}\nEmail: {$_POST['contactemail']}\n\n\n{$_POST['contactmessage']}\n\n";
mail($to, "Message from yoursite.com", $body, "From: {$_POST['contactemail']}"); // E-Mail subject here.

So here is found it so now i just change where it says youremail is there anything else that should be changed in this code
Reply
2015-12-06, 03:58 AM,
(This post was last modified: 2015-12-06, 04:04 AM by MoneyCashers.)
#4
Give me a minute I'll write you a custom script ;)

~MoneyCashers
Latest Thanks - View all

dontbejello87(2015-12-06 04:00 AM) 

Even if you don't believe in yourself... I will. :)

[Image: banner3.jpg]
Reply
2015-12-06, 04:00 AM,
#5
Thank you Thats awesome something tells me you dont like how this one looks.
Reply
2015-12-06, 04:03 AM,
(This post was last modified: 2015-12-06, 04:20 AM by MoneyCashers.)
#6
That would be correct :)

Alright, I just tested this and it works great :)
Make sure to replace your email with the test@gmail.com :)


PHP Code:
<?php

// Coded By MoneyCashers. Made for a friend :)
 
$name $_POST['contactname'];
$message $_POST['contactmessage'];
$email $_POST['contactemail'];

$myemail "test@gmail.com"# Enter your email here

if (empty($name) || empty($email) || empty($message)) {
    echo 
'Opps! You missed a Field, please go back and make sure you fill out every one :)';
    return 
false;
    
}
else

$to      $myemail;
$subject 'New Form Contact!';
$email_message $message;
    
$headers 'From:' $email "\r\n" .
    
'Reply-To:' $email "\r\n" .
    
'X-Mailer: PHP/' phpversion();

mail($to$subject$email_message$headers);
?>

So basically when someone completes your form you will receive an email with their message and details.

I hope this is what you are after :)

Keep me updated on how it goes :)

~MoneyCashers
Latest Thanks - View all

dontbejello87(2015-12-06 04:21 AM) 

Even if you don't believe in yourself... I will. :)

[Image: banner3.jpg]
Reply
2015-12-06, 04:21 AM,
(This post was last modified: 2015-12-06, 04:30 AM by dontbejello87.)
#7
Yes i will im about to test it out right now

PHP Code:
<?php

// Coded By MoneyCashers. Made for a friend :)
 
$name $_POST['contactname'];
$message $_POST['contactmessage'];
$email $_POST['contactemail'];

$myemail "zestyjay84@gmail.com"# Enter your email here

if (empty($name) || empty($email) || empty($message)) {
    echo 
'Opps! You missed a Field, please go back and make sure you fill out every one :)';
    return 
false;
    
}
else

$to      $myemail;
$subject 'New Form Contact!';
$email_message $message;
    
$headers 'From:' $email "\r\n" .
    
'Reply-To:' $email "\r\n" .
    
'X-Mailer: PHP/' phpversion();

mail($to$subject$email_message$headers);
?>

I put my email in i tested it but im not getting no email
Reply
2015-12-06, 04:48 AM,
#8
Nope nothing i refrshed everything to even click on all email in gmail nothing do it think something may be wrong with the code in the html code not the php
Reply
2015-12-06, 04:55 AM,
(This post was last modified: 2015-12-06, 04:56 AM by MoneyCashers.)
#9
Yes I did find quite a few issues with it in fact:

Try this:


Code:
<form action="scripts/contact.php" method="post" name="Content_form">
<div class="form-group">
<input type="text" class="form-control" id="name" placeholder="Full name" name="name">
</div>
<div class="form-group">
<input type="email" class="form-control" id="email" placeholder="Email Address" name="email">
</div>
<div class="form-group">
<textarea class="form-control" rows="4" placeholder="Your message or question" id="message" name="message"></textarea>
</div>
<button type="submit" id="contact_submit" data-loading-text="&bull;&bull;&bull;" class="btn btn-lg btn-block btn-primary">Order</button>
</form>

~MoneyCashers

Even if you don't believe in yourself... I will. :)

[Image: banner3.jpg]
Reply
2015-12-06, 05:07 AM,
#10
okay i put in then when i got to test it im redirected to a black page at http://www.aplusme.org/scripts/contact.php
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  So You Want to Build a Ch@t Bot – Here's How (Complete with Code!) SwiffJustus 0 167 2017-10-05, 09:56 AM
Last Post: SwiffJustus
  I will try to code a bot for you for FREE blacksploit 30 2,222 2017-09-02, 11:49 PM
Last Post: blacksploit
  Best method to learn to code instagramteam 10 2,169 2017-06-02, 11:01 PM
Last Post: Cupcake1337
  [REQUEST] Comment box with moderation HTML code iamrichsoon 1 707 2016-12-25, 05:51 AM
Last Post: CegaFin
  How to make this code? ngengs 7 833 2016-12-18, 09:51 PM
Last Post: bryan1




About Us | Contact Us | CPA Elites | Advertise | Stats | Staff Team

© 2013-2017 CPA Elites Ltd
Enhanced by MyBB and WallBB
Return to top