Jump to content

calling a page from a directory


salvador2001

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.