Possible to create a HTML page as a result of a form?

Discussion in 'PHP' started by pangea, Jun 6, 2007.

  1. #1
    Hi guys,

    Is there a way to create a html page as a result of a php form, that are then offered to the user to download after submitting?

    Something like a PHP script that writes config files, except the file it writes is downloaded not written to the server.

    Cheers
     
    pangea, Jun 6, 2007 IP
  2. dp-user-1

    dp-user-1 Well-Known Member

    Messages:
    794
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    110
    #2
    If I understand your question correctly, all you would have to do is configure your .htaccess file to parse PHP in HTML files, then simply display (via POST) and manipulate the form variables to your liking.

    AddHandler application/x-httpd-php .htm .html
    Code (.htaccess):
     
    dp-user-1, Jun 6, 2007 IP
    pangea likes this.
  3. pangea

    pangea Guest

    Messages:
    557
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Cheers....I'll look into it,

    But are there anyways which dont involve .htaccess?
     
    pangea, Jun 6, 2007 IP
  4. coderbari

    coderbari Well-Known Member

    Messages:
    3,168
    Likes Received:
    193
    Best Answers:
    0
    Trophy Points:
    135
    #4
    i couldn't understand your question :(
     
    coderbari, Jun 6, 2007 IP
  5. speda1

    speda1 Well-Known Member

    Messages:
    374
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    108
    #5
    You could write it to a directory on the web server and then delete it after it is downloaded. Or maybe set up a Cron job to clean up the directory every so often.
     
    speda1, Jun 6, 2007 IP