SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can someone help me/design me a PHP contact form for this HTML?

    Can someone design me a contact form in PHP for this HTML form? Just need it to send data, then redirect to a thanks.html page.

    Code:
    <!-- Contact -->
    		<div class="article">
    			<h2>Contact me?</h2>
    			<form action="email.php">
    				<div class="cl">&nbsp;</div>
    				<div class="column-cnt">
    					<div class="cl">&nbsp;</div>
    					<div class="column">
    						<label for="name">Your Name?</label>		
    						<span class="text-field"><input type="text" id="name" value="" />	</span>			
    					</div>					
    					<div class="column">
    						<label for="email">Your E-mail address?</label>		
    						<span class="text-field"><input type="text" id="email" value="" /></span>				
    					</div>		
    					<div class="cl">&nbsp;</div>
    					<p>You can call me anytime for a quote on <strong>07801233070</strong>. Alternatively, you can use the contact form below and I will get back to you usually within 12-24 hours! My web design prices are usually cheap and I can cater for just about anyones needs!</p>											
    				</div>
    				<div class="column-big">
    					<label for="message">Your Message</label>		
    					<span class="text-area"><textarea id="message" rows="" cols=""></textarea>	</span>		
    					<input type="submit" value="Send Email">
    				</div>	
    				<div class="cl">&nbsp;</div>
    			</form>
    		</div>
    		<!-- End Contact -->
    PHP is not my strongest language and when I have tried, it sends the email but does not contain anything!

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,788
    Mentioned
    151 Post(s)
    Tagged
    3 Thread(s)
    It wont send anything because you haven't named any of your fields......

    Code:
    <input type="text" id="usr_name" name="usr_name" value="" />
    Without a name the PHP mail script cant get the values to send.
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh my god someone please tell me why I read over this a thousand times looking for errors and looked at id="name" for the name of the box! God dammit thankyou!

    Any chance you can create me a simple PHP script that will send an email laid out like this in the message body?

    Code:
    Name: John Doe
    Email: johndoe1@live.co.uk
    
    Message text here
    And for the subject to be "Contact Form Submission - John Doe"
    I would like for it to echo the name of the person submitting it in the email subject after Contact Form Submission.

    Many thanks!

  4. #4
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,788
    Mentioned
    151 Post(s)
    Tagged
    3 Thread(s)
    change the email addresses and form NAMES as appropriate
    PHP Code:
    $usr_name $_POST['user_name'];
    $usr_email $_POST['usr_email'];
    $usr_message $_POST['usr_message'];

    $to 'you@youremail.com';
    $subject "Contact Form Submission - $usr_email";


    $msg "
    Name: 
    $usr_name
    Email:
    $usr_email

    Message: 
    $usr_message
    "
    ;

    $headers "From: myplace@here.com\r\n";
    $headers .= "Reply-To: myplace2@here.com\r\n";
    $headers .= "Return-Path: myplace@here.com\r\n";
    $headers .= "CC: sombodyelse@noplace.com\r\n";
    $headers .= "BCC: hidden@special.com\r\n";


    mail($to$subject$msg$headers);

    header("Location: thanks.html");
    exit(); 
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  5. #5
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Haha legend mate, thanks very much!

  6. #6
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Edit got it working thanks!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •