This shouldn't break to my knowledge, but it does, I'm very confused.
PHP Code:
<?php
include('head.txt');
include('conn.php');
$feedtitle = $_POST[user];
$password = $_POST[pass];
if($feedtitle != '' and $password != '')
{
$check = "select * from rssers where title = sha1('$feedtitle') and password = sha1('$password')";
$sendchk = mysql_query($check);
$valid = mysql_num_rows($sendchk);
if($valid == '1')
{
$title = $_POST[title];
$descript = $_POST[descript];
$link = $_POST[link];
if($title == '' || ($descript == 'Post Content' || $link == 'http://example.com'))
{
echo "<form action=\"$PHP_SELF\" method=\"post\"><label for=\"title\">Post Title<input type=\"text\" name=\"title\" /></label><br />
<textarea name=\"descript\">Post Content</textarea><br />
<label for=\"link\">Link<a href=\"#link\">*</a><input type=\"text\" name=\"link\" value=\"http://example.com\" /></label><br />
<input type=\"hidden\" value=\"$feedtitle\" name=\"user\" /><input type=\"hidden\" value=\"$password\" name=\"pass\" />
<input type=\"submit\" value=\"post\" /> <input type=\"reset\" value=\"clear\" /></form><p><a name=\"link\">*</a>You must use a unique link that you have not used within your last 15 posts, this is RSS protocol, not my choice. It will break if you don't obey.</p>";
}
else
{
$check = mysql_query("select link from rss where title = sha1('$feedtitle') and link = '$link' order by feednum desc limit 15");
$check = mysql_fetch_assoc($check);
if($check == '')
{
$rssfeed = "insert into rss values(NULL,sha1('$feedtitle'),'$title','$descript','$link',NOW())";
$feedrss = mysql_query($rssfeed);
echo "<p>Please click <a href=\"createrss.php\">here</a> to confirm.</p>";
}
else
{
echo "<p>Your link is used already, please use another link!</p><form action=\"$PHP_SELF\" method=\"post\"><label for=\"title\">Post Title<input type=\"text\" name=\"title\" /></label><br />
<textarea name=\"descript\">Post Content</textarea><br />
<label for=\"link\">Link<a href=\"#link\">*</a><input type=\"text\" name=\"link\" value=\"http://example.com\" /></label><br />
<input type=\"hidden\" value=\"$feedtitle\" name=\"user\" /><input type=\"hidden\" value=\"$password\" name=\"pass\" />
<input type=\"submit\" value=\"post\" /> <input type=\"reset\" value=\"clear\" /></form><p><a name=\"link\">*</a>You must use a unique link that you have not used within your last 15 posts, this is RSS protocol, not my choice. It will break if you don't obey.</p>";
}
}
}
else
{
echo "<p>Please login</p><form action=\"$PHP_SELF\" method=\"post\"><label for=\"user\">Feed Title<input type=\"text\" name=\"user\" /></label><br />
<label for=\"pass\">Password<input type=\"password\" name=\"pass\" /></label><br />
<input type=\"submit\" value=\"Login\" /></form>";
}
include('body.txt');
?>
It breaks with
Code:
Parse error: parse error, unexpected $ in /home/content/O/t/t/Otterbein/html/rss.php on line 51
I don't get that at all, any help would be great. Also could anyone tell me if my if statement here works right to check for dups?
PHP Code:
$check = mysql_query("select link from rss where title = sha1('$feedtitle') and link = '$link' order by feednum desc limit 15");
$check = mysql_fetch_assoc($check);
if($check == '')
Thanks for any advice and help!