I have installed php v5 on a windowsXP PC. Server is Apache 2.2.
Even though I have turned register globals on in the ini file,
> the php is still not allowing the use of $HTTP_GET_VARS (and probably
other similier variables), and I am having to change my existing script
> to $_GET before they
You're using the wrong option.
Register globals is for the auto-creation of variables passed through
GET, POST, etc.
What you want is register_long_vars (or something like that, long
variables, long arrays...)
Chris
Rodney Courtis wrote:
Hi
I have installed php v5 on a windowsXP PC. Serv
At 12:55 PM +0100 9/12/06, Ford, Mike wrote:
Correction:
$_GET - any parameters passed in the GET string.
$_POST - any parameters passed in the body of a POST query.
$_COOKIE - Any values sent by the browser as a cookie.
$_REQUEST - The *three* above merged.
I'm not sure whether $_REQUE
On 12 September 2006 08:18, Larry Garfield wrote:
[...]
>
> In any vaguely recent version of PHP, you get five super-global array
> variables:
>
> $_GET - any parameters passed in the GET string.
> $_POST - any parameters passed in the body of a POST query.
> $_REQUEST - The two above merged.
correction: $GLOBALS not $_GLOBAL
:)
cheers
On 9/12/06, J R <[EMAIL PROTECTED]> wrote:
there are many ways you can keep information.
now if you must really use global. you can still use global even if the
server is set to global off by using $_GLOBAL or using globals decleration.
example:
$
there are many ways you can keep information.
now if you must really use global. you can still use global even if the
server is set to global off by using $_GLOBAL or using globals decleration.
example:
$test = 'i'm global';
function f1()
{
echo $_GLOBAL['test']; // should display i'm global
Zbigniew Szalbot wrote:
Hello again,
On Tue, 12 Sep 2006, Chris wrote:
I thought I would ask your opinion before we make any decision. Is it
really so that without register globals, such things as displaying
information from databases based on the initial choice of languages is not
an option?
On Tuesday 12 September 2006 01:16, Zbigniew Szalbot wrote:
> Hello again,
>
> Can I ask a general question? One of the website that we have built was
> constructed using register globals. Thanks to that we set the language for
> browsing the website by determining user's browser language and then
Hello again,
On Tue, 12 Sep 2006, Chris wrote:
> > I thought I would ask your opinion before we make any decision. Is it
> > really so that without register globals, such things as displaying
> > information from databases based on the initial choice of languages is not
> > an option? I am not a
Zbigniew Szalbot wrote:
Hello again,
Can I ask a general question? One of the website that we have built was
constructed using register globals. Thanks to that we set the language for
browsing the website by determining user's browser language and then also
(I think) it is used to remember some
On 11/8/05 10:20 PM, Richard Lynch wrote:
I change this line to:
mail($to, stripslashes($_POST["subject"]), wordwrap($_POST["message"],
60), "From: $_POST["from"]\r\n");
"From: $_POST[from]\r\n"
No quotes.
No apostrophes.
Nothin but index.
You can also use curly braces:
"From: {$_POST["fro
On Thu, November 3, 2005 8:17 pm, John Taylor-Johnston wrote:
> Ok, you are all used to working with register_gloabsl=off.
>
> mail($to, stripslashes($subject), wordwrap($message, 60), "From:
> $from\r\n");
>
> I change this line to:
>
> mail($to, stripslashes($_POST["subject"]), wordwrap($_POS
On Thu, November 3, 2005 10:00 pm, John Taylor-Johnston wrote:
> Patience please :)
>
> See my html below. Basically, if type=checkbox is checked, I'm trying
> to build $to string in mail().
>
>>parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING
>> or T_VARIABLE or T_NUM_STRING l
John Taylor-Johnston wrote:
Patience please :)
See my html below. Basically, if type=checkbox is checked, I'm trying to
build $to string in mail().
parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING
or T_VARIABLE or T_NUM_STRING line 4
How do I rebuild this peice of cod
John Taylor-Johnston wrote:
Patience please :)
See my html below. Basically, if type=checkbox is checked, I'm trying to
build $to string in mail().
parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING
or T_VARIABLE or T_NUM_STRING line 4
How do I rebuild this peice of cod
Got it:
mail($to, $_POST["subject"], wordwrap($_POST["message"], 60), "From:
{$_POST["from"]}\r\n");
No more errors.
But nothing comes through from smtp. I checked to be sure with phpinfo.
All values exist.
This worked though:
mail("[EMAIL PROTECTED],[EMAIL PROTECTED]",
"123", "456", "From: [
I'm guessing it's because of the double quotes within double quotes in the
"From" part:
mail($to, stripslashes($_POST["subject"]), wordwrap($_POST["message"],
60), "From: $_POST["from"]\r\n");
Your $_POST["subject"] is ok because that's all that's in that part of the
parameter, but the part:
mail($to, stripslashes($_POST["subject"]), wordwrap($_POST
["message"], 60), "From: $_POST["from"]\r\n");
and I get:
Parse error: parse error, unexpected '\"', expecting T_STRING or
T_VARIABLE or T_NUM_STRING in /www-html/emailer/index.html on line 41
The use of $var['index'] or $var["index"
>> If i use, at the beginning of my scripts,
>> ini_set('register_globals', 0), register globals will be
>> turned off?
> if you have php <= 4.2.3 yes, otherwise no.
> it has to be set in php.ini, .htaccess, or httpd.conf
You may NEVER set register_globals at runtime with
ini_set() regardless of
On Fri, July 8, 2005 7:50 am, Terry Romine said:
You *ARE* doing session_start at the top of each page, right?...
Ya gotta do that.
> I was setting the $_SESSION by:
> $_SESSION['var_name'] = "this";
> or
> $my_local = "this";
> $_SESSION['var_name'] = $my_local;
There *WAS* a bug in PHP [mumbl
ects, so you can see my frustration in
trying to do this by bits and pieces. I had done a test file like this:
test1.php:
Click
and
test2.php:
test1.php displays "test1" but test2.php displays nothing.
Terry
-Original Message-
From: Jason Barnett <[EMAIL PROTECTED]&g
Since you mention the PHP version was old (4.1) then I have to ask: were
you using the $_SESSION array all along or were you using
session_register to register session variables? Although you probably
aren't since that would be rather easy to debug.
The script in which your global_variable wa
ething like this work?
where $global_var is set in one file and then used in another?
Thanks for any help
Terry
-Original Message-
From: Sebastian <[EMAIL PROTECTED]>
Sent: Jul 8, 2005 6:42 AM
To: [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Subject: Re: [PHP] Register globals and i
if you have php <= 4.2.3 yes, otherwise no.
it has to be set in php.ini, .htaccess, or httpd.conf
[EMAIL PROTECTED] wrote:
Hi,
If i use, at the beginning of my scripts, ini_set('register_globals', 0),
register globals will be turned off?
Thanks
--
PHP General Mailing List (http://www.ph
HarryG wrote:
> Which process is better to use in PHP?
>
> Having register_globals=on and referring to variables as if($name){} or
> using $_GET & $_POST statements like if(isset($_GET['name']))?
>
> What is the main advantage/disadvantage in both cases.
The only advantage in register_globals = ON
HarryG wrote:
Having register_globals=on and referring to variables as if($name){} or
using $_GET & $_POST statements like if(isset($_GET['name']))?
What is the main advantage/disadvantage in both cases.
Doesn't matter if it's on or off, really.
1) Don't trust any input from the user
2) Always init
On Mon, 3 Jan 2005 22:21:48 +1100, HarryG <[EMAIL PROTECTED]> wrote:
> Which process is better to use in PHP?
>
> Having register_globals=on and referring to variables as if($name){} or
> using $_GET & $_POST statements like if(isset($_GET['name']))?
>
> What is the main advantage/disadvantage in
* Thus wrote Matthew Sims:
>
> I just signed up with a new hosting site. So first thing I did was check
> what phpinfo() had to say.
>
> I see that register_globals is turned on. Now I always use the $_GET and
> $_POST vars but will this still affect me?
As long as you dont use third party softw
On Mon, 25 Oct 2004 11:50:39 -0700 (PDT), Matthew Sims
<[EMAIL PROTECTED]> wrote:
> I see that register_globals is turned on. Now I always use the $_GET and
> $_POST vars but will this still affect me?
.htaccess
php_flag register_globals off
--
Greg Donald
Zend Certified Engineer
http://gdcons
Simas Toleikis wrote:
And this [register globals] won't pose as a security risk to me?
It will.
No, it won't. register_globals is not a security risk. Poorly written
code that does not adequately initialize variables or account for
variables from outside sources can present security risks. You c
And this won't pose as a security risk to me?
It will. You could emulate namespaces in php. Do something like this:
function init_namespace()
{
// all your script code goes here
}
init_namespace(); // notice the call
This way any globally registered post/get/cookie etc variables wont be
access
Jay Blanchard wrote:
[snip]
I just signed up with a new hosting site. So first thing I did was check
what phpinfo() had to say.
I see that register_globals is turned on. Now I always use the $_GET and
$_POST vars but will this still affect me?
[/snip]
Nope, you can keep using, and should keep using
On Monday 25 October 2004 02:50 pm, Matthew Sims wrote:
[snip]
>
> I see that register_globals is turned on. Now I always use the $_GET and
> $_POST vars but will this still affect me?
>
[snip]
Matthew,
Although it shouldn't affect you, I had a terrible time trying to get anything
to pass via se
> [snip]
> I just signed up with a new hosting site. So first thing I did was check
> what phpinfo() had to say.
>
> I see that register_globals is turned on. Now I always use the $_GET and
> $_POST vars but will this still affect me?
> [/snip]
>
> Nope, you can keep using, and should keep using, t
[snip]
I just signed up with a new hosting site. So first thing I did was check
what phpinfo() had to say.
I see that register_globals is turned on. Now I always use the $_GET and
$_POST vars but will this still affect me?
[/snip]
Nope, you can keep using, and should keep using, the $_GET and $_P
On Thu, 30 Sep 2004 14:33:30 -0400, Kevin Coyner <[EMAIL PROTECTED]> wrote:
> What does work is:
>
> $cid = $_GET($varname);
>
> But that is only for when a single variable is passed, not when a bunch
> of them get passed and need to be put into an array.
$_GET is already an array, why reassign
Patrick Hutchinson wrote:
Thanks for the response. I basically have an environment analogous to an
internal ISP. A lot of corporate users that have the ability to make web
pages for the intranet etc. Basically management wants PHP turned off
now because a rogue user could potentially gather and
Yes. My understanding turning globals off stops using $PHP_AUTH_PW directly.
> Hi, Even with register globals off isn't it possible to have a webpage
> like this:
>
>
>
>
>
> Hello,
> I know your password is
>
>
>
>
>
>
> Is there a way to make sure apache doesn't set the $SERVER['PHP_AUT
Thanks for the response. I basically have an environment analogous to an
internal ISP. A lot of corporate users that have the ability to make web
pages for the intranet etc. Basically management wants PHP turned off
now because a rogue user could potentially gather and store people's
passwords
Friday, April 30, 2004, 5:37:15 PM, thus was written:
> Hi, Even with register globals off isn't it possible to have a webpage
> like this:
Not sure what you are asking. You can have a webpage like this. And I
guess it even does what it should - print the information.
>
>
>
> Hello,
> I know
You are working with Register globals turned off, so try
is_upload_file($_FILES['tmp_name']['filename'])
bill wrote:
I'm converting old code to work with Register globals turned off in php.ini.
With it on, is_upload_file($filename) works fine but when turned off doesn't
work at all.
What am I mis
bill wrote:
I'm converting old code to work with Register globals turned off in php.ini.
With it on, is_upload_file($filename) works fine but when turned off doesn't
work at all.
What am I missing.. Help me please !!
...the "Handling file uploads" section of the manual.
http://www.php.net/manual
http://us3.php.net/features.file-upload
--- bill <[EMAIL PROTECTED]> wrote:
> I'm converting old code to work with Register
> globals turned off in php.ini.
> With it on, is_upload_file($filename) works fine but
> when turned off doesn't
> work at all.
>
> What am I missing.. Help me please !!
>
What is your aim?
a) to have the site *work* on a server with rg off, or;
b) to re-engineer your site to be safer and more secure, taking
advantage of the REASONS rg was turned off by default?
If it's a, then look at my example on weberdev, or just switch them
back on with something like a .ht
* Thus wrote stfmoreau ([EMAIL PROTECTED]):
> (ii) Even better:
>
> // _GET
> if (isset($_GET))
> extract($_GET);
Cool.. ya learn somthing every day... thanks..
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--
PHP General Mailing List (http://w
* Thus wrote stfmoreau ([EMAIL PROTECTED]):
> Hi,
>
> include this code in your header file :
> // _GET
> if (isset($_GET))
> while (list($key, $val) = each($_GET))
> {
> eval ("$".$key." = '".$val."';");
> }
> // _P
whoa, i didn't know that. i love this mailing list! :)
Petre Agenbag wrote:
a simple extract($_POST) or extract($_GET) would also work
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
OK, sorry, I tried to help... and finaly I learn (I didn't know extract...)
-Message d'origine-
De : Ford, Mike [LSS] [mailto:[EMAIL PROTECTED]
Envoyé : lundi 21 juillet 2003 14:35
À : 'stfmoreau'; Daryl Meese; [EMAIL PROTECTED]
Objet : RE: [PHP] Register Globals
>
> -Original Message-
> From: stfmoreau [mailto:[EMAIL PROTECTED]
> Sent: 21 July 2003 13:23
>
> include this code in your header file :
> // _GET
> if (isset($_GET))
> while (list($key, $val) = each($_GET))
> {
> eval ("$".$key.
a simple extract($_POST) or extract($_GET) would also work
On Mon, 2003-07-21 at 14:22, stfmoreau wrote:
> Hi,
>
> include this code in your header file :
> // _GET
> if (isset($_GET))
> while (list($key, $val) = each($_GET))
> {
> eva
Hi,
include this code in your header file :
// _GET
if (isset($_GET))
while (list($key, $val) = each($_GET))
{
eval ("$".$key." = '".$val."';");
}
// _POST
if (isset($_POST))
whi
a good editor with a good find and replace tool...
i know dreamweaver MX can do a find and replace for an entire site once
you've defined it.
- Original Message -
From: "Daryl Meese" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 21, 2003 1:17 PM
Subject: [PHP] Register G
Only per-directory, by putting a .htaccess file in that directory which
turns RG on.
Sebastian wrote:
Hmm .. might be easier to use an .htaccess. Is it possible to enable
Register Global just for the script and not the site? I heard it's possible
to enable it on just one directory (where the scr
- Original Message -
From: "Sebastian" <[EMAIL PROTECTED]>
To: "php list" <[EMAIL PROTECTED]>
Sent: Wednesday, March 26, 2003 3:45 PM
Subject: [PHP] register globals :|
> Is there any work-around to get a scipt that requires globals to be ON
work
> when globals is OFF?
>
> Its a small sc
Hmm .. might be easier to use an .htaccess. Is it possible to enable
Register Global just for the script and not the site? I heard it's possible
to enable it on just one directory (where the script resides).
cheers,
- Sebastian
- Original Message -
From: "Leif K-Brooks" <[EMAIL PROTECTED]
Hi Davy,
I found the following in the php manual:
Please note that register_globals cannot be set at runtime (ini_set()). Although, you
can use .htaccess if your host allows it as described above. An example .htaccess
entry: php_flag register_globals on.
on this page: http://www.php.net/manual
well, i found my mistake ;)
on windows i forgot to change the name of the .htaccess-files because on
win they couldnt have a extentsion without a name.
So i've named them now only "htaccess" without the dot and it works fine
Frank W. wrote:
it works only if i put it in my httpd.conf - yes allo
Hi Frank,
> > ServerName localhost
> > DocumentRoot /var/www/html/mysite
> > php_value register_globals 0 (or 1 for "on")
>
> it works only if i put it in my httpd.conf - yes
> allowoveride is set to all :/
>
> i'm using apache 1.3.27 on win2k.
Well, you're doing *something* wrong, 'cos it wor
it works only if i put it in my httpd.conf - yes allowoveride is set to
all :/
i'm using apache 1.3.27 on win2k.
Jon Haworth wrote:
> Hi,
>
>
> >Thx for your reply It is working.
>
>
> No probs, glad to help.
>
>
> >I also found from php.net that it's possible
> >to set register_globals to "off"
On Fri, 25 Oct 2002 13:16:27 +0300
Tjoumaidis <[EMAIL PROTECTED]> wrote:
> Hi to Everyone,
> I just want to know if there is a way that i can have register_globals
> On in my php.ini file but for some application i can turn that Off
> perhaps with a .htacces file.
I prefer it Off in php.ini and
Hi,
> Thx for your reply It is working.
No probs, glad to help.
> I also found from php.net that it's possible
> to set register_globals to "off" on a site-by-
> site basis via Apache, thus overriding the "global"
> setting of register_globals in php.ini:
>
>
> ServerName localhost
> Documen
Thx for your reply It is working.
I also found from php.net that it's possible to set register_globals to
"off" on a site-by-site basis via Apache, thus overriding the "global"
setting of register_globals in php.ini:
In httpd.conf:
ServerName localhost
DocumentRoot /var/www/html/mysite
php_va
Hi,
> I just want to know if there is a way that i
> can have register_globals On in my php.ini file
> but for some application i can turn that Off
> perhaps with a .htacces file.
In your .htaccess:
php_flag register_globals on
or
php_flag register_globals off
Manual pages at
http://w
What is the name of the file that is registered in your phpinfo()..
eg is that the path and name of the config??
Also have you restarted your webserver??
Phil Ewington wrote:
> Hi,
>
> I have just upgraded PHP to 4.2.3 and have found that register_globals
> defaults to 'off'. I have changed t
On Saturday 24 August 2002 16:52, Andy wrote:
> I do have a command line php version installed and I need to switch
> register globals to on for this install. Where do I find this php.ini
> regarding this installation. There is also a web-php installation running
> where I do have a php.ini for.
On Monday, July 1, 2002, at 11:30 AM, Adrian Greeman wrote:
> Would it be true to say that every time an example is given where data
> is
> passed on (for forms and so forth) that I can simply replace the
> variable in
> the example with $_POST or $_GET? Or do I have to do more?
Pretty much
AG> I have to understand the new "register globals off" methods and it seems
AG> like a good idea to learn that from the beginning but all the books and
AG> beginners guides gives examples the old way.
give it 3 more weeks and 2nd edition of PHP Fast & Easy will be
out...all register_global u
You could leave the setting to ON in your php.ini, and impose OFF on a
per-directory (account, domain, etc) basis with a .htaccess file (or
vice-versa), assuming you have Apache.
This will mean all new clients will have the setting to OFF, and will do
things "the right way" from day 1. It will a
On Sunday 30 June 2002 23:12, PHPCoder wrote:
> Hi
> Going through some literature, it seems like the use of registered
> globals can cause security issues. Now, the dilemma, all my previous PHP
> installations ( for the last year or so ) have come with register
> globals = on in the php.ini file
> 2. use a .htaccess file to change register_globals for your
> domain / dir, as long as your Apache config file allows it.
> http://www.php.net/manual/en/configuration.php
As Justin stated, doing this (use of .htaccess) is possible
if your host allows it. The following will work in
.htaccess
From: "Ignacio Vazquez-Abrams" <[EMAIL PROTECTED]>
Sent: Wednesday, January 17, 2001 11:33 PM
> On Wed, 17 Jan 2001, Carsten Gehling wrote:
>
> > Is there a way to programatically enable the register_globals option for
a
> > php-script?
> >
> > For certain reasons I have the register_globals opt
On Wed, 17 Jan 2001, Carsten Gehling wrote:
> Is there a way to programatically enable the register_globals option for a
> php-script?
>
> For certain reasons I have the register_globals option set to "Off".
> However, phpMyAdmin will not work unless it is set to "On" therefore, I
> thought of ma
72 matches
Mail list logo