Jump to content

Using PHP Pages and IDs


AeroCoder
 Share

Recommended Posts

I've got a couple questions regarding PHP and how to implement it in the following two ways.1) How can I make a .php file actually workable as a page? Even if I do have some PHP in an HTML document, and save it as a .php file (ex. home.php), the server throws an error message... my server is able to parse PHP, and even has Safe-Mode off, so I don't see what's wrong. How do I make a .php page viewable?2) I want to set up my pages so that one central file is used to navigate to other pages using a global varname (If that's how the terminology goes). The name I want use is "id" , like so:Code:http://www.cemrin.com/portfolio.htm?id=webdesignhttp://www.cemrin.com/portfolio.htm?id=graphicsdesignDoes anyone know how I can implement this... and maybe if not by the HTM extension, PHP?I appreciate all the help. :)-- AeroCoder

Link to comment
Share on other sites

well. you have to use the '$_GET[id];' to do this page.my idea is you can use an if statement like if the $_GET[id]; is 'webdesign' then show this content and else if the $_GET[id]; is 'graphicsdesign' then show this content.i think you get my ideaMenan

Link to comment
Share on other sites

well. you have to use the '$_GET[id];' to do this page.my idea is you can use an if statement like if the $_GET[id]; is 'webdesign' then show this content and else if the $_GET[id]; is 'graphicsdesign' then show this content.i think you get my ideaMenan
Actually, that's $_GET['id'] (Just like an array, don't forget the quotes.) Also AeroCoder, you need a server "installed" on your home computer to view PHP content (Get EasyPHP or Xitami, then upload the file into the www directory.) You can't just get Apache and put it on your comp and expect it to work. Also, if you wanted to do the $_GET method via JavaScript, I could go get the information for you.
Link to comment
Share on other sites

Actually, that's $_GET['id'] (Just like an array, don't forget the quotes.) Also AeroCoder, you need a server "installed" on your home computer to view PHP content (Get EasyPHP or Xitami, then upload the file into the www directory.) You can't just get Apache and put it on your comp and expect it to work. Also, if you wanted to do the $_GET method via JavaScript, I could go get the information for you.
Sorry, I neglected to mention that I'm using my host server, the one that hosts my website, MediaTemple. I do all the testing there, and not from a local directory on my computer.EDIT: Seems to be working now... thanks. :)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...