what i need to know is how do i link my php page to my html page to make the poxy thing work
|
Advertisement
|
|
|
| 15-07-2012, 12:07 | #2 |
|
Moderator
![]() 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.
|
|
|
| 15-07-2012, 12:43 | #3 |
|
Registered User
![]() |
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.
|
|
|
| 15-07-2012, 13:05 | #4 |
|
Moderator
![]() 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.
|
|
|
| 15-07-2012, 13:20 | #5 |
|
Registered User
![]() |
<?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? |
|
|
|
Advertisement
|
|
|
| 15-07-2012, 14:07 | #6 |
|
Moderator
![]() 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:
|
|
|
| 15-07-2012, 14:13 | #7 |
|
Moderator
![]() |
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.
|
|
|
| 15-07-2012, 14:31 | #9 |
|
Moderator
![]() |
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. |
|
|
| (2) thanks from: |
|
Advertisement
|
|
|