Public feed #602756

How to sanitize?

public text v1 · immutable
Raw Edit
·published 2007-07-04 09:06 UTC
rendered paste body
<?php

	require ('../requires.php');
	
	require('../forums/SSI.php');
	if(!in_array(GROUP_NEWS, $user_info['groups'])) {
		header("Location: $admin[redirect]");	
	}
	else {
	}
	
	if(!in_array(GROUP_NEWS, $user_info['groups'])) {
		header("Location: $admin[redirect]");	
	}
	
	$author = $context['user']['name'];
	$title = mysql_real_escape_string($_POST['title']);
	$content = mysql_real_escape_string($_POST['content']);
	$time = date('l, j F, Y - g:i A');
		
	mysql_query ("
		INSERT INTO news (news_author, news_title, news_content, news_time)
		VALUES ('$author', '$title', '$content', '$time')
	");
	
?>