[thelist] php: problem with variable

Michael Galvin mpgalvin at eircom.net
Wed Jan 23 12:32:26 CST 2002


I didn't know about the register_globals until I read it on thelist (as I
said, I'm a complete newbie), but the way I'm reading the manual, if this is
OFF, then all 'environment' variables (EGPCS) are basically no longer
available (I have to use $HTTP_... to get them).  Since it's ON by default,
I can't see how that is the answer to my problem.  And pretty much to prove
my point, I turned if off, and the variables posted by the form were no
longer available.

Basically, the php file is checking the 'existance' of $submit.  If it
doesn't exist, it assumes that the user hasn't 'submitted' anything yet, and
shows the form.  If it does, then it does the actual processing of the form.

At this point, I'm pretty much ready to give up on the project (and find one
a little more up to date out there to mess on).  I figure I could split the
.php file, one file to show the form, then post to the other to process.
But, as I said, coming from an ASP background, I would have normally used 1
file for form generation and processing - I was just kinda hoping it was
still possible to do that using php.

BTW, quick question: if I make a change to the .ini file in Win98/PWS, can I
just restart PWS, or is there more I have to do?

Michael

----- Original Message -----
From: "Chris Blessing" <webguy at mail.rit.edu>
To: <thelist at lists.evolt.org>
Sent: Wednesday, January 23, 2002 6:18 PM
Subject: RE: [thelist] php: problem with variable


| Michael-
|
| I may have missed it already, but did you check to see that
register_globals
| was turned on in your php.ini conf?
|
| If the name is set in the form there is no other reason you shouldn't see
it
| immediately once it has been submitted.
|
| Chris Blessing
| webguy at mail.rit.edu
| http://www.330i.net
|
| > -----Original Message-----
| > From: thelist-admin at lists.evolt.org
| > [mailto:thelist-admin at lists.evolt.org]On Behalf Of Michael Galvin
| > Sent: Wednesday, January 23, 2002 9:57 AM
| > To: thelist at lists.evolt.org
| > Subject: Re: [thelist] php: problem with variable
| >
| >
| > Chris/Mark
| >
| > Both the name and type are "submit".  I understand about the hidden
value
| > (and indeed if I were using ASP, that's the way I'd do it), but I'd
still
| > have the same problem, in that if I set a hidden field 'test', then
$test
| > would still be an undefined variable the first time I enter the form.
| >
| > I guess Jason's "if (!isset($_POST['submitted']))" is the best
| > way to do it.
| > Seems a little strange.  Was I correct in assuming that undefined
| > variables
| > are a fairly recent addition to the php stable?
| >
| > ----- Original Message -----
| > From: "Chris Blessing" <webguy at mail.rit.edu>
| > To: <thelist at lists.evolt.org>
| > Sent: Wednesday, January 23, 2002 2:50 PM
| > Subject: RE: [thelist] php: problem with variable
| >
| >
| > | Hi Michael-
| > |
| > | Are you certain that the submit button is named "submit" and that the
| > "type"
| > | attribute for that element isn't what you were looking at?
| > |
| > | I try not to use that technique anyhow.  You can do some other
| > things like
| > | add an "action" hidden input to your form (this is what I
| > usually do) that
| > | says something more intuitive like "processEmail" and then
| > check for that
| > to
| > | see if you actually process the form or display it (I just
| > prefer this to
| > | checking for a button).
| > |
| > | Chris Blessing
| > | webguy at mail.rit.edu
| > | http://www.330i.net
| > |
| > | > Now I'm having some trouble with what appears to be undefined
| > variables,
| > | > which I assume didn't cause much of a problem in whichever version
of
| > php
| > | > this was originally written.
| > | >
| > | > I have an add.php which submits a form to itself.  So the
| > first thing it
| > | > does is check for a variable called '$submit' which is the
| > value of the
| > | > submit button.  If this is empty, it creates the form.  If not,
| > | > it does some
| > | > other stuff (not important).
| > |
| > |
| > | --
| > | For unsubscribe and other options, including
| > | the Tip Harvester and archive of TheList go to:
| > | http://lists.evolt.org Workers of the Web, evolt !
| > |
| > |
| >
| >
| > --
| > For unsubscribe and other options, including
| > the Tip Harvester and archive of TheList go to:
| > http://lists.evolt.org Workers of the Web, evolt !
|
|
| --
| For unsubscribe and other options, including
| the Tip Harvester and archive of TheList go to:
| http://lists.evolt.org Workers of the Web, evolt !
|
|





More information about the thelist mailing list