Results 1 to 8 of 8
  1. #1

    How can I make customized web pages using PHP?

    I already have a form where the user inputs news, articles and such and then encodes the info in the database. Then I can access the info by querying the database and show it to a page that accesses the database ("readsection.php?article=1&page=2")

    But now Im thinking of making every article and news into a totally different page like (readsection-1-4-2002.html).

    Is there a way to do this with PHP?

  2. #2
    Join Date
    May 2002
    Location
    UK
    Posts
    2,994
    Yes however not necessarily quite like that.

    Using a nifty feature on apache and mod_rewrite you can do

    domain.com/readsection/article/1/page/2/

    or something like that

    where readsection is your PHP file without the .php and then you just work out from the query string the relevant ids.

  3. #3
    Join Date
    Jul 2002
    Location
    Israel
    Posts
    351
    Uhmm, sure. You could just run a query, say, every hour that extracts the news and articles from the DB and generates standalone HTML files.

    Shouldn't be too hard.

    EDIT: Or you could follow the previous poster's advice
    C#/C++/TCL/Python/PHP developer.
    mark at mark org il

  4. #4
    Join Date
    May 2002
    Location
    UK
    Posts
    2,994
    On the subject of removing file extensions and being able to use .htaccess to tell Apache it's a php file... has anyone yet figured out how to do the same on IIS... I've looked and looked and looked... searches, msdn, technet... not there.

  5. #5
    Join Date
    Aug 2002
    Location
    Long Island
    Posts
    427
    I'll tell you, I do like IIS but!! I have notice that it's so much easier to do things with apache...

    You could create .html file with php and store them on the server in any folder configuration you would like. You would have to create an ASCII file and basically write to that file all the html tags and then save it as anything you would like.

    Although I feel that one of the purposes of PHP is to have dynamic HTML from one .php file. This way you save space and it's truly dynamic. I'm not sure the reason behind the static pages but I'm sure you have a good one.

    John
    John Trovato
    In Office Networks, LLC
    Programmer, Cisco Network Engineer, Roofer, Biochemist, and Conductor.

  6. #6
    Join Date
    Sep 2002
    Location
    TX
    Posts
    30

    [URL=http://gigabean.com]Gigabean.com[/URL]

    Sorry, wrong forum.
    Curtis
    [email protected]
    http://gigabean.com
    979-575-8449

  7. #7
    Benefit of .html / .shtml static interface: Search engines more willing to index your site (better page ranking I think, and some search engines just dont index an url with ? in it)

    Benefit of using an apache rewrite to make it appear your site contents is static files: Easy!

    Benefit of generating the whole site as static html pages: The two above + less CPU time load.

    Ofcourse the last option requires quite a bit more programming (and there is some issues regarding file permissions that has to be set/handled properly,+ it uses more discspace), but for sites with HUGE amounts of traffic it can greatly reduce CPU load. One downfall is that it isn't really a good solution if your contents is changing constantly, then one should use the rewrite solution or queries.

    my 2 cents.

  8. #8
    Join Date
    May 2002
    Location
    UK
    Posts
    2,994
    Originally posted by jtrovato
    I'll tell you, I do like IIS but!! I have notice that it's so much easier to do things with apache...
    I know, but you don't always get the choice when it's not your decision to make. (I use both Apache and IIS BTW).

    However what I want to know is how to remove a file extension from a file and still execute it as PHP. In Apache this is incredibily simple, however I cannot find any documentation on how to do the same on IIS.

Posting Permissions

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