[thelist] I need php help again

Terion Miller webdev.terion at gmail.com
Wed Nov 26 09:42:19 CST 2008


Ok, what could cause this...script worked fine when I left the office
yesterday and now this morning it is back to Not inserting? This seems to be
happening to me the whole 3 weeks I got suckered into doing this job:
Here's the script:

<?php
if(isset($_POST['add']))
{
 include 'inc/dbconnOpen.php';
 $href = $_POST['href'];
 $title = $_POST['title'];
 $blurb = $_POST['blurb'];
 $bmonth = $_POST['bmonth'];
 $bday = $_POST['bday'];
 $byear = $_POST['byear'];
 $emonth = $_POST['emonth'];
 $eday = $_POST['eday'];
 $eyear = $_POST['eyear'];
 $expos = $_POST['expos'];

 $query = "INSERT INTO `textads`  (`title`, `href`, `blurb`, `bmonth`,
`bday`, `byear`, `emonth`, `eday`, `eyear`, `expos`) VALUES
('$title', '$href', '$blurb', '$bDate', '$eDate', '$expos', '$bmonth',
'$bday', '$byear', '$emonth', '$eday', '$eyear')";
/*echo $query; */
 mysql_query($query) or die('Error, friggin insert query failed');
 echo "New Dream Job Text Ad  added";
}
else
{
?>
<form action="" method="post">
<table width="400" border="0" cellspacing="1" cellpadding="2">
<tr>
<td width="100">TITLE</td>
<td><input name="title" type="text" id="title"></td>
</tr>
<tr>
<td width="100">Blurb</td>
<td><input name="blurb" type="text" id="blurb"></td>
</tr>
<tr>
<td width="100">LINK</td>
<td><input name="href" type="text" id="href"></td>
</tr>
<tr>
<td width="100">Beginning Date</td>
<td>
<table>
<td>Month:<input name="bmonth" type="text"
id="bmonth"></td><td>Day:<input name="bday" type="text"
id="bday"></td><td>Year:<input name="byear" type="text"
id="byear"></td></table></td>
</tr>
<tr>
<td width="100">Ending Date</td>
<td>
<table>
<td>Month<input name="emonth" type="text" id="emonth"></td><td>Day:
<input name="eday" type="text" id="eday"></td><td>Year:<input
name="eyear" type="text" id="eyear"></td></table></td>
</tr>
<tr>
<td width="100">Exposures Purchased</td>
<td><input name="expos" type="text" id="expos"></td>
</tr>
<tr>
<td width="100">&nbsp;</td>
<td><input name="add" type="submit" id="add" value="Add AD"><input
type="reset"></td>
</tr>
</table>
</form>
<?php
}
?>
</body>
</html>



More information about the thelist mailing list