| | |
listbox prob........
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Nov 2007
Posts: 183
Reputation:
Solved Threads: 5
PHP Syntax (Toggle Plain Text)
<html> <head> <SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT"> <!-- function view(ss) { if(ss.options[ss.selectedIndex].value!='') { var a=document.getElementById('IndustryType'); var temp=a.value; var b='<?php echo $id; ?>'; parent.frameright.location = "http://www.web.com/webd.php?var=" + temp + "&vars=" + b; } } --> </script> </head> <body> $id=$_GET('id'); $hostname = "localhost"; $username = "car"; $password = "try"; $dbid = "car"; $link=mysql_connect($hostname, $username, $password); mysql_select_db($dbid) or die("unable to connect"); $result=mysql_query("select * from jop where owns='$id' and chkshare='yes'"); $sel ='<tr><td align="center" bgcolor="#EBEBEB"><select name="IndustryType" language="javascript" onchange="view(this);" size="12" style="width: 300px">'; $i = 0; while ($row = mysql_fetch_row($result)) { if ($i == 0) { $value = 'SELECTED value="' . $row[0] . '"'; } else { $value = 'value="' . $row[0] . '"'; } $sel .= '<option ' . $value . '>' . $row[1] . '</option>'; $i++; } $sel .= '</select></td></tr>'; print $sel; ?> </form> </body> </html>
•
•
Join Date: May 2005
Posts: 508
Reputation:
Solved Threads: 19
Well your main problem here is trying to use javascript + php natively like this with frames.
I would look to convert this to ajax as it is much more flexible. Sort of middle ground for client vs. server side.
I would look to convert this to ajax as it is much more flexible. Sort of middle ground for client vs. server side.
![]() |
Other Threads in the PHP Forum
- Previous Thread: shopping cart in php
- Next Thread: need help!!
| Thread Tools | Search this Thread |
apache api array auto beginner binary broken cache cakephp checkbox class cms code codingproblem cron curl customizableitems database date display dynamic echo email error file files filter folder form format forms forum function functions gc_maxlifetime global google headmethod host href htaccess html image include insert ip javascript joomla limit link login mail malfunctioning memmory memory menu mlm multiple mysql nodes oop parameter parsing paypal pdf php phpmysql popup problem query radio random recursion recursiveloop remote script search select server sessions sms snippet source space sql static syntax system table trouble tutorial up-to-date update upload url validator variable video web youtube





