Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.