help with some code
Posted: 31. August 2009 16:35
Hello,
I'm using XAMPP v1.7.2 on a Windows Vista x64 system.
When I enter the following code out of a book I'm using to learn PHP (McGraw.Hill.PHP.Programming.Solutions(Jun.2007))
I get the error msg stated at the bottom of this message. Can anyone tell me what I need to set or do to make this code work properly?
I get the following Error Message:
Access forbidden!
You don't have permission to access the requested object. It is either read-protected or not readable by the server.
If you think this is a server error, please contact the webmaster.
Error 403
I'm using XAMPP v1.7.2 on a Windows Vista x64 system.
When I enter the following code out of a book I'm using to learn PHP (McGraw.Hill.PHP.Programming.Solutions(Jun.2007))
I get the error msg stated at the bottom of this message. Can anyone tell me what I need to set or do to make this code work properly?
- Code: Select all
<html>
<head></head>
<body>
<?php
if (!$_POST['submit']) {
// if $_POST['submit'] does not exist
// display initial page
?>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
Enter your age: <input name="age" size="2" maxlength="2">
<input type="submit" name="submit" value="Go">
</form>
<?php
} else {
// if $_POST['submit'] exists
// process form data
$age = $_POST['age'];
echo ($age >= 21) ? "You're an adult" : "You're a child";
}
?>
</body>
</html>
I get the following Error Message:
Access forbidden!
You don't have permission to access the requested object. It is either read-protected or not readable by the server.
If you think this is a server error, please contact the webmaster.
Error 403