- Joined
- Jun 16, 2010
- Messages
- 9
- Reaction score
- 4
Last edited:
<?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')");
}
}
?>
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
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
<?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']; ?>
<?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')");
}
}
?>
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
when i press Submit nothing happen
<?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')");
}
}
?>
How about you guys stop QQ'eing all the time? This **** is unique and helps alot of people. It's going to get leeched but it's not something that got leaked. If your any decent and your server's as decent as you say it is, you'll be able to come up with something unique and top the others. A simple news system doesn't top other servers. And who knows how many of you aren't using this.
I say, nice release.
Amen.
Why can't people EVER take the time to actually LEARN a web-language, or even a programming language. It's not that fuckin' hard. I did it. Well, I did it in 1 year - 2 years, but thats cause I really didn't take my time reading over stupid w3school ****. I went and used common sense. I looked at the source code, figured out what the **** it meant, and so on. It can't be that hard. I'm 12 years old, for crying out loud. I've set up my own server(Personal), I've coded my share of ****, and these fuckin' 20 year olds can't set their own **** up, and they have to leech to make a decent website.
/End Rage Mode
//Edit
I reached 600 posts!!!! W00T, GO ME!