Jump to content

Recommended Posts

Ok so I basically have a structure like:

 

www.mysite.com/location/a-name.php
www.mysite.com/location/a-different-name.php
www.mysite.com/location/another-different-name.php

 

Now I want these all to point to one file of .php so that I can output stuff from mysql for each of the different name files. BUT I want to keep the names of the files in the URl.

 

An example:

 

  • I have the 3 links to those pages in www.mysite.com/location/index.php
  • A person clicks the link to: www.mysite.com/location/a-name.php
  • It takes them to that location, but uses a file called: www.mysite.com/location/grab-mysql-data.php

 

This is so that when I eventually create another new page, I will not have to physcially make a new php page, I can just store the data in mysql and it will get pulled automatically and presented like all the other pages.

 

Make sense? I know that you will suggest mod_Rewrite but I cant see how mod_Rewrite will work in this case, unless you are able to make apache grab information from a mysql database.

Link to comment
https://forums.phpfreaks.com/topic/228201-help-understanding-re-write-please/
Share on other sites

Dont worry I have decided it is probably best I just create a new php file for each time I want to do a new page and just call a function. The reason I wanted to do this in the first place was just for ease of updating the site, but tbh its easy enough to just create a new page with one different parameter.

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.