Forum Moderators: coopster

Message Too Old, No Replies

More on how to pass php variable to java script function!

         

hughc

3:23 am on Mar 25, 2004 (gmt 0)

10+ Year Member



Sorry.....
Actually, I want to display nine items in a page. And when visitors click on the 'More>>', a new windows will be opened, so, can I use one function for all items?
That mean the function will be used several times and display different information.
If so, what can I do in passing variable to it?

hughc

3:36 am on Mar 25, 2004 (gmt 0)

10+ Year Member



HERE IS THE BODY:

<SCRIPT LANGUAGE="JavaScript">

function n1($ip){
window.open("2300.php","main",'width=400, height=310, resizable=no, scrollbars=auto,status=no, menubar=no, toolbar=no, location=no, directories=no,left=60% top=50%');
}

</SCRIPT>

<?
require_once('../Connections/DB.php');
mysql_select_db($database_DB, $DB);
$queryNokia = "SELECT * FROM Phone where PhoneBrand='Nokia'";
$Nokia= mysql_query($queryNokia, $DB) or die(mysql_error());
?>

<?
$count=0;
while ($row=mysql_fetch_object($Nokia)){
if($count!=3){
$count++;
}else{
echo"</tr>";
$count=1;
}
echo "<td>";
echo"<input type='hidden' name='hiddenField'>";
echo "<center><img src=\"$row->PhoneImage\" height='199' width='193'><br></center>";
echo "<center><font color='#7289e9' size='+2'><strong>$row->PhoneModel</strong></font></center>";
echo "<div align='right'> <a href='#' class='style1' onClick='n1();'> More&gt;&gt;</a></div>";
echo"</td>";

}?>