homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

Dynamic php/mysql driven site
question/advice on link structure

 12:20 pm on Oct 21, 2002 (gmt 0)

Hello. I'm working on building my first dynamic site. I was wondering about how most of you with dynamic sites structure your links.

Do you build a template for each main category or one template for all?

What is the best way to pass variables?

  • mysite.com/template.php?category_id=1
  • mysite.com/template.php/1

Thanks for any advice!



 12:30 pm on Oct 21, 2002 (gmt 0)

Hi Birdman,

I prefer the latter. As for templates, just depends on how you want it to look....



 12:32 pm on Oct 21, 2002 (gmt 0)


Methods may vary. For one i have been involed in the template stays the same and the variable passed is used to get the information out. You may need to include a bit of IF empty do nothing else echo variable to avoid strange looking blank spaces. If you want different colours or looks for each section that is fine also. Depends what you want.



It looks like the first one is the way in which you will be doing it but the second hase been rewritten using the rewrite module, but that is a different beast right now.

If you want to keep the URL parameter name down to a minimum you dont have to call it the name of the DB feild. There is nothing to stop you calling it id=

Cheers and best of luck


 1:38 pm on Oct 21, 2002 (gmt 0)

Sorry, I thought I posted this earlier. Lost connection:(


I was experimenting with this method.
$res = explode("my_product_catalog.html/", $REQUEST_URI);
$vars = explode("/", $res[1]);
$var1 = $vars[0]; //now var1 holds value1
$var2 = $vars[1]; //and var2 holds value2

It just seem like a more natural url that SEs might prefer. I read somewhere today that engines don't index?dynamic_urls. Do you agree that this option may be more 'search engine friendly'?


 4:59 pm on Oct 21, 2002 (gmt 0)

When I first developed my site, I used the form
However I felt it looked better (and probably crawled better) if I used the form

To get to the second form is not difficult at all, just added a rewrite rule for this domain:
RewriteRule ^/artista/(.*)/(.*)\.html$ /artista/artista.html?id=$1 [PT,L]

And, of course, told PHP to parse HTML pages as well:
AddType application/x-httpd-php .php .html

There, from a SEO viewpoint, you have a link and a page with keywords, isn't that just great? :)

Hope that helps!

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved