Jump to content

trilbyfish

Members
  • Posts

    52
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

trilbyfish's Achievements

Member

Member (2/5)

0

Reputation

  1. Ok thanks, would that let me do 2 or coloumns? WOuld i have to have a different variable each time?
  2. Is there a way to run a multi-line mysql query (such as creating a database with about 20 fields and entering some data) from a php script?
  3. Ok thanks for the help. The only thing that seems to work for me is echo $row[0]; Is there a way to do this for multiple columns? ive tried changing the number in the $row[0] but that just echoes nothing.
  4. hi i have the sql query SELECT COUNT( * ) FROM `bookingtable` WHERE `eight` = '-' and the output is 2. how do i echo the output using php? I know it is probably right in front of me, but i cant find the solution. The php code i have at the moment is <?php require_once ('../project/connect.php'); // Connect to the db. $query = "SELECT COUNT(*) FROM `bookingtable` WHERE `eight` = '-'"; $result = @mysql_query ($query); // Run the query. $row = mysql_fetch_array ($result, MYSQL_NUM); // Return a record, if applicable. echo ($row['count(*)']); ?> The output of this is a blank page. If anyone can tell me what i need to echo, or if there are any problems above that, i would be grateful. Thanks in advance
  5. I've change the column names, but still get the same error. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; CREATE TABLE 'bookingtable3' ( `baynumber` varchar(20) NOT NULL auto_increme' at line 1 Is the error, and the code is: ("DROP TABLE IF EXISTS bookingtable3; CREATE TABLE 'bookingtable3' ( `baynumber` varchar(20) NOT NULL auto_increment, `eight` varchar(30) NOT NULL default '', `nine` varchar(30) NOT NULL default '', `ten` varchar(30) NOT NULL default '', `eleven` varchar(30) NOT NULL default '', `twelve` varchar(30) NOT NULL default '', `thirteen` varchar(30) NOT NULL default '', `fourteen` varchar(30) NOT NULL default '', `fifteen` varchar(30) NOT NULL default '', `sixteen` varchar(30) NOT NULL default '', `id` smallint(30) NOT NULL default '0', PRIMARY KEY (`baynumber`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=20 ; Edit: ive changed `baynumber` varchar(20) NOT NULL auto_increment, to `baynumber` int(20) NOT NULL auto_increment, but still the same problem
  6. How do i do the (date('G')<18) ? date('l') : date('l',time()+60*60*24) thing so that if the next day is a saturday or sunday, it shows monday?
  7. Thanks for that, it was really helpful. One more thing, how could i improve on that so that also tomorrows date is displayed after 6pm, and not just the day? Thanks in advance
  8. Ahha i didnt think of that! No that didnt work, but maybe if i did something like if hour<6 echo todays date else echo tomorrows date. How would i do that?
  9. How would i set uo the php date function so that at 6pm it prints the following day? So it would say 'table for 'today's date'' upto 5:59pm and then at 6pm it was say 'table for 'tomorrow's date''? I hope i have explained this so someone can understand it, its hard to explain. Thanks in advance
  10. ("DROP TABLE IF EXISTS `bookingtable3`; CREATE TABLE bookingtable3 ( baynumber tinyint(2) NOT NULL auto_increment, 08:00 - 09:00 varchar(30) NOT NULL default '', 09:00 - 10:00 varchar(30) NOT NULL default '', 10:00 - 11:00 varchar(30) NOT NULL default '', 11:00 - 12:00 varchar(30) NOT NULL default '', 12:00 - 13:00 varchar(30) NOT NULL default '', 13:00 - 14:00 varchar(30) NOT NULL default '', 14:00 - 15:00 varchar(30) NOT NULL default '', 15:00 - 16:00 varchar(30) NOT NULL default '', 16:00 - 17:00 varchar(30) NOT NULL default '', id smallint(30) NOT NULL default '0', PRIMARY KEY (baynumber) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=20 ; INSERT INTO bookingtable3 VALUES(1, '-', '-', '-', '-', '-', '-', '-', '-', '-', 1); INSERT INTO bookingtable3 VALUES(2, '-', '-', '-', '-', '-', '-', '-', '-', '-', 2); INSERT INTO bookingtable3 VALUES(3, '-', '-', '-', '-', '-', '-', '-', '-', '-', 3); INSERT INTO bookingtable3 VALUES(4, '-', '-', '-', '-', '-', '-', '-', '-', '-', 4); INSERT INTO bookingtable3 VALUES(5, '-', '-', '-', '-', '-', '-', '-', '-', '-', 5); INSERT INTO bookingtable3 VALUES(6, '-', '-', '-', '-', '-', '-', '-', '-', '-', 6); INSERT INTO bookingtable3 VALUES(7, '-', '-', '-', '-', '-', '-', '-', '-', '-', 7); INSERT INTO bookingtable3 VALUES(8, '-', '-', '-', '-', '-', '-', '-', '-', '-', ; INSERT INTO bookingtable3 VALUES(9, '-', '-', '-', '-', '-', '-', '-', '-', '-', 9); INSERT INTO bookingtable3 VALUES(10, '-', '-', '-', '-', '-', '-', '-', '-', '-', 10); INSERT INTO bookingtable3 VALUES(11, '-', '-', '-', '-', '-', '-', '-', '-', '-', 11); INSERT INTO bookingtable3 VALUES(12, '-', '-', '-', '-', '-', '-', '-', '-', '-', 12); INSERT INTO bookingtable3 VALUES(13, '-', '-', '-', '-', '-', '-', '-', '-', '-', 13); INSERT INTO bookingtable3 VALUES(14, '-', '-', '-', '-', '-', '-', '-', '-', '-', 14); INSERT INTO bookingtable3 VALUES(15, '-', '-', '-', '-', '-', '-', '-', '-', '-', 15); INSERT INTO bookingtable3 VALUES(16, '-', '-', '-', '-', '-', '-', '-', '-', '-', 16); INSERT INTO bookingtable3 VALUES(17, '-', '-', '-', '-', '-', '-', '-', '-', '-', 17); INSERT INTO bookingtable3 VALUES(18, '-', '-', '-', '-', '-', '-', '-', '-', '-', 18); INSERT INTO bookingtable3 VALUES(19, '-', '-', '-', '-', '-', '-', '-', '-', '-', 19); ") Most of the '-' would have names there, but i removed them.
  11. I am having a problem when running some code, and i get the following error: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CREATE TABLE bookingtable3 ( baynumber tinyint(2) NOT NULL auto_increment, ' at line 2 I do not know why this is because it is automatically generated code. Thanks in advance
  12. My sessions work fine. Doing that just keeps redirecting me to the login page whenever i login.
  13. Ok ive done all that, and all the if statements are working, but now the submit button doesnt show up. Ive been fiddling around with it for hours. <?php session_name('visit'); session_start(); //check for session value if(!isset($_SESSION['agent']) OR ($_SESSION['agent'] != md5($_SERVER['HTTP_USER_AGENT']))){ // Redirect the user to the loggedin.php page. // Start defining the URL. $url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']); // Check for a trailing slash. if ((substr($url, -1) == '/') OR (substr($url, -1) == '\\') ) { $url = substr ($url, 0, -1); // Chop off the slash. } // Add the page. $url .= '/members.php'; header("Location: $url"); exit(); // Quit the script. } // This script retrieves all the records from bookingtable where the id is the one that corresponds with what was clicked on the previous page $page_title = 'View the booking table'; require_once ('../project/connect.php'); // Connect to the db. // Make sure the id that was on the bookingtable page was set, and select the relevent bay record from the sql 'bookingtable' table // Check for $_GET id if (isset($_GET['id'])) { $id = mysql_real_escape_string($_GET['id']); $sql = "SELECT * FROM bookingtable WHERE id = $id"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { // echo '$_GET['id']; // Table header. echo '<table align="left" cellspacing="0" cellpadding="5" border ="1"> <tr> <td align="left"><b>Bay Number</b></td> <td align="left"><b>08:00 - 09:00 </b></td> <td align="left"><b>09:00 - 10:00 </b></td> <td align="left"><b>10:00 - 11:00 </b></td> <td align="left"><b>11:00 - 12:00 </b></td> <td align="left"><b>12:00 - 13:00 </b></td> <td align="left"><b>13:00 - 14:00 </b></td> <td align="left"><b>14:00 - 15:00 </b></td> <td align="left"><b>15:00 - 16:00 </b></td> <td align="left"><b>16:00 - 17:00 </b></td> </tr> '; echo '<table align="left" cellspacing="0" cellpadding="5" border ="1"> <tr > <td colspan="11" td align="middle"> <input type="submit" name="submit" value="Submit"></td> <input type="hidden" name="submitted" value="TRUE" /> <input type="hidden" name="id" value="' . $id . '" /> </tr> '; // Fetch and print the record whice corresponds to the bay id from the 'edit' link that was clicked on the bookingtable page if ($result) { while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo ' <tr> <form action="editbay.php?id=' . $row['id'] . '" method="post"> <td align="left">' . $row['baynumber'] . '</td> '; if (($row['08:00 - 09:00']) == "-") { echo '<td align="left"><select name="eight"> <option value="-">-</option> <option value="' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '">' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '</option> <option value="' . $row['08:00 - 09:00'] . '" selected="selected">' . $row['08:00 - 09:00'] . '</option> </select> </td>'; } else { echo '<td align="left"><input type="text" name="08:00 - 09:00" size="12" maxlength="30" readonly="true" value="' . $row['08:00 - 09:00'] . '" /></td>'; }' '; if (($row['09:00 - 10:00']) == "-") { echo '<td align="left"><select name="nine"> <option value="-">-</option> <option value="' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '">' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '</option> <option value="' . $row['09:00 - 10:00'] . '" selected="selected">' . $row['09:00 - 10:00'] . '</option> </select> </td>'; } else { echo '<td align="left"><input type="text" name="08:00 - 09:00" size="12" maxlength="30" readonly="true" value="' . $row['09:00 - 10:00'] . '" /></td>'; }' '; if (($row['10:00 - 11:00']) == "-") { echo '<td align="left"><select name="ten"> <option value="-">-</option> <option value="' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '">' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '</option> <option value="' . $row['10:00 - 11:00'] . '" selected="selected">' . $row['10:00 - 11:00'] . '</option> </select> </td>'; } else { echo '<td align="left"><input type="text" name="10:00 - 11:00" size="12" maxlength="30" readonly="true" value="' . $row['10:00 - 11:00'] . '" /></td>'; }' '; if (($row['11:00 - 12:00']) == "-") { echo '<td align="left"><select name="eleven"> <option value="-">-</option> <option value="' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '">' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '</option> <option value="' . $row['11:00 - 12:00'] . '" selected="selected">' . $row['11:00 - 12:00'] . '</option> </select> </td>'; } else { echo '<td align="left"><input type="text" name="11:00 - 12:00" size="12" maxlength="30" readonly="true" value="' . $row['11:00 - 12:00'] . '" /></td>'; }' '; if (($row['12:00 - 13:00']) == "-") { echo '<td align="left"><select name="twelve"> <option value="-">-</option> <option value="' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '">' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '</option> <option value="' . $row['12:00 - 13:00'] . '" selected="selected">' . $row['12:00 - 13:00'] . '</option> </select> </td>'; } else { echo '<td align="left"><input type="text" name="12:00 - 13:00" size="12" maxlength="30" readonly="true" value="' . $row['12:00 - 13:00'] . '" /></td>'; }' '; if (($row['13:00 - 14:00']) == "-") { echo '<td align="left"><select name="thirteen"> <option value="-">-</option> <option value="' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '">' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '</option> <option value="' . $row['13:00 - 14:00'] . '" selected="selected">' . $row['13:00 - 14:00'] . '</option> </select> </td>'; } else { echo '<td align="left"><input type="text" name="13:00 - 14:00" size="12" maxlength="30" readonly="true" value="' . $row['13:00 - 14:00'] . '" /></td>'; }' '; if (($row['14:00 - 15:00']) == "-") { echo '<td align="left"><select name="fourteen"> <option value="-">-</option> <option value="' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '">' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '</option> <option value="' . $row['14:00 - 15:00'] . '" selected="selected">' . $row['14:00 - 15:00'] . '</option> </select> </td>'; } else { echo '<td align="left"><input type="text" name="14:00 - 15:00" size="12" maxlength="30" readonly="true" value="' . $row['14:00 - 15:00'] . '" /></td>'; }' '; if (($row['15:00 - 16:00']) == "-") { echo '<td align="left"><select name="fifteen"> <option value="-">-</option> <option value="' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '">' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '</option> <option value="' . $row['15:00 - 16:00'] . '" selected="selected">' . $row['15:00 - 16:00'] . '</option> </select> </td>'; } else { echo '<td align="left"><input type="text" name="15:00 - 16:00" size="12" maxlength="30" readonly="true" value="' . $row['15:00 - 16:00'] . '" /></td>'; }' '; if (($row['16:00 - 17:00']) == "-") { echo '<td align="left"><select name="sixteen"> <option value="-">-</option> <option value="' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '">' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '</option> <option value="' . $row['16:00 - 17:00'] . '" selected="selected">' . $row['16:00 - 17:00'] . '</option> </select> </td>'; } else { echo '<td align="left"><input type="text" name="16:00 - 17:00" size="12" maxlength="30" readonly="true" value="' . $row['16:00 - 17:00'] . '" /></td>'; }' </tr> <tr > <td colspan="11" td align="middle"> <input type="submit" name="submit" value="Submit"></td> <input type="hidden" name="submitted" value="TRUE" /> <input type="hidden" name="id" value="' . $id . '" /> </tr> </form> </table> '; } echo '</table>'; // Check if the form has been submitted. if ($_REQUEST['submit']) { $errors = array(); // Initialize error array. // Check for a 08:00 - 09:00 time slot. if (empty($_POST['eight'])) { $errors[] = 'You forgot to enter something in 08:00 - 09:00.'; } else { $eight = escape_data($_POST['eight']); } // Check for a 09:00 - 10:00 time slot. if (empty($_POST['nine'])) { $errors[] = 'You forgot to enter something in 09:00 - 10:00.'; } else { $nine = escape_data($_POST['nine']); } // Check for a 10:00 - 11:00 time slot. if (empty($_POST['ten'])) { $errors[] = 'You forgot to enter something in 10:00 - 11:00.'; } else { $ten = escape_data($_POST['ten']); } // Check for a 11:00 - 12:00 time slot. if (empty($_POST['eleven'])) { $errors[] = 'You forgot to enter something in 11:00 - 12:00.'; } else { $eleven = escape_data($_POST['eleven']); } // Check for a 12:00 - 13:00 time slot. if (empty($_POST['twelve'])) { $errors[] = 'You forgot to enter something in 12:00 - 13:00.'; } else { $twelve = escape_data($_POST['twelve']); } // Check for a 13:00 - 14:00 time slot. if (empty($_POST['thirteen'])) { $errors[] = 'You forgot to enter something in 13:00 - 14:00.'; } else { $thirteen = escape_data($_POST['thirteen']); } // Check for a 14:00 - 15:00 time slot. if (empty($_POST['fourteen'])) { $errors[] = 'You forgot to enter something in 14:00 - 15:00.'; } else { $fourteen = escape_data($_POST['fourteen']); } // Check for a 15:00 - 16:00 time slot. if (empty($_POST['fifteen'])) { $errors[] = 'You forgot to enter something in 15:00 - 16:00.'; } else { $fifteen = escape_data($_POST['fifteen']); } // Check for a 16:00 - 17:00 time slot. if (empty($_POST['sixteen'])) { $errors[] = 'You forgot to enter something in 16:00 - 17:00.'; } else { $sixteen = escape_data($_POST['sixteen']); } if (empty($errors)) { // If everything's OK. { // Make the query. $query = "UPDATE bookingtable SET `08:00 - 09:00` = '$eight', `09:00 - 10:00` = '$nine', `10:00 - 11:00` = '$ten', `11:00 - 12:00` = '$eleven', `12:00 - 13:00` = '$twelve', `13:00 - 14:00` = '$thirteen', `14:00 - 15:00` = '$fourteen', `15:00 - 16:00` = '$fifteen', `16:00 - 17:00` = '$sixteen' WHERE baynumber = '$id' "; $result = mysql_query ($query) or die(mysql_error(). " -- $query"); // Run the query. if (mysql_affected_rows() == 1) { // If it ran OK. // Print a message. echo '<br><br><br><br><br><br><h1 id="mainhead">Edit a Bay</h1> <p>A time slot has been edited.</p><p><br /><br /></p>'; } else { // If it did not run OK. echo '<br><br><br><br><br><br><p><h2 id="mainhead" align="left">System Error</h1></p> <p class="error">The time slot could not be edited due to a system error. We apologize for any inconvenience.</p>'; // Public message. echo '<p>' . mysql_error() . '<br /><br />Query: ' . $query . '</p>'; // Debugging message. exit(); } mysql_free_result ($result); // Free up the resources. } } } } } } }else{ echo '<p>'. mysql_error() . '<br/> <br/>Query: ' . $query . '</p>'; } mysql_close(); // Close the database connection. echo "<br><br><br><br><br><br><p>If you wish to go back and view the bookingtable click <a href = bookingtable.php>here</a></p>"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> </body> </html> This is the code i have at the moment, where the submit button <tr > <td colspan="11" td align="middle"> <input type="submit" name="submit" value="Submit"></td> <input type="hidden" name="submitted" value="TRUE" /> <input type="hidden" name="id" value="' . $id . '" /> </tr> doesnt show up. It previously showed up before without all the if statement for each timeslot. The best i have got so far is a submit button on the far right of the page that when clicked doesnt do anything.
  14. For some reason when i open this page, the submit button isnt shown. When i use a html WYSIWYG editor, it shows the submit button. <?php // Table header. echo '<table align="left" cellspacing="0" cellpadding="5" border ="1"> <tr> <td align="left"><b>Bay Number</b></td> <td align="left"><b>08:00 - 09:00 </b></td> <td align="left"><b>09:00 - 10:00 </b></td> <td align="left"><b>10:00 - 11:00 </b></td> <td align="left"><b>11:00 - 12:00 </b></td> <td align="left"><b>12:00 - 13:00 </b></td> <td align="left"><b>13:00 - 14:00 </b></td> <td align="left"><b>14:00 - 15:00 </b></td> <td align="left"><b>15:00 - 16:00 </b></td> <td align="left"><b>16:00 - 17:00 </b></td> </tr> '; // Fetch and print the record whice corresponds to the bay id from the 'edit' link that was clicked on the bookingtable page if ($result) { while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo ' <tr> <form action="editbay.php?id=' . $row['id'] . '" method="post"> <td align="left">' . $row['baynumber'] . '</td> '; if (($row['08:00 - 09:00']) == "-") { echo '<td align="left"><select name="eight"> <option value="-">-</option> <option value="' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '">' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '</option> <option value="' . $row['08:00 - 09:00'] . '" selected="selected">' . $row['08:00 - 09:00'] . '</option> </select> </td>'; } else { echo '<td align="left"><input type="text" name="08:00 - 09:00" size="12" maxlength="30" readonly="true" value="' . $row['08:00 - 09:00'] . '" /></td>'; }' '; if (($row['09:00 - 10:00']) == "-") { echo '<td align="left"><select name="nine"> <option value="-">-</option> <option value="' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '">' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '</option> <option value="' . $row['09:00 - 10:00'] . '" selected="selected">' . $row['09:00 - 10:00'] . '</option> </select> </td>'; } else { echo '<td align="left"><input type="text" name="08:00 - 09:00" size="12" maxlength="30" readonly="true" value="' . $row['09:00 - 10:00'] . '" /></td>'; }' '; if (($row['10:00 - 11:00']) == "-") { echo '<td align="left"><select name="ten"> <option value="-">-</option> <option value="' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '">' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '</option> <option value="' . $row['10:00 - 11:00'] . '" selected="selected">' . $row['10:00 - 11:00'] . '</option> </select> </td>'; } else { echo '<td align="left"><input type="text" name="10:00 - 11:00" size="12" maxlength="30" readonly="true" value="' . $row['10:00 - 11:00'] . '" /></td>'; }' '; if (($row['11:00 - 12:00']) == "-") { echo '<td align="left"><select name="eleven"> <option value="-">-</option> <option value="' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '">' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '</option> <option value="' . $row['11:00 - 12:00'] . '" selected="selected">' . $row['11:00 - 12:00'] . '</option> </select> </td>'; } else { echo '<td align="left"><input type="text" name="11:00 - 12:00" size="12" maxlength="30" readonly="true" value="' . $row['11:00 - 12:00'] . '" /></td>'; }' '; if (($row['12:00 - 13:00']) == "-") { echo '<td align="left"><select name="twelve"> <option value="-">-</option> <option value="' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '">' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '</option> <option value="' . $row['12:00 - 13:00'] . '" selected="selected">' . $row['12:00 - 13:00'] . '</option> </select> </td>'; } else { echo '<td align="left"><input type="text" name="12:00 - 13:00" size="12" maxlength="30" readonly="true" value="' . $row['12:00 - 13:00'] . '" /></td>'; }' '; if (($row['13:00 - 14:00']) == "-") { echo '<td align="left"><select name="thirteen"> <option value="-">-</option> <option value="' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '">' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '</option> <option value="' . $row['13:00 - 14:00'] . '" selected="selected">' . $row['13:00 - 14:00'] . '</option> </select> </td>'; } else { echo '<td align="left"><input type="text" name="13:00 - 14:00" size="12" maxlength="30" readonly="true" value="' . $row['13:00 - 14:00'] . '" /></td>'; }' '; if (($row['14:00 - 15:00']) == "-") { echo '<td align="left"><select name="fourteen"> <option value="-">-</option> <option value="' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '">' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '</option> <option value="' . $row['14:00 - 15:00'] . '" selected="selected">' . $row['14:00 - 15:00'] . '</option> </select> </td>'; } else { echo '<td align="left"><input type="text" name="14:00 - 15:00" size="12" maxlength="30" readonly="true" value="' . $row['14:00 - 15:00'] . '" /></td>'; }' '; if (($row['15:00 - 16:00']) == "-") { echo '<td align="left"><select name="fifteen"> <option value="-">-</option> <option value="' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '">' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '</option> <option value="' . $row['15:00 - 16:00'] . '" selected="selected">' . $row['15:00 - 16:00'] . '</option> </select> </td>'; } else { echo '<td align="left"><input type="text" name="15:00 - 16:00" size="12" maxlength="30" readonly="true" value="' . $row['15:00 - 16:00'] . '" /></td>'; }' '; if (($row['16:00 - 17:00']) == "-") { echo '<td align="left"><select name="sixteen"> <option value="-">-</option> <option value="' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '">' .$_SESSION['firstname']. ' ' .$_SESSION['surname']. '</option> <option value="' . $row['16:00 - 17:00'] . '" selected="selected">' . $row['16:00 - 17:00'] . '</option> </select> </td>'; } else { echo '<td align="left"><input type="text" name="16:00 - 17:00" size="12" maxlength="30" readonly="true" value="' . $row['16:00 - 17:00'] . '" /></td>'; }' </tr> <tr > <td colspan="11" td align="middle"> <input type="submit" name="submit" value="Submit"></td> <input type="hidden" name="submitted" value="TRUE" /> <input type="hidden" name="id" value="' . $id . '" /> </tr> </form> </table> '; } echo '</table>'; // Check if the form has been submitted. ?> I have cut out most of the php code which isnt related to the submit button. I would be very glad if you could help. Thanks in advance.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.