Computing.Net > Forums > Web Development > index.php?id=main/news Doesnt Work

index.php?id=main/news Doesnt Work

Reply to Message Icon

Original Message
Name: Tom65789
Date: December 18, 2005 at 03:55:53 Pacific
Subject: index.php?id=main/news Doesnt Work
OS: XP Home
CPU/Ram: 2.8GHz 512MB DDR RAM
Comment:

hi, im trying to get my links similar to this one:

index.php?id=main/news

i know that main is the folder and news is the file, but it just seems to refresh the homepage. Whats the problem


Report Offensive Message For Removal

Response Number 1
Name: Laler
Date: December 18, 2005 at 08:26:37 Pacific
Subject: index.php?id=main/news Doesnt Work
Reply: (edit)

it's not that simple, the ?id=main/news is called "query" to a processor inside the file (index.php in this case).

this is a sample processor on top of index.php

<?php
if (isset ($_GET['id']) && file_exists ($_GET['id']))
{
header ("Location: " . $_GET['id']);
exit();
}
?>

Now if you have news.php in folder /main, you can access it from index.php:

http://yoursite.org/index.php?id=main/news.php

---
Site of the Day


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: index.php?id=main/news Doesnt Work

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software