GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   dumb php question (https://gfy.com/showthread.php?t=99348)

mrthumbs 01-12-2003 03:36 AM

dumb php question
 
just moved our databases to a new server
running the latest version of php and mysql.

Expected to run into a lot of shit but none of that
until this little fucking issue came up. And im TIRED and
not in the fucking mood.

Everything works but for some reason php
doesnt allow me to pass variables through the url
(which is quite essential :Graucho)

www.bla.com/bla.php?var=hello

well..

content bla.php:
<?
echo $var;
?>

$var is empty instead of 'hello'.

How do i enable this and why the fuck is this disabled?

Apollo 01-12-2003 03:39 AM

If you're using PHP 4.2+ you either need to alter the php.ini to have global variables enabled, or you need to change your PHP scripts around to initially grab the variables

In regards to your example

http://www.bla.com/bla.php?var=hello

the line

$var = $_GET["var"];

would give the variable $var the value of hello.

Madball 01-12-2003 03:41 AM

I remember my programmer dude tell me to tell my host to have them compile "php with globals on" whatever that means. He said this was essential for var passing.

stanton 01-12-2003 03:43 AM

who is php?!

stanton 01-12-2003 03:43 AM

naw thats a dumb question

mrthumbs 01-12-2003 03:44 AM

aha.. so global variables are stored in an array for the new php versions! Ok.. thanks.. that makes sense.. let me see if i can change the .ini on the fly.

REALLY appreciate that reply. thanks :thumbsup

Triple 6 01-12-2003 03:49 AM

Whenever PHP acts up, always check your php.ini

Bad B0y 01-12-2003 06:04 AM

The value 'hello' would be stored in: $_GET['var']

I new versions of PHP(4.2+) has register_globals in php.ini disabled to encourage 'good' programming.

Edit php.ini: register_globals = On

and it should be behave as expected.

mrthumbs 01-12-2003 06:27 AM

yep.. just figured that out.. thanks!

thought this would turn out in a nightmare but it's
fixed and everything works stable and fine now..

Running through the final tests and getting some sleep!!

thanks..:thumbsup :thumbsup :thumbsup


All times are GMT -7. The time now is 09:00 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123