Jump to content

Help needed please


westminster

Recommended Posts

Hi someone ple help me im new to php One problem i've got is that i created a form and added an error form called 'NewMember.php' such that if the user submits the form without filling it should send an error message telling them the part of the form that has been left blank. However, it doesnt like this, on cliking the submit button the page displays the whole php code. can someone tell me whats wrong, this's my code:


-->
</style>
</head>
$required = array("FirstName" => "First Name",
"LastName" => "Last Name",
"Email" => "Email Address",
"Password" => "Password",
"SecurityQuestion" => "Security Question";
foreach($required as $field => $label) {
if (!$_POST[$field]) {
$err ,= "Please fill in your $label" <br>";
}
}

</body>
</html>

on clicking the submit button this is what i get shown on the page below:

$required = array("FirstName" => "First Name", "LastName" => "Last Name", "Email" => "Email Address", "Password" => "Password", "SecurityQuestion" => "Security Question"; foreach($required as $field => $label) { if (!$_POST[$field]) { $err ,= "Please fill in your $label"
"; } }

PLS HELP! WHATS WRONG?
Link to comment
Share on other sites

hi, thanks for you help. i added the php tags but now it comes up with the following error

Parse error: syntax error, unexpected ';', expecting ')' in C:\wamp\www\Westminster_Studentville\NewMember.php on line 24

what should i do? and you mentioned my code is appearing the way it should.can u tell me how it is supposed to appear???

by the by when you say westminster coll in pa, do you mean pa as in pennsylvania, usa? if so, no it's actually westminster university, london.
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.