...

View Full Version : Trying to make .html pages with Php



jayoe
10-27-2007, 07:44 PM
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



$html = $_POST["html"];

$cont = $_POST["cont"];




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





exit;
}
}
?>

Mwnciau
10-27-2007, 09:18 PM
$fh = fopen($html, 'w') or die("can't open file");
fwrite($fh, $cont);
fclose($fh);

jayoe
10-28-2007, 01:17 AM
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?

CFMaBiSmAd
10-28-2007, 02:08 AM
http://w3schools.com/html/html_images.asp

jayoe
10-28-2007, 02:13 AM
I know that stuff the problem is writing from Php to a .html

CFMaBiSmAd
10-28-2007, 02:20 PM
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.

jayoe
10-28-2007, 07:17 PM
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!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum