Jump to content

Archived

This topic is now archived and is closed to further replies.

salvador2001

calling a page from a directory

Recommended Posts

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 !!

[code]<?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");    
}    

?> [/code]

Share this post


Link to post
Share on other sites
You will get a parse error:
[code]<?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";  
   }
?> [/code]

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.