我之前发布了一个关于这个问题,但现在我有一个新问题,我没有得到。 下面是HTML:爆炸下拉值
<select name="contactname">
<option></option>
<option value="John Smith|[email protected]">John Smith</option>
</select>
以下是错误现在,我感到我所做的投稿页面上进行更改。 解析错误:语法错误,上线48
这里意外T_CONSTANT_ENCAPSED_STRING是投稿页面:
</head>
<body>
<?php
$pickone = $_POST [pickone];
$dropone = $_POST [dropone];
$weight = $_POST [weight];
$length = $_POST [length];
$pallets = $_POST [pallets];
$pickupdate = $_POST [pickupdate];
$equipment = $_POST [equipment];
$loadtype = $_POST [loadtype];
$specialinformation = $_POST [specialinformation];
$commodity = $_POST [commodity];
$closetime = $_POST [closetime];
$deliverydate = $_POST [deliverydate];
$req = $_POST [req];
$contact = explode('|', $_POST[contactname]);
$header = "From: " . $contact[0] . " <" . $contact[1] . ">\r\n";
$subject= "New Load";
$from= "You";
$message = "
Picks: $pickone
Drops: $dropone \n
PU Date: $pickupdate Close Time: $closetime
Del Date: $deliverydate \n
Mode: $loadtype
Equipment: $equipment
Length: $length
Weight: $weight
Pallets: $pallets
Commodity: $commodity \n
Requirements:
$req \n
Special Information: $specialinformation
Contact: $contactname[0]
";
mail("email.com", $subject, $message, $header");
?>
<p align="center">Thank You<br>
<input type="button" onclick="window.location.href='page.php';" value=" Post Another Load " />
</p>
</body>
</html>
请让我知道我错过了,因为如果我不尝试爆炸CONTACTNAME它工作正常。谢谢,
这行是第48? – 2011-05-12 23:06:02
没有冒犯,但你的代码真的很糟糕。请将'error_reporting(E_ALL);'添加到代码的开头,然后修复所有通知。主要引用字符串(你的数组键) - 例如'$ _POST ['pickone']'而不是'$ _POST [pickone]' – ThiefMaster 2011-05-12 23:08:10