Post not working from 1 script to another

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jidospod
Forum Commoner
Posts: 33
Joined: Tue Jun 11, 2002 1:05 am

Post not working from 1 script to another

Post by jidospod »

Well lets see, our server is Apache, and this one directory all the php scripts are renamed for example "register.php" is just "register", (dont ask why its irrelevant), and register POSTs to "checkacct", now my problem here is I cant get this to work, when I try and POST I get a Internal Server Error (500). What can I add to my .htaccess file to make it post to the file.

If I rename to .php they will work fine, however the sysadmin does not want extentions on those files. Please dont tell me I should rename them to .php I KNOW that, but he's adement on having no extentions. Thanks in advance guys.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

sorry, no idea, but your sysadmin is working on your side? ;)
Have you checked the apache's error logs. May be it tries to tell you something (may be not. I got internal errors without error logs :( )
jidospod
Forum Commoner
Posts: 33
Joined: Tue Jun 11, 2002 1:05 am

Post by jidospod »

24.67.xxx.xxx - - [11/Jun/2002:02:13:56 - 400] "POST /checkacct?option=WRITE HTTP/1.1" 405 339 "http://www.mydomain.com/register" "Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)"

Is what appears in my logfiles...
However, I am at a loss :)
jidospod
Forum Commoner
Posts: 33
Joined: Tue Jun 11, 2002 1:05 am

Post by jidospod »

I am using the following line in my register script (which is php) to POST to my checkacct script (also php). Any ideas?

<FORM METHOD=POST ACTION="checkacct?option=CHECK">
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

You are mixing POST and GET. Form-method is POST but you add '?option=check' which is GET. instead include a

Code: Select all

<input type="hidden" name="option" value="CHECK" />
$_POST['option'] will be available in your script (='CHECK').

Just a few moments ago I tried
<Location /php>
ForceType application/x-httpd-php
</Location>
in my httpd.conf to treat any file in a directory (../htdocs/php) as php-script and it worked without server errors.
Server Version: Apache/2.0.36 (Win32) PHP/4.2.1
Server Built: May 6 2002 23:31:19
Post Reply