Re: PHP, create link behind a drop down list box!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi, sana ! i think u have to use in javascript code using switch case and condistionally call particular page or website in the frame. code is like that below
switch(i){
 case "1":
         document.GetElementById("framename").src="whatever.html";
          breake;
...................
................
................
............

}



 thanks



________________________________
From: Sana Alamgeer <sanalmgr47@xxxxxxxxx>
To: php-objects@xxxxxxxxxxxxxxx
Sent: Sunday, 2 August, 2009 1:15:55 AM
Subject:  PHP, create link behind a drop down list box!

  

hello everyone
here i have a php code
i wantto create a link to a specific page behind the drop down list box, while data is coming from databse.
when user clicks on any item in list, a concerned page should open in frame f4. here is the code, please correct this, or help me, partial code i m sending.
<SCRIPT language="JavaScrip t">
function submitform()
{
  document.form1. submit();
}
</SCRIPT>
============ =====
   <form action="<?php $_SERVER['.. /sana/PHP_ SELF']; ?>" name="form1" method="post" >
   <table width="500px" cellpadding= "0" cellspacing= "0" align="left" >
    <tr>
     <td>
      <select name="mem_year" onchange="submitfor m();">
             <?php 
        $sql="select id, page_name from tab_1";
        $sqlstmt=mysql_ query($sql) ;
        echo "<option value='--'>Page Name</option> ";
        while($result= mysql_fetch_ array($sqlstmt) ){
        echo "<option value=".$result[ "id"].">" .$result[ "page_name" ]."</option> "; 
        $i++;
        }
       ?>
      </select>
     </td>
    </tr>
   </table>
   </form>
============ =========   
<?php
switch ($_POST['mem_ year']):
    case "1":
 echo '<a href="f1.php" ?target=f4> </a>';
       break;
    default:
       echo "Error: Action must be either one option";
endswitch;
?>
</body>
</html>
SanaAlamgeer 


[Non-text portions of this message have been removed]





      See the Web&#39;s breaking stories, chosen by people like you. Check out Yahoo! Buzz. http://in.buzz.yahoo.com/

[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux