Jump to content

change image


kclark

Recommended Posts

Here is the code that I am working with. This will correctly pull the panels that I need for a particular company and put them in a list box. How can I get my image to change upon selection?

<?php 
$panels = "select * from panels where company = " . $_GET["company"] . " order by name";
$result = mysql_query($panels);
$num_rows = mysql_num_rows($result);

if($num_rows == 0)
echo "";
else {
echo "<select>";
// printing the list box select command

while($nt=mysql_fetch_array($result)){//Array or records stored in $nt
echo "<option value=$nt[panelid]>$nt[name]</option>";
/* Option values are added by looping through the array */
}
echo "<br></select>";// Closing of list box 
}
?>

Link to comment
https://forums.phpfreaks.com/topic/228128-change-image/#findComment-1176740
Share on other sites

So are you wanting the image to change on the same page as the select box changes...or on the next page after the form is submitted?

 

To change on the same page, you'll need to use something like JavaScript. Otherwise if the image changes on the next page, you can use PHP.

Link to comment
https://forums.phpfreaks.com/topic/228128-change-image/#findComment-1176769
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.