Forum Moderators: coopster

Message Too Old, No Replies

I have a small and probably easy question

         

geekgrrl

8:11 pm on Aug 7, 2004 (gmt 0)

10+ Year Member



I'm wondering if it's possible to open a new pre-defined size window (new php/html
page) with php code?

I have this so far..

<A href=\"emoticons.php\" target=\"_blank\">Emoticons</A> \n";

I can't figure out how the height and width tags would work, i've tried different code, but they don't seem to be working. Is it even possible in php?

dreamcatcher

8:38 pm on Aug 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

I think you might be getting your javascript mixed up with your PHP. Try this:


<a href=\"#\" onClick=\"MyWindow=window.open('emoticons.php','MyWindow','toolbar=no,location=no, directories=no,status=no,menubar=no,scrollbars=yes,left=250,top=20,screenX=0,screenY=0,resizable=no,width=500,height=400'); return false;\">Emoticons</a>

Its cheap and nasty, but should be ok. Edit the variables to suit.

:)

geekgrrl

8:40 pm on Aug 7, 2004 (gmt 0)

10+ Year Member



Thanks, I did know how to do it in js, I was just wondering is it was possible in php...gah.

problem is...this is my actual code...

if ($emoticon=="1")
echo " <A href=\"emoticons.php\" target=\"_blank\">Emoticons</A> \n";

see it has to be called from another page I have, this makes no sense does it? lol

[edited by: geekgrrl at 8:43 pm (utc) on Aug. 7, 2004]

dreamcatcher

8:43 pm on Aug 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can do the pop up in a variety of ways, but it cannot be done specifically using PHP code. PHP cannot change the size of windows. You always need javascript for this.

:)

[edited by: dreamcatcher at 8:48 pm (utc) on Aug. 7, 2004]

ergophobe

8:45 pm on Aug 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Welcome to WebmasterWorld geekgrrl.

Always ask yourself one question when thinking through something like this: is this happening on my computer or on the server?

- update the database. That's happening on the server. The database is not on your computer. Thus, it's a PHP task, not HTML or Javascript

- open a new window. That's happening on your computer. PHP runs on the server, so it can't help. Must be an HTML or JS solution.

dreamcatcher

8:46 pm on Aug 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ah, you edited your code. Sneaky!

won`t this work?

if ($emoticons==1)
{
echo "<a href=\"#\" onClick=\"MyWindow=window.open('emoticons.php','MyWindow','toolbar=no,location=no, directories=no,status=no, menubar=no,scrollbars=yes,left=250,top=20,screenX=0,screenY=0,resizable=no,width=500,height=400'); return false;\">Emoticons</a>\n";
}

[edited by: dreamcatcher at 8:47 pm (utc) on Aug. 7, 2004]

geekgrrl

8:46 pm on Aug 7, 2004 (gmt 0)

10+ Year Member



Of course not 'cause that would be to easy *snicker*

okay, i'm going to do another way around this, i'll prolly be back hahaha

geekgrrl

8:48 pm on Aug 7, 2004 (gmt 0)

10+ Year Member



lol dreamcatcher..I did hahaa

and that didn't work...
Parse error: parse error in /home/virtual/site74/fst/var/www/html/tag/index.php on line 69

blah

ergophobe
Ya, I know, but you know asking never hurt ;)

dreamcatcher

8:51 pm on Aug 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The code I posted won`t generate a parse error. Must be something else you did. :)

geekgrrl

9:02 pm on Aug 7, 2004 (gmt 0)

10+ Year Member



*edited...

I fixed it...

Thanks so much for your help, i'm sure i'll definitely be back! lol