Author Topic: Just cant figure this one out. Please help me out  (Read 189 times)

0 Members and 1 Guest are viewing this topic.

Offline clown[NOR]Topic starter

  • Devotee
  • Gender: Male
    • View Profile
Just cant figure this one out. Please help me out
« on: May 31, 2007, 10:11:57 AM »
for some awsome reason this just wont work...  :) but I just can't figure out the reason why...

Code: [Select]
<?php

$include "hjem.php";
$vis $_GET['vis'];
if (isset($vis)) {
$cs explode("/"$vis);
if (!empty($cs[1])) { 
$include str_replace("/"""$vis);
} else { $include "$vis.php"; }
}
if (!file_exists($include)) { $include "missing.php"; }
require_once($include);

?>


Quote
Notice: Undefined index: vis in /web/sirkulus/beta/index.php on line 56


Thanks In Advance
- Clown
<?php echo "The n00b is back"; ?>

I don't test my codes before I post them.

Online thorpe

  • Staff Alumni
  • 'Mind Boggling!'
  • *
    • View Profile
Re: Just cant figure this one out. Please help me out
« Reply #1 on: May 31, 2007, 10:19:25 AM »
Quote
this just wont work


What does that meen?
Patience is like bread I say, I ran out of that yesterday.

Debian :: Funtoo :: Hudzilla :: Rute :: How To Ask?

Offline frost110

  • Fanatic
  • Gender: Male
  • /dev/null
    • View Profile
    • PHP
Re: Just cant figure this one out. Please help me out
« Reply #2 on: May 31, 2007, 10:20:09 AM »
Code: [Select]
<?php

$include "hjem.php";
if (isset($_GET['vis'])) {
        
$vis $_GET['vis'];
$cs explode("/"$vis);
if (!empty($cs[1])) { 
$include str_replace("/"""$vis);
} else { $include "$vis.php"; }
}
if (!file_exists($include)) { $include "missing.php"; }
require_once($include);

?>


It is the $_GET you have to check for isset as that is the array with the "unknown" index.
Note: I do not test most of my code before posting, be aware!!!!

 Looking for an Awesome FREE PHP Editor? Eclipse with PHP-IDE Plugin - Best I ever used!

PHP Freaks Forums

« on: »

Tired of these ads? Purchase a supporter subscription to get rid of them.