|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| 05/26/2009 at 05:35AM PDT, ID: 24437776 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: |
<?
$host = "localhost"; //This is your mysql server host name
$db_user="lessons";//"dbuser"; //Substitute your Database user name here
$db_pwd="lessons";//"password"; //Substitute your Database user password here
$db_name="lessons";//"dbname"; // Your database name
$connection = mysql_connect($host, $db_user, $db_pwd)
or die (mysql_error()); // 'database_name'
$db = mysql_select_db($db_name, $connection) or die (mysql_error());
?>
<?
$desc = mysql_real_escape_string($_POST['perioddesc']);
$query = "select * from periods order by Perioddesc"; //Querying the Periods table
$result = mysql_query($query) or die(mysql_error()); //Execute the Query
if($desc==""){
$option="<option>-- Select --</option>";
}else{
$option="<option>".$desc."</option>";
}
while($rs=mysql_fetch_array($result)){ // Fetch each record from the result set
$option.= "<option>".$rs['Perioddesc']."</option>";
}
?>
<?
if(isset($_POST['submit'])){
$desc = mysql_real_escape_string($_POST['perioddesc']);
$starttime = mysql_real_escape_string($_POST['starttime']);
$endtime = mysql_real_escape_string($_POST['endtime']);
$query = "insert into daylessons(lessondesc, starttime, endtime) values('$desc', '$starttime', '$endtime')";
$res = mysql_query($query) or die(mysql_error());
echo "Record inserted!";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Day Lessons</title>
<script language="javascript">
function callsubmit(){
var dform = document.getElementById("daylessonfrm");
dform.setAttribute("action", "insertlesson.php?action=displaytime");
document.getElementById("daylessonfrm").submit();
//document.getElementById("daylessonfrm").action="insertlesson.php?action=displaytime";
//document.getElementById("daylessonfrm").submit();
}
</script>
</head>
<body>
<?
if($_REQUEST['action']=="displaytime"){
$desc = mysql_real_escape_string($_POST['perioddesc']);
$db_query = "select * from periods where perioddesc='".$desc."'";
$resultset = mysql_query($db_query);
$rowset = mysql_fetch_array($resultset);
$starttime = $rowset['starttime'];
$endtime = $rowset['endtime'];
}
?>
<form name="daylessonfrm" id="daylessonfrm" action="insertlesson.php" method="post" >
<span>Period : <select name="perioddesc" id="perioddesc" onChange="callsubmit();">
<? echo $option; ?>
</select></span>
<br /><br />Start Time: <input type="text" name="starttime" id="starttime" value="<?=$starttime?>" />
<br /><br />End Time: <input type="text" name="endtime" id="endtime" value="<?=$endtime?>" />
<input type="submit" name="submit" value="submit" />
</form>
</body>
</html>
|
Advertisement