Jump to content

[SOLVED] Weird ?


nesiak

Recommended Posts

Great news, i ran into another problem

 

Everything is doing ok except one thing, this is the part that should change the links of my site, and it does change them into something weird check this out>

 

code to post the code

 

<form name="input" action="changetop.php" method="post">
<p><textarea  name="text" rows="20" cols="60"><?php include("http://nenadspp.freehostia.com/php/include/link.php"); ?></textarea></p>
<p><input type="submit" name="go" value="Change links"></p>
</form>

 

code to get the code

<?php 
function writetofile()
{
$file=fopen("sidelink.php","w");
$text = $_POST["text"];
fwrite ($file,$text);
echo 'Links are changed';
fclose($file);
}
writetofile();
?>

 

It's a simple code, nothing complicated but for some reason it inserts backslashes in some parts of the text when i post it (between the quotes "")>

 

This is the original code for links

 

<style type="text/css">

.navigation {

font-family: Verdana, sans-serif;

font-size: 16px;

font-style: normal;

font-weight: bold;

color: #FFFFFF;

padding: 8px;

width: 140px;

}

.navigation:hover {

font-family: Verdana, sans-serif;

font-size: 16px;

font-style: normal;

font-weight: bold;

color: #FFFFFF;

padding: 8px;

width: 140px;

}

</style>

 

<a href="#" class="navigation">Link 1</a>

<a href="#" class="navigation">Link 2</a>

<a href="#" class="navigation">Link 3</a>

<a href="#" class="navigation">Administration</a>

 

And this is the messed up part

<style type=\"text/css\">

.navigation {

font-family: Verdana, sans-serif;

font-size: 16px;

font-style: normal;

font-weight: bold;

color: #FFFFFF;

padding: 8px;

width: 140px;

}

.navigation:hover {

font-family: Verdana, sans-serif;

font-size: 16px;

font-style: normal;

font-weight: bold;

color: #FFFFFF;

padding: 8px;

width: 140px;

}

</style>

 

<a href=\"#\" class=\"navigation\">Link 1</a>

<a href=\"#\" class=\"navigation\">Link 2</a>

<a href=\"#\" class=\"navigation\">Link 3</a>

<a href=\"#\" class=\"navigation\">Administration</a>

That f*cks up the entire code How do i solve this

Link to comment
https://forums.phpfreaks.com/topic/52004-solved-weird/
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.