Help in creating files using PHP

Discussion in 'PHP' started by kks_krishna, May 12, 2007.

  1. #1
    HI,

    I want to creates a system where each posting is converted into a flat file. not to be stored in the DB. If you see the following site :
    http://www.dzone.com/links/raganwald_hardcore_concurrency_considerations.html

    they are converting every post into html files and assigning seperate link. normally in html files we can't use the dynamic scripts. Can anyone give me ideas how can we achive these types of programming.

    Please help me.
     
    kks_krishna, May 12, 2007 IP
  2. SoKickIt

    SoKickIt Active Member

    Messages:
    305
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    70
    #2
    They are probably just using mod_rewrite to convert URLs so they look like they're static files. Is that what you want or you really want to use flat files (not a good idea)?
     
    SoKickIt, May 12, 2007 IP
  3. kks_krishna

    kks_krishna Active Member

    Messages:
    1,495
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    80
    #3
    ohh..just reading mod_readwrite concept..I realy not aware of that. thanks for your reply.
     
    kks_krishna, May 12, 2007 IP
  4. kks_krishna

    kks_krishna Active Member

    Messages:
    1,495
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    80
    #4
    Can you help me in mode rewrite. how can i achive that?
     
    kks_krishna, May 12, 2007 IP
  5. SoKickIt

    SoKickIt Active Member

    Messages:
    305
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    70
    #5
    SoKickIt, May 12, 2007 IP
  6. kks_krishna

    kks_krishna Active Member

    Messages:
    1,495
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    80
    #6
    Thanks for the reply. I am reading the article. they mentioned as "You'll also need to have write access to this file, and access to restart the Apache.".

    I am using Godaddy server. how can i restart the server? will it update the file without restarting.
     
    kks_krishna, May 12, 2007 IP
  7. SoKickIt

    SoKickIt Active Member

    Messages:
    305
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    70
    #7
    Another tutorial. You can use .htaccess files since it doesn't require restarting Apache...
     
    SoKickIt, May 12, 2007 IP
  8. kks_krishna

    kks_krishna Active Member

    Messages:
    1,495
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    80
    #8
    thanks a lot man. your helping me in right time. thanks again.
     
    kks_krishna, May 12, 2007 IP
  9. kks_krishna

    kks_krishna Active Member

    Messages:
    1,495
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    80
    #9
    HI,

    is the following enrty is correct:
    RewriteEngine on
    RewriteRule ^(.*).index.php index.html

    .index.php will converted as .html. is it correct?
    its not working for me.
     
    kks_krishna, May 12, 2007 IP
  10. grandpa

    grandpa Active Member

    Messages:
    185
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    75
    #10
    it should be like this:

    RewriteEngine on
    RewriteRule ^index.php index.html
    Code (markup):
    why you'd like to convert php to html?
    if the file in your server is index.php, and you want when anyone call index.html will output of that index.php, this is what you need

    RewriteEngine on
    RewriteRule ^index.html index.php
    Code (markup):
     
    grandpa, May 14, 2007 IP
  11. haxanstudios

    haxanstudios Member

    Messages:
    46
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #11
    yup, they are using mod_rewrite.

    you might need to write this code in the .htaccess file on your server.
    this file is mostly present in the directory where all your other webpages reside :D
     
    haxanstudios, May 14, 2007 IP
  12. coderbari

    coderbari Well-Known Member

    Messages:
    3,168
    Likes Received:
    193
    Best Answers:
    0
    Trophy Points:
    135
    #12
    yes you have to use .htaccess which is in your present directory not in your server.
     
    coderbari, May 14, 2007 IP