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 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jan 2007
    Location
    NYC
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Trying to make .html pages with Php

    I'm trying to make .html files with Flash and Php! I think there must be something wrong with the code or something!

    In Flash I have two text fields each with the var of html and cont
    and a POST button!

    Let me know if you have suggestions or spot something!
    Thanks!

    PHP Code:
    <?php



    $html             
    $_POST["html"];

    $cont             $_POST["cont"];




    fopen($html'w') or die("can't open file");
    fwrite($fp$cont10000000);
    fclose($html);





            exit;
            }
        }
    ?>

  • #2
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    PHP Code:
    $fh fopen($html'w') or die("can't open file");
    fwrite($fh$cont);
    fclose($fh); 

  • #3
    New to the CF scene
    Join Date
    Jan 2007
    Location
    NYC
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Got it to work, thanks! I have another question! I'm also trying to add html code for ads and whatnot! And I'm adding it but it comes out scrambled and doesn't display! I put some html code in a text file and tried to refer to it in Php by writing something like this $adim = "imagecode.txt", however I just get imagecode.txt on the screen! How would you do this?
    Last edited by jayoe; 10-28-2007 at 12:19 AM.

  • #4
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,026
    Thanks
    2
    Thanked 315 Times in 307 Posts
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #5
    New to the CF scene
    Join Date
    Jan 2007
    Location
    NYC
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I know that stuff the problem is writing from Php to a .html

  • #6
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,026
    Thanks
    2
    Thanked 315 Times in 307 Posts
    Quote Originally Posted by jayoe View Post
    Got it to work, thanks! I have another question! I'm also trying to add html code for ads and whatnot! And I'm adding it but it comes out scrambled and doesn't display! I put some html code in a text file and tried to refer to it in Php by writing something like this $adim = "imagecode.txt", however I just get imagecode.txt on the screen! How would you do this?
    Your post does not contain any useful information for anyone here to help you. Based on what you wrote, you are attempting to place an ad (which I took to mean an image, based on the file name being used) onto a page and you got scrambled output.

    Why don't you re-read your post from the point of view of someone in a Forum and ask yourself, how is anyone here expected to be able to figure out what you are doing, what you actually see, and what code produced those symptoms?

    Also, the code you posted, where the file name and content is from form fields, will allow a hacker to place his own php script files onto your server, overwrite any of your existing files (such as index.html/index.php) with his own, or simply overwrite files to delete them.
    Last edited by CFMaBiSmAd; 10-28-2007 at 02:21 PM. Reason: add more
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #7
    New to the CF scene
    Join Date
    Jan 2007
    Location
    NYC
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm not a total newbie! I right-click properties and uncheck everything in world section! And I use protected directories! Yeah I get what your saying! If you don't exactly understand someone I always find it a good idea to throw out several suggestions and let them decide like multiple choice! I figured out that second problem! It's awsome I got Php to make .html pages on the fly!
    Last edited by jayoe; 10-28-2007 at 06:19 PM.


  •  

    Posting Permissions

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