Jump to content


Photo

calling a page from a directory


  • Please log in to reply
2 replies to this topic

#1 salvador2001

salvador2001
  • Members
  • PipPipPip
  • Advanced Member
  • 30 posts

Posted 17 April 2006 - 03:26 PM

Hi all,

I have got a mayor problem. I have poor knowledgde of PHP and i cant solve this one.
After a few days i am getting realy frustrated about this...
I have this script and its working fine basicly. I want to add a directory to the script, in this directory are a few pages i want to load.
All i get is an errorpage or error messages....
I have to finish this very soon so i hope that somebody can help me out here.
Would somebody please, please, please adjust the script for me ????

I would be very thankfull !!

<?php    

// loading permitted pages

if(isset($_GET['load'])) {    
  switch($_GET['load']) {    
    case 'news':    
    case 'about':    
    case 'members': 
    case 'organisation': 
    case 'members/page1': 
    case 'members/page2':
  
    
      $load = $_GET['load'];    
      break;    
    default:    
      $load = 'error404';    
  }  
} else {  
  $load = 'welcome';    // -- if $_GET['load'] is not defined
}    

// loading from dir ** but this is not working

elseif($load == "members") {  
      include "members/page1.php";  
   }  
elseif($load == "members") {  
      include "members/page2.php";  
   }  


// loading errorpage

else {    
include("http://www.xxxxxx/error404.php");    
}    

?>


#2 Darkness Soul

Darkness Soul
  • Members
  • PipPipPip
  • Advanced Member
  • 133 posts
  • LocationBrazil; São Paulo.

Posted 17 April 2006 - 04:28 PM

You will get a parse error:
<?php    

} else {  
  $load = 'welcome';    // -- if $_GET['load'] is not defined
}    

// loading from dir ** but this is not working

elseif($load == "members") {  
      include "members/page1.php";  
   }
?>

if {}
else {}
elseif {} (?)

Why you're testin two times the same thing??
In your switch, you have members, m/p1, m/p2.. in your code.. if members.. p1 e p2..

Exemple what you want about that point of code.. =)

D.Soul
(If something is wrong, please tell me. I'm learning this language. Thank you)

#3 salvador2001

salvador2001
  • Members
  • PipPipPip
  • Advanced Member
  • 30 posts

Posted 17 April 2006 - 09:13 PM

my purpose is that i can load pages from the members directory. like page1 and page2
so if i call it from the menu with [a href=\"http://www.mydomain.com/index.php?load=page1.php\" target=\"_blank\"]http://www.mydomain.com/index.php?load=page1.php[/a] it will appear.
Now all i get is an error page 404.
I do have great difficutltys learning the code.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users