Jump to content

Need to write html from a frame src to file


mluks

Recommended Posts

I have a frame with some html in it.  I want to write the html which may have been modified to file.  I was under the impression I could do this as follows, but it doesn't work.  I was trying to avoid changing to .php for my main file because I call a lot of javascript stuff.

 

from little.html....

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>Resource Classes Web Editor</title>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<meta name="PageTitle" content="Cross-Browser Rich Text Editor">

</head>

<body>

 

<script type="text/javascript" src="little.php?FILE=reminders0.htm&DATA=html"></script>

<iframe id="contentFrame" name="contentFrame" src="reminders0.htm"></iframe>

</body>

 

</html>

 

 

And from little.php....

 

<?php

Header("content-type: application/x-javascript");

$FILE = $HTTP_GET_VARS[0];

$Data = $HTTP_GET_VARS[1];

$Handle = fopen($FILE, 'w');

fwrite($Handle, $Data);

fclose($Handle);

?>

 

Sorry...that probably needs more explanation.  The iframe is basically meaningless in the code I included...I just stuck it in there for reference.  My main problem is getting the external PHP file to work.  The idea is that I wouldn't have to change the .html to a .php.  Instead I could just "call" the .php file from the .html file.

  • 2 weeks later...

Sorry...that probably needs more explanation.  The iframe is basically meaningless in the code I included...I just stuck it in there for reference.  My main problem is getting the external PHP file to work.  The idea is that I wouldn't have to change the .html to a .php.  Instead I could just "call" the .php file from the .html file.

 

just type include("filename"); at the top of your html file

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.