Forum Moderators: coopster
<tr><td align='center'><a href='$row[link_url]' onClick=\"javascript:window.open('waiting.php?email=$email& banner_id=$row[banner_id]& action=open','loading','toolbar=no,left=50,top=50,scrollbars=no,resizable=no,width=400,height=100,alwaysRaised=yes')\ "></a></td></tr>
I think this is the piece I need to change.
The 'waiting.php' file opens in a new window but
I want the [link_url] to open in a new window aswell.
Is there any piece of code that can be put into a php file to make links open in new window?
[edited by: jatar_k at 5:08 pm (utc) on Aug. 13, 2004]
[edit reason] fixed sidescroll [/edit]
it's not valid in XHTML, but is fine in HTML links.
I don't believe that single quotes for attributes are valid so
align='center' should be align="center"
Also, your PHP syntax has some problems
$row[link_url] should be $row['link_url'] and so on.
You'll need to do some sorting with your quotes, but I would recommend just getting out of the strings instead of doing inline variable substitution as in
$x = '<tr><td align="center"><a href="' . $row['link_url']' . "onClick=\"javascript:window.open('waiting.php')\">Link text</a></td></tr>";
I don't believe that single quotes for attributes are valid
Single quotes are fine, it's something HTML picked up from SGML:
[w3.org...]
By default, SGML requires that all attribute values be delimited using either double quotation marks (ASCII decimal 34) or single quotation marks (ASCII decimal 39). Single quote marks can be included within the attribute value when the value is delimited by double quote marks, and vice versa.
On the other stuff, if you set error reporting to show notices and warnings, you'll be getting them all over the place because of not quoting associative indexes. Check out the manual on arrays [us2.php.net] and read the section "Array do's and don'ts. Why is $foo[bar] wrong?".