can you be a little more specific. im a newbie to php & mysql.
Heres my code.
<?
require("config.php3");
include("connect.inc");
db_connect();
require("split.class.php");
$sellogin="select * from article_admin where article_login=1";
$resultlog=mysql_query($sellogin);
if(mysql_num_rows($resultlog)==0)
{
echo "<META HTTP-EQUIV='REFRESH' CONTENT=\"0; URL='index.htm'\">";
exit;
}
?>
<?
if ($imageField_x!="")
{
$sqlfind="select * from article_main where article_title='$arttitle'";
$resfind=mysql_query($sqlfind);
if (mysql_num_rows($resfind)>0)
{
$failure=1;
}
else
{
$createdate=date("Y-m-d");
$ins="insert into article_main (article_title,article_desc,creation_date) values ('$arttitle','$artdesc','$createdate')";
mysql_query($ins);
echo "<META HTTP-EQUIV='REFRESH' CONTENT=\"0; URL='viewarticle.php?added=1&title=$arttitle'\">";
exit;
}
}
?>
<html>
<head>
<title>Add Domain</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px}
-->
</style>
<LINK href="images/style.css"
rel=stylesheet type=text/css>
<SCRIPT language=javascript>
function check()
{
if(document.form1.arttitle.value=="")
{
alert("Please enter proper title.");
document.form1.arttitle.focus();
return false;
}
if (document.form1.artdesc.value.length<2)
{
alert("Please enter proper description.");
document.form1.artdesc.focus();
return false;
}
}
</script>
</head>
<body bgcolor=#ffffff link="#006699" vlink="#008080" alink="#CC0000">
<center>
<div align="center">
<center>
</center>
</div>
</center>
<table width="600" border="0" cellpadding="0" cellspacing="0" align="center">
<center>
<tr>
<td valign="top" colspan="3">
<table width="100%" border="0" cellpadding="2" cellspacing="0">
<tr valign="middle" bgcolor="#eeeeee" align="left">
<td bgcolor="#FFFFFF"><font face="Verdana" size="1" color="#000000"> <b> </b></font></td>
</tr>
</table>
<img src="/images/clear.gif" width="0" height="5">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
</table>
<form name="form1" method="post" action="addarticle.php" onsubmit="return check()">
<table width="75%" border="0" cellspacing="0" cellpadding="5" align="center">
<tr bgcolor="#990000">
<td class="body" height="35" bgcolor="#FFFFFF" valign="middle">
<div align="center"><b></b>
<table width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
<tr bgcolor="#FFFFFF">
<td colspan=2 align=left><a href="javascript:history.back()"><font face=arial>back</font></a></td>
<td align=right><a href="services.php"><font face=arial>home</font></a></td>
</tr>
<tr bgcolor="#CCCCCC">
<td colspan=3 align=center><b><font color="#000099" size="-1" face="Arial, Helvetica, sans-serif">New Sermon</font></b></td>
</tr>
<?
if ($inserted=="1")
{
?>
<tr>
<td colspan=3 align=center><font face=arial size=2 color=red><b>Domain
Succesfully Added</b></font></td>
</tr>
<?
$inserted=0;
}
?>
<?
if ($failure=="1")
{
?>
<tr>
<td colspan=3 align=center><font face=arial size=2 color=red><b>Title
Already Exist</b></font></td>
</tr>
<?
$failure=0;
}
?>
<tr>
<td class="body" width="49%">Sermon Title</td>
<td class="body" width="1%">:</td>
<td class="body" width="50%">
<input type="text" size=30 maxlength=40 name="arttitle" value="<?=$arttitle?>" onChange="javascript:while(''+this.value.charAt(0)==' ')this.value=this.value.substring(1,this.value.length);">
</td>
</tr>
<tr>
<td class="body" width="49%">Description</td>
<td class="body" width="1%">:</td>
<td class="body" width="50%">
<textarea name=artdesc cols=30 rows=5 onChange="javascript:while(''+this.value.charAt(0)==' ')this.value=this.value.substring(1,this.value.length);" ></textarea>
</td>
</tr>
<?
$now=date("M Y");
$nowyr=date("Y");
$nowmon=date("M");
$currmonth=date("m");
$prevmon=date("m");
$nowday=date("d");
$prevyr=$nowyr-1;
$prevnow=$nowmon." ".$prevyr;
$prevdate=$prevyr."-".$prevmon."-".$nowday; $nowstart=$nowyr."-04-01";
$prevstart=$prevyr."-04-01";
?>
<tr>
<td class="body" width="49%"> </td>
<td class="body" width="1%"> </td>
<td class="body" width="50%"> </td>
</tr>
<tr>
<td class="body" colspan="3">
<div align="center">
<input type="image" border="0" name="imageField" src="images/submit-button.gif" width="89" height="20">
</div>
</td>
</tr>
<tr>
<td class="body" width="49%"> </td>
<td class="body" width="1%"> </td>
<td class="body" width="50%"> </td>
</tr>
</table>
<b><font color="#000099"> </font></b></div>
</td>
</tr>
<tr bgcolor="#990000">
<td class="body" height="212" bgcolor="#FFFFFF" valign="middle">
<div align="center"> </div>
</td>
</tr>
</table>
</form>
</td>
</tr>
</center>
</table>
</body>
</html>