ok what i want is so that if nameused or emailused or comment i null or just empty like'' i want it to return an error , instead its backwards it allows the empty post and disallows the post wth conntent look. any help will be greatly appreciated
<?php
include('include2.php');
connect_db();
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
header("Refresh: 4; URL=galpicinfo.php?picid=".$_GET['picid']."");
if($_POST['nameused'] or $_POST['emailused'] or $_POST['comment'] == NULL){
echo 'there is nothing to post';}else{
$time = time();
$query = 'select * from comments where picid="'.$_GET['picid'].'"';
$result = mysql_query($query);
$numrows = mysql_num_rows($result);
$postcount = $numrows + 1;
$query = 'INSERT INTO `comments` ( `commentid` , `picid` , `nameused` , `emailused` , `pstcount` , `comment` , `postdate` )
VALUES (
NULL , \''.$_GET['picid'].'\', \''.$_POST['nameused'].'\', \''.$_POST['emailused'].'\', \''.$postcount.'\', \''.$_POST['comment'].'\', \''.$time.'\'
), (
NULL , \'\', \'\', \'\', \'\', \'\', \'\'
);';
$result = mysql_query($query);
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Thanks for your post, You will be redirected</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">td img {display: block;}</style>
<!--Fireworks 8 Dreamweaver 8 target. Created Mon Jul 04 20:57:15 GMT-0400 (Eastern Standard Time) 2005-->
<script language="JavaScript1.2" type="text/javascript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
</head>
<body bgcolor="#e78b19" onLoad="MM_preloadImages(\'images/saved_r2_c2_f2.gif\');">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="500">
<!-- fwtable fwsrc="saved.png" fwbase="saved.gif" fwstyle="Dreamweaver" fwdocid = "1247369023" fwnested="0" -->
<tr>
<td><img src="images/spacer.gif" width="382" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="53" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="65" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="1" border="0" alt="" /></td>
</tr>
<tr>
<td colspan="3"><img name="saved_r1_c1" src="images/saved_r1_c1.gif" width="500" height="160" border="0" id="saved_r1_c1" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="160" border="0" alt="" /></td>
</tr>
<tr>
<td rowspan="2"><img name="saved_r2_c1" src="images/saved_r2_c1.gif" width="382" height="140" border="0" id="saved_r2_c1" alt="" /></td>
<td><a href="galpicinfo.php?picid='.$_REQUEST['picid'].'" onmouseout="MM_swapImgRestore();" onmouseover="MM_swapImage(\'saved_r2_c2\',\'\',\'images/saved_r2_c2_f2.gif\',1);"><img name="saved_r2_c2" src="images/saved_r2_c2.gif" width="53" height="16" border="0" id="saved_r2_c2" alt="" /></a></td>
<td rowspan="2"><img name="saved_r2_c3" src="images/saved_r2_c3.gif" width="65" height="140" border="0" id="saved_r2_c3" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="16" border="0" alt="" /></td>
</tr>
<tr>
<td><img name="saved_r3_c2" src="images/saved_r3_c2.gif" width="53" height="124" border="0" id="saved_r3_c2" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="124" border="0" alt="" /></td>
</tr>
</table>
</body>
</html>
';
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$totaltime = ($endtime - $starttime);
echo "This page was executed in ".$totaltime." seconds";
// NN4 requires that we output something...
exit();}
?>