473,396 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Register Globals and Submit Buttons

We have developed an application with register_globals "On" and are
now trying to convert it to run under "Off".

I understand that a text field previously referred to as txtText must
now be referred to as $_POST['txtText'].

The problem we are hitting is with the PHP code that runs when a
submit button is clicked. The application currently looks like this:

<input type="submit" value="Submit" name="cmdButton">
<input type="text" name="txtText" size="20" value="testing">

<?php

if ($cmdButton)
{
echo "Text Value: ".$_POST['txtText'];
}

?>

This works great with register_globals "On", but when "Off", it is not
invoked when the button is clicked.

Any suggestions?
Jul 17 '05 #1
3 1600
On 28 Jul 2004 13:16:44 -0700, hi***********@yahoo.com (Mark) wrote:
We have developed an application with register_globals "On" and are
now trying to convert it to run under "Off".

I understand that a text field previously referred to as txtText must
now be referred to as $_POST['txtText'].

The problem we are hitting is with the PHP code that runs when a
submit button is clicked. The application currently looks like this:

<input type="submit" value="Submit" name="cmdButton">
<input type="text" name="txtText" size="20" value="testing">

<?php

if ($cmdButton)
{
echo "Text Value: ".$_POST['txtText'];
}

?>

This works great with register_globals "On", but when "Off", it is not
invoked when the button is clicked.

Any suggestions?


Exactly the same applies. $cmdButton becomes $_POST['cmdButton'].

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space
Jul 17 '05 #2
Mark wrote:
We have developed an application with register_globals "On" and are
now trying to convert it to run under "Off".

I understand that a text field previously referred to as txtText must
now be referred to as $_POST['txtText'].

The problem we are hitting is with the PHP code that runs when a
submit button is clicked. The application currently looks like this:

<input type="submit" value="Submit" name="cmdButton">
<input type="text" name="txtText" size="20" value="testing">

<?php

if ($cmdButton)
{
echo "Text Value: ".$_POST['txtText'];
}

?>

This works great with register_globals "On", but when "Off", it is not
invoked when the button is clicked.

Any suggestions?


if($_POST['cmdButton'])
{
echo "Text Value: ".$_POST['txtText'];
}

or am I missing something?

Also, to avoid a notice it should be isset($_POST['cmdButton'])
Jul 17 '05 #3
>We have developed an application with register_globals "On" and are
now trying to convert it to run under "Off".

I understand that a text field previously referred to as txtText must
now be referred to as $_POST['txtText'].
Guess what? This refers to all the other variables you get from
a page, too.
The problem we are hitting is with the PHP code that runs when a
submit button is clicked. The application currently looks like this:

<input type="submit" value="Submit" name="cmdButton">
<input type="text" name="txtText" size="20" value="testing">

<?php

if ($cmdButton)
{
echo "Text Value: ".$_POST['txtText'];
}

?>

This works great with register_globals "On", but when "Off", it is not
invoked when the button is clicked.

Any suggestions?


$_POST['cmdButton']

Gordon L. Burditt
Jul 17 '05 #4

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

Similar topics

1
by: Nel | last post by:
I have a question related to the "security" issues posed by Globals ON. It is good programming technique IMO to initialise variables, even if it's just $foo = 0; $bar = ""; Surely it would...
1
by: Manu J | last post by:
Hi, i have a login script which makes use of sessions. Login script *********** session_start() ..... ..... ....
1
by: yawnmoth | last post by:
even though register globals is disabled by default, i'm currious as to how it and magic quotes interact. consider the following code: <? // assuming $_GET='"test"' and register globals enabled...
6
by: Paddy | last post by:
Hi, I got tripped up on the way eval works with respect to modules and so wrote a test. It seems that a function carries around knowledge of the globals() present when it was defined. (The...
1
by: G Kannan | last post by:
Hey all! I have written a perl script to retrieve information from a HTML Form and insert the data into an Oracle database table. I am gettting the the following error message: "Use of...
4
by: Bob Lehmann | last post by:
Hi, I pretty sure I've seen this problem addressed before, but I can't find any references. The short story is that I have I have multiple submit buttons on a page, each providing different...
9
by: Poker Man | last post by:
Hi, I know how to do Sumbit buttons in Forms, and I know how to do custom buttons in Javascript. What I can't seem to find is how to do custom Submit buttons using Javascript! Anybody out...
1
by: Bill_W_Stephens | last post by:
I have a complicated page with several submit buttons. I don't want to create multiple forms because much of the input is shared and the code is getting very ugly. However I would like to determine...
5
by: Alex | last post by:
Hello, I hope I can explain this properly. I'm writing an application with a tabbed-based navigation, and a form which gets filled out by users will be split into 5 subtabs. What I need is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.