Forum Moderators: coopster

Message Too Old, No Replies

Newbie @ php global register off

         

EftheM

8:38 am on May 24, 2004 (gmt 0)



Hey all,

first big aplause to this forum.. great!

second I am just knew into php I have read some stuff into it. basics what I do, I search on the internet for I nice phpscript and I configure and implement it on my website. But I rather get disorientated in the whole global register thing. I want to have scripts work with "off" but I cannot manage it.

Is it ok if I post the script I got into here and have somebody help me converting it to work with global register "off"?

Thnx in advance!

Birdman

11:53 am on May 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think the easiest way to fix your scripts would be to extract() any global vars at the top of the script.

If it's GET variables(eg. script.php?var=something), then do this:

<?php
extract($_GET);
...

If it's POST variables(eg. a form), then do this:

<?php
extract($_POST);
...

By doing this, your script should work fine.

Welcome to Webmaster World!

Birdman

EftheM

1:00 pm on May 24, 2004 (gmt 0)



thnx m8,

that actually worked..

does it also work when configuring other global vars?

thnx again!