I have been struggling with a problem regarding the open.window function. I have a query which returns a list of names and i have made a list of a href links. See below…
[CODE]
$query = “SELECT DISTINCT Name FROM Comp2 WHERE Lower(Name) LIKE lower(‘%$name%’) ORDER BY Name”;
$qry_result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($qry_result)){
$url = str_replace(” “,”_”,$row[Name]);
echo $url;
$display_string .= “<a href=’javascript:openwindow($url)’>$row[Name]</a><br />”;
$count++;
}
the above seems to work but the function openwindow() seen below does nothing but make an error on the page.
[CODE]
<script type=’text/javascript’>
function openwindow(url) {
alert(url);
var link = ‘http://www.myurl.co.uk/getresults.php?name=’ + url;
window.open(link,’new’,’toolbar=no,location=no,directories=no, status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=1000,height=400′);
};
</script>
If anyone could point me in the right direction to getting this solved that would be amazing, i would be greatly appreciative. Thankyou in advance!
Jonny