detalab Posted May 2, 2009 Share Posted May 2, 2009 Hi guys, I cant sleep because of this. The answer must be pretty easy. But I couldnt figure out HOW!? I have a index.php file and this link below brings up the "project.php" file into the "index.php" via php include function <td colspan="2" valign="top" class="borderTable" onMouseover="this.bgColor='#FFFFFF'" onMouseout="this.bgColor=''"> <a href='index.php?type=project'> <b> Project</b> </td> project.php file brings 4 options (4 different projects) <td width="420" align="left" valign="middle" bgcolor="#00CCFF"> <a href='project-detail.php?id=15'> <span class="style7">PROJECT 1</span> </td> When I click any of these 4 , I want them to "open"(not include) a new file: project-detail.php, but I want it to have different project content corresponding to the project option. So it will be "/project-detail.php?id=15 for PROJECT 1 and "/project-detail.php?id=35" for PROJECT 2 How can I code to open "project-detail.php" file from "project.php" file and make it have different projects content. Here is an exact sample of php code system: FROM http://www.stevenholl.com/project.php?type=educational&page=0 TO http://www.stevenholl.com/project-detail.php?type=educational&id=39&page=0 Thank you in advance for your time and wisdom, Best, Matt Link to comment https://forums.phpfreaks.com/topic/156560-solved-php-code-to-open-a-new-file-with-different-content-id15id35/ Share on other sites More sharing options...
GingerRobot Posted May 2, 2009 Share Posted May 2, 2009 If i follow correctly, you just need to retrieve the variable from the URL using the $_GET superglobal. See here for example. Once you've got that number, you obviously need to load the correct content be it from the a database or by including different files. Link to comment https://forums.phpfreaks.com/topic/156560-solved-php-code-to-open-a-new-file-with-different-content-id15id35/#findComment-824357 Share on other sites More sharing options...
detalab Posted May 4, 2009 Author Share Posted May 4, 2009 Thanks a lot Ben!! I appreciate it. Link to comment https://forums.phpfreaks.com/topic/156560-solved-php-code-to-open-a-new-file-with-different-content-id15id35/#findComment-825376 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.