create a html file

Discussion in 'PHP' started by psim, Dec 17, 2008.

  1. #1
    Hi, i am new in php..
    I have already a site(.html) that the user choose some items from radio buttons checkboxes and drop down lists..and i save them in a database.

    I want automatically to create a html file according to the options the user puts..could you please tell how can i do that?how to beggin...
     
    psim, Dec 17, 2008 IP
  2. chopsticks

    chopsticks Active Member

    Messages:
    565
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    60
    #2
    Take a look at frwite() to create your files from the data you've saved via the forms. You'll have to specify the html, and then write it to the file using that function.
     
    chopsticks, Dec 17, 2008 IP
  3. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #3
    but remember to not save all direct inputs to your file, some things can damage your webhosting.

    htmlspecialchars can overcome most!
     
    EricBruggema, Dec 17, 2008 IP
  4. Yesideez

    Yesideez Peon

    Messages:
    196
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I'm a little puzzled by your question as all PHP does is to create HTML files anyway.
     
    Yesideez, Dec 17, 2008 IP
  5. tzvika

    tzvika Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    psim, What is it that you want to do: create a static html file and save it on the disk, or response with a dynamic html according to the user's input?
     
    tzvika, Dec 17, 2008 IP
  6. Kaizoku

    Kaizoku Well-Known Member

    Messages:
    1,261
    Likes Received:
    20
    Best Answers:
    1
    Trophy Points:
    105
    #6
    Perhaps a .htaccess mod_rewrite the $_GET data?
     
    Kaizoku, Dec 18, 2008 IP
  7. chopsticks

    chopsticks Active Member

    Messages:
    565
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    60
    #7
    ^^^
    It'd be unnecessary, mod_rewrite wouldn't be needed.

    Security?
    - Strip all php from it (although not important unless your .html's are included or executed as php)
    - Strip all images which aren't on your server
    - Strip all frames/iframes, etc
    - Strip all javascript
    - Strip anything else fishy, leaving on the html which has been sanitized
     
    chopsticks, Dec 18, 2008 IP
  8. herbacious

    herbacious Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    you really dont want to use php to generate html files...

    instead - point your form at a php file and let the php script output your html for you
     
    herbacious, Dec 19, 2008 IP