Form posting problem and post data issue

Form posting problem and post data issue

Post by Blah Gu » Sun, 26 Jan 2003 10:25:54



Hello I am having a strange problem. The servers at my work were recently
upgraded to redhat 8.0 and the appache I think is handling form post data
differently.
I think its a configuration setting or something but the server
administrator does not
seem to know what the exact problem is.

When posting data from a form it takes it to the php
file and prints out the value followed by the variable name followed by =
and the value again.

example code:
==========FORM FILE===========
Form Page:
< !-- CODE ON THIS PAGE -->
<FORM ACTION="testform.php" METHOD="post">
testval: <input type="text" NAME="testval">
<INPUT TYPE="submit">
</FORM>
< -- CODE ENDS -- >
==========TESTFORM.PHP========
testform.php file:
<?php
echo $testval;
?>
==============================
When inputing something like the word test
the resulting printed value on the testform.php is:
Input: "test"

Output: "testtestval=test"
expecteed output should simply be: "test"

Here is the same script in operation on the server and you can see what its
output is: http://www.lara.on.ca/~travis/

This problem is driving me crazy since I have some projects needed to be
completed but this is holding me
back on severl pages. It has to do with how form data is being handled by
the server I believe because it works
when do a URL?testval=test and such but not when from a form.

PLEASE HELP!!
Thank you.

 
 
 

Form posting problem and post data issue

Post by Pollu » Sun, 26 Jan 2003 11:46:14


Hi,

I tried it on my apache/php server and I get the usual result:

Page1: (test.php3)

<FORM ACTION="testform.php3" METHOD="post">
testval: <input type="text" NAME="testval"><BR>
<INPUT TYPE="submit">
</FORM>

<  !-- CODE ON THIS PAGE --><BR><BR>
<_ FORM ACTION="testform.php" METHOD="post" _><BR>
testval: <_input type="text" NAME="testval"_><_BR_><BR>
<_INPUT TYPE="submit"_><BR>
<_/FORM_><BR><BR>
< -- CODE ENDS -- >

</BODY>
</HTML>

Page2: (testform.php3)

<?php
echo $testval
?>

When I input test I just get "test" as response (as it should of course).

There must be something wrong with either your browser or your compilation
of apache/php I guess. If your admin is not supportive. Just compile
apache/php (uses ./configure --help to get the options and look on the php
site for instructions) under your own account then start it on a non
privileged port. If that works show your admin the results. If it doesn't
give correct results, maybe it is your browser that gives problems?

Good luck.

Regards, pollux


Quote:> Hello I am having a strange problem. The servers at my work were recently
> upgraded to redhat 8.0 and the appache I think is handling form post data
> differently.
> I think its a configuration setting or something but the server
> administrator does not
> seem to know what the exact problem is.

> When posting data from a form it takes it to the php
> file and prints out the value followed by the variable name followed by =
> and the value again.

> example code:
> ==========FORM FILE===========
> Form Page:
> < !-- CODE ON THIS PAGE -->
> <FORM ACTION="testform.php" METHOD="post">
> testval: <input type="text" NAME="testval">
> <INPUT TYPE="submit">
> </FORM>
> < -- CODE ENDS -- >
> ==========TESTFORM.PHP========
> testform.php file:
> <?php
> echo $testval;
> ?>
> ==============================
> When inputing something like the word test
> the resulting printed value on the testform.php is:
> Input: "test"

> Output: "testtestval=test"
> expecteed output should simply be: "test"

> Here is the same script in operation on the server and you can see what
its
> output is: http://www.lara.on.ca/~travis/

> This problem is driving me crazy since I have some projects needed to be
> completed but this is holding me
> back on severl pages. It has to do with how form data is being handled by
> the server I believe because it works
> when do a URL?testval=test and such but not when from a form.

> PLEASE HELP!!
> Thank you.


 
 
 

Form posting problem and post data issue

Post by Blah Gu » Sun, 26 Jan 2003 13:16:54


Its not the browser I have tried on 5 systems at the office. And I have my
Apache installed here
and php just default install and it works fine. Same versions at work. They
must have done something different
at the office. Its causing one hell of a headache. I get the normal results
when I run the code on my home
system but at work its a different story. The admin says it must be the new
method Apache handles Form
data or PHP handles form data but I dont think they will ever change the
standard methods as it would cause
havoc.

I want to know where to look for the config that does this. Cant take the
server down or recompile as it
would cause a downtime and we have hundreds of sites running on it.


> Hi,

> I tried it on my apache/php server and I get the usual result:

> Page1: (test.php3)

> <FORM ACTION="testform.php3" METHOD="post">
> testval: <input type="text" NAME="testval"><BR>
> <INPUT TYPE="submit">
> </FORM>

> <  !-- CODE ON THIS PAGE --><BR><BR>
> <_ FORM ACTION="testform.php" METHOD="post" _><BR>
> testval: <_input type="text" NAME="testval"_><_BR_><BR>
> <_INPUT TYPE="submit"_><BR>
> <_/FORM_><BR><BR>
> < -- CODE ENDS -- >

> </BODY>
> </HTML>

> Page2: (testform.php3)

> <?php
> echo $testval
> ?>

> When I input test I just get "test" as response (as it should of course).

> There must be something wrong with either your browser or your compilation
> of apache/php I guess. If your admin is not supportive. Just compile
> apache/php (uses ./configure --help to get the options and look on the php
> site for instructions) under your own account then start it on a non
> privileged port. If that works show your admin the results. If it doesn't
> give correct results, maybe it is your browser that gives problems?

> Good luck.

> Regards, pollux



> > Hello I am having a strange problem. The servers at my work were
recently
> > upgraded to redhat 8.0 and the appache I think is handling form post
data
> > differently.
> > I think its a configuration setting or something but the server
> > administrator does not
> > seem to know what the exact problem is.

> > When posting data from a form it takes it to the php
> > file and prints out the value followed by the variable name followed by
=
> > and the value again.

> > example code:
> > ==========FORM FILE===========
> > Form Page:
> > < !-- CODE ON THIS PAGE -->
> > <FORM ACTION="testform.php" METHOD="post">
> > testval: <input type="text" NAME="testval">
> > <INPUT TYPE="submit">
> > </FORM>
> > < -- CODE ENDS -- >
> > ==========TESTFORM.PHP========
> > testform.php file:
> > <?php
> > echo $testval;
> > ?>
> > ==============================
> > When inputing something like the word test
> > the resulting printed value on the testform.php is:
> > Input: "test"

> > Output: "testtestval=test"
> > expecteed output should simply be: "test"

> > Here is the same script in operation on the server and you can see what
> its
> > output is: http://www.lara.on.ca/~travis/

> > This problem is driving me crazy since I have some projects needed to be
> > completed but this is holding me
> > back on severl pages. It has to do with how form data is being handled
by
> > the server I believe because it works
> > when do a URL?testval=test and such but not when from a form.

> > PLEASE HELP!!
> > Thank you.

 
 
 

Form posting problem and post data issue

Post by Richard Hocke » Sun, 26 Jan 2003 14:37:23


might be the settings in php.ini:

; - register_globals = Off         [Security, Performance]
;     Global variables are no longer registered for input data (POST, GET,
cookies,
;     environment and other server variables).  Instead of using $foo, you
must use
;     you can use $_REQUEST["foo"] (includes any variable that arrives
through the
;     request, namely, POST, GET and cookie variables), or use one of the
specific
;     $_GET["foo"], $_POST["foo"], $_COOKIE["foo"] or $_FILES["foo"],
depending
;     on where the input originates.  Also, you can look at the
;     import_request_variables() function.

(pertinent excerpt from the php.ini for php 4.3)

try $_POST["test"] instead of $test


> Its not the browser I have tried on 5 systems at the office. And I have my
> Apache installed here
> and php just default install and it works fine. Same versions at work.
They
> must have done something different
> at the office. Its causing one hell of a headache. I get the normal
results
> when I run the code on my home
> system but at work its a different story. The admin says it must be the
new
> method Apache handles Form
> data or PHP handles form data but I dont think they will ever change the
> standard methods as it would cause
> havoc.

> I want to know where to look for the config that does this. Cant take the
> server down or recompile as it
> would cause a downtime and we have hundreds of sites running on it.



> > Hi,

> > I tried it on my apache/php server and I get the usual result:

> > Page1: (test.php3)

> > <FORM ACTION="testform.php3" METHOD="post">
> > testval: <input type="text" NAME="testval"><BR>
> > <INPUT TYPE="submit">
> > </FORM>

> > <  !-- CODE ON THIS PAGE --><BR><BR>
> > <_ FORM ACTION="testform.php" METHOD="post" _><BR>
> > testval: <_input type="text" NAME="testval"_><_BR_><BR>
> > <_INPUT TYPE="submit"_><BR>
> > <_/FORM_><BR><BR>
> > < -- CODE ENDS -- >

> > </BODY>
> > </HTML>

> > Page2: (testform.php3)

> > <?php
> > echo $testval
> > ?>

> > When I input test I just get "test" as response (as it should of
course).

> > There must be something wrong with either your browser or your
compilation
> > of apache/php I guess. If your admin is not supportive. Just compile
> > apache/php (uses ./configure --help to get the options and look on the
php
> > site for instructions) under your own account then start it on a non
> > privileged port. If that works show your admin the results. If it
doesn't
> > give correct results, maybe it is your browser that gives problems?

> > Good luck.

> > Regards, pollux



> > > Hello I am having a strange problem. The servers at my work were
> recently
> > > upgraded to redhat 8.0 and the appache I think is handling form post
> data
> > > differently.
> > > I think its a configuration setting or something but the server
> > > administrator does not
> > > seem to know what the exact problem is.

> > > When posting data from a form it takes it to the php
> > > file and prints out the value followed by the variable name followed
by
> =
> > > and the value again.

> > > example code:
> > > ==========FORM FILE===========
> > > Form Page:
> > > < !-- CODE ON THIS PAGE -->
> > > <FORM ACTION="testform.php" METHOD="post">
> > > testval: <input type="text" NAME="testval">
> > > <INPUT TYPE="submit">
> > > </FORM>
> > > < -- CODE ENDS -- >
> > > ==========TESTFORM.PHP========
> > > testform.php file:
> > > <?php
> > > echo $testval;
> > > ?>
> > > ==============================
> > > When inputing something like the word test
> > > the resulting printed value on the testform.php is:
> > > Input: "test"

> > > Output: "testtestval=test"
> > > expecteed output should simply be: "test"

> > > Here is the same script in operation on the server and you can see
what
> > its
> > > output is: http://www.lara.on.ca/~travis/

> > > This problem is driving me crazy since I have some projects needed to
be
> > > completed but this is holding me
> > > back on severl pages. It has to do with how form data is being handled
> by
> > > the server I believe because it works
> > > when do a URL?testval=test and such but not when from a form.

> > > PLEASE HELP!!
> > > Thank you.

 
 
 

Form posting problem and post data issue

Post by Jaso » Sun, 26 Jan 2003 14:34:22


What happens with $_POST['testval']? Dunno if I'm helping. :)
 
 
 

Form posting problem and post data issue

Post by Blah Gu » Mon, 27 Jan 2003 01:16:45


Global Vars are turned On so I dont think using the $_POST['testval'] is
going to work but I will try it.


Quote:> What happens with $_POST['testval']? Dunno if I'm helping. :)

 
 
 

Form posting problem and post data issue

Post by Jaron » Mon, 27 Jan 2003 05:58:21


The date was Fri, 24 Jan 2003 20:25:54 -0500, and "Blah Guy"

<snip>

Quote:>Output: "testtestval=test"
>expecteed output should simply be: "test"

>Here is the same script in operation on the server and you can see what its
>output is: http://www.lara.on.ca/~travis/

</snip>

When I went to the url listed above and tried entering a value, the
result on the next page was the exact value I entered., not
"testtestval=test."  (I used the value "test" by the way.)

In other words, looks likey our problem has been fixed somehow some
way.

~Jaron

"We must find out what words are and how they
function.  They become images when written down,
but images of the word repeated in the mind, and
not of the thing itself."  ~William S. Burroughs

 
 
 

Form posting problem and post data issue

Post by Blah Gu » Mon, 27 Jan 2003 07:47:44


Thats my fault. I switched method to get as you can see by the URL. When its
set to post it causes
testtestval=test



> The date was Fri, 24 Jan 2003 20:25:54 -0500, and "Blah Guy"

> <snip>
> >Output: "testtestval=test"
> >expecteed output should simply be: "test"

> >Here is the same script in operation on the server and you can see what
its
> >output is: http://www.lara.on.ca/~travis/

> </snip>

> When I went to the url listed above and tried entering a value, the
> result on the next page was the exact value I entered., not
> "testtestval=test."  (I used the value "test" by the way.)

> In other words, looks likey our problem has been fixed somehow some
> way.

> ~Jaron

> "We must find out what words are and how they
> function.  They become images when written down,
> but images of the word repeated in the mind, and
> not of the thing itself."  ~William S. Burroughs

 
 
 

Form posting problem and post data issue

Post by Pollu » Mon, 27 Jan 2003 10:36:10


Hi,

There really is no downtime if you compile it using your own account. I have
my own php/mysql/apache server running in paralel with some other developer
running on the same machine.

Just download http://www.php.net and http://www.apache.org  Then use
./configure --exec-path=/home/<your account goese here>/apache

See the instructions on php. Make sure you use a port like 2505 (higher than
one of the privileged port) or something. Connect to it through http://<your
website>:2505

You can run a webserver under your own account without interupting
production.

If you need extra help just let me know.

Regards, pollux.


> Its not the browser I have tried on 5 systems at the office. And I have my
> Apache installed here
> and php just default install and it works fine. Same versions at work.
They
> must have done something different
> at the office. Its causing one hell of a headache. I get the normal
results
> when I run the code on my home
> system but at work its a different story. The admin says it must be the
new
> method Apache handles Form
> data or PHP handles form data but I dont think they will ever change the
> standard methods as it would cause
> havoc.

> I want to know where to look for the config that does this. Cant take the
> server down or recompile as it
> would cause a downtime and we have hundreds of sites running on it.



> > Hi,

> > I tried it on my apache/php server and I get the usual result:

> > Page1: (test.php3)

> > <FORM ACTION="testform.php3" METHOD="post">
> > testval: <input type="text" NAME="testval"><BR>
> > <INPUT TYPE="submit">
> > </FORM>

> > <  !-- CODE ON THIS PAGE --><BR><BR>
> > <_ FORM ACTION="testform.php" METHOD="post" _><BR>
> > testval: <_input type="text" NAME="testval"_><_BR_><BR>
> > <_INPUT TYPE="submit"_><BR>
> > <_/FORM_><BR><BR>
> > < -- CODE ENDS -- >

> > </BODY>
> > </HTML>

> > Page2: (testform.php3)

> > <?php
> > echo $testval
> > ?>

> > When I input test I just get "test" as response (as it should of
course).

> > There must be something wrong with either your browser or your
compilation
> > of apache/php I guess. If your admin is not supportive. Just compile
> > apache/php (uses ./configure --help to get the options and look on the
php
> > site for instructions) under your own account then start it on a non
> > privileged port. If that works show your admin the results. If it
doesn't
> > give correct results, maybe it is your browser that gives problems?

> > Good luck.

> > Regards, pollux



> > > Hello I am having a strange problem. The servers at my work were
> recently
> > > upgraded to redhat 8.0 and the appache I think is handling form post
> data
> > > differently.
> > > I think its a configuration setting or something but the server
> > > administrator does not
> > > seem to know what the exact problem is.

> > > When posting data from a form it takes it to the php
> > > file and prints out the value followed by the variable name followed
by
> =
> > > and the value again.

> > > example code:
> > > ==========FORM FILE===========
> > > Form Page:
> > > < !-- CODE ON THIS PAGE -->
> > > <FORM ACTION="testform.php" METHOD="post">
> > > testval: <input type="text" NAME="testval">
> > > <INPUT TYPE="submit">
> > > </FORM>
> > > < -- CODE ENDS -- >
> > > ==========TESTFORM.PHP========
> > > testform.php file:
> > > <?php
> > > echo $testval;
> > > ?>
> > > ==============================
> > > When inputing something like the word test
> > > the resulting printed value on the testform.php is:
> > > Input: "test"

> > > Output: "testtestval=test"
> > > expecteed output should simply be: "test"

> > > Here is the same script in operation on the server and you can see
what
> > its
> > > output is: http://www.lara.on.ca/~travis/

> > > This problem is driving me crazy since I have some projects needed to
be
> > > completed but this is holding me
> > > back on severl pages. It has to do with how form data is being handled
> by
> > > the server I believe because it works
> > > when do a URL?testval=test and such but not when from a form.

> > > PLEASE HELP!!
> > > Thank you.

 
 
 

Form posting problem and post data issue

Post by Jaron » Mon, 27 Jan 2003 12:17:45


The date was Sat, 25 Jan 2003 17:47:44 -0500, and "Blah Guy"

Quote:>Thats my fault. I switched method to get as you can see by the URL. When its
>set to post it causes
>testtestval=test

When I use the code you posted in the start of this thread, I get the
error

Notice: Undefined variable: testval in C:\Inetpub\wwwroot\testform.php
on line 2

Does anyone know what's going wrong in my case?

~Jaron

"We must find out what words are and how they
function.  They become images when written down,
but images of the word repeated in the mind, and
not of the thing itself."  ~William S. Burroughs