ldoozer Posted September 30, 2007 Share Posted September 30, 2007 Please could someone shed some light on this its driving me mad. The following is sposed to send a order form to an email address but when i get the email it has all the field titles in it but no data? <form action="formmail.php" method="post" name="BuyForm"> <input type="hidden" name="instId" value="120597"> <input type="hidden" name="cartId" value="GTG"> <input type="hidden" name="currency" value="GBP"> <input type="hidden" name="desc" value="order"> <input type="hidden" name="amount" value="0"> <input type="hidden" name="testMode" value="100"> <table border="0" cellpadding="0" cellspacing="3"> <tr> <td colspan="2"><h1><strong>Your details</strong></h1></td> </tr> <tr> <td width="107">Name</td> <td width="147"><input name="MC_Name" type="text" size="30"></td> </tr> <tr> <td align="left" valign="top">Address</td> <td><textarea name="MC_Address" cols="30" rows="3" wrap="VIRTUAL"></textarea></td> </tr> <tr> <td>Postcode</td> <td><input name="MC_Code" type="text" size="8" maxlength="8"></td> </tr> <tr> <td>E Mail</td> <td><input name="MC_Email" type="text" size="30"></td> </tr> <tr> <td>Phone number </td> <td><input name="MC_Phone" type="text" id="MC_Phone" size="30" /></td> </tr> <tr> <td>Where to plant</td> <td><select name="MC_Location"> <option value="Any">Any</option> <option value="Barnsley">Barnsley</option> <option value="Doncaster">Doncaster</option> <option value="Rotherham">Rotherham</option> <option value="Sheffield">Sheffield</option> </select></td> </tr> <tr> <td align="left" valign="top">Message on certificate </td> <td><textarea name="MC_Message" cols="30" rows="5" wrap="VIRTUAL"></textarea></td> </tr> <tr> <td colspan="2"><h1><strong>If gift, who will receive it</strong></h1></td> </tr> <tr> <td>Name</td> <td><input name="MC_Gift_Name" type="text" size="30"></td> </tr> <tr> <td>Address</td> <td><textarea name="MC_Gift_Address" cols="30" rows="3" wrap="VIRTUAL"></textarea></td> </tr> <tr> <td>Postcode</td> <td><input name="MC_Gift_Code" type="text" size="8" maxlength="8"></td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td>Please select your payment method </td> <td><input name="method" type="radio" id="cheque" value="cheque" /> Cheque <input name="method" type="radio" id="worldpay" value="worldpay" /> Worldpay</td> </tr> </table> <p>The information you provide will be kept confidential, we will not share your details with any other organisation.</p> <!-- This generates a button that submits the information and sends the user to the Worldpay payment pages. --> <input type="submit" value="Buy Now" onclick="javascript:formCheck();"> </form> <?php $to = "[email protected]"; $message = "order: \r\n\r\nCustomer Name: ".$MC_Name."\r\nCustomer Address: ".$MC_Address."\r\nCustomer Postcode: ".$MC_Code."\r\nCustomer Email: ".$MC_Email."\r\nCustomer Phone: ".$MC_Phone."\r\nPlant in: ".$MC_Location."\r\nMessage on Certificate: ".$MC_Message."\r\nGift Name: ".$MC_Gift_Name."\r\nGift Address: ".$MC_Gift_Address."\r\nGift Postcode: ".$MC_Gift_Code."\r\nPayment Method: ".$method."\r\n\r\nEnd of order"; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; mail($to, "Order", $message, "from: [email protected] \r\n"); ?> Link to comment https://forums.phpfreaks.com/topic/71235-solved-variables-problem-not-being-sent/ Share on other sites More sharing options...
xylex Posted September 30, 2007 Share Posted September 30, 2007 Register globals is off (which is a good thing), so you need to refer to the variables as $_POST['MC_Name'] or $_REQUEST['MC_Name'] instead of just $MC_Name. Link to comment https://forums.phpfreaks.com/topic/71235-solved-variables-problem-not-being-sent/#findComment-358310 Share on other sites More sharing options...
ldoozer Posted September 30, 2007 Author Share Posted September 30, 2007 legend - thankyou xylex Link to comment https://forums.phpfreaks.com/topic/71235-solved-variables-problem-not-being-sent/#findComment-358326 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.