[-me]Criando CATEGORIAS em sistema de notícias
Pessoal, tenho um sistema de notícias que adaptei para ADICIONAR TUTORIAIS...
Gostaria de saber o que posso fazer para quando acessar o ADICIONAR.PHP tiver lá as opções: Tutos de Jogos, ou Tutos de Programas...
ou seja, adicionar os tutorias em categorias diferentes: Tutoriais de GAMES ||| Tutoriais de PROGRAMAS || Variados
código do adicionar.php:
<?php
require("conexao.php");
require("funcoes.php");
$MENSAGEM = "";
if ($_POST['titulo'] != "")
{
$categoria = $_POST['categoria'];
$data = $_POST['data'];
$titulo = $_POST['titulo'];
$corpo = $_POST['corpo'];
$fonte = $_POST['fonte'];
$SQL = "INSERT INTO `tutoriais` ( `id` , `data` , `titulo` , `tutorial`)
VALUES ('', '".$data."', '".$titulo."', '".$corpo."');";
$result_id = mysql_query($SQL) or die(mysql_error());
$MENSAGEM = '<p align="center"><b><font color="Red">Notícia adicionada ao banco de dados com sucesso! :D</font></b></p><Br>';
}
?>
<style type="text/css">
<!--
.style1 {
font-size: 12px;
font-weight: bold;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
-->
</style>
<?
include "../fckeditor/fckeditor.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="[http://www.w3.org/1999/xhtml">](http://www.w3.org/1999/xhtml)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript" src="../fckeditor/fckeditor.js"></script>
</head>
<body>
<?
if (isset($_POST)){
echo stripslashes($_POST['corpo']);
echo "<hr>";
}
?>
<div align="center" style="background-color: #F3B200"><font size="2"><b> ADICIONAR TUTORIAL </b></font></div>
<? echo $MENSAGEM ?>
<form method="post" name="form1" action="">
<input type="hidden" name="data" value="<? echo date("YmdHis"); ?>" size="20">
<tr valign="baseline">
<td nowrap align="right" valign="top"><span class="style1">Título:</span>
<input type="text" name="titulo" value="" style="width:500px" /></td>
<td> </td>
</tr>
<tr valign="baseline">
<td nowrap align="right" valign="top">:</td>
<td>
<br>
<br>
<?php
$editor = new fckeditor("corpo");
$editor->BasePath = "/fckeditor/";
$editor->Width = "90%";
$editor->Height = "200";
$editor->Create();
?>
<input name="submit" type="submit" value="ENVIAR">
<br />
<br />
<input name="reset" type="reset" value="Limpar!" />
</form><br />
<br /></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td> </td>
</tr>
</form>Discussão (2)
Carregando comentários...