php window.open

D

Drisco

Hello,
I am trying to open a query in a new window with say widht 550 and
hight 350, I have searched google and found some answears using a
javascript function, but it did not help here is my current link.


<td width="33%" height="22" align="center"><font color="#333333"> <a
href="/video_pop.php?GenderID=<?php echo $row_rs_Gender['GenderID']; ?>
" target="_blank"class="centerTable"> <img src="<?php echo
$row_rs_Gender['Pic1']; ?>" border="0"></a></font></td>


Can some one please shed some light

Thanks
Drisco
 
V

verymicrochip

looks like you're gonna have to run that php script externally and use
javascript to resize the window using
window.open('address','name','width=550; height=350;') If that don't
work i dunno what will...
 
D

Drisco

Thank you for replying,
here is what I have so far,

<SCRIPT TYPE="text/javascript" LANGUAGE="javascript">

function vid_popup(name)
{
window.focus();
url = name + ".php?GenderID=<?php echo $row_rs_Gender['GenderID']; ?>
";
pop_width = (name != 'video_pop'? 710:710);
pop_height = (name != 'video_pop'? 370:370);
param = "width=" + pop_width + ",height=" + pop_height +
",resizable=no,scrollbars=no";
name += "_popup";
window.open(url,name,param);
}
</SCRIPT>

<a href="video_pop.php?GenderID=<?php echo
$row_rs_Gender['GenderID'];?>" CLASS="vclip"
onClick="vid_popup('video_pop'); return false" TARGET="_blank"><img
src=<?php echo $row_rs_Gender['Pic1']; ?> border="0"></A


This works, but all rows bring up the first artist in the row, then
when I click on the next page, it brings up the first artist in the
second page, this happens on all next and previous pages.
another thing is the mouseover shows the correct IDs in the status bar.
any thoughts?
Thanks
Drisco
 
D

Drisco

I have seen this work on much much complexd scale on some sites,
Let me explain one more time.
I have $maxRows_rs_Gender = 10; and $pageNum_rs_Gender = 0;
my page desplays 10 entries, each entry has a different ID, but with
the script I mentioned in the previous post, all 10 entries link to 1
ID, which is same as the first ID in the first row, but mouseover shows
a different ID for each row when you look at the status bar.

could some one please help, I am stuck and can't go any further with my
project

your help is very very much appreciated

Drisco
 
D

Drisco

Is this that hard to achieve? or this is the slowest NG on the net,
Can any one please take a moment and help a desprate guy
Thank you in advance
Drisco
 
R

RobG

Drisco said:
Is this that hard to achieve? or this is the slowest NG on the net,
Can any one please take a moment and help a desprate guy
Thank you in advance
Drisco

What you have posted is a munge of PHP and JavaScript. This group
deals with JavaScript, though many here also know PHP.

Post what the client (browser) receives, not the code that you feed to
your server.

Post a minimal example that displays the error - debugging invisible
code is a challenge that most will pass on.
 
D

Drisco

First, thanks for the reply, and sorry about the munging :)
I pasted the exact link bellow that I have currently on my table. It
works as expected, but I need to have the target window come up with a
certain size, no address bar, and no scrolls etc..

<a href="video_pop.php?GenderID=­<?php echo
$row_rs_Gender['GenderID']; ?> " target="_blank"class="centerTa­ble">
<img src="<?php echo $row_rs_Gender['Pic1']; ?>" border="0"></a>


Please let me know if you need any more details

Thank you again
Drisco
 
G

Grant Wagner

First, thanks for the reply, and sorry about the munging :)
I pasted the exact link bellow that I have currently on my table. It
works as expected, but I need to have the target window come up with a
certain size, no address bar, and no scrolls etc..

<a href="video_pop.php?GenderID=­<?php echo
$row_rs_Gender['GenderID']; ?> " target="_blank"class="centerTa­ble">
<img src="<?php echo $row_rs_Gender['Pic1']; ?>" border="0"></a>


Use:

<a href="..."
target="..."
class="..."
onclick="return openWindow(this);"

<script type="text/javascript">
function openWindow(lnk)
{
window.open(
lnk.href,
lnk.target,
'...attributes...'
);
return false;
}
</script>

....attributes... can be anything documented:
<url: http://docs.sun.com/source/816-6408-10/window.htm#1202731 />
<url:
http://www.mozilla.org/docs/dom/domref/dom_window_ref76.html#1019331 />
<url:
http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/open_1.asp
/>

Note that some popup blockers will block this script. Then again, you
can configure Gecko-based browsers to ignore <A ... TARGET="..."> as
well, so you're not going be guarantee to see any behaviour you expect
when attempting to open a new browser window on the visitor's computer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top