Jump to content

Dynamic pages


hansman

Recommended Posts

Hello all,

 

I am reading up on php and i had a question.

 

I would like to create a company listing. Entering these companies into my database is no problem. How can i make each company have their own "static" page but it is dynamic.

EX:

www.example.com/companies/[company name]

 

Currently im using a method that is searches by zip code, but my result is www.example.com/zip.php

(zip.php takes the entered zip code as a variable, then pulls it from the db with the rest of the information)

 

Is there any topic that i should be looking into to figure out how to do this?

 

Thanks in advance for any help.

Link to comment
Share on other sites

Hello all,

 

I am reading up on php and i had a question.

 

I would like to create a company listing. Entering these companies into my database is no problem. How can i make each company have their own "static" page but it is dynamic.

EX:

www.example.com/companies/[company name]

 

Currently im using a method that is searches by zip code, but my result is www.example.com/zip.php

(zip.php takes the entered zip code as a variable, then pulls it from the db with the rest of the information)

 

Is there any topic that i should be looking into to figure out how to do this?

 

Thanks in advance for any help.

I do this type of thing all the time

 

index.php?page=1

index.php?page=2

etc...

 

<?php

if(isset($_REQUEST['page']) && $_REQUEST['page'] == '1'){

  Put the first page here

  }

elseif($_REQUEST['page'] == '2'){

  Put the second page here

  }

etc...

Now you have one script that loads each page for each query. You can also put that just in the "content" <div> of the page, so the rest stays static.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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