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)
-   -   Playing with PHP. Got a little hanger... (https://gfy.com/showthread.php?t=135445)

Validus 05-20-2003 03:36 AM

Playing with PHP. Got a little hanger...
 
I was playing last night with some PHP and... I got stuck... what am I doing wrong?



PHP Code:

<?PHP
$line 
file('tpl/gen_text.tpl');

if(!empty(
$_GET["scr"]))
 { switch(
$scr) {
    case 
"DE":
        print(
"$line[1]");
        break;
    case 
"EN"
        print(
"$line[2]");
        break;
    default:
        print(
"$line[1]");
        } } 
else { 
print(
"$line[1]");
}
?>


Bad B0y 05-20-2003 03:49 AM

What error do you get?

Validus 05-20-2003 03:54 AM

Well.. index?scr=DE works... but.. index?scr=EN doesn't show nothing!

Bad B0y 05-20-2003 03:58 AM

Make sure that there are at least 3 lines in the file ;-)

Validus 05-20-2003 04:00 AM

So line 1 is acutally `0?

Bad B0y 05-20-2003 04:02 AM

Quote:

Originally posted by Validus
So line 1 is acutally `0?
Yep. :)

Validus 05-20-2003 07:14 AM

U didn't by any chance ban me from #php did you?

Validus 05-20-2003 07:29 AM

I guess not :-)

kevinale 05-20-2003 07:56 AM

You don't have the variable $scr defined...

change this :

switch($scr)

to this

switch($_GET["scr"])


All times are GMT -7. The time now is 08:43 PM.

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