about2flip
Technical User
Hello:
I have a form that I am trying to make a dropdown menu using a phpscript. I keep getting a tstring error on line 21 which is function make_calendar_pulldowns...
I am using php4, is this the correct format for php 4? If someone could cut and past the script into their editor and see what is wrong I highly appreciate it. Also I need to know what variables I uses to write into my sql db. Thanks.
<?
$page_title ="EXDQ TRUCKING ADMIN";
include ('includes/header.html');
?>
<h1 id="mainhead">Expedited Trucking Admin</h1>
<p>
<?
echo 'Today is ' .date('l') . ' . The current Time is ' . date ('g:i a') .'.';
?>
</p>
<Form method ="post" action="addload.php">
<table width="557" border="0">
<tr>
<td width="116">Shipper Origin:</td>
<td width="431"><input name="shipperorg" type="text" size="20" maxlength="10" /></td>
</tr>
<tr>
<td><label>Pick Up Date:</label></td>
<td>
<?
fuction make_calender_pulldowns($m=NULL, $d=NULL, $y=NULL) {
// Make the months array.
$months = array (1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July',
'August', 'September', 'October', 'November', 'December');
// Make the months pull-down menu.
echo '<select name="month">';
foreach ($month as $key => $value) {
echo "<option value=\"$key\"";
if ($key == $m) { //Preselect.
echo ' selected="selected"';
}
echo ">$value</option>\n";
}
echo '</select>';
// Make the days pull-down menu.
echo '<select name="day">';
for ($day = 1; $day <= 31; $day++) {
echo "<option value=\"$day\"";
if($day==$d) {//Preselect.
echo 'selected="selected"';
}
echo ">$day</option>/n";
}
echo '</select>';
// Make the years pull-down menu.
echo '<select name="year">';
for($year = 2006; $year <=2015; $year++) {
echo "<option value=\"$year\"";
if ($year == $y) {//Preselect.
echo 'selected="selected"';
}
echo ">$year</option>\n";
}
echo '</select>';
// Get today's information and call the function.
$dates=getdate();
make_calendar_pulldowns
($dates['mon'], $dates['mday'], $dates['year']);
?>
</td>
</tr>
<tr>
<td>Origin City: </td>
<td><input name="origincity" type="text" id="origincity" size="35" maxlength="35" /></td>
</tr>
<tr>
<td>Origin State: </td>
<td><input name="originstate" type="text" id="originstate" size="5" maxlength="2" /></td>
</tr>
<tr>
<td>Destination City: </td>
<td><input name="destcity" type="text" id="destcity" size="35" maxlength="35" /></td>
</tr>
<tr>
<td>Destination State: </td>
<td><input name="deststate" type="text" id="deststate" size="5" maxlength="2" /></td>
</tr>
<tr>
<td>Loadtype:</td>
<td><select name="loadtype" id="loadtype">
<option>Please Select</option>
<option value="Outbound">Outbound</option>
<option value="Inbound">Inbound</option>
</select> </td>
</tr>
<tr>
<td>Euipment Type: </td>
<td><select name="equiptype" id="equiptype">
<option>Please Select</option>
<option>FBTL</option>
</select> </td>
</tr>
<tr>
<td>Weight:</td>
<td><input name="weight" type="text" id="weight" size="10" maxlength="10" /></td>
</tr>
<tr>
<td>Miles:</td>
<td><input name="miles" type="text" id="miles" size="10" maxlength="10" /></td>
</tr>
</table>
<p>
<input name="submit" type="submit" id="submit" value="Add New Load" />
</p>
<p> </p>
I have a form that I am trying to make a dropdown menu using a phpscript. I keep getting a tstring error on line 21 which is function make_calendar_pulldowns...
I am using php4, is this the correct format for php 4? If someone could cut and past the script into their editor and see what is wrong I highly appreciate it. Also I need to know what variables I uses to write into my sql db. Thanks.
<?
$page_title ="EXDQ TRUCKING ADMIN";
include ('includes/header.html');
?>
<h1 id="mainhead">Expedited Trucking Admin</h1>
<p>
<?
echo 'Today is ' .date('l') . ' . The current Time is ' . date ('g:i a') .'.';
?>
</p>
<Form method ="post" action="addload.php">
<table width="557" border="0">
<tr>
<td width="116">Shipper Origin:</td>
<td width="431"><input name="shipperorg" type="text" size="20" maxlength="10" /></td>
</tr>
<tr>
<td><label>Pick Up Date:</label></td>
<td>
<?
fuction make_calender_pulldowns($m=NULL, $d=NULL, $y=NULL) {
// Make the months array.
$months = array (1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July',
'August', 'September', 'October', 'November', 'December');
// Make the months pull-down menu.
echo '<select name="month">';
foreach ($month as $key => $value) {
echo "<option value=\"$key\"";
if ($key == $m) { //Preselect.
echo ' selected="selected"';
}
echo ">$value</option>\n";
}
echo '</select>';
// Make the days pull-down menu.
echo '<select name="day">';
for ($day = 1; $day <= 31; $day++) {
echo "<option value=\"$day\"";
if($day==$d) {//Preselect.
echo 'selected="selected"';
}
echo ">$day</option>/n";
}
echo '</select>';
// Make the years pull-down menu.
echo '<select name="year">';
for($year = 2006; $year <=2015; $year++) {
echo "<option value=\"$year\"";
if ($year == $y) {//Preselect.
echo 'selected="selected"';
}
echo ">$year</option>\n";
}
echo '</select>';
// Get today's information and call the function.
$dates=getdate();
make_calendar_pulldowns
($dates['mon'], $dates['mday'], $dates['year']);
?>
</td>
</tr>
<tr>
<td>Origin City: </td>
<td><input name="origincity" type="text" id="origincity" size="35" maxlength="35" /></td>
</tr>
<tr>
<td>Origin State: </td>
<td><input name="originstate" type="text" id="originstate" size="5" maxlength="2" /></td>
</tr>
<tr>
<td>Destination City: </td>
<td><input name="destcity" type="text" id="destcity" size="35" maxlength="35" /></td>
</tr>
<tr>
<td>Destination State: </td>
<td><input name="deststate" type="text" id="deststate" size="5" maxlength="2" /></td>
</tr>
<tr>
<td>Loadtype:</td>
<td><select name="loadtype" id="loadtype">
<option>Please Select</option>
<option value="Outbound">Outbound</option>
<option value="Inbound">Inbound</option>
</select> </td>
</tr>
<tr>
<td>Euipment Type: </td>
<td><select name="equiptype" id="equiptype">
<option>Please Select</option>
<option>FBTL</option>
</select> </td>
</tr>
<tr>
<td>Weight:</td>
<td><input name="weight" type="text" id="weight" size="10" maxlength="10" /></td>
</tr>
<tr>
<td>Miles:</td>
<td><input name="miles" type="text" id="miles" size="10" maxlength="10" /></td>
</tr>
</table>
<p>
<input name="submit" type="submit" id="submit" value="Add New Load" />
</p>
<p> </p>