I run a website for a rambling club, and recently I've come up against a problem that used not to be there. I'm wondering if there's been a change in the php handling of my website provider. Can anyone help?
When a walker wants to book a walk they arrive at a form which shows the leader of the walk, the walker enters his name in a box then presses a SUBMIT button. This then operates a php file which sends me an email and echoes a thankyou back.
The leader's name is injected into the form via local.storage from the walks listing page.
My problem is that the users's name gets sent fine, but the leader's name is null in the post and the echo, even though they both show on the form. Here is the relevant code:
In booking.htm file: <FORM name="BOOKING" METHOD="post" ACTION="booking.php">
<TABLE> <TR><TD>Leader:</TD><TD ID="Leader" name="Leader"></TD></TR> <TR><TD><textarea cols=21 rows=1 ID="namein" name="namein"></textarea></TD></TR> </TABLE> </FORM> <SCRIPT LANGUAGE="JavaScript">document.getElementById("Leader").innerHTML = localStorage.getItem("Leader"); </SCRIPT>
In booking.php file: { $message = "Leader: " . $_POST['Leader'] . "\n"; $message .= "NAME: " . $_POST['namein'] . "\n"; $sent = mail("xxxxxxxxx", $message); }