Bueno estoy practicando y haciendo scripts. Estoy usando un servidor local en mi computaroda y cuando defino las variables $empleados = $_POST["sales_rep"]; y $dias= $_POST["weekday"]; me aparece estos mensajes arriba:
Cita: Notice: Undefined index: sales_rep in W:\www\school\lab5.php on line 30
Notice: Undefined index: weekday in W:\www\school\lab5.php on line 31
Es por usar servidor local que me da errores?
Código PHP:
<html>
<head>
<title>Lab 5</title>
</head>
<body>
<?php
error_reporting(E_ALL);
$emiliano = array('monday'=>'$10','tuesday'=>'$20','wednesday'=>'$30','thursday'=>'$40','friday'=>'$50','saturday'=>'$60');
$lisandro = array('monday'=>'$11','tuesday'=>'$21','wednesday'=>'$31','thursday'=>'$41','friday'=>'$51','saturday'=>'$61');
$nelson = array('monday'=>'$12','tuesday'=>'$22','wednesday'=>'$32','thursday'=>'$42','friday'=>'$52','saturday'=>'$62');
$caro = array('monday'=>'$14','tuesday'=>'$24','wednesday'=>'$34','thursday'=>'$44','friday'=>'$54','saturday'=>'$64');
$nuno = array('monday'=>'$15','tuesday'=>'$25','wednesday'=>'$35','thursday'=>'$45','friday'=>'$55','saturday'=>'$65');
$abel = array('monday'=>'$16','tuesday'=>'$26','wednesday'=>'$36','thursday'=>'$46','friday'=>'$56','saturday'=>'$66');
$all = array
('emiliano'=>'$emiliano','lisandro'=>'$lisandro','nelson'=>'$nelson','caro'=>'$caro','nuno'=>'$nuno','abel'=>'$abel');
//Lets show the sales for each person
//Linea 30 y 31
$empleados = $_POST["sales_rep"];
$dias= $_POST["weekday"];
if (isset($submit)){
//for($all as $name=>$value) {
echo 'isset yes values?';
}
?>
<h1> Use this system to get sales results from the employees</h1>
<form name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<table>
<tr>
<td><label><b> Select Sales representative: </b></td>
<td><select name="sales_rep" id="sales_rep">
<option value="emiliano">Emiliano</option>
<option value="lisandro">Lisandro</option>
<option value="nelson">Nelson</option>
<option value="nuno">Nuno</option>
<option value="abel">Abel</option>
<option value="caro">Caro</option>
<option value="all">All</option>
</select>
</td></label>
</tr><tr><td>  </td></tr>
<tr>
<td><label><b> Select day of the week: </b></td>
<td><select name="weekday" id="weeday_id">
<option value="1">Monday</option>
<option value="2">Tuesday</option>
<option value="3">Wednesday</option>
<option value="4">Thursday</option>
<option value="5">Friday</option>
<option value="6">Saturday</option>
<option value="all">All</option>
</tr><tr><td>  </td></tr>
<td><input type="submit" name="submit_name" id="submit_name" value="Submit"></td>
<td><input type="reset" name"reset_name" id="reset_name" value="Reset"></td>
</table>
</form>
</body>
</html>