473,703 Members | 2,542 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problems with POST

Hi,

The script below *used* to work. I have only just set up a
server, PHP etc again on my Win98 system and now it doesn't?

On first loading this page, you would have

$p =

and the button image below it.
On clicking the button the same page would reload but pass the hidden values
(r=w & p=f)
so that the first line of the page would then have

$p = f

This no longer works???

<?php
echo "<html><bod y>";
echo "\$p = $p<br><br>"; //###
$str = <<<HTM
<head>
</head>
<body>
<form action="" method="post">
<input type="hidden" name="r" value="w">
<input type="hidden" name="p" value="f">
<input type="image" src="http://home/images/faq-up.gif" border="0"
height="22" width="77">
</form>
</body>
</html>
HTM;
echo $str;
?>
on printing the $_ENV variables along with the the above script I find the
following :

QUERY_METHOD POST
REQUEST_METHOD POST
FORM_P f
FORM_R w

Is there something I haven't enabled in my
setup of PHP that is stopping this from working now?

Or has something changed with PHP, so that I have to do this another way?

many thanks

mori

Nov 27 '05 #1
24 2876
>The script below *used* to work. I have only just set up a
server, PHP etc again on my Win98 system and now it doesn't?
A variable passed from HTML by the POST method is $_POST['r'] or
$_POST['p'], *not* $r or $p. (Also see $_GET for variables
passed by the GET method). Fix your script. Do not turn
on "register_globa ls".

Gordon L. Burditt


On first loading this page, you would have

$p =

and the button image below it.
On clicking the button the same page would reload but pass the hidden values
(r=w & p=f)
so that the first line of the page would then have

$p = f

This no longer works???

<?php
echo "<html><bod y>";
echo "\$p = $p<br><br>"; //###
$str = <<<HTM
<head>
</head>
<body>
<form action="" method="post">
<input type="hidden" name="r" value="w">
<input type="hidden" name="p" value="f">
<input type="image" src="http://home/images/faq-up.gif" border="0"
height="22" width="77">
</form>
</body>
</html>
HTM;
echo $str;
?>
on printing the $_ENV variables along with the the above script I find the
following :

QUERY_METHOD POST
REQUEST_METH OD POST
FORM_P f
FORM_R w

Is there something I haven't enabled in my
setup of PHP that is stopping this from working now?

Or has something changed with PHP, so that I have to do this another way?

many thanks

mori

Nov 27 '05 #2
wow, thx for the *very* quick reply ;-)

tried changing the
echo "\$p = $p<br><br>";

to

echo "\$p = " . $_POST['p'] . "<br><br>";

but still not working :(

mori

"Gordon Burditt" <go***********@ burditt.org> wrote in message
news:11******** *****@corp.supe rnews.com...
The script below *used* to work. I have only just set up a
server, PHP etc again on my Win98 system and now it doesn't?


A variable passed from HTML by the POST method is $_POST['r'] or
$_POST['p'], *not* $r or $p. (Also see $_GET for variables
passed by the GET method). Fix your script. Do not turn
on "register_globa ls".

Gordon L. Burditt


On first loading this page, you would have

$p =

and the button image below it.
On clicking the button the same page would reload but pass the hidden values(r=w & p=f)
so that the first line of the page would then have

$p = f

This no longer works???

<?php
echo "<html><bod y>";
echo "\$p = $p<br><br>"; //###
$str = <<<HTM
<head>
</head>
<body>
<form action="" method="post">
<input type="hidden" name="r" value="w">
<input type="hidden" name="p" value="f">
<input type="image" src="http://home/images/faq-up.gif" border="0"
height="22" width="77">
</form>
</body>
</html>
HTM;
echo $str;
?>
on printing the $_ENV variables along with the the above script I find thefollowing :

QUERY_METHOD POST
REQUEST_METH OD POST
FORM_P f
FORM_R w

Is there something I haven't enabled in my
setup of PHP that is stopping this from working now?

Or has something changed with PHP, so that I have to do this another way?

many thanks

mori


Nov 27 '05 #3
Don't know much about PHP, but it does appear you are sending "<body>"
twice, once in line 2 and once in line 7. The one in line 2 should be
deleted so the "<head>" section of the page comes first. Or you need to
rearrange the order of your statements.

Nov 27 '05 #4

"PeteY48" <pe********@gma il.com> wrote in message
news:11******** *************@z 14g2000cwz.goog legroups.com...
Don't know much about PHP, but it does appear you are sending "<body>"
twice, once in line 2 and once in line 7. The one in line 2 should be
deleted so the "<head>" section of the page comes first. Or you need to
rearrange the order of your statements.


Yes, you are right about the double <head>, this was due to shortening the
script and missing this repeat.
However, this makes absolutely no difference to the operation of the script.
Nov 28 '05 #5
moriman wrote:
wow, thx for the *very* quick reply ;-)

tried changing the
echo "\$p = $p<br><br>";

to

echo "\$p = " . $_POST['p'] . "<br><br>";

but still not working :(

mori

"Gordon Burditt" <go***********@ burditt.org> wrote in message
news:11******** *****@corp.supe rnews.com...
The script below *used* to work. I have only just set up a
server, PHP etc again on my Win98 system and now it doesn't?


A variable passed from HTML by the POST method is $_POST['r'] or
$_POST['p'], *not* $r or $p. (Also see $_GET for variables
passed by the GET method). Fix your script. Do not turn
on "register_globa ls".

Gordon L. Burditt
On first loading this page, you would have

$p =

and the button image below it.
On clicking the button the same page would reload but pass the hidden
values
(r=w & p=f)
so that the first line of the page would then have

$p = f

This no longer works???

<?php
echo "<html><bod y>";
echo "\$p = $p<br><br>"; //###
$str = <<<HTM
<head>
</head>
<body>
<form action="" method="post">
<input type="hidden" name="r" value="w">
<input type="hidden" name="p" value="f">
<input type="image" src="http://home/images/faq-up.gif" border="0"
height="22 " width="77">
</form>
</body>
</html>
HTM;
echo $str;
?>
on printing the $_ENV variables along with the the above script I find
the
following :

QUERY_METH OD POST
REQUEST_METH OD POST
FORM_P f
FORM_R w

Is there something I haven't enabled in my
setup of PHP that is stopping this from working now?

Or has something changed with PHP, so that I have to do this another way?

many thanks

mori




Try:

echo "\$p = " . $HTTP_POST_VARS['p'] . "<br><br>";
Nov 28 '05 #6

"Juliette" <jr*********@jo keaday.net> wrote in message
news:43******** *************** @news.wanadoo.n l...
moriman wrote:
wow, thx for the *very* quick reply ;-)

tried changing the
echo "\$p = $p<br><br>";

to

echo "\$p = " . $_POST['p'] . "<br><br>";

but still not working :(

mori

"Gordon Burditt" <go***********@ burditt.org> wrote in message
news:11******** *****@corp.supe rnews.com...
The script below *used* to work. I have only just set up a
server, PHP etc again on my Win98 system and now it doesn't?

A variable passed from HTML by the POST method is $_POST['r'] or
$_POST['p'], *not* $r or $p. (Also see $_GET for variables
passed by the GET method). Fix your script. Do not turn
on "register_globa ls".

Gordon L. Burditt

On first loading this page, you would have

$p =

and the button image below it.
On clicking the button the same page would reload but pass the hidden


values
(r=w & p=f)
so that the first line of the page would then have

$p = f

This no longer works???

<?php
echo "<html><bod y>";
echo "\$p = $p<br><br>"; //###
$str = <<<HTM
<head>
</head>
<body>
<form action="" method="post">
<input type="hidden" name="r" value="w">
<input type="hidden" name="p" value="f">
<input type="image" src="http://home/images/faq-up.gif" border="0"
height="22 " width="77">
</form>
</body>
</html>
HTM;
echo $str;
?>
on printing the $_ENV variables along with the the above script I find


the
following :

QUERY_METH OD POST
REQUEST_METH OD POST
FORM_P f
FORM_R w

Is there something I haven't enabled in my
setup of PHP that is stopping this from working now?

Or has something changed with PHP, so that I have to do this another way?
many thanks

mori




Try:

echo "\$p = " . $HTTP_POST_VARS['p'] . "<br><br>";


nope, doesn't work either :(
Nov 28 '05 #7


moriman wrote:
"Juliette" <jr*********@jo keaday.net> wrote in message
news:43******** *************** @news.wanadoo.n l...
moriman wrote:
wow, thx for the *very* quick reply ;-)

tried changing the
echo "\$p = $p<br><br>";

to

echo "\$p = " . $_POST['p'] . "<br><br>";

but still not working :(

mori

"Gordon Burditt" <go***********@ burditt.org> wrote in message
news:11******** *****@corp.supe rnews.com...

> The script below *used* to work. I have only just set up a
> server, PHP etc again on my Win98 system and now it doesn't?
A variable passed from HTML by the POST method is $_POST['r'] or
$_POST['p'], *not* $r or $p. (Also see $_GET for variables
passed by the GET method). Fix your script. Do not turn
on "register_globa ls".

Gordon L. Burditt

> On first loading this page, you would have
>
> $p =
>
> and the button image below it.
> On clicking the button the same page would reload but pass the hidden
values

> (r=w & p=f)
> so that the first line of the page would then have
>
> $p = f
>
> This no longer works???
>
> <?php
> echo "<html><bod y>";
> echo "\$p = $p<br><br>"; //###
> $str = <<<HTM
> <head>
> </head>
> <body>
> <form action="" method="post">
> <input type="hidden" name="r" value="w">
> <input type="hidden" name="p" value="f">
> <input type="image" src="http://home/images/faq-up.gif" border="0"
> height="22" width="77">
> </form>
> </body>
> </html>
> HTM;
> echo $str;
> ?>
>
>
> on printing the $_ENV variables along with the the above script I find
the

> following :
>
> QUERY_METHOD POST
> REQUEST_METHOD POST
> FORM_P f
> FORM_R w
>
> Is there something I haven't enabled in my
> setup of PHP that is stopping this from working now?
>
> Or has something changed with PHP, so that I have to do this another way?> many thanks
>
> mori
>
>
>

Try:

echo "\$p = " . $HTTP_POST_VARS['p'] . "<br><br>";


nope, doesn't work either :(


This will work, you have to set up an submit button
(javascript or nativ html to send your form data)

If you would like to have an image you should prefer JavaScript.
If a simple HTML - Button is enougth try the simple Submit Button like
in my example.
Have Fun...

<?php
echo "<html>";
echo "\$p = ".$_POST['p']."<br><br>"; //###
$str = <<<HTM
<head>
</head>
<body>
<form action="" method="post">
<input type="hidden" name="r" value="w">
<input type="hidden" name="p" value="f">
<input type="submit">
</form>
</body>
</html>
HTM;
echo $str;
?>
Nov 28 '05 #8
moriman wrote:
Hi,

The script below *used* to work. I have only just set up a
server, PHP etc again on my Win98 system and now it doesn't?

On first loading this page, you would have

$p =

and the button image below it.
On clicking the button the same page would reload but pass the hidden values
(r=w & p=f)
so that the first line of the page would then have

$p = f

This no longer works???

<?php
echo "<html><bod y>";
echo "\$p = $p<br><br>"; //###
$str = <<<HTM
<head>
</head>
<body>
<form action="" method="post">
<input type="hidden" name="r" value="w">
<input type="hidden" name="p" value="f">
<input type="image" src="http://home/images/faq-up.gif" border="0"
height="22" width="77">
</form>
</body>
</html>
HTM;
echo $str;
?>
on printing the $_ENV variables along with the the above script I find the
following :

QUERY_METHOD POST
REQUEST_METHOD POST
FORM_P f
FORM_R w

Is there something I haven't enabled in my
setup of PHP that is stopping this from working now?

Or has something changed with PHP, so that I have to do this another way?

many thanks

mori

How are you submitting your form? I don't see a submit button, for
instance.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Nov 28 '05 #9
vdP
Jerry Stuckle wrote:
moriman wrote:
<form action="" method="post">
<input type="hidden" name="r" value="w">
<input type="hidden" name="p" value="f">
<input type="image" src="http://home/images/faq-up.gif" border="0"
height="22" width="77">
</form>

How are you submitting your form? I don't see a submit button, for
instance.

I thought the same till I looked up the HTML-specification at
http://www.w3.org/TR/REC-html40/inte...ms.html#h-17.4
Apparently the input of image type serves as a submit button.

vdP
Nov 28 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
17411
by: jfixsen | last post by:
Hello! Oracle 9.2.0.4 SunOS pchi-db01 5.8 Generic_108528-19 sun4u sparc SUNW,Ultra-EnterpriseSystem = SunOS Node = pchi-db01 Release = 5.8 KernelID = Generic_108528-19 Machine = sun4u BusType = <unknown>
5
4604
by: Tyler Style | last post by:
Hullo - looking for a little advice here. I have a form on a page in one domain submitting to a cgi in another domain. Weirdly, on some Windows XP systems, a form on the page fails to submit/post properly to the cgi and users get the message from IE that it "Cannot find server: The page cannot be displayed The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to...
1
2206
by: Henry Reardon | last post by:
I'm having some migration problems. On Friday, I upgraded from DB2 7.2 (FP9) to DB2 8.2 (FP7), then applied Fixpack 8. I'm running Windows XP. My migrations did not work and I am trying to fix them manually. The Control Center gives me SQL0535 for some of the databases and SQL1039C for the others. I'll describe the SQL0535 problems in this note and make a separate post for SQL1039C.
10
2408
by: BBFrost | last post by:
We just recently moved one of our major c# apps from VS Net 2002 to VS Net 2003. At first things were looking ok, now problems are starting to appear. So far ... (1) ComboBox.SelectedValue = db_value; If the db_value was not included in the ComboBox value list the ComboBox.SelectedIndex used to return -1, Now the very same code is
19
2976
by: Dales | last post by:
I have a custom control that builds what we refer to as "Formlets" around some content in a page. These are basically content "wrapper" sections that are tables that have a colored header and provide an open TD with a DIV in it for the content of this formlet. (The DIV is for DHTML to hide and show the content) I've created a web page showing step by step the two problems I'm encountering. This problem is much easier to see than it...
17
2482
by: Lloyd Sheen | last post by:
This IDE is driving me nuts. I needed another button so I copied an existing one, changed the Text and the id and position by drag and drop. Well then I run and get the following: Control 'Button19' of type 'Button' must be placed inside a form tag with runat=server Can the IDE not do what it is supposed to do. It seems that it is a fight to make it do anything or did I do something wrong? It would seem silly to have to create a...
10
19168
by: Danny | last post by:
Hi all, I am having some odd problems with AJAX on Firefox (1.5). When I use GET as the request method everything works ok, but when I do a POST the remote function doesn't get the parameters I am passing to it. Everything works fine on IE 6. Here's a couple samples of what I am doing: // using GET url = 'http://www.myserver.com/cgi-bin/funct?key1=value1&key2=value2'
71
19109
by: desktop | last post by:
I have read in Bjarne Stroustrup that using malloc and free should be avoided in C++ because they deal with uninitialized memory and one should instead use new and delete. But why is that a problem? I cannot see why using malloc instead of new does not give the same result.
3
1381
Mobius Evalon
by: Mobius Evalon | last post by:
I've been staring at this problem and stabbing in the dark at it for a few hours now, and I've finally broken down to the point where I realize I need some help. I'm absolutely positioning most of the elements on my site, found here: http://mobiusevalon.tibbius.com/tibbius/ I'm having problems with the post information displayed at the top left of each post div. The first set appear where they're supposed to, but each consequent post...
34
5351
by: Alexnb | last post by:
Gerhard Häring wrote: No, it didn't work, but it gave me some interesting feedback when I ran it in the shell. Heres what it told me: Traceback (most recent call last): File "<pyshell#10>", line 1, in <module> os.startfile("C:\Documents and Settings\Alex\My Documents\My
0
8756
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8667
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9251
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9014
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7861
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4429
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3122
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2446
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2063
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.