[BNM] php problem

Patrick Heath patrick at 2000.co.uk
Fri Jun 10 22:14:42 BST 2005


its beacuse register globals is set to off so your form variables are to 
automatically predifined,  you want to use $_POST['Company'] to access them.

$message = "Name: {$_POST['Name']}\n
   Company: {$_POST['Company']}\n
   Email: {$_POST['mail']}\n
   Subject: {$_POST['subject']}\n
   Phone: {$_POST['phone']}\n
   Comment: {$_POST['Comment']}\n";


cheers

Pat...


jamie womersley wrote:

>All
> 
>I'm trying to create a user form sending info to a mail address. I have it half sussed, in that I am recieving mails, with field titles, i.e Name, mail address, but no data is being sent.
> 
>Below is the HTML for the form, and for the php. I'm sure the php code is using the correct field name so I'm a little confused as to why it's not working...
> 
><form action="sent.php" method="post" name="E_mail" id="E_mail" onsubmit="MM_validateForm('mail','','RisEmail','Name','','R');return document.MM_returnValue" >
>   <table width="400" align="center">
>      
>   <tr valign="baseline">
>         <td>Name:</td>
>        <td><input name="Name" type="text" id="Name"  size="35" /></td>
>      </tr>
>      
>   <tr valign="baseline">
>        <td><div align="left">Company:</div></td>
>        <td><input name="Company" type="text" id="Company" /></td>
>      </tr>
>      
>     <tr valign="baseline">
>        <td><div align="left">Email Address:</div></td>
>        <td><input name="mail" type="text" id="mail" /></td>
>      </tr>
>      
>   <tr valign="baseline">
>        <td>Subject:</td>
>        <td><input name="Subject" type="text" id="Subject" /></td>
>      </tr>
>   
>   <tr valign="baseline">
>        <td>Telephone Number:</td>
>        <td><input name="phone" type="text" id="phone" /></td>
>      </tr>
>   
>   <tr valign="baseline">
>        <td height="48">Message:</td>
>        <td><textarea name="message" cols="40" rows="6" id="message"></textarea> </td>
>      </tr>
>   
>   <tr valign="baseline">
>        <td>&nbsp;</td>
>        <td><input name="Submit" type="submit" value="Submit" /> <input name="Reset" type="reset" id="Reset" value="Reset" /> </td>
>      </tr>
>   
>    </table>
></form>
> 
>and the PHP
> 
><?php
>$message = "Name: $Name\n
>   Company: $Company\n
>   Email: $mail\n
>   Subject: $subject\n
>   Phone: $phone\n
>   Comment: $Comment\n";
> mail ("jamie.womersley at btinternet.com", "Sparkhouse Contact Details", $message);
> 
>?>
> 
>Anyone any ideas? I'm sure it is something easy if I knew what I was doing!
> 
>Thanks in advance
> 
>Jamie
>  
>


More information about the BNMList mailing list
BNMList is hosted by Screenlists, a Screen-Play.net service