Got a really weird error going on here. Some of my " are turning into /%22. Here's the relevant code:
<?PHP
#include "inc/config.php";
# needed config vars
$path_to_images = "/ryanbrill/images";
$header = "inc/header.txt";
$title = "";
$entry = "";
$date = date("l, F jS, Y");
$time = date("h:i a");
if (isset($_POST['submit'])) {
$title = stripslashes(@$_POST['title']);
$entry = stripslashes(@$_POST['entry']);
###If I remove from here...
$header = "<?PHP\n"
."include \"$header\";\n"
."?>\n\n";
### ... to here, it works fine
$blog = "<div class=\"blogentry\">\n"
." <h2 class=\"blogtitle\"><a href=\"#\">$title</a></h2>\n"
." <p class=\"blogdate\">$date</p>\n"
." $entry\n"
." <p class=\"blogfooter\">Posted at $time | <img src=\"$path_to_images/permalink.gif\" width=\"8\" height=\"10\" alt=\"Permanant URL\" /> <a href=\"#\">Permanent URL</a> | <img src=\"$path_to_images/comments.gif\" width=\"10\" height=\"10\" alt\"comments\" /> <a href=\"#\">0 Comments</a></p>\n"
."</div>\n";
echo $blog;
}
?>
<div id="container">
<form action="<?PHP echo $_SERVER['PHP_SELF']; ?>" method="post">
<p>Entry title <input type="text" name="title" value="<?PHP echo $title; ?>" class="formbox" id="title" / ></p>
<p><textarea name="entry" rows="25" cols="65" class="formbox"><?PHP echo $entry; ?></textarea></p>
<p class="right">Formatting? <input type="checkbox" name="format" checked="checked" class="middle" />
<a href="#"><img src="images/help.gif" width="15" height="15" alt="help" class="middle" /></a><br />
<input type="submit" name="preview" value="Preview" class="middle" />
<input type="submit" name="submit" value="Blog It" class="middle" /> </p>
</form>
</div>
Now, for instance, this line:
." <h2 class=\"blogtitle\"><a href=\"#\">$title</a></h2>\n"
echos out as
<h2 class="blogtitle"><a href=/%22#/%22></a></h2>
Any ideas what's going on? I'm gettin pretty frusterated.... 🙁