Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    New Zealand
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Creating New Pages With PHP

    Is it possible to have php generate a brand new .php or .html page and place it in the directory on the server?

    For example...
    If i extracted some page information from a database into a php page, could I then tell the page to write a new file (lets say stuff.php) and put it in a directory: new/stuff.php?

    Thanks.
    eTheory - the theory of revolution

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Yeah you can do that, but you could have stuff.php already in the /new directory, then just have that fetch all the info from the database, be the best way... but as I don't really know what you're trying to do, here's what you asked for
    PHP Code:
    copy('phppage.php','new/stuff.html'); 

  • #3
    Regular Coder
    Join Date
    Jul 2002
    Location
    New Zealand
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Nightfire

    What I think I need to do is make a bunch of pages, each different (depending on database variables). So I really need to open a template page, change some variables, save this as a new page in a new directory.

    Any thoughts on this one?
    eTheory - the theory of revolution

  • #4
    Regular Coder
    Join Date
    Jul 2002
    Location
    New Zealand
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hmm, this page is getting close to what I need...

    php form to generate a html document
    eTheory - the theory of revolution


  •  

    Posting Permissions

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