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

0 Members and 1 Guest are viewing this topic.

Offline clown[NOR]Topic starter

  • Devotee
  • Posts: 711
  • 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.

Offline thorpe

  • Administrator
  • 'Mind Boggling!'
  • *
  • Posts: 29,241
    • 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?

Offline per1os

  • Fanatic
  • Posts: 4,005
  • Gender: Female
  • badger badger badger
    • View Profile
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!!!!