error 403

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

error 403

Postby praetor67 » 12. December 2008 07:26

Hello

I recently installed xampp lite on my laptop running vista.

I get the following error when I attempt to run some php/html code:

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 learning PHP and this is the code that I'm running:-

<html>
<head>
<body>

<form action = index.php" method=POST>
Username:<input type=text name=user><br />
Password:<input type=password name=pass><br />
<input type=submit value="GO!"><p>
</form>


<?php
$user=$_POST['user'];
$pass=$_POST['pass'];

if(($user=="test")&&(pass=="test"))
echo "Access Granted!";
else echo "Access Denied!";

?>

</head>
</body>
</html>

I've made sure that I have full control rights to the directory, xampp, so that i should be able to read and write to it.

Can anyone help me with suggestions on how to solve this?

Thanks
praetor67
 
Posts: 4
Joined: 12. December 2008 07:18

Re: error 403

Postby Wiedmann » 12. December 2008 09:20

You don't have permission to access the requested object.

What address your browser is trying to request? (see in error.log)
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: error 403

Postby praetor67 » 12. December 2008 14:39

Hi wiedmann

This is the error from the error log:

[Fri Dec 12 01:00:54 2008] [error] [client 127.0.0.1] (20024)The given path is misformatted or contained invalid characters: Cannot map GET /xampp/test/index.php%22 HTTP/1.1 to file
[Fri Dec 12 08:35:04 2008] [error] [client 127.0.0.1] (20024)The given path is misformatted or contained invalid characters: Cannot map POST /xampp/test/index.php%22 HTTP/1.1 to file, referer: http://localhost/xampp/test/index.php

Any ideas?
praetor67
 
Posts: 4
Joined: 12. December 2008 07:18

Re: error 403

Postby Wiedmann » 12. December 2008 14:58

Fri Dec 12 01:00:54 2008] [error] [client 127.0.0.1] (20024)The given path is misformatted or contained invalid characters: Cannot map GET /xampp/test/index.php%22 HTTP/1.1 to file

"%22" is an additional/wrong " in your html code. (because the filename is index.php and not index.php")
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: error 403

Postby praetor67 » 12. December 2008 15:42

Hi

The url is that i type in is http://localhost/xampp/test/index.php. I do not put %22 at the end.

The error log adds the %22 onto the end:

[Fri Dec 12 01:00:54 2008] [error] [client 127.0.0.1] (20024)The given path is misformatted or contained invalid characters: Cannot map GET /xampp/test/index.php%22 HTTP/1.1 to file

Any thoughts?
praetor67
 
Posts: 4
Joined: 12. December 2008 07:18

Re: error 403

Postby Wiedmann » 12. December 2008 15:49

The url is that i type

This is the moment when you load the page (1st step).

I do not put %22 at the end.

Not you, but your html code adds this when you send the form (2nd step)

--> Verify the "action" attribute in your html form.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: error 403

Postby praetor67 » 12. December 2008 17:19

Hi Wiedmann

Looked at my code and corrected it and it now works.

Thanks!

:D
praetor67
 
Posts: 4
Joined: 12. December 2008 07:18


Return to XAMPP for Windows

Who is online

Users browsing this forum: xamchqh and 273 guests