Strange 403 error - no problem with localhost

This is a discussion on Strange 403 error - no problem with localhost within the Apache Web Server forums, part of the Web Server and Related Forums category; I've searched the forums on this and can't seem to find out what's going on. I'm ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-24-2007
Cut
 
Posts: n/a
Default Strange 403 error - no problem with localhost

I've searched the forums on this and can't seem to find out what's
going on.

I'm running Apache 2.2 with PHP 5 on Windows. I have a file,
index.php (below) that does load: the form with the name, password,
and submit all load on the screen. However, when I click submit, I'm
getting "You are not authorized to access this resource" regardless of
correct name/password.

Interestingly enough, when I access this page from /localhost, the
submit button works and the private data is displayed. However, when
I try to access this page from the public IP address, I'm getting a
403 error after I click submit. I've checked my httpd.conf file, but
nothing seems to be amiss. This same program works just fine on my
other computer.

Here is the file:

<?php
//create short names for variables
$name= $_POST['name'];
$password = $_POST['password'];

if(empty($name)||empty($password))
{
?>

<h1>Please Log In</h1>
<form method ="post" action="<?php $_SERVER['PHP_SELF'] ?>">
<table border = "1"
<tr>
<th>Username</th>
<td><input type="text" name="name"> </td>
</tr>
<tr>
<th>Password</th>
<td><input type="password" name="password"> </td>
</tr>
<tr>
<td colspan="2" align="center">
<input type = "submit" value = "Log In">
</td>
</tr>
</table>
</form>

<?php
}
else if($name=='foo' && $password=='bar')
{
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
//some other junk

<?php
}
?>

  #2 (permalink)  
Old 04-25-2007
Purl Gurl
 
Posts: n/a
Default Re: Strange 403 error - no problem with localhost

Cut wrote:

> I've searched the forums on this and can't seem to find out what's
> going on.


> I'm running Apache 2.2 with PHP 5 on Windows. I have a file,
> index.php (below) that does load: the form with the name, password,
> and submit all load on the screen. However, when I click submit, I'm
> getting "You are not authorized to access this resource" regardless of
> correct name/password.


> Interestingly enough, when I access this page from /localhost, the
> submit button works and the private data is displayed. However, when
> I try to access this page from the public IP address, I'm getting a
> 403 error after I click submit. I've checked my httpd.conf file, but
> nothing seems to be amiss. This same program works just fine on my
> other computer.


> $name= $_POST['name'];


This can be a number of issues. My suggestion is you address
one issue at a time, then test each issue; be patient.

There are many tutorials available on the web which instruct
how to address each of these issues.

Your Windows firewall configuration could be an issue if
running an NT5 type; xp home pro media. Apache needs to be
added to your "exceptions" in your firewall to allow services
for your local network and the internet.

Apache must be running as a background service.

Check your directory permissions for the directory where you
are writing a file. You need to turn on "file sharing" for
this directory and enable "allow changing files" to write.
Usually turning on file sharing and changing files for a
parent directory containing your child directory will do.
However, this grants permission to write for all child
directories; you might not want to open up all directories.

For some very rare circumstances, you need to enable your
executable file for "run as" then select an administrator
account and enter a password. Doubtful this is a problem
but keep this in mind. A restricted local user cannot
grant permission for internet file sharing. My presumption
is your Apache is under an Administrator or All Users.
Again, doubtful this is an issue.

Check your Apache httpd.conf file to be sure a POST method
is allowed for your directory.

Your directory will need to be in Apache root, this is, under
htdocs OR aliased in your httpd.conf file with appropriate
directives enabled.

Google searching will help you with each issue.

Purl Gurl
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:16 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0