help with some code

Problems with the Windows version of XAMPP, questions, comments, and anything related.

help with some code

Postby Zero10 » 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?

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
Zero10
 
Posts: 2
Joined: 31. August 2009 15:40

Re: help with some code

Postby Wiedmann » 31. August 2009 17:03

I get the following Error Message:

What are you doing exactly while you're getting this message?
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: help with some code

Postby Zero10 » 31. August 2009 18:21

I'm just running it on my testing server (XAMPP).
Zero10
 
Posts: 2
Joined: 31. August 2009 15:40

Re: help with some code

Postby Wiedmann » 31. August 2009 18:25

I'm just running it on my testing server (XAMPP).

You mean you access this file with your browser with a mystic URI, and know you can see this error message in your browser?
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 54 guests