Jump to content

form problem


imax

Recommended Posts

Hi, I have put a sendmail script together but I am having problems with it. Any help would be appreciated.

 

ok I have a simple form below is the code:

 

<form action=script/sendmail.php method=post>
<table border=0>
<tr>
<td>Name:</td><td><input type=text name=name size=40></td>
</tr>
<tr>
<td> </td><td align=center><input type=submit name=submit value=Submit> <input type=reset Value=Reset></td>
</tr>
</table>
</form>

 

It's just a simple form to get me used to phps built in mail function. Ok I have made an input field and named it and actioned it to post to a sendmail script.

 

Below is my sendmail script:

 

<?php

$name = $_GET['name'];
$to = "some@whereonthenet.com";
$subject = "My Website Test";
$message = "Name: \t $name \n";

mail($to, $subject, $message);

echo "<html><head><title>My Site</title></head>";
echo "<body><p><font size=6>Thankyou,</font></p>";
echo "<p>Your Mail has been sent</p><p><a href=../index.html>Return</a></p>";
echo "</body></html>";

?>

 

As you can see it's nothing fancy and probably looks like most all other simple mail scripts. Problem is when this script E-mails me the info I get this below:

 

Name:

 

As you can see it puts in the Name: and a tab in but once it gets to the variable it's missing it. Everything else works I even inserted a php.ini in the same folder as my script regestering globals as on and different ways of writing the script within my scope. I have not been useing php for long and know the basics of what I am doing and this is basically one of my first scripts. Can someone please tell me where I went wrong as this is starting to drive me crazy.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.