|
Posted by Lennart Anderson on 02/13/07 14:19
"Jerry Stuckle" <jstucklex@attglobal.net> skrev i meddelandet
news:yuydnWM8Vf6DOE3YnZ2dnUVZ_rPinZ2d@comcast.com...
> Lennart Anderson wrote:
>> "Lennart Anderson" <lennart.anderson@tele2.se> skrev i meddelandet
>> news:q90Ah.82$a36.413@nntpserver.swip.net...
>>> "Captain Paralytic" <paul_lautman@yahoo.com> skrev i meddelandet
>>> news:1171295377.124061.210900@s48g2000cws.googlegroups.com...
>>>> On 12 Feb, 15:41, "Lennart Anderson" <lennart.ander...@tele2.se>
>>>> wrote:
>>>>> "Captain Paralytic" <paul_laut...@yahoo.com> skrev i
>>>>> meddelandetnews:1171293983.056633.220620@j27g2000cwj.googlegroups.com...
>>>>>
>>>>>
>>>>>
>>>>>> On 12 Feb, 15:13, "Lennart Anderson" <lennart.ander...@tele2.se>
>>>>>> wrote:
>>>>>>> "Captain Paralytic" <paul_laut...@yahoo.com> skrev i
>>>>>>> meddelandetnews:1171292908.022502.97460@s48g2000cws.googlegroups.com...
>>>>>>>> On 12 Feb, 15:06, "Lennart Anderson" <lennart.ander...@tele2.se>
>>>>>>>> wrote:
>>>>>>>>> "Satya" <satya61...@gmail.com> skrev i
>>>>>>>>> meddelandetnews:1171087978.827105.134470@h3g2000cwc.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.
> jstucklex@attglobal.net
> ==================
Thanks. That worked and solved my current problem.
Thanks again
/Lennart
Navigation:
[Reply to this message]
|