
11-03-2002, 07:41 PM
|
|
Newbie
|
|
Join Date: Oct 2002
Posts: 5
|
|
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?
|

11-03-2002, 07:48 PM
|
|
Web Hosting Master
|
|
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.
|

11-03-2002, 07:48 PM
|
|
Aspiring Evangelist
|
|
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
|

11-04-2002, 05:22 AM
|
|
Web Hosting Master
|
|
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.
|

11-04-2002, 08:30 AM
|
|
Aspiring Evangelist
|
|
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.
|

11-24-2002, 09:15 PM
|
|
Junior Guru Wannabe
|
|
Join Date: Sep 2002
Location: TX
Posts: 30
|
|
[URL=http://gigabean.com]Gigabean.com[/URL]
__________________
Curtis
sales@gigabean.com
http://gigabean.com
979-575-8449
|

11-24-2002, 09:34 PM
|
|
WHT Addict
|
|
Join Date: Nov 2002
Posts: 163
|
|
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.
|

11-25-2002, 06:03 AM
|
|
Web Hosting Master
|
|
Join Date: May 2002
Location: UK
Posts: 2,994
|
|
Quote:
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.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
| Postbit Selector |
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
| Login: |
|
|
| Advertisement: |
|
|
| Web Hosting News: |
|
|
|