I am trying to create a page that has more than one drop down. I am having trouble with the syntax. I am also having trouble trying to separate the two Buttons that both submit form data. There are two pages here. One PHP page and one HTML page
Here is the HTML page:
Lines 50-52 are giving me problems. I am trying to get dropdown/button #2 to react like button #1 is. Here is the line 50-52 codeCode:<!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 content="en-us" http-equiv="Content-Language" /> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Portland Climate Data</title> <style type="text/css"> .banner { background-color: #000000; color: #FFFFFF; text-align: center; font-size: x-large; } .button { background-color: #00FFFF; position: relative; width: 100%; text-align: center; } .content { background-color: #000080; color: #FFFFFF; } </style> </head> <div class="auto-style1"> <div id="banner" class="banner"> PORTLAND CLIMATE DATA</div> <div id="button" class="button"> <table cellpadding="0" cellspacing="0" style="width: 100%"> <tr> <td style="width: 268px" class="auto-style1"> <form action="process4.php" method="post"> <select name="item" style="width: 72px; height: 27px;"> <?php for($i=2010; $i>=1949; $i--){?> <option value="<?php echo $i?>" <?php if($i==$_POST['item']) echo 'selected="selected"'?>><?php echo $i?></option> <?php }?> </select>   <input name="Submit1" type="submit" value="submit" style="height: 27px" /></div> <br /> <td style="width: 258px; text-align: center;"> <form action="process4.php" method="post"> <select name="item2" style="width: 109px"> <?php $M1= 'Jan-2012'?>; <option value = "<?php echo $M1?>" <?php echo 'selected="selected"'?><?php echo $M1?></option> <option value = "Feb-2012">Feb-2012</option> </select> <input name="submit2" type="submit" value="submit" /></td> <td> </td> <td> </td> <td> </td> </tr> <div id="content" align="center" class="content"><?php echo $url ?></div> </td> </form> </table> </div> <div id="content" class="content"<?php echo $url ?> </div> </body> </html>
Here is the PHP PAGE:Code:<?php $M1= 'Jan-2012'?>; <option value = "<?php echo $M1?>" <?php echo 'selected="selected"'?><?php echo $M1?></option> <option value = "Feb-2012">Feb-2012</option>
Code:<?php error_reporting(E_ALL ^ E_NOTICE); if($_POST['item']) $item = $_POST['item']; else $item = 2010; $url = "<img src='/FORMPROCESSING/ClimateImages/{$item}.png' />"; if($_POST['item2']) $item2 = $_POST['item2']; else $item2 = Jan-2012; $url2 = "<img src='/FORMPROCESSING/ClimateImages/{$item2}.png' />"; //include_once('portland.html'); include_once('2button.html'); ?>


Reply With Quote
Bookmarks