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 5 of 5
  1. #1
    Regular Coder
    Join Date
    Dec 2006
    Posts
    306
    Thanks
    24
    Thanked 0 Times in 0 Posts

    create a php file like this forum does

    Hi;
    I'd like to create a php file after a user submit a thread. For example, i post this thread with the title of "create a php file like this forum does",
    then i want to create a php file with a name of "create-a-php-file- like-this-forum-does.php".

    Could anyone tell me how i can do this, please.

    I tried to create a php file as following, but it does not work.
    PHP Code:
    <?php
    error_reporting
    (e_all);
    $myFile="create-a-php-file- like-this-forum-does";
    $e=".php";
    $myFile="$myFile$e";


    $fh fopen($myFile'w') or die("can't open file");
    $stringData "<html>welcome to mypage, I am testing</html>";
    fwrite($fh$stringData);
    fclose($fh);
    ?>

  • #2
    New Coder
    Join Date
    Sep 2005
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hmmm do you mean like file.php?id=like_this

  • #3
    Senior Coder
    Join Date
    Mar 2003
    Location
    Atlanta
    Posts
    1,037
    Thanks
    14
    Thanked 30 Times in 28 Posts
    Are you trying to just create cruft free urls? If so, just use mod_rewrite. (link)
    Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.

  • #4
    Regular Coder
    Join Date
    Dec 2006
    Posts
    306
    Thanks
    24
    Thanked 0 Times in 0 Posts
    >Hmmm do you mean like file.php?id=like_this

    yes, like that.

  • #5
    Regular Coder
    Join Date
    Dec 2006
    Posts
    306
    Thanks
    24
    Thanked 0 Times in 0 Posts
    >Are you trying to just create cruft free urls? If so, just use mod_rewrite. (link)
    Yes, and thanks for your link.


  •  

    Posting Permissions

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