print pop up window help.

  • bufhal
  • Born
  • Born
  • bufhal
  • Posts: 1

Post 3+ Months Ago

Hello, I hope someone can give me a little guidance..
I have a webpage with three dropdowns (Ciyt, Date and Agency) that are populated with a MySQL database. I am trying to get the results of a user clicking an item of the dropdown to print in a pop up window. I am not sure how to:
1) enhance the code on this index.php file to get the information to come up in search results pop up.
2) Create the code for the results.php file
I am new to PHP and Javascript and any help is greatly appreciated.. :o

Here is index.php:
Code: [ Select ]
$i = 0;

$data = mysql_query("SELECT date, agency, city FROM agencies");
while($rs = mysql_fetch_array($data))
{
$date[$i] = $rs['date'];
$agency[$i] = $rs['agency'];
$city[$i] = $rs['city'];

$i++;
}

$date_out = '<select name="date">';
foreach($date as $key => $val)
{
$date_out .= '<option>'.$val.'</option>';
}
$date_out .='</select>';

$agency_out = '<select name="date">';
foreach($agency as $key => $val)
{
$agency_out .= '<option>'.$val.'</option>';
}
$agency_out .='</select>';

$city_out = '<select name="date">';
foreach($city as $key => $val)
{
$city_out .= '<option>'.$val.'</option>';
}
$city_out .='</select>';

echo $date_out;
echo $agency_out;
echo $city_out;
?>
  1. $i = 0;
  2. $data = mysql_query("SELECT date, agency, city FROM agencies");
  3. while($rs = mysql_fetch_array($data))
  4. {
  5. $date[$i] = $rs['date'];
  6. $agency[$i] = $rs['agency'];
  7. $city[$i] = $rs['city'];
  8. $i++;
  9. }
  10. $date_out = '<select name="date">';
  11. foreach($date as $key => $val)
  12. {
  13. $date_out .= '<option>'.$val.'</option>';
  14. }
  15. $date_out .='</select>';
  16. $agency_out = '<select name="date">';
  17. foreach($agency as $key => $val)
  18. {
  19. $agency_out .= '<option>'.$val.'</option>';
  20. }
  21. $agency_out .='</select>';
  22. $city_out = '<select name="date">';
  23. foreach($city as $key => $val)
  24. {
  25. $city_out .= '<option>'.$val.'</option>';
  26. }
  27. $city_out .='</select>';
  28. echo $date_out;
  29. echo $agency_out;
  30. echo $city_out;
  31. ?>
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 84 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.