Jump to content

daniel_son

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

daniel_son's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks, I actually looked at that earlier today. Im afraid Im far from a coder so couldn't make sense of it. I really need someone to provide the code for me. Happy to donate to somebody if they could knock this functionality up for me. (Dropdown list of phone names, where the iframe underneath loads according to the item in the list they select) I need to start making attempts to network with new php devs as the guy I normally use is unavailable. Hope someone can help with this, thanks J
  2. Hi all, beginner here. I'm have a single page with a PHP dropdown which lists phone names from my database and an iframe on the same page. Im trying to pass the value (Phone_Make and Phone_Model) from what is selected to the dropdown to an iframe url which is called below. So when someone selects a certain mobile name from the dropdown, the iframe gets loaded with that value in its URL. With a bit of googling I've managed to get the phone drop working but thats as far as I've got. I'm sure this is straight forward to most coders. Willing to send someone a small thankyou payment (for a beer/coffee) if they can provide me with the needed code to get this working. I was also wondering if this should be approached with javascript not php. Many thanks in advance. J <html> <body> <?php ini_set('display_errors',1); $dbh = mysql_connect("localhost", "DB_USER", "DB_PASSWORD"); mysql_select_db("DB_NAME"); // Write out our query. $query = "SELECT CONCAT(Phone_Make, ' ', Phone_Model AS Full_Phone_Name FROM Mobile_DB_table ORDER BY Full_Phone_Name"; // Execute it, or return the error message if there's a problem. $result = mysql_query($query) or die(mysql_error()); $dropdown = "<select name='Mobile_DB_table'>"; while($row = mysql_fetch_assoc($result)) { $dropdown .= "\r\n<option value='{$row['Full_Phone_Name']}'>{$row['Full_Phone_Name']}</option>"; } $dropdown .= "\r\n</select>"; echo $dropdown; ?> <iframe src='http://www.somedomain.com/iframe.php?make=INSERT_MAKE_HERE&model=INSERT_MODEL_HERE' style='width:100%; height: 1000px' scrolling='auto' frameborder='0' ></iframe> </body> </html>
×
×
  • 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.