Boards.ie uses cookies. By continuing to browse this site you are agreeing to our use of cookies. Click here to find out more x
Post Reply  
 
Thread Tools Search this Thread
15-07-2012, 00:36   #1
off.the.walls
Registered User
 
off.the.walls's Avatar
 
Join Date: Jun 2010
Location: dublin
Posts: 941
Send a message via Skype™ to off.the.walls
contact forms

Have the forms laid out in html

what i need to know is how do i link my php page to my html page to make the poxy thing work
off.the.walls is offline  
Advertisement
15-07-2012, 12:07   #2
The Corinthian
Moderator
 
The Corinthian's Avatar
 
Join Date: Jun 2001
Location: The 2nd Circle of Hell
Posts: 14,547
I presume you didn't write the code in the PHP page, but got it from a third party. If so, I suggest you read whatever documentation came with the script.
The Corinthian is offline  
15-07-2012, 12:43   #3
Feathers
Registered User
 
Feathers's Avatar
 
Join Date: Jan 2006
Location: Londain, Ríocht Aontaithe
Posts: 843
In a general sense, it's the action attribute of the form that tells it where to post if you're reading up on it. But as TC says, unless you're coding the handler from scratch, you probably have some docs somewhere.
Feathers is offline  
15-07-2012, 13:05   #4
The Corinthian
Moderator
 
The Corinthian's Avatar
 
Join Date: Jun 2001
Location: The 2nd Circle of Hell
Posts: 14,547
The docs are important as many such third-party forms may require settings sent in hidden form fields or other configurations to work properly.
The Corinthian is offline  
15-07-2012, 13:20   #5
off.the.walls
Registered User
 
off.the.walls's Avatar
 
Join Date: Jun 2010
Location: dublin
Posts: 941
Send a message via Skype™ to off.the.walls
<?php

$name=$_POST['name'];
$email=$_POST['email'];
$message=$_POST['message'];

$to="off.the.walls@live.ie";
$subject="Grasp Web Mail Alert";
$body="This is an automated message your message has been recieved, do not reply to this message.";
mail ($to,$subject,$body);

echo 'Message Sent!<a href="contact.html">Click Here</a>To Send Another';


?>



iv id="content" class="container">
<form action="send.php" method="POST">
Name <br/> <input type="text" name="name" /><br/>
Email <br/> <input type="text" name="email" /><br/>
Message <br/> <textarea name="message"></textarea>
<input type="submit" class-"submit" name="Send" />



thats the php and the html, just keeps telling me i need a server?
off.the.walls is offline  
Advertisement
15-07-2012, 14:07   #6
The Corinthian
Moderator
 
The Corinthian's Avatar
 
Join Date: Jun 2001
Location: The 2nd Circle of Hell
Posts: 14,547
If you're doing this on your local machine, then you don't have a mail server; hence the error.

Secondly, all that PHP script will do is sent you an email with the text: "This is an automated message your message has been received, do not reply to this message", which isn't much use. You would need to incorporate the data from the form in some way, like this:
PHP Code:
$body "Sender: ".$name."\nEmail: ".$email."\nMessage: ".$message."\n"
It's not a very secure script, TBH.
The Corinthian is offline  
15-07-2012, 14:13   #7
tricky D
Moderator
 
tricky D's Avatar
 
Join Date: Oct 2003
Location: Not Mars. Nope.
Posts: 4,666
Are you writing the script from scratch yourself? If so, you would be much better off grabbing one of the many formmail scripts already out there. They will be properly hardened for security.
tricky D is online now  
15-07-2012, 14:17   #8
off.the.walls
Registered User
 
off.the.walls's Avatar
 
Join Date: Jun 2010
Location: dublin
Posts: 941
Send a message via Skype™ to off.the.walls
got it off a youtube tutorial.
off.the.walls is offline  
15-07-2012, 14:31   #9
tricky D
Moderator
 
tricky D's Avatar
 
Join Date: Oct 2003
Location: Not Mars. Nope.
Posts: 4,666
Grab yourself formmail: http://www.scriptarchive.com/formmail.html or a similar script. It's pretty easy to set up.

The one you are using is way, way too basic with little security, customisation, checking etc... What you are using is like a wooden wheel compared to a modern day car wheel.
tricky D is online now  
(2) thanks from:
Advertisement
15-07-2012, 14:51   #10
off.the.walls
Registered User
 
off.the.walls's Avatar
 
Join Date: Jun 2010
Location: dublin
Posts: 941
Send a message via Skype™ to off.the.walls
Cheers for the help lads. Think i may grab myself a book on php haha
off.the.walls is offline  
Post Reply

Quick Reply
Message:
Remove Text Formatting
Bold
Italic
Underline

Insert Image
Wrap [QUOTE] tags around selected text
 
Decrease Size
Increase Size
Please sign up or log in to join the discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search