Form Submission

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
Crimsonshift
Forum Newbie
Posts: 5
Joined: Mon Jul 02, 2007 3:47 pm

Form Submission

Post by Crimsonshift »

Hello everyone. The question that I have is as follows:
The system I'm working on is 4.3.9 and the issue was that I have a form (the action url is a made-up one for this post):

<form action='http://page.php' method='post'>

None of the $_POST variables submitted are available. However when I changed the form definition to be as below (note the differences in action), everything works.

<form action='page.php' method='post'>


I am wondering why this is happening.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Crimsonshift wrote:http://page.php
the browser is looking for the domain page.php which does not exist.
Crimsonshift
Forum Newbie
Posts: 5
Joined: Mon Jul 02, 2007 3:47 pm

Post by Crimsonshift »

I'm not a newbie. The url does exist I just used http://page.php as an example for this forum.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Post the actual code, including the two differences.
Crimsonshift
Forum Newbie
Posts: 5
Joined: Mon Jul 02, 2007 3:47 pm

Post by Crimsonshift »

Doesn't Work: <form action='http://www.xxxxxxxxx.com/error_reporting/page.php' method='post' onSubmit="return Validator(this)" name="Form1" language="JavaScript">


Does Work: <form action='page.php' method='post' onSubmit="return Validator(this)" name="Form1" language="JavaScript">


This is not my original code, and I'm wondering if the language="javascript" is throwing it off or if there is some setting on the server or in the php.ini file that doesn't allow for urls in the action field?? I've been programming in php for the last 4 years, and this is the first time something like this has come up.
Last edited by Crimsonshift on Mon Jul 02, 2007 5:21 pm, edited 1 time in total.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

In case you're using an apache webserver what does

Code: Select all

echo '<div>'; print_r(getallheaders()); echo "</div>\n";
in page.php print?
Crimsonshift
Forum Newbie
Posts: 5
Joined: Mon Jul 02, 2007 3:47 pm

Post by Crimsonshift »

this is a live site, and I don't want to mess with it anymore, their FTP is really touchy and I don't want to have it mess up by me uploading something. Especially because it's not really a problem. I'm just curious as to what could be causing this. Thank You for trying to help me!!!
Crimsonshift
Forum Newbie
Posts: 5
Joined: Mon Jul 02, 2007 3:47 pm

Post by Crimsonshift »

It must be some setting on the server or in php.ini because when I run the code on my server there is no issue. Anyone know what setting could be causing this?
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Well, you aren't making sense.

Just post to the same page and be done with it.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

A misconfigured reverse proxy or deep inspection firewall for incoming requests can cause such behaviour ....but it could also be something completely different.
Post Reply