MyBB Community Forums

Full Version: Please Help me in Creating a PHP page with id's
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Recently i also started a topic "How to create PHP page" in that discussion i learn making page through id's like index.php?id=wall
Here is i need more help.
Here is My Structure for creating Page
Wallpapers>Bollywwod>Celbrities Name>page1,2,3,4,5,6.....
and
How to access this
May be index.php?id=wall?id=kat
i don't think this is a correct formating
i put this code but not working...
<? php
$id = $_GET['id'];
if ($id == 'wall')
 {
    //output page 1
    include 'wallpapers/index.php';
    //i want to create more category in this is, how to do that?
     if ($id == 'kat')
     {     
     echo "Celebrities Name";
     }
     if ($id == 'pre')
     {
     echo "Second Name";
     }
}
elseif($id == 'vid')
{
    //output page 2
    include 'video.php';
}
else
{
    //this is outputted if no ID is given
    echo "oops, No Id Found";
}
?>
/moved to Web Development and Admin Smile
Also there shouldn't be a space between <? And php.
Honestly, take a look at laravel Smile it would make life much easier Smile
Or just use multiple files, and directories. Honestly, I don't see why you need PHP for this at all with the lack of complexity in what you're doing. Just name rename all the files that you're including to .html files and drop them in the correct locations on your server. That would give you nicer URLs, for a start, would avoid the E_NOTICE on line two that I warned you about in your last thread, and is a lot simpler for someone who doesn't know PHP.
Or just get the id parameter, and load the page that is parameterValue.php
Less maintenance. Then that script would work without you editing it after you add each file.
(2012-07-23, 08:41 PM)Josh H. Wrote: [ -> ]Or just get the id parameter, and load the page that is parameterValue.php
Less maintenance. Then that script would work without you editing it after you add each file.

That won't be much help though if people have to find the page still. Since he isn't using a generated menu or anything he still has to manually make the link for each page. I think he's trying to swim a little to fast and should learn the basics before drowning.
(2012-07-24, 04:39 AM)Alex Smith Wrote: [ -> ]
(2012-07-23, 08:41 PM)Josh H. Wrote: [ -> ]Or just get the id parameter, and load the page that is parameterValue.php
Less maintenance. Then that script would work without you editing it after you add each file.

That won't be much help though if people have to find the page still. Since he isn't using a generated menu or anything he still has to manually make the link for each page. I think he's trying to swim a little to fast and should learn the basics before drowning.
Well, it's better than editing the menu, and then the PHP file. But I see what you're saying Wink.