Jump to content

Blank File with fread()


elite_prodigy

Recommended Posts

I'm using the code below to open a CSS file and attempting to place it into a text box so the user can edit it. However, the texbox always comes up blank! What am I doing wrong?

???

<?php
session_start();
if(isset($_SESSION[username]) || isset($_SESSION[id])){

$local = "overall.css";
$css_file = fopen($local, "w+");
$CSS = fread($css_file, 400000);
fclose($css_file);

}
else{
header("location: login.php");

}

?>
<html>
<head>
<title></title>

<style>

@import URL("overall.css");

</style>

</head>
<body>

<br />
<br />
<br />
<br />
<br />
<br />

<table class="body">

<tr>
  <td class="top_left">.</td>
  <td class="top_center"><script type="text/javascript" src="http://x10hosting.com/adserve.js?corporate"></script></td>
  <td class="top_right">.</td>
</tr>

<tr>
  <td class="center_left"></td>
  <td class="middle">

  <form method="post" action="edit_style.php">

  <textarea name="css" rows="35" cols="75" wrap="virtual"><?php echo $CSS; ?></textarea>

  </form>

  </td>
  <td class="center_right"></td>
</tr>

<tr>
  <td class="bottom_left">.</td>
  <td class="bottom_center"><center>Copyright © 2008 Expose Your School</center></td>
  <td class="bottom_right">.</td>
</tr>
</table>

<br />
<br />
<br />
<br />
<br />
<br />

</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/100819-blank-file-with-fread/
Share on other sites

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.