Submit Your Article Forum Rules

Results 1 to 5 of 5

Thread: How: PHP script outputs multiple files?

  1. #1
    Junior Member
    Join Date
    Aug 2003
    Posts
    22

    How: PHP script outputs multiple files?

    I creating a simple MYSQL-driven site where a script outputs meta tags, keywords, and main content from a database. The pages look exactly alike, and I am using a template in the form of include files.

    My problem: I would like the script to show the useragent different filenames depnding on the requested link on the template. This is opposed to running the same script with different variables. The obvious approach is to create a different script for each page, but since the scripts are exactly the same (except for the MYSQL query), I was wondering if there could be a shortcut. Perhaps sending some Apache header variables? Is such a thing at all possible?

    I'll be clear about my intent: I am planning to link every page to my main site, to improve it SERP. This way i will have 20 or so links pointing to my main site, rather than an all-in-one page.

    Your ideas are much appreciated!

    z01d

  2. #2
    Junior Member
    Join Date
    Dec 2003
    Posts
    17

    Re: How: PHP script outputs multiple files?

    I'm not completely clear on what you are trying to accomplish but I'll take a shot at answering ....

    I think you want to detect the $HTTP_USER_AGENT variable & then use a switch statement to write the filenames.

    If this doesn't cover it maybe you can post more information.

    Bob

    Quote Originally Posted by z01d
    I creating a simple MYSQL-driven site where a script outputs meta tags, keywords, and main content from a database. The pages look exactly alike, and I am using a template in the form of include files.

    My problem: I would like the script to show the useragent different filenames depnding on the requested link on the template. This is opposed to running the same script with different variables. The obvious approach is to create a different script for each page, but since the scripts are exactly the same (except for the MYSQL query), I was wondering if there could be a shortcut. Perhaps sending some Apache header variables? Is such a thing at all possible?

    I'll be clear about my intent: I am planning to link every page to my main site, to improve it SERP. This way i will have 20 or so links pointing to my main site, rather than an all-in-one page.

    Your ideas are much appreciated!

    z01d

  3. #3
    Junior Member
    Join Date
    Aug 2003
    Posts
    22
    I found the name of the problem, its "dynamic pages indexing". From my reading I don't think that php has the means to achive this.:(

  4. #4
    Junior Member
    Join Date
    Dec 2003
    Posts
    17
    PHP is pretty amazing , I wouldn't give up that easily.

    You mentioned the user agent in your first post. Are you trying to sniff search engine spiders & feed them different pages than a human visitor gets?

    If you are trying to make dynamic URLs easy for the search engine spiders to index, see:

    Make URLs search engine friendly

    If you are trying to create index pages with links to your individual pages, you can do that with a foreach loop that goes through each record.

    I hope this helps, I'm still not sure I understand what you are trying to do.

    Bob

    Quote Originally Posted by z01d
    I found the name of the problem, its "dynamic pages indexing". From my reading I don't think that php has the means to achive this.:(

  5. #5
    Junior Member
    Join Date
    Aug 2003
    Posts
    22
    Thank you Bob.
    *burried reading*
    I'm wondering if I can do the Apache tweaking on virtual host...hm

Similar Threads

  1. Multiple Merchant Accounts for Multiple Stores?
    By Marc Bowker in forum eCommerce Discussion Forum
    Replies: 13
    Last Post: 08-31-2007, 09:52 AM
  2. Multiple css for multiple browsers/ platforms
    By slideri812 in forum Graphics & Design Discussion Forum
    Replies: 4
    Last Post: 10-06-2005, 12:45 PM
  3. Looking for PHP Script to Display Recently Uploaded Files
    By salomon741 in forum Web Programming Discussion Forum
    Replies: 1
    Last Post: 04-27-2005, 03:50 AM
  4. One CSS or multiple files?
    By technica in forum Graphics & Design Discussion Forum
    Replies: 6
    Last Post: 02-11-2004, 08:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •