hi,
can someone please tell me where I can find out about PHP Includes and how to use them on a site. I know what code to use to include files but I don't know how to have a page url to look like: www.yourdomain.com/index.php?id=contact something like that.
If anyone knows where I can find out about it or if anyone could explain it to me it would be much appreciated.
thanks, Jonathan Cooper
here is how i do it on my site.. www.sn0n.com/index.php?page=login
<?php if ($page == "login") { require ("includes/login.php"); } elseif ($page == "draft") { require ("includes/draft.php"); } elseif ($page == "post") { require ("includes/post.php"); } elseif ($page == "handle") { require ("includes/handle.php"); } elseif ($page == "edit") { require ("includes/edit.php"); } elseif ($page == "rob") { require ("includes/rob.php"); } else { require ("includes/data.php"); }
hope that helps.
where abouts do you put:
<?php if ($page == "login") { require ("includes/login.php"); } elseif ($page == "draft") { require ("includes/draft.php"); } elseif ($page == "post") { require ("includes/post.php"); } elseif ($page == "handle") { require ("includes/handle.php"); } elseif ($page == "edit") { require ("includes/edit.php"); } elseif ($page == "rob") { require ("includes/rob.php"); } else { require ("includes/data.php"); } ?>
wherever you want the 'code' to be in your document
_____________ |_____|______| | | | | | XXX | | | | |_____|______|
in my site its in the XXX section