Jump to content
Larry Ullman's Book Forums

Script 6.3


Recommended Posts

Hello, I am asking. I have 6.3 completed and i try to run it with register.html. error handling is on in my ini file and ,where as before i got a blank page. I put else statements on all

of the conditionals after i put them on the numeric function. got errors about this line unexpected '>'. I took out the else where not absolutely needed , errors just popping up all over as i fix one. Now i looked at the sample script and i am in exact compliamce with your script. I am wondering if there is something in the ini file that should be turned on/off or it's an error elsewhere which happens, that it displays is only indicative of something else, in my experience. Thanks for any attention to this its very appreciated.

Link to comment
Share on other sites

Hello friend51,

 

Please post your code and also the error messages you are getting, so people can help you. As some people like myself don't own the book you are using.

 

Thanks

 

Jonathon

 

Sorry i think this is the wrong place i saw second addition but here it goes anyway. this is PHP. The error is

 

Parse error: syntax error, unexpected '}' in C:\inetpub\wwwroot\handle_reg.php on line 56

and it's right under the print statement for the month is_numeric

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML

1.0 Transitional//EN"

 

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<html xmls-"http://www.w3.org/1999/xhtml">

<head>

 

<meta http-equiv="content-type"

content="text/html; charset=

iso-8859-1" />

<title>Registration</title>

 

</head>

<body>

 

<?php //Script 6.2 - handle_reg.php

ini_set ('display_errors' , 1);

error_reporting (E_ALL & ~E_NOTICE);

 

// In case register globals is disabled

 

$first_name = $_POST['first_name'];

$last_name = $_POST['last_name'];

$email = $_POST['email'];

$password = $_POST['password'];

$confirm = $_POST['confirm'];

$month = $_POST['month'];

$day = $_POST['day'];

$year = $_POST['year'];

$color = $_POST['color'];

 

print '<p>Registration Results:</p>';

 

 

if (empty ($first_name)) {

print '<p> Please enter your first name.</p>';

}

 

if (empty ($last_name)) {

print '<p>Please enter your last name.</p>';

}

 

if (empty ($email)) {

print '<p>Please enter your email address.</p>';

}

 

if (empty ($password)) {

print '<p>Please enter your password.</p>';

}

 

if (is_numeric ($month)) {

$birthdate .= $month . '-';

} else {

print '<p>Please select the month you were born.</p>'

}

 

if (is_numeric ($day)) {

$birthdate .= $day . '-';

} else {

print '<p>Please select the day</p>';

}

 

if (is_numeric ($year)) {

$birthdate .= $year;

} else {

print '<p>please enter the year you were born as four digits.

</p>';

}

print "you entered your birthday as $birthdate";

?>

 

</body>

</html>

Link to comment
Share on other sites

Sorry i think this is the wrong place i saw second addition but here it goes anyway. this is PHP. The error is

 

Parse error: syntax error, unexpected '}' in C:\inetpub\wwwroot\handle_reg.php on line 56

and it's right under the print statement for the month is_numeric

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML

1.0 Transitional//EN"

 

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<html xmls-"http://www.w3.org/1999/xhtml">

<head>

 

<meta http-equiv="content-type"

content="text/html; charset=

iso-8859-1" />

<title>Registration</title>

 

</head>

<body>

 

<?php //Script 6.2 - handle_reg.php

ini_set ('display_errors' , 1);

error_reporting (E_ALL & ~E_NOTICE);

 

// In case register globals is disabled

 

$first_name = $_POST['first_name'];

$last_name = $_POST['last_name'];

$email = $_POST['email'];

$password = $_POST['password'];

$confirm = $_POST['confirm'];

$month = $_POST['month'];

$day = $_POST['day'];

$year = $_POST['year'];

$color = $_POST['color'];

 

print '<p>Registration Results:</p>';

 

 

if (empty ($first_name)) {

print '<p> Please enter your first name.</p>';

}

 

if (empty ($last_name)) {

print '<p>Please enter your last name.</p>';

}

 

if (empty ($email)) {

print '<p>Please enter your email address.</p>';

}

 

if (empty ($password)) {

print '<p>Please enter your password.</p>';

}

 

if (is_numeric ($month)) {

$birthdate .= $month . '-';

} else {

print '<p>Please select the month you were born.</p>'

}

 

if (is_numeric ($day)) {

$birthdate .= $day . '-';

} else {

print '<p>Please select the day</p>';

}

 

if (is_numeric ($year)) {

$birthdate .= $year;

} else {

print '<p>please enter the year you were born as four digits.

</p>';

}

print "you entered your birthday as $birthdate";

?>

 

</body>

</html>

 

 

 

I think i found it .... think i keeps jumpin around

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...
 Share

×
×
  • Create New...