Jump to content

$_GET['page'] Problem


depojones

Recommended Posts

Thank you for clicking on my question. I was wondering if anyone can teach me how to create links like this in php

 

hxxp://www.domain.com/index.php?page=home

hxxp://www.domain.com/index.php?page=contact

hxxp://www.domain.com/index.php?page=terms

 

and what are the disadvantages.

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/165115-_getpage-problem/
Share on other sites


here

 


$page = $_GET

;

if ($page == "index")
include ("index.php")
elseif ($page =="contact")
include ("contact.php")

 

do this for as many pages as you need, put this code in all of the files you want to link to and your index file.

 

when you hyperlink use the following:

 

<a href="/?page=pagename>pagename</a>

 

Hope this helps,

Shergold.

 

Link to comment
https://forums.phpfreaks.com/topic/165115-_getpage-problem/#findComment-870651
Share on other sites

Archived

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

×
×
  • 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.