<?php
/*
=========================================================================
Welcome...This script was designed by [Op]QuickShot of
[url]www.wargamershq.net[/url]
This script was made for people to use for free...anyone
found redistributing this script for a fee will be charged a
$100.00 fine. This is copyrighted material....
=========================================================================
FAQ
Q1 :: I want my settings different?
A1 :: You may make your settings different in the section
titled Settings...just do not erase the names!
Q2 :: I do not want a seperate page for my news...how can
i change this?
A2 :: You may copy the section titled infile copy...just
copy and paste!
more questions? just email me! :-)
=========================================================================
*/
//========================================================================
//Settings
//First we make the settings so the regular script will work
//We need this before the echo
$news_title = "Default News Title";
$news_slogan = "Powered by ezSquad_news v1.0.00";
$news_text_size = "12";
$news_text_color = "Black";
$news_background = "White";
$home_link = "www.yoursite.com";
$home_link_text = "Home";
$news_border_color = "White";
$news_link_color = "red";
$news_text_face = "Veranda";
$table_border_size = "1";
$table_cellpadding = "2";
$admin_username = "admin";
$admin_password = "admin";
//========================================================================
//Regular Script (Do not edit unless you have php
//knowledge)
echo "
<html>
<head>
<title>".$news_title."</title>
<style type='text/css'>
body{background-color:".$news_background";}
a:link{color:".$news_link_color.";}
a:visited{color:".$news_link_color";}
text{font-family:".$news_text_face"; font-size:".$news_text_size";color:".$news_text_color";}
input{font-family:".$news_text_face"; font-size:".$news_text_size";color:".$news_text_color;
background-color:"$new_background";}
</style>
</head>
<body>
";
//Done with the whole ting there...let's get this news going on!
$db = mysql_connect("yourhost","yourusername","yourpassword)
or die("Could not connect");
mysql_select_db("news",$db)
or die("Could not select Data Base");
$result = mysql_query("SELECT * FROM news ORDER BY news_id DESC",$db)
or die ("could not execute query");
echo "<table border=".$table_border_size." cellpadding=".$table_cellpadding." cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">";
while($myrow=mysql_fetch_array($result)) {
printf ("<tr><td>$myrow[NewsTitle] :: Posted by <b>$myrow[NewsAuthor]</b> - Posted On: <b>$myrow[NewsDate]</b></td></tr><tr><td>$myrow[NewsStory]</tr><td>");
}
//Now that we have the whole thing all pulled out and all...lets make a admin login below it!
//Here we go.
echo "
<hr> ";
if($_COOKIE['admin'] == "yes") {
echo "
<form method="POST" action="$_PHP['Self']">
<p align="center"<p>Insert New Story</p>
<p align="center">
<input type="text" name="Title" size="20" value="Title"></p>
<p align="center"><input type="text" name="Author" size="20" value="Author"></p>
<p align="center"><textarea rows="9" name="Story" cols="23">Story</textarea></p>
<p align="center"><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>";
$result 2 = mysql_query("INSERT * INTO news (NewsTitle,NewsAuthor,NewsStory) VALUES ({$_POST['NewsTitle']},{$_POST['NewsAuthor']},{$_POST['NewsStory']}));
$result 3 = mysql_query("UPDATE news SET NewsTitle='$_POST['first']',NewsAuthor='$_POST['middle']',story='$_POST['last']' WHERE id=$id");
<form method="POST" action="$PHP_['SELF']">
<p align="center">
Modify Story (This will modify everything so cut and paste everything and
insert it into the forms then modify where is needed!:</p>
<p align="center"><input type="text" name="first" size="20" value="Title"></p>
<p align="center"><input type="text" name="middle" size="20" value="Author"></p>
<p align="center"><textarea rows="8" name="last" cols="22">Story</textarea></p>
<p align="center"><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>
<form method = "POST" action="$_PHP['Self']">
<form method="POST" action="$_PHP['Self']">
<p> </p>
<p align="center">Admin Name:
<input type="text" name="username" size="20" style="border-style: solid; border-width: 1"></p>
<p align="center">Admin Pass:
<input type="password" name="password" size="20" style="border-style: solid; border-width: 1"></p>
<p align="center"><input type="submit" value="Login!" name="B1"><input type="reset" value="Reset Forms!" name="B2"></p>
</form>
if(($_POST['password']=="$admin_password") && ($_POST['username']=="$admin_username"))
{
setcookie("admin","yes",time()+3600)
or die("could not set cookie...check your browser to make sure that you support browsers!");
}
else
{
print ("Wrong login! Please try again"!);
}
?>
Error:
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /www/htdocs/zp/phptest/fsshq/news.php on line 49