Code: Select all
function do_news() {
$this->site = $_GET['site'];
$this->author = $_COOKIE['gp_user'];
$this->headline = $_POST['headline'];
$this->caption = $_POST['caption'];
$this->news = $_POST['news'];
$this->color = $color;
$this -> select_category();
//$this -> text_news();
$sql = "insert into ".$this->site."_news ( author , headline , caption , news , color ) values ('$this->author' , '$this->headline' , '$this->caption' , '$this->news' , '$color')";
$act = mysql_query($sql);
if (!$act) { echo mysql_error(); }
}This is the code for select_category:
Code: Select all
function select_category() {
$this->category = $_POST['category'];
$sql = "select cat_hex from news_cat where cat_name = '$this->category'";
$act = mysql_query($sql);
while ($hex = mysql_fetch_array($act)) {
$color = $hex['cat_hex'];
echo $color;
}
}Any reason that won't work? Any ideas to solve the problem?
Help is appreciated!
-Jim