Last edited by xGlast; 12-08-10 at 10:58 AM.
Yaii thanks Bro for put Credits :)
+1
You might want to make a backend script so the staff can post messages easier, as no one really wants to open SQL Management Studio every time they want to post a new message.
Other than that, fairly nice release.
Easy, i am brother of xGlast.
Here PHP Code to make new:
Script Creted by XiDaXPHP Code:<?php
mssql_connect("XXX\SQLEXPRESS", "sa", "pass");
mssql_select_db("ACCOUNT_DBF");
$ip = $_SERVER['REMOTE_ADDR'];
$time = date("F j, Y, g:i a");
echo '
<form action="add.php?accion=add" method="post">
<input name="title" value="Title Here" type="text"/><br>
<input name="external" value="#" type="text"/><br>
<select name="category">
<option value="1">News</option>
<option value="2">Events</option>
<option value="3">Patch Notes</option>
</select><br>
<input name="time" value="'.$time.'" type="text" readonly="readonly"/><br>
<input name="who" value="" type="text"><br>
<textarea name="content" value="Text here" type="text" width="111" rows="12"/></textarea><br>
<input size="20" type="submit" value="Submit"/>
</form>';
if(@$_GET['accion'] == "add"){
if(isset($_POST["title"])){
mssql_select_db("ACCOUNT_DBF");
mssql_query("INSERT into NEWS_TBL (title,title_url,category,when,who,content,ip,blocked) VALUES ('$_POST[title]','$_POST[external]','$_POST[category]','$_POST[time]','$_POST[who]','$_POST[content]','$ip','no')");
}
}
?>
PD: Sry for me bad English ...
Last edited by Dell Honne; 11-08-10 at 05:07 PM. Reason: Fix
nice but its saying error with the add page might want to look in to it D: i know some php but not where i can fix it xD
OBJECT NOT FOUND ._. in big letters its looking for add.php but cant find it i changed it to create.php but it wouldnt work. since where on this subject the script to find the database for the news wont show up QQ i hate mssql thats why i made one for mysql xD
edit: i made the add.php and got this error
Warning: mssql_query() [function.mssql-query]: message: Incorrect syntax near the keyword 'when'. (severity 15) in C:\xampp\htdocs\FFSilence\add.php on line 24
Warning: mssql_query() [function.mssql-query]: Query failed in C:\xampp\htdocs\FFSilence\add.php on line 24
Last edited by nightwolf0022; 10-08-10 at 09:25 PM.
Well. Here goes all the best scripts being released.
News system - A cool thing for a server to have. Sad it got released to the public.
Nice release <.<
Warning: mssql_query() [function.mssql-query]: message: Incorrect syntax near the keyword 'when'. (severity 15) in C:\xampp\htdocs\FFSilence\add.php on line 23
Warning: mssql_query() [function.mssql-query]: Query failed in C:\xampp\htdocs\FFSilence\add.php on line 23 tried D: i dunno i think my computer is failing xD
Fixed SQL:
Fixed "news.php"Code:USE [ACCOUNT_DBF] GO /****** Object: Table [dbo].[NEWS_TBL] Script Date: 08/10/2010 11:06:46 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[NEWS_TBL]( [id] [int] IDENTITY(1,1) NOT NULL, [title] [varchar](200) NULL, [title_url] [text] NULL, [category] [varchar](50) NOT NULL CONSTRAINT [DF_NEWS_TBL_category] DEFAULT ('1'), [date] [text] NULL, [who] [text] NULL, [detalle] [text] NULL, [ip] [text] NOT NULL, [blocked] [varchar](1) NOT NULL CONSTRAINT [DF_NEWS_TBL_isblock] DEFAULT ('no') ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_PADDING OFF
create news.php
Fixed "add.php"PHP Code:<?php
function cat($cat)
{
if($cat == '1')
{
return "News";
}
else if($cat == '2')
{
return "Events";
}
else if($cat == '3')
{
return "Patch Notes";
}
}
$nbsp = " ";
$conexion = mssql_connect("XXX\SQLEXPRESS", "user", "pass");
$db = mssql_select_db("ACCOUNT_DBF");
$consulta = mssql_query("SELECT * FROM NEWS_TBL WHERE blocked='no'");
$asoc = mssql_fetch_assoc($consulta);
?>
<h2>Title: <strong><a href="<?php echo $asoc['title_url']; ?>" alt="<?php echo $asoc['title']; ?>"><?php echo $asoc['title'];?></a></strong><?php echo $nbsp; ?>Posted by <strong><?php echo $asoc['who']; ?></strong></h2> in <strong><?php echo cat($asoc['category']); ?> category.</strong><br>
Content: <br>
<?php echo $asoc['detalle']; ?><br><br>
Date: <?php echo $asoc['date']; ?>
Sry for take a time to fix it.PHP Code:<?php
mssql_connect("XXX\SQLEXPRESS", "sa", "pass");
mssql_select_db("ACCOUNT_DBF");
$ip = $_SERVER['REMOTE_ADDR'];
$time = date("F j, Y, g:i a");
echo '
<form action="add.php?accion=add" method="post">
<input name="title" value="Title Here" type="text"/><br>
<input name="external" value="#" type="text"/><br>
<select name="category">
<option value="1">News</option>
<option value="2">Events</option>
<option value="3">Patch Notes</option>
</select><br>
<input name="time" value="'.$time.'" type="text" readonly="readonly"/><br>
<input name="who" value="" type="text"><br>
<textarea name="content" value="Text here" type="text" width="111" rows="12"/></textarea><br>
<input size="20" type="submit" value="Submit"/>
</form>';
if(@$_GET['accion'] == "add"){
if(isset($_POST["title"])){
mssql_select_db("ACCOUNT_DBF");
mssql_query("INSERT into NEWS_TBL (title,title_url,category,date,who,detalle,ip,blocked) VALUES ('$_POST[title]','$_POST[external]','$_POST[category]','$_POST[time]','$_POST[who]','$_POST[content]','$ip','no')");
}
}
?>
Just press in thanks :)
Credits to XiDaX.
---------- Post added at 01:26 PM ---------- Previous post was at 01:22 PM ----------
The problem is the script of query, SQL Server make a line called [when] and it is wrong, in query cant out [] extra, so just rename it or make me new script, [content] have the same problem.
Scroll up and try me new code.
Last edited by Dell Honne; 11-08-10 at 05:06 PM.
when i press Submit nothing happen
yeah but it still add a new :P
See, This guy probably didn't notice this(The guy who "fixed" the php script).
Here's the GOOD version:
Replace that.PHP Code:<?php
mssql_connect("XXX\SQLEXPRESS", "sa", "pass");
mssql_select_db("ACCOUNT_DBF");
$ip = $_SERVER['REMOTE_ADDR'];
$time = date("F j, Y, g:i a");
echo '
<form action="add.php?accion=add" method="post">
<input name="title" value="Title Here" type="text"/><br>
<input name="external" value="#" type="text"/><br>
<select name="category">
<option value="1">News</option>
<option value="2">Events</option>
<option value="3">Patch Notes</option>
</select><br>
<input name="time" value="'.$time.'" type="text" readonly="readonly"/><br>
<input name="who" value="" type="text"><br>
<textarea name="content" value="Text here" type="text" width="111" rows="12"/></textarea><br>
<input size="20" type="submit" name="submit" value="Submit"/>
</form>';
if(@$_GET['accion'] == "add"){
if(isset($_POST["submit"])){
mssql_select_db("ACCOUNT_DBF");
mssql_query("INSERT into NEWS_TBL (title,title_url,category,date,who,detalle,ip,blocked) VALUES ('$_POST[title]','$_POST[external]','$_POST[category]','$_POST[time]','$_POST[who]','$_POST[content]','$ip','no')");
}
}
?>
-Apixen.
It should process your request.
Lets just make a whole new forums for flyff?
Seriously guys -.-