n7dz Posted April 13, 2015 Share Posted April 13, 2015 (edited) hey guys i dont know how to code php so i was hoping somone could help me create a php file here is the form that im creating: * * Edit * * i went with a new form a link posted down below. ignore this codeand my request for a php file * * <section id="contact" class="content-section form contact light space"> <div class="container"> <div class="content cover text-center"> <div class="heading"> <h2>Getting in touch</h2> <p>Do you have questions or wanna leave feedback?<br/><br/></p> </div> <div class="row"> <span id="message"></span><!-- remove #message to stop floating jQuery messages --> <form target="#" name="contact"> <div class="col-lg-5 anim fadeInLeft animated" style="visibility: visible;"> <span class="input-group"> <i class="fa fa-user"></i> <input type="text" name="contactName" id="contactName" class="lg" placeholder="Name"> </span><!-- .input-group --> <span class="input-group"> <i class="fa fa-envelope"></i> <input type="text" name="contactEmail" id="contactAddress" class="lg" placeholder="Email Address"> </span><!-- .input-group --> <span class="input-group"> <i class="fa fa-book"></i> <input type="text" name="contactSubject" id="contactSubject" class="lg" placeholder="Subject"> </span><!-- .input-group --> </div><!-- .col-5 --> <div class="col-lg-7 anim fadeInRight animated" style="visibility: visible;"> <span class="input-group"> <textarea name="contactMessage" id="contactMessage" class="lg" placeholder="What's on your mind?"></textarea> </span><!-- .input-group --> <span class="input-group"> <button class="submit" id="submit_contact" data-loading-text="SENDING...">SEND</button> </span><!-- .input-group --> </div> </form> </div> </div><!-- .container --> <span id="message_sent"><i class="fa-check fa"></i></span><!-- jQuery display of giant checkmark --> </section> Edited April 15, 2015 by n7dz Link to comment Share on other sites More sharing options...
Ingolme Posted April 13, 2015 Share Posted April 13, 2015 If you need PHP then now's a good time to learn it. I'm here to help people learn, not write code for them. The W3Schools PHP tutorial even has a section about sending e-mail with PHP. Link to comment Share on other sites More sharing options...
n7dz Posted April 13, 2015 Author Share Posted April 13, 2015 well the thing is i dont have the time to learn it. Link to comment Share on other sites More sharing options...
justsomeguy Posted April 13, 2015 Share Posted April 13, 2015 If you need code written then there are plenty of PHP programmers who can use the work. There are plenty of freelancing sites out there. You shouldn't expect someone to do your work for free. Link to comment Share on other sites More sharing options...
Techneut Posted April 14, 2015 Share Posted April 14, 2015 Yh, like seriously, if only you need to process this why don't you learn it. But if you need help drop me a PM. I wish to help you though. Link to comment Share on other sites More sharing options...
n7dz Posted April 15, 2015 Author Share Posted April 15, 2015 Ok so i got a php file running on my site but it doesnt seem to be working. heres a link to where i have a contact form http://www.frostcoding.com/current/index.html also its still a work in progress but if you have any tips on the site let me know but im mainly trying to get the php to work. Link to comment Share on other sites More sharing options...
n7dz Posted April 15, 2015 Author Share Posted April 15, 2015 i am using bootstrap Link to comment Share on other sites More sharing options...
Ingolme Posted April 15, 2015 Share Posted April 15, 2015 We can't see the PHP source code. If it's not working, you'll have to post it here. Link to comment Share on other sites More sharing options...
n7dz Posted April 15, 2015 Author Share Posted April 15, 2015 <?php // Check for empty fields if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST['message']) || !filter_var($_POST['email'],FILTER_VALIDATE_EMAIL)) { echo "Thank You and Dont forget to Stop By"; return false; } $name = $_POST['name']; $email_address = $_POST['email']; $phone = $_POST['phone']; $message = $_POST['message']; // Create the email and send the message $to = 'xdz69x@gmail.com'; // Add your email address inbetween the '' replacing yourname@yourdomain.com - This is where the form will send a message to. $email_subject = "Website Contact Form: $name"; $email_body = "You have received a new message from your website contact form.nn"."Here are the details:nnName: $namennEmail: $email_addressnnPhone: $phonennMessage:n$message"; $headers = "From: noreply@yahoo.comn"; // This is the email address the generated message will be from. We recommend using something like noreply@yourdomain.com. $headers .= "Reply-To: $email_address"; mail($to,$email_subject,$email_body,$headers); return true; ?> Link to comment Share on other sites More sharing options...
justsomeguy Posted April 15, 2015 Share Posted April 15, 2015 None of the form elements have a name attribute, it's not submitting anything with the form. Link to comment Share on other sites More sharing options...
n7dz Posted April 15, 2015 Author Share Posted April 15, 2015 how do i fix that? Link to comment Share on other sites More sharing options...
Stemar Posted April 16, 2015 Share Posted April 16, 2015 First, look in your HTML for something like <input type="..." name="...">. Next step is to change the name form something meaningful. E.g: for the email field use <input type="text" name="email">, for the message use name="message" and so on. At last go to the PHP code and use the exacly same name between the square brackets in $_POST[' '] Link to comment Share on other sites More sharing options...
n7dz Posted April 16, 2015 Author Share Posted April 16, 2015 is their any code lines in my html that i dont need or php? Link to comment Share on other sites More sharing options...
n7dz Posted April 16, 2015 Author Share Posted April 16, 2015 thanks for the help so far guys Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now