absolute beginer,please help
Posted: Mon Nov 08, 2010 12:38 am
hi
I am very new to php and stuck at very basic problem.my goal user will input value through drop down list, and according to that selection nos of images will be display on another div.here is code
problem is when for the first time the page loaded its shows
Notice: Undefined index: submit in C:\wamp\www\test\practice.php on line
whats wrong?Why the "if" is not working?
Please help
Thanks in advance
kingkol
I am very new to php and stuck at very basic problem.my goal user will input value through drop down list, and according to that selection nos of images will be display on another div.here is code
Code: Select all
<div id="left_col">
how many pictures
<form method = "POST" name="how" action="practice.php">
<select name='one'>
<option>10</option>
<option>20</option>
<option>30</option>
</select>
<input type="submit" name ="submit">
</form>
</div>
<div id="right_col">
<?php
if ($_POST['submit'])
{
$how = $_POST['one'];
echo $how;
echo "<br>";
for($i=1; $i<=$how; $i++)
{
echo "<img src =\"one.jpg\">";
}
}
?>Notice: Undefined index: submit in C:\wamp\www\test\practice.php on line
whats wrong?Why the "if" is not working?
Please help
Thanks in advance
kingkol