Line Problems in PHP Code
Posted: Thu Apr 26, 2007 9:47 am
Jcart | Please use
Jcart | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I have a system for when I go to my administration page, I can add peoples names to another page by selecting their name and clicking submit, but when ever I go to the administration page or when ever I refresh that page, it puts an <hr> line in the page where the peoples names are, even if I don't click submit, all I have to do is refresh and it will put one there. Can someone take a look at my code and see if they can see anything wrong?Code: Select all
<?
include "connect.phtml";
$db=delranfire_org;
$query1="insert into dutycrews(name,station,dat,dat_day,fr,toa,position,truck)values('$select','$station','$ddate_month','$ddate_day','$dfrom','$dto','$dposition','$dtruck')";
mysql_db_query($db,$query1,$connection) or die("Error in query:$query. " .mysql_error());
$query="select name from member order by name asc";
$rows=mysql_db_query($db,$query,$connection) or die("Error in query:$query. " .mysql_error());
?>
<html>
<head>
<title>
<?
include "admin_panel_title.php";?>
</title>
</head>
<body bgcolor="#990000" text="#FFCC66" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="#FFCC66" vlink="#999900" alink="#FFCC66">
<form action="dutycrewsadd.phtml" method="post">
<center>
<img src="/newadmin/Administration_Panel_Banner.jpg"><BR>
<h3>Duty Crews</h3>
<table border="1" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="47%" align="center" valign="middle">
<div align="right"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>Select Member: </b></div>
</td>
<td width="51%" valign="middle">
 <select name="select">
<option>Select Member</option>
<?
while($row=mysql_fetch_array($rows))
{
echo "<option value='$row[name]'>$row[name]</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td width="47%" align="center" valign="middle">
<div align="right"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Enter
Station Name: </font></b></div>
</td>
<td width="51%" valign="middle">
 <select name="station">
<option selected value="">Select Station
<option value="Station 231">Station 231
<option value="Station 232">Station 232
</td>
</tr>
<tr>
<td width="47%" align="center" valign="middle">
<div align="right"><font face="Verdana, Arial, Helvetica, sans-serif"><b><font size="2">Duty Crew
Date: </font></b></font></div>
</td>
<td width="51%" valign="middle">
 <select name="ddate_month">
<option selected value="">Select Month
<option value="January">January
<option value="February">February
<option value="March">March
<option value="April">April
<option value="May">May
<option value="June">June
<option value="July">July
<option value="August">August
<option value="September">September
<option value="October">October
<option value="November">November
<option value="December">December
</select>
<select name="ddate_day">
<option selected value="">Select Day
<option value="1, 2006">1st
<option value="2, 2006">2nd
<option value="3, 2006">3rd
<option value="4, 2006">4th
<option value="5, 2006">5th
<option value="6, 2006">6th
<option value="7, 2006">7th
<option value="8, 2006">8th
<option value="9, 2006">9th
<option value="10, 2006">10th
<option value="11, 2006">11th
<option value="12, 2006">12th
<option value="13, 2006">13th
<option value="14, 2006">14th
<option value="15, 2006">15th
<option value="16, 2006">16th
<option value="17, 2006">17th
<option value="18, 2006">18th
<option value="19, 2006">19th
<option value="20, 2006">20th
<option value="21, 2006">21st
<option value="22, 2006">22nd
<option value="23, 2006">23rd
<option value="24, 2006">24th
<option value="25, 2006">25th
<option value="26, 2006">26th
<option value="27, 2006">27th
<option value="28, 2006">28th
<option value="29, 2006">29th
<option value="30, 2006">30th
<option value="31, 2006">31st
</select>
</td>
</tr>
<tr>
<td width="47%" align="center" valign="middle">
<div align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>Duty Crew
Time Start: </b></font></div>
</td>
<td width="51%" valign="middle">
 <select name="dfrom">
<option selected value="">Select Start Time
<option value="0100 Hours">0100
<option value="0200 Hours">0200
<option value="0300 Hours">0300
<option value="0400 Hours">0400
<option value="0500 Hours">0500
<option value="0600 Hours">0600
<option value="0700 Hours">0700
<option value="0800 Hours">0800
<option value="0900 Hours">0900
<option value="1000 Hours">1000
<option value="1100 Hours">1100
<option value="1200 Hours">1200
<option value="1300 Hours">1300
<option value="1400 Hours">1400
<option value="1500 Hours">1500
<option value="1600 Hours">1600
<option value="1700 Hours">1700
<option value="1800 Hours">1800
<option value="1900 Hours">1900
<option value="2000 Hours">2000
<option value="2100 Hours">2100
<option value="2200 Hours">2200
<option value="2300 Hours">2300
<option value="0000 Hours">0000
</option>
</select>
</td>
</tr>
<tr>
<td width="47%" align="center" valign="middle">
<div align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>Duty Crew
Time Finish: </b></font></div>
</td>
<td width="51%" valign="middle">
 <select name="dto">
<option selected value="">Select Finish Time
<option value="0100 Hours">0100
<option value="0200 Hours">0200
<option value="0300 Hours">0300
<option value="0400 Hours">0400
<option value="0500 Hours">0500
<option value="0600 Hours">0600
<option value="0700 Hours">0700
<option value="0800 Hours">0800
<option value="0900 Hours">0900
<option value="1000 Hours">1000
<option value="1100 Hours">1100
<option value="1200 Hours">1200
<option value="1300 Hours">1300
<option value="1400 Hours">1400
<option value="1500 Hours">1500
<option value="1600 Hours">1600
<option value="1700 Hours">1700
<option value="1800 Hours">1800
<option value="1900 Hours">1900
<option value="2000 Hours">2000
<option value="2100 Hours">2100
<option value="2200 Hours">2200
<option value="2300 Hours">2300
<option value="0000 Hours">0000
</option>
</select>
</td>
</tr>
<tr>
<td width="47%" align="center" valign="middle">
<div align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>Riding Position: </b></font></div>
</td>
<td width="51%" valign="middle">
 <select name="dposition">
<option selected value="">Select Position
<option value="Driver">Driver
<option value="Officer">Officer
<option value="Pack">Pack
<option value="Extra">Extra
</option>
</select>
</td>
</tr>
<tr>
<td width="47%" align="center" valign="middle">
<div align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>Truck Assignment: </b></font></div>
</td>
<td width="51%" valign="middle">
 <select name="dtruck">
<option selected value="">Select Truck
<option value="Engine 2311">Engine 2311
<option value="Engine 2312">Engine 2312
<option value="Ladder 2315">Ladder 2315
<option value="Brush 2316">Brush 2316
<option value="Pickup 2318">Pickup 2318
<option value="Cascade 2319">Cascade 2319
<option value="Engine 2321">Engine 2321
<option value="Squirt 2324">Squirt 2324
<option value="Pickup 2327">Pickup 2327
<option value="Support 2328">Support 2328
<option value="Rescue 2329">Rescue 2329
</select>
</td>
</tr>
<tr>
<td colspan="3">
<div align="center">
<input type="submit" name="Submit" value="Post Duty">
<input type="reset" name="reset" value="Clear Information">
</div>
</td>
</tr>
</table>
</form>
<a href="/newadmin/">Back to Administration Section</a>
</body></html>
<?
mysql_close();
?>Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]