By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,642 Members | 1,674 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,642 IT Pros & Developers. It's quick & easy.

HTTP 403

P: n/a
I have finally managed to get Apache 2.2.4, PHP 5.2.0 and MySQL to talk to
each other. Everything seems to work OK when dealing with databases but as
soon as I use a php-script that use $_server the browser will throw me away
and give me HTTP 403.

It has worked before but that was before I got the communication to work
with MySQL

Any ideas or solutions are very much appreciated.

/Lennart
Feb 8 '07 #1
Share this Question
Share on Google+
20 Replies


P: n/a
On Feb 8, 3:59 am, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
I have finally managed to get Apache 2.2.4, PHP 5.2.0 and MySQL to talk to
each other. Everything seems to work OK when dealing with databases but as
soon as I use a php-script that use $_server the browser will throw me away
and give me HTTP 403.

It has worked before but that was before I got the communication to work
with MySQL

Any ideas or solutions are very much appreciated.

/Lennart
---------------------
I see no reason for this.
if you are using $_server then use $_SERVER['key'];

Feb 10 '07 #2

P: n/a

"Satya" <sa********@gmail.comskrev i meddelandet
news:11**********************@h3g2000cwc.googlegro ups.com...
On Feb 8, 3:59 am, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
>I have finally managed to get Apache 2.2.4, PHP 5.2.0 and MySQL to talk
to
each other. Everything seems to work OK when dealing with databases but
as
soon as I use a php-script that use $_server the browser will throw me
away
and give me HTTP 403.

It has worked before but that was before I got the communication to work
with MySQL

Any ideas or solutions are very much appreciated.

/Lennart

---------------------
I see no reason for this.
if you are using $_server then use $_SERVER['key'];
Thats is exactly how I'm doing. Still the browser will through me away and
denies to show the page, just saying HTTP 403.
/Lennart
Feb 12 '07 #3

P: n/a
On 12 Feb, 15:06, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Satya" <satya61...@gmail.comskrev i meddelandetnews:11**********************@h3g2000cw c.googlegroups.com...
On Feb 8, 3:59 am, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
I have finally managed to get Apache 2.2.4, PHP 5.2.0 and MySQL to talk
to
each other. Everything seems to work OK when dealing with databases but
as
soon as I use a php-script that use $_server the browser will throw me
away
and give me HTTP 403.
It has worked before but that was before I got the communication to work
with MySQL
Any ideas or solutions are very much appreciated.
/Lennart
---------------------
I see no reason for this.
if you are using $_server then use $_SERVER['key'];

Thats is exactly how I'm doing. Still the browser will through me away and
denies to show the page, just saying HTTP 403.
/Lennart- Hide quoted text -

- Show quoted text -
Care to share some of the code?

Feb 12 '07 #4

P: n/a

"Satya" <sa********@gmail.comskrev i meddelandet
news:11**********************@h3g2000cwc.googlegro ups.com...
On Feb 8, 3:59 am, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
>I have finally managed to get Apache 2.2.4, PHP 5.2.0 and MySQL to talk
to
each other. Everything seems to work OK when dealing with databases but
as
soon as I use a php-script that use $_server the browser will throw me
away
and give me HTTP 403.

It has worked before but that was before I got the communication to work
with MySQL

Any ideas or solutions are very much appreciated.

/Lennart

---------------------
I see no reason for this.
if you are using $_server then use $_SERVER['key'];
This is exactly how I'm using it but still the browser refuse to show the
page but just say HTTP 403
/Lennart
Feb 12 '07 #5

P: n/a

"Captain Paralytic" <pa**********@yahoo.comskrev i meddelandet
news:11*********************@s48g2000cws.googlegro ups.com...
On 12 Feb, 15:06, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
>"Satya" <satya61...@gmail.comskrev i
meddelandetnews:11**********************@h3g2000c wc.googlegroups.com...
On Feb 8, 3:59 am, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
I have finally managed to get Apache 2.2.4, PHP 5.2.0 and MySQL to
talk
to
each other. Everything seems to work OK when dealing with databases
but
as
soon as I use a php-script that use $_server the browser will throw me
away
and give me HTTP 403.
>It has worked before but that was before I got the communication to
work
with MySQL
>Any ideas or solutions are very much appreciated.
>/Lennart
---------------------
I see no reason for this.
if you are using $_server then use $_SERVER['key'];

Thats is exactly how I'm doing. Still the browser will through me away
and
denies to show the page, just saying HTTP 403.
/Lennart- Hide quoted text -

- Show quoted text -

Care to share some of the code?
This is the simple test code that causes the HTTP403
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
Username: <input type="text" name="username">
<br />
Password: <input type="password" name="password">
<br /><br />
<input type="submit" name="submit" value="Sign Up">

/Lennart
Feb 12 '07 #6

P: n/a
On 12 Feb, 15:13, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i meddelandetnews:11*********************@s48g2000cw s.googlegroups.com...
On 12 Feb, 15:06, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Satya" <satya61...@gmail.comskrev i
meddelandetnews:11**********************@h3g2000cw c.googlegroups.com...
On Feb 8, 3:59 am, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
I have finally managed to get Apache 2.2.4, PHP 5.2.0 and MySQL to
talk
to
each other. Everything seems to work OK when dealing with databases
but
as
soon as I use a php-script that use $_server the browser will throw me
away
and give me HTTP 403.
It has worked before but that was before I got the communication to
work
with MySQL
Any ideas or solutions are very much appreciated.
/Lennart
---------------------
I see no reason for this.
if you are using $_server then use $_SERVER['key'];
Thats is exactly how I'm doing. Still the browser will through me away
and
denies to show the page, just saying HTTP 403.
/Lennart- Hide quoted text -
- Show quoted text -
Care to share some of the code?

This is the simple test code that causes the HTTP403
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
Username: <input type="text" name="username">
<br />
Password: <input type="password" name="password">
<br /><br />
<input type="submit" name="submit" value="Sign Up">

/Lennart- Hide quoted text -

- Show quoted text -
OK, now when you say "I use a php script", when aer you considering it
to be used?
Do you get the form displayed but get the error when you press "Sign
Up" or do you not get the form displayed at all?

Feb 12 '07 #7

P: n/a

"Captain Paralytic" <pa**********@yahoo.comskrev i meddelandet
news:11**********************@j27g2000cwj.googlegr oups.com...
On 12 Feb, 15:13, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
>"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11*********************@s48g2000c ws.googlegroups.com...
On 12 Feb, 15:06, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Satya" <satya61...@gmail.comskrev i
meddelandetnews:11**********************@h3g2000c wc.googlegroups.com...
On Feb 8, 3:59 am, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
I have finally managed to get Apache 2.2.4, PHP 5.2.0 and MySQL to
talk
to
each other. Everything seems to work OK when dealing with databases
but
as
soon as I use a php-script that use $_server the browser will throw
me
away
and give me HTTP 403.
>It has worked before but that was before I got the communication to
work
with MySQL
>Any ideas or solutions are very much appreciated.
>/Lennart
---------------------
I see no reason for this.
if you are using $_server then use $_SERVER['key'];
>Thats is exactly how I'm doing. Still the browser will through me away
and
denies to show the page, just saying HTTP 403.
/Lennart- Hide quoted text -
>- Show quoted text -
Care to share some of the code?

This is the simple test code that causes the HTTP403
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
Username: <input type="text" name="username">
<br />
Password: <input type="password" name="password">
<br /><br />
<input type="submit" name="submit" value="Sign Up">

/Lennart- Hide quoted text -

- Show quoted text -

OK, now when you say "I use a php script", when aer you considering it
to be used?
Do you get the form displayed but get the error when you press "Sign
Up" or do you not get the form displayed at all?
When ran I get the page and give ensers to the two inputs.
The browser reacts with HTTP 403 when I press the submit-button
/Lennart
Feb 12 '07 #8

P: n/a
On 12 Feb, 15:41, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i meddelandetnews:11**********************@j27g2000c wj.googlegroups.com...
On 12 Feb, 15:13, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11*********************@s48g2000cw s.googlegroups.com...
On 12 Feb, 15:06, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Satya" <satya61...@gmail.comskrev i
meddelandetnews:11**********************@h3g2000cw c.googlegroups.com...
On Feb 8, 3:59 am, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
I have finally managed to get Apache 2.2.4, PHP 5.2.0 and MySQL to
talk
to
each other. Everything seems to work OK when dealing with databases
but
as
soon as I use a php-script that use $_server the browser will throw
me
away
and give me HTTP 403.
It has worked before but that was before I got the communication to
work
with MySQL
Any ideas or solutions are very much appreciated.
/Lennart
---------------------
I see no reason for this.
if you are using $_server then use $_SERVER['key'];
Thats is exactly how I'm doing. Still the browser will through me away
and
denies to show the page, just saying HTTP 403.
/Lennart- Hide quoted text -
- Show quoted text -
Care to share some of the code?
This is the simple test code that causes the HTTP403
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
Username: <input type="text" name="username">
<br />
Password: <input type="password" name="password">
<br /><br />
<input type="submit" name="submit" value="Sign Up">
/Lennart- Hide quoted text -
- Show quoted text -
OK, now when you say "I use a php script", when aer you considering it
to be used?
Do you get the form displayed but get the error when you press "Sign
Up" or do you not get the form displayed at all?

When ran I get the page and give ensers to the two inputs.
The browser reacts with HTTP 403 when I press the submit-button
/Lennart- Hide quoted text -

- Show quoted text -
OK, so what you said first was incorrect. You are using the script to
produce the form. So it is not the act of accessing $_SERVER per se
that is causing the 403. You are getting the 403 when you try to
submit the form to the "address" that is output by the original php
call.

To be honest, you don't really need that call for what you are doing.
By default the form will submit to the same address that is in the
address bar, so try coding the form as

<form action="" method="post">
Username: <input type="text" name="username">
<br />
Password: <input type="password" name="password">
<br /><br />
<input type="submit" name="submit" value="Sign Up">

and see what happens.

Feb 12 '07 #9

P: n/a

"Captain Paralytic" <pa**********@yahoo.comskrev i meddelandet
news:11**********************@s48g2000cws.googlegr oups.com...
On 12 Feb, 15:41, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
>"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11**********************@j27g2000 cwj.googlegroups.com...
On 12 Feb, 15:13, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11*********************@s48g2000c ws.googlegroups.com...
On 12 Feb, 15:06, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Satya" <satya61...@gmail.comskrev i
meddelandetnews:11**********************@h3g2000c wc.googlegroups.com...
On Feb 8, 3:59 am, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
I have finally managed to get Apache 2.2.4, PHP 5.2.0 and MySQL
to
talk
to
each other. Everything seems to work OK when dealing with
databases
but
as
soon as I use a php-script that use $_server the browser will
throw
me
away
and give me HTTP 403.
>It has worked before but that was before I got the communication
to
work
with MySQL
>Any ideas or solutions are very much appreciated.
>/Lennart
---------------------
I see no reason for this.
if you are using $_server then use $_SERVER['key'];
>Thats is exactly how I'm doing. Still the browser will through me
away
and
denies to show the page, just saying HTTP 403.
/Lennart- Hide quoted text -
>- Show quoted text -
Care to share some of the code?
>This is the simple test code that causes the HTTP403
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
Username: <input type="text" name="username">
<br />
Password: <input type="password" name="password">
<br /><br />
<input type="submit" name="submit" value="Sign Up">
>/Lennart- Hide quoted text -
>- Show quoted text -
OK, now when you say "I use a php script", when aer you considering it
to be used?
Do you get the form displayed but get the error when you press "Sign
Up" or do you not get the form displayed at all?

When ran I get the page and give ensers to the two inputs.
The browser reacts with HTTP 403 when I press the submit-button
/Lennart- Hide quoted text -

- Show quoted text -

OK, so what you said first was incorrect. You are using the script to
produce the form. So it is not the act of accessing $_SERVER per se
that is causing the 403. You are getting the 403 when you try to
submit the form to the "address" that is output by the original php
call.

To be honest, you don't really need that call for what you are doing.
By default the form will submit to the same address that is in the
address bar, so try coding the form as

<form action="" method="post">
Username: <input type="text" name="username">
<br />
Password: <input type="password" name="password">
<br /><br />
<input type="submit" name="submit" value="Sign Up">

and see what happens.
Thanks. I think I see what you mean but can I still use the keyed username
and password as variables and go furhter to for instance a database with
them. I admit I am a newbie but if you don't ask you don't get any answers.
/Lennart
Feb 12 '07 #10

P: n/a

"Lennart Anderson" <le**************@tele2.seskrev i meddelandet
news:q9**************@nntpserver.swip.net...
>
"Captain Paralytic" <pa**********@yahoo.comskrev i meddelandet
news:11**********************@s48g2000cws.googlegr oups.com...
>On 12 Feb, 15:41, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
>>"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11**********************@j27g200 0cwj.googlegroups.com...

On 12 Feb, 15:13, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11*********************@s48g2000 cws.googlegroups.com...

On 12 Feb, 15:06, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Satya" <satya61...@gmail.comskrev i
meddelandetnews:11**********************@h3g2000 cwc.googlegroups.com...

On Feb 8, 3:59 am, "Lennart Anderson"
<lennart.ander...@tele2.se>
wrote:
I have finally managed to get Apache 2.2.4, PHP 5.2.0 and MySQL
to
talk
to
each other. Everything seems to work OK when dealing with
databases
but
as
soon as I use a php-script that use $_server the browser will
throw
me
away
and give me HTTP 403.

It has worked before but that was before I got the
communication to
work
with MySQL

Any ideas or solutions are very much appreciated.

/Lennart

---------------------
I see no reason for this.
if you are using $_server then use $_SERVER['key'];

Thats is exactly how I'm doing. Still the browser will through me
away
and
denies to show the page, just saying HTTP 403.
/Lennart- Hide quoted text -

- Show quoted text -

Care to share some of the code?

This is the simple test code that causes the HTTP403
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
Username: <input type="text" name="username">
<br />
Password: <input type="password" name="password">
<br /><br />
<input type="submit" name="submit" value="Sign Up">

/Lennart- Hide quoted text -

- Show quoted text -

OK, now when you say "I use a php script", when aer you considering it
to be used?
Do you get the form displayed but get the error when you press "Sign
Up" or do you not get the form displayed at all?

When ran I get the page and give ensers to the two inputs.
The browser reacts with HTTP 403 when I press the submit-button
/Lennart- Hide quoted text -

- Show quoted text -

OK, so what you said first was incorrect. You are using the script to
produce the form. So it is not the act of accessing $_SERVER per se
that is causing the 403. You are getting the 403 when you try to
submit the form to the "address" that is output by the original php
call.

To be honest, you don't really need that call for what you are doing.
By default the form will submit to the same address that is in the
address bar, so try coding the form as

<form action="" method="post">
Username: <input type="text" name="username">
<br />
Password: <input type="password" name="password">
<br /><br />
<input type="submit" name="submit" value="Sign Up">

and see what happens.
Thanks. I think I see what you mean but can I still use the keyed username
and password as variables and go furhter to for instance a database with
them. I admit I am a newbie but if you don't ask you don't get any
answers.
/Lennart
When running my original script i furthermore get:
http://localhost/%3C?=$_SERVER['PHP_SELF']?>
in the URL-line of the browser.
I know the script works because i have ran it at the webb-hotel. Just
wondering why it works there but not on my local workstation
/Lennart
Feb 12 '07 #11

P: n/a
On 12 Feb, 15:59, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i meddelandetnews:11**********************@s48g2000c ws.googlegroups.com...
On 12 Feb, 15:41, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11**********************@j27g2000c wj.googlegroups.com...
On 12 Feb, 15:13, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11*********************@s48g2000cw s.googlegroups.com...
On 12 Feb, 15:06, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Satya" <satya61...@gmail.comskrev i
meddelandetnews:11**********************@h3g2000cw c.googlegroups.com...
On Feb 8, 3:59 am, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
I have finally managed to get Apache 2.2.4, PHP 5.2.0 and MySQL
to
talk
to
each other. Everything seems to work OK when dealing with
databases
but
as
soon as I use a php-script that use $_server the browser will
throw
me
away
and give me HTTP 403.
It has worked before but that was before I got the communication
to
work
with MySQL
Any ideas or solutions are very much appreciated.
/Lennart
---------------------
I see no reason for this.
if you are using $_server then use $_SERVER['key'];
Thats is exactly how I'm doing. Still the browser will through me
away
and
denies to show the page, just saying HTTP 403.
/Lennart- Hide quoted text -
- Show quoted text -
Care to share some of the code?
This is the simple test code that causes the HTTP403
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
Username: <input type="text" name="username">
<br />
Password: <input type="password" name="password">
<br /><br />
<input type="submit" name="submit" value="Sign Up">
/Lennart- Hide quoted text -
- Show quoted text -
OK, now when you say "I use a php script", when aer you considering it
to be used?
Do you get the form displayed but get the error when you press "Sign
Up" or do you not get the form displayed at all?
When ran I get the page and give ensers to the two inputs.
The browser reacts with HTTP 403 when I press the submit-button
/Lennart- Hide quoted text -
- Show quoted text -
OK, so what you said first was incorrect. You are using the script to
produce the form. So it is not the act of accessing $_SERVER per se
that is causing the 403. You are getting the 403 when you try to
submit the form to the "address" that is output by the original php
call.
To be honest, you don't really need that call for what you are doing.
By default the form will submit to the same address that is in the
address bar, so try coding the form as
<form action="" method="post">
Username: <input type="text" name="username">
<br />
Password: <input type="password" name="password">
<br /><br />
<input type="submit" name="submit" value="Sign Up">
and see what happens.

Thanks. I think I see what you mean but can I still use the keyed username
and password as variables and go furhter to for instance a database with
them. I admit I am a newbie but if you don't ask you don't get any answers.
/Lennart- Hide quoted text -

- Show quoted text -
What is happening with the way that you have coded your script (if
you've done it correctly) is that the first time it gets executed, it
will display the form. Then when you click "Sign Up" the same script
is executed again, but this time it detects that it has been run due
to a valid form submission and the does whatever other processing you
have asked it to do.

An empty "action" parm just does the submission back to the current
URL, the same as the php_self should have done.

Did the submit work OK using my suggestion?

Feb 12 '07 #12

P: n/a

"Captain Paralytic" <pa**********@yahoo.comskrev i meddelandet
news:11**********************@k78g2000cwa.googlegr oups.com...
On 12 Feb, 15:59, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
>"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11**********************@s48g2000 cws.googlegroups.com...
On 12 Feb, 15:41, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11**********************@j27g2000 cwj.googlegroups.com...
On 12 Feb, 15:13, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11*********************@s48g2000c ws.googlegroups.com...
On 12 Feb, 15:06, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Satya" <satya61...@gmail.comskrev i
meddelandetnews:11**********************@h3g2000c wc.googlegroups.com...
On Feb 8, 3:59 am, "Lennart Anderson"
<lennart.ander...@tele2.se>
wrote:
I have finally managed to get Apache 2.2.4, PHP 5.2.0 and
MySQL
to
talk
to
each other. Everything seems to work OK when dealing with
databases
but
as
soon as I use a php-script that use $_server the browser will
throw
me
away
and give me HTTP 403.
>It has worked before but that was before I got the
communication
to
work
with MySQL
>Any ideas or solutions are very much appreciated.
>/Lennart
---------------------
I see no reason for this.
if you are using $_server then use $_SERVER['key'];
>Thats is exactly how I'm doing. Still the browser will through
me
away
and
denies to show the page, just saying HTTP 403.
/Lennart- Hide quoted text -
>- Show quoted text -
Care to share some of the code?
>This is the simple test code that causes the HTTP403
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
Username: <input type="text" name="username">
<br />
Password: <input type="password" name="password">
<br /><br />
<input type="submit" name="submit" value="Sign Up">
>/Lennart- Hide quoted text -
>- Show quoted text -
OK, now when you say "I use a php script", when aer you considering
it
to be used?
Do you get the form displayed but get the error when you press "Sign
Up" or do you not get the form displayed at all?
>When ran I get the page and give ensers to the two inputs.
The browser reacts with HTTP 403 when I press the submit-button
/Lennart- Hide quoted text -
>- Show quoted text -
OK, so what you said first was incorrect. You are using the script to
produce the form. So it is not the act of accessing $_SERVER per se
that is causing the 403. You are getting the 403 when you try to
submit the form to the "address" that is output by the original php
call.
To be honest, you don't really need that call for what you are doing.
By default the form will submit to the same address that is in the
address bar, so try coding the form as
<form action="" method="post">
Username: <input type="text" name="username">
<br />
Password: <input type="password" name="password">
<br /><br />
<input type="submit" name="submit" value="Sign Up">
and see what happens.

Thanks. I think I see what you mean but can I still use the keyed
username
and password as variables and go furhter to for instance a database with
them. I admit I am a newbie but if you don't ask you don't get any
answers.
/Lennart- Hide quoted text -

- Show quoted text -

What is happening with the way that you have coded your script (if
you've done it correctly) is that the first time it gets executed, it
will display the form. Then when you click "Sign Up" the same script
is executed again, but this time it detects that it has been run due
to a valid form submission and the does whatever other processing you
have asked it to do.

An empty "action" parm just does the submission back to the current
URL, the same as the php_self should have done.

Did the submit work OK using my suggestion?
Thanks. Your suggested code worked as expected and accepted the inouts an
took care of them.
Just the follow question as above - can I in your script use the input names
as variables for further actions?
/Lennart
Feb 12 '07 #13

P: n/a
On 12 Feb, 16:24, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i meddelandetnews:11**********************@k78g2000c wa.googlegroups.com...


On 12 Feb, 15:59, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11**********************@s48g2000c ws.googlegroups.com...
On 12 Feb, 15:41, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11**********************@j27g2000c wj.googlegroups.com...
On 12 Feb, 15:13, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11*********************@s48g2000cw s.googlegroups.com...
On 12 Feb, 15:06, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Satya" <satya61...@gmail.comskrev i
meddelandetnews:11**********************@h3g2000cw c.googlegroups.com...
On Feb 8, 3:59 am, "Lennart Anderson"
<lennart.ander...@tele2.se>
wrote:
I have finally managed to get Apache 2.2.4, PHP 5.2.0 and
MySQL
to
talk
to
each other. Everything seems to work OK when dealing with
databases
but
as
soon as I use a php-script that use $_server the browser will
throw
me
away
and give me HTTP 403.
It has worked before but that was before I got the
communication
to
work
with MySQL
Any ideas or solutions are very much appreciated.
/Lennart
---------------------
I see no reason for this.
if you are using $_server then use $_SERVER['key'];
Thats is exactly how I'm doing. Still the browser will through
me
away
and
denies to show the page, just saying HTTP 403.
/Lennart- Hide quoted text -
- Show quoted text -
Care to share some of the code?
This is the simple test code that causes the HTTP403
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
Username: <input type="text" name="username">
<br />
Password: <input type="password" name="password">
<br /><br />
<input type="submit" name="submit" value="Sign Up">
/Lennart- Hide quoted text -
- Show quoted text -
OK, now when you say "I use a php script", when aer you considering
it
to be used?
Do you get the form displayed but get the error when you press "Sign
Up" or do you not get the form displayed at all?
When ran I get the page and give ensers to the two inputs.
The browser reacts with HTTP 403 when I press the submit-button
/Lennart- Hide quoted text -
- Show quoted text -
OK, so what you said first was incorrect. You are using the script to
produce the form. So it is not the act of accessing $_SERVER per se
that is causing the 403. You are getting the 403 when you try to
submit the form to the "address" that is output by the original php
call.
To be honest, you don't really need that call for what you are doing.
By default the form will submit to the same address that is in the
address bar, so try coding the form as
<form action="" method="post">
Username: <input type="text" name="username">
<br />
Password: <input type="password" name="password">
<br /><br />
<input type="submit" name="submit" value="Sign Up">
and see what happens.
Thanks. I think I see what you mean but can I still use the keyed
username
and password as variables and go furhter to for instance a database with
them. I admit I am a newbie but if you don't ask you don't get any
answers.
/Lennart- Hide quoted text -
- Show quoted text -
What is happening with the way that you have coded your script (if
you've done it correctly) is that the first time it gets executed, it
will display the form. Then when you click "Sign Up" the same script
is executed again, but this time it detects that it has been run due
to a valid form submission and the does whatever other processing you
have asked it to do.
An empty "action" parm just does the submission back to the current
URL, the same as the php_self should have done.
Did the submit work OK using my suggestion?

Thanks. Your suggested code worked as expected and accepted the inouts an
took care of them.
Just the follow question as above - can I in your script use the input names
as variables for further actions?
/Lennart- Hide quoted text -

- Show quoted text -
I don't understand the question. I didn't supply any script.
Please re-phrase it?

Feb 12 '07 #14

P: n/a

"Captain Paralytic" <pa**********@yahoo.comskrev i meddelandet
news:11*********************@m58g2000cwm.googlegro ups.com...
On 12 Feb, 16:24, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
>"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11**********************@k78g2000 cwa.googlegroups.com...


On 12 Feb, 15:59, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11**********************@s48g2000 cws.googlegroups.com...
On 12 Feb, 15:41, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11**********************@j27g2000 cwj.googlegroups.com...
On 12 Feb, 15:13, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11*********************@s48g2000c ws.googlegroups.com...
On 12 Feb, 15:06, "Lennart Anderson"
<lennart.ander...@tele2.se>
wrote:
"Satya" <satya61...@gmail.comskrev i
meddelandetnews:11**********************@h3g2000c wc.googlegroups.com...
On Feb 8, 3:59 am, "Lennart Anderson"
<lennart.ander...@tele2.se>
wrote:
I have finally managed to get Apache 2.2.4, PHP 5.2.0 and
MySQL
to
talk
to
each other. Everything seems to work OK when dealing with
databases
but
as
soon as I use a php-script that use $_server the browser
will
throw
me
away
and give me HTTP 403.
>It has worked before but that was before I got the
communication
to
work
with MySQL
>Any ideas or solutions are very much appreciated.
>/Lennart
---------------------
I see no reason for this.
if you are using $_server then use $_SERVER['key'];
>Thats is exactly how I'm doing. Still the browser will
through
me
away
and
denies to show the page, just saying HTTP 403.
/Lennart- Hide quoted text -
>- Show quoted text -
Care to share some of the code?
>This is the simple test code that causes the HTTP403
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
Username: <input type="text" name="username">
<br />
Password: <input type="password" name="password">
<br /><br />
<input type="submit" name="submit" value="Sign Up">
>/Lennart- Hide quoted text -
>- Show quoted text -
OK, now when you say "I use a php script", when aer you
considering
it
to be used?
Do you get the form displayed but get the error when you press
"Sign
Up" or do you not get the form displayed at all?
>When ran I get the page and give ensers to the two inputs.
The browser reacts with HTTP 403 when I press the submit-button
/Lennart- Hide quoted text -
>- Show quoted text -
OK, so what you said first was incorrect. You are using the script
to
produce the form. So it is not the act of accessing $_SERVER per se
that is causing the 403. You are getting the 403 when you try to
submit the form to the "address" that is output by the original php
call.
To be honest, you don't really need that call for what you are
doing.
By default the form will submit to the same address that is in the
address bar, so try coding the form as
<form action="" method="post">
Username: <input type="text" name="username">
<br />
Password: <input type="password" name="password">
<br /><br />
<input type="submit" name="submit" value="Sign Up">
and see what happens.
>Thanks. I think I see what you mean but can I still use the keyed
username
and password as variables and go furhter to for instance a database
with
them. I admit I am a newbie but if you don't ask you don't get any
answers.
/Lennart- Hide quoted text -
>- Show quoted text -
What is happening with the way that you have coded your script (if
you've done it correctly) is that the first time it gets executed, it
will display the form. Then when you click "Sign Up" the same script
is executed again, but this time it detects that it has been run due
to a valid form submission and the does whatever other processing you
have asked it to do.
An empty "action" parm just does the submission back to the current
URL, the same as the php_self should have done.
Did the submit work OK using my suggestion?

Thanks. Your suggested code worked as expected and accepted the inouts an
took care of them.
Just the follow question as above - can I in your script use the input
names
as variables for further actions?
/Lennart- Hide quoted text -

- Show quoted text -

I don't understand the question. I didn't supply any script.
Please re-phrase it?
OK Script could be the wrong word. You suggested an other code that could
do, and did, the same task but in an other way and then my follow question
was if I, if using your code, can use the given inputs, username and
password, as variables for further actions?
Sorry if I was not clear enough
/Lennart
Feb 12 '07 #15

P: n/a
On 12 Feb, 16:46, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i meddelandetnews:11*********************@m58g2000cw m.googlegroups.com...
On 12 Feb, 16:24, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11**********************@k78g2000c wa.googlegroups.com...
On 12 Feb, 15:59, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11**********************@s48g2000c ws.googlegroups.com...
On 12 Feb, 15:41, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11**********************@j27g2000c wj.googlegroups.com...
On 12 Feb, 15:13, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11*********************@s48g2000cw s.googlegroups.com...
On 12 Feb, 15:06, "Lennart Anderson"
<lennart.ander...@tele2.se>
wrote:
"Satya" <satya61...@gmail.comskrev i
meddelandetnews:11**********************@h3g2000cw c.googlegroups.com...
On Feb 8, 3:59 am, "Lennart Anderson"
<lennart.ander...@tele2.se>
wrote:
I have finally managed to get Apache 2.2.4, PHP 5.2.0 and
MySQL
to
talk
to
each other. Everything seems to work OK when dealing with
databases
but
as
soon as I use a php-script that use $_server the browser
will
throw
me
away
and give me HTTP 403.
It has worked before but that was before I got the
communication
to
work
with MySQL
Any ideas or solutions are very much appreciated.
/Lennart
---------------------
I see no reason for this.
if you are using $_server then use $_SERVER['key'];
Thats is exactly how I'm doing. Still the browser will
through
me
away
and
denies to show the page, just saying HTTP 403.
/Lennart- Hide quoted text -
- Show quoted text -
Care to share some of the code?
This is the simple test code that causes the HTTP403
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
Username: <input type="text" name="username">
<br />
Password: <input type="password" name="password">
<br /><br />
<input type="submit" name="submit" value="Sign Up">
/Lennart- Hide quoted text -
- Show quoted text -
OK, now when you say "I use a php script", when aer you
considering
it
to be used?
Do you get the form displayed but get the error when you press
"Sign
Up" or do you not get the form displayed at all?
When ran I get the page and give ensers to the two inputs.
The browser reacts with HTTP 403 when I press the submit-button
/Lennart- Hide quoted text -
- Show quoted text -
OK, so what you said first was incorrect. You are using the script
to
produce the form. So it is not the act of accessing $_SERVER per se
that is causing the 403. You are getting the 403 when you try to
submit the form to the "address" that is output by the original php
call.
To be honest, you don't really need that call for what you are
doing.
By default the form will submit to the same address that is in the
address bar, so try coding the form as
<form action="" method="post">
Username: <input type="text" name="username">
<br />
Password: <input type="password" name="password">
<br /><br />
<input type="submit" name="submit" value="Sign Up">
and see what happens.
Thanks. I think I see what you mean but can I still use the keyed
username
and password as variables and go furhter to for instance a database
with
them. I admit I am a newbie but if you don't ask you don't get any
answers.
/Lennart- Hide quoted text -
- Show quoted text -
What is happening with the way that you have coded your script (if
you've done it correctly) is that the first time it gets executed, it
will display the form. Then when you click "Sign Up" the same script
is executed again, but this time it detects that it has been run due
to a valid form submission and the does whatever other processing you
have asked it to do.
An empty "action" parm just does the submission back to the current
URL, the same as the php_self should have done.
Did the submit work OK using my suggestion?
Thanks. Your suggested code worked as expected and accepted the inouts an
took care of them.
Just the follow question as above - can I in your script use the input
names
as variables for further actions?
/Lennart- Hide quoted text -
- Show quoted text -
I don't understand the question. I didn't supply any script.
Please re-phrase it?

OK Script could be the wrong word. You suggested an other code that could
do, and did, the same task but in an other way and then my follow question
was if I, if using your code, can use the given inputs, username and
password, as variables for further actions?
Sorry if I was not clear enough
/Lennart- Hide quoted text -

- Show quoted text -
I just copied your exact HTML and simply removed the php part.
Anything you could do with it as it was, you can still do with it as I
haven't changed it at all.
I am not sure what you mean by using the inputs as variables. You will
have to be more precise in explaining what you mean?

Feb 12 '07 #16

P: n/a

"Captain Paralytic" <pa**********@yahoo.comskrev i meddelandet
news:11**********************@j27g2000cwj.googlegr oups.com...
On 12 Feb, 16:46, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
>"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11*********************@m58g2000c wm.googlegroups.com...
On 12 Feb, 16:24, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11**********************@k78g2000 cwa.googlegroups.com...
On 12 Feb, 15:59, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11**********************@s48g2000 cws.googlegroups.com...
On 12 Feb, 15:41, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11**********************@j27g2000 cwj.googlegroups.com...
On 12 Feb, 15:13, "Lennart Anderson"
<lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11*********************@s48g2000c ws.googlegroups.com...
On 12 Feb, 15:06, "Lennart Anderson"
<lennart.ander...@tele2.se>
wrote:
"Satya" <satya61...@gmail.comskrev i
meddelandetnews:11**********************@h3g2000c wc.googlegroups.com...
On Feb 8, 3:59 am, "Lennart Anderson"
<lennart.ander...@tele2.se>
wrote:
I have finally managed to get Apache 2.2.4, PHP 5.2.0
and
MySQL
to
talk
to
each other. Everything seems to work OK when dealing
with
databases
but
as
soon as I use a php-script that use $_server the
browser
will
throw
me
away
and give me HTTP 403.
>It has worked before but that was before I got the
communication
to
work
with MySQL
>Any ideas or solutions are very much appreciated.
>/Lennart
---------------------
I see no reason for this.
if you are using $_server then use $_SERVER['key'];
>Thats is exactly how I'm doing. Still the browser will
through
me
away
and
denies to show the page, just saying HTTP 403.
/Lennart- Hide quoted text -
>- Show quoted text -
Care to share some of the code?
>This is the simple test code that causes the HTTP403
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
Username: <input type="text" name="username">
<br />
Password: <input type="password" name="password">
<br /><br />
<input type="submit" name="submit" value="Sign Up">
>/Lennart- Hide quoted text -
>- Show quoted text -
OK, now when you say "I use a php script", when aer you
considering
it
to be used?
Do you get the form displayed but get the error when you press
"Sign
Up" or do you not get the form displayed at all?
>When ran I get the page and give ensers to the two inputs.
The browser reacts with HTTP 403 when I press the submit-button
/Lennart- Hide quoted text -
>- Show quoted text -
OK, so what you said first was incorrect. You are using the
script
to
produce the form. So it is not the act of accessing $_SERVER per
se
that is causing the 403. You are getting the 403 when you try to
submit the form to the "address" that is output by the original
php
call.
To be honest, you don't really need that call for what you are
doing.
By default the form will submit to the same address that is in
the
address bar, so try coding the form as
<form action="" method="post">
Username: <input type="text" name="username">
<br />
Password: <input type="password" name="password">
<br /><br />
<input type="submit" name="submit" value="Sign Up">
and see what happens.
>Thanks. I think I see what you mean but can I still use the keyed
username
and password as variables and go furhter to for instance a database
with
them. I admit I am a newbie but if you don't ask you don't get any
answers.
/Lennart- Hide quoted text -
>- Show quoted text -
What is happening with the way that you have coded your script (if
you've done it correctly) is that the first time it gets executed,
it
will display the form. Then when you click "Sign Up" the same script
is executed again, but this time it detects that it has been run due
to a valid form submission and the does whatever other processing
you
have asked it to do.
An empty "action" parm just does the submission back to the current
URL, the same as the php_self should have done.
Did the submit work OK using my suggestion?
>Thanks. Your suggested code worked as expected and accepted the inouts
an
took care of them.
Just the follow question as above - can I in your script use the input
names
as variables for further actions?
/Lennart- Hide quoted text -
>- Show quoted text -
I don't understand the question. I didn't supply any script.
Please re-phrase it?

OK Script could be the wrong word. You suggested an other code that could
do, and did, the same task but in an other way and then my follow
question
was if I, if using your code, can use the given inputs, username and
password, as variables for further actions?
Sorry if I was not clear enough
/Lennart- Hide quoted text -

- Show quoted text -

I just copied your exact HTML and simply removed the php part.
Anything you could do with it as it was, you can still do with it as I
haven't changed it at all.
I am not sure what you mean by using the inputs as variables. You will
have to be more precise in explaining what you mean?
I'm sorry if I am not precise enough. I just wonder that I, if using your
suggested code can go on with the given username and passwor and use them as
variables for checking against a database table with approved users. I guess
I can use $_POST["username"] to do that. Is that OK?
/Lennart
Feb 12 '07 #17

P: n/a
Lennart Anderson wrote:
"Lennart Anderson" <le**************@tele2.seskrev i meddelandet
news:q9**************@nntpserver.swip.net...
>"Captain Paralytic" <pa**********@yahoo.comskrev i meddelandet
news:11**********************@s48g2000cws.googleg roups.com...
>>On 12 Feb, 15:41, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11**********************@j27g20 00cwj.googlegroups.com...

On 12 Feb, 15:13, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
>"Captain Paralytic" <paul_laut...@yahoo.comskrev i
>meddelandetnews:11*********************@s48g2 000cws.googlegroups.com...
>>On 12 Feb, 15:06, "Lennart Anderson" <lennart.ander...@tele2.se>
>>wrote:
>>>"Satya" <satya61...@gmail.comskrev i
>>>meddelandetnews:11**********************@h3 g2000cwc.googlegroups.com...
>>>>On Feb 8, 3:59 am, "Lennart Anderson"
>>>><lennart.ander...@tele2.se>
>>>>wrote:
>>>>>I have finally managed to get Apache 2.2.4, PHP 5.2.0 and MySQL
>>>>>to
>>>>>talk
>>>>>to
>>>>>each other. Everything seems to work OK when dealing with
>>>>>databases
>>>>>but
>>>>>as
>>>>>soon as I use a php-script that use $_server the browser will
>>>>>throw
>>>>>me
>>>>>away
>>>>>and give me HTTP 403.
>>>>>It has worked before but that was before I got the
>>>>>communication to
>>>>>work
>>>>>with MySQL
>>>>>Any ideas or solutions are very much appreciated.
>>>>>/Lennart
>>>>---------------------
>>>>I see no reason for this.
>>>>if you are using $_server then use $_SERVER['key'];
>>>Thats is exactly how I'm doing. Still the browser will through me
>>>away
>>>and
>>>denies to show the page, just saying HTTP 403.
>>>/Lennart- Hide quoted text -
>>>- Show quoted text -
>>Care to share some of the code?
>This is the simple test code that causes the HTTP403
><form action="<?=$_SERVER['PHP_SELF']?>" method="post">
>Username: <input type="text" name="username">
><br />
>Password: <input type="password" name="password">
><br /><br />
><input type="submit" name="submit" value="Sign Up">
>/Lennart- Hide quoted text -
>- Show quoted text -
OK, now when you say "I use a php script", when aer you considering it
to be used?
Do you get the form displayed but get the error when you press "Sign
Up" or do you not get the form displayed at all?
When ran I get the page and give ensers to the two inputs.
The browser reacts with HTTP 403 when I press the submit-button
/Lennart- Hide quoted text -

- Show quoted text -
OK, so what you said first was incorrect. You are using the script to
produce the form. So it is not the act of accessing $_SERVER per se
that is causing the 403. You are getting the 403 when you try to
submit the form to the "address" that is output by the original php
call.

To be honest, you don't really need that call for what you are doing.
By default the form will submit to the same address that is in the
address bar, so try coding the form as

<form action="" method="post">
Username: <input type="text" name="username">
<br />
Password: <input type="password" name="password">
<br /><br />
<input type="submit" name="submit" value="Sign Up">

and see what happens.
Thanks. I think I see what you mean but can I still use the keyed username
and password as variables and go furhter to for instance a database with
them. I admit I am a newbie but if you don't ask you don't get any
answers.
/Lennart
When running my original script i furthermore get:
http://localhost/%3C?=$_SERVER['PHP_SELF']?>
in the URL-line of the browser.
I know the script works because i have ran it at the webb-hotel. Just
wondering why it works there but not on my local workstation
/Lennart

It's not working because on your system your php.ini has

short_open_tag=off

(or it defaults to this).

You shouldn't count on short_open_tag being enabled. Many hosts don't
have it on. Rather, use:

<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">

It should work on all servers.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Feb 12 '07 #18

P: n/a
On 12 Feb, 15:10, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Satya" <satya61...@gmail.comskrev i meddelandetnews:11**********************@h3g2000cw c.googlegroups.com...
On Feb 8, 3:59 am, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
I have finally managed to get Apache 2.2.4, PHP 5.2.0 and MySQL to talk
to
each other. Everything seems to work OK when dealing with databases but
as
soon as I use a php-script that use $_server the browser will throw me
away
and give me HTTP 403.
It has worked before but that was before I got the communication to work
with MySQL
Any ideas or solutions are very much appreciated.
/Lennart
---------------------
I see no reason for this.
if you are using $_server then use $_SERVER['key'];

This is exactly how I'm using it but still the browser refuse to show the
page but just say HTTP 403
/Lennart- Hide quoted text -

- Show quoted text -
I thought you said it was working???

Feb 13 '07 #19

P: n/a

"Jerry Stuckle" <js*******@attglobal.netskrev i meddelandet
news:yu******************************@comcast.com. ..
Lennart Anderson wrote:
>"Lennart Anderson" <le**************@tele2.seskrev i meddelandet
news:q9**************@nntpserver.swip.net...
>>"Captain Paralytic" <pa**********@yahoo.comskrev i meddelandet
news:11**********************@s48g2000cws.google groups.com...
On 12 Feb, 15:41, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
"Captain Paralytic" <paul_laut...@yahoo.comskrev i
meddelandetnews:11**********************@j27g2 000cwj.googlegroups.com...
>
>
>
>On 12 Feb, 15:13, "Lennart Anderson" <lennart.ander...@tele2.se>
>wrote:
>>"Captain Paralytic" <paul_laut...@yahoo.comskrev i
>>meddelandetnews:11*********************@s48g 2000cws.googlegroups.com...
>>>On 12 Feb, 15:06, "Lennart Anderson" <lennart.ander...@tele2.se>
>>>wrote:
>>>>"Satya" <satya61...@gmail.comskrev i
>>>>meddelandetnews:11**********************@h 3g2000cwc.googlegroups.com...
>>>>>On Feb 8, 3:59 am, "Lennart Anderson" <lennart.ander...@tele2.se>
>>>>>wrote:
>>>>>>I have finally managed to get Apache 2.2.4, PHP 5.2.0 and MySQL
>>>>>>to
>>>>>>talk
>>>>>>to
>>>>>>each other. Everything seems to work OK when dealing with
>>>>>>databases
>>>>>>but
>>>>>>as
>>>>>>soon as I use a php-script that use $_server the browser will
>>>>>>throw
>>>>>>me
>>>>>>away
>>>>>>and give me HTTP 403.
>>>>>>It has worked before but that was before I got the communication
>>>>>>to
>>>>>>work
>>>>>>with MySQL
>>>>>>Any ideas or solutions are very much appreciated.
>>>>>>/Lennart
>>>>>---------------------
>>>>>I see no reason for this.
>>>>>if you are using $_server then use $_SERVER['key'];
>>>>Thats is exactly how I'm doing. Still the browser will through me
>>>>away
>>>>and
>>>>denies to show the page, just saying HTTP 403.
>>>>/Lennart- Hide quoted text -
>>>>- Show quoted text -
>>>Care to share some of the code?
>>This is the simple test code that causes the HTTP403
>><form action="<?=$_SERVER['PHP_SELF']?>" method="post">
>>Username: <input type="text" name="username">
>><br />
>>Password: <input type="password" name="password">
>><br /><br />
>><input type="submit" name="submit" value="Sign Up">
>>/Lennart- Hide quoted text -
>>- Show quoted text -
>OK, now when you say "I use a php script", when aer you considering
>it
>to be used?
>Do you get the form displayed but get the error when you press "Sign
>Up" or do you not get the form displayed at all?
When ran I get the page and give ensers to the two inputs.
The browser reacts with HTTP 403 when I press the submit-button
/Lennart- Hide quoted text -
>
- Show quoted text -
OK, so what you said first was incorrect. You are using the script to
produce the form. So it is not the act of accessing $_SERVER per se
that is causing the 403. You are getting the 403 when you try to
submit the form to the "address" that is output by the original php
call.

To be honest, you don't really need that call for what you are doing.
By default the form will submit to the same address that is in the
address bar, so try coding the form as

<form action="" method="post">
Username: <input type="text" name="username">
<br />
Password: <input type="password" name="password">
<br /><br />
<input type="submit" name="submit" value="Sign Up">

and see what happens.

Thanks. I think I see what you mean but can I still use the keyed
username and password as variables and go furhter to for instance a
database with them. I admit I am a newbie but if you don't ask you don't
get any answers.
/Lennart
When running my original script i furthermore get:
http://localhost/%3C?=$_SERVER['PHP_SELF']?>
in the URL-line of the browser.
I know the script works because i have ran it at the webb-hotel. Just
wondering why it works there but not on my local workstation
/Lennart

It's not working because on your system your php.ini has

short_open_tag=off

(or it defaults to this).

You shouldn't count on short_open_tag being enabled. Many hosts don't
have it on. Rather, use:

<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">

It should work on all servers.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Thanks. That worked and solved my current problem.
Thanks again
/Lennart
Feb 13 '07 #20

P: n/a

"Captain Paralytic" <pa**********@yahoo.comskrev i meddelandet
news:11**********************@h3g2000cwc.googlegro ups.com...
On 12 Feb, 15:10, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
>"Satya" <satya61...@gmail.comskrev i
meddelandetnews:11**********************@h3g2000c wc.googlegroups.com...
On Feb 8, 3:59 am, "Lennart Anderson" <lennart.ander...@tele2.se>
wrote:
I have finally managed to get Apache 2.2.4, PHP 5.2.0 and MySQL to
talk
to
each other. Everything seems to work OK when dealing with databases
but
as
soon as I use a php-script that use $_server the browser will throw me
away
and give me HTTP 403.
>It has worked before but that was before I got the communication to
work
with MySQL
>Any ideas or solutions are very much appreciated.
>/Lennart
---------------------
I see no reason for this.
if you are using $_server then use $_SERVER['key'];

This is exactly how I'm using it but still the browser refuse to show the
page but just say HTTP 403
/Lennart- Hide quoted text -

- Show quoted text -

I thought you said it was working???
OK Problem solved thanks to the code you suggested.
Thanks for all hints.
/Lennart
Feb 13 '07 #21

This discussion thread is closed

Replies have been disabled for this discussion.