Jump to content

php is adding brackets!!! ahh


Vivid Lust

Recommended Posts

I have a code which opens a css files and then saves it again:

 

<?php
session_start();
if(!isset($_SESSION['admin'])){
header('location: ../admin.php');
}
$filename = "../css.css";
$file = fopen( $filename, "r" );
$filesize = filesize($filename);
$text = fread( $file, $filesize ); 
fclose( $file );  
?> 

<form action=editcssdone.php method=POST>
<textarea name="top" id="textarea" cols="70" rows="10" >
<?php echo $text; ?>
</textarea>
<Br>
<input type="Submit" value=Update>
</form>

 

<?php
session_start();
if(!isset($_SESSION['admin'])){
header('location: ../admin.php');
}
$top = $_POST['top'];
$filename = "../css.css";
$file = fopen( $filename, "w+" );
fwrite( $file, $top ); 
fclose( $file ); 

header('location: editcss.php');
?> 

 

It keeps on adding brackets on this:

 

url("http://valiants.freehostia.com/uploads/903573218footer.jpg");

 

so that its like this:

 

url(\"http://valiants.freehostia.com/uploads/903573218footer.jpg\");

 

Can anyone help sort the problem of these annoying slashes???

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/115627-php-is-adding-brackets-ahh/
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.