Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

open in new window

4 views
Skip to first unread message

Dave

unread,
Aug 8, 2010, 6:28:25 PM8/8/10
to
Have a ques. I'm not really a php programmer.. just need a little help with
"opening a page in a new window".


This is the code:

<li class="sub"><a class="sub" href="<?php echo
$TMPL['path'].'invite.php';?>"target="_blank" ><?php echo T_('Invite a
Friend');?>

What do I need to input to get a height of 15 and width of 200?


Dave

unread,
Aug 8, 2010, 6:31:06 PM8/8/10
to
<li class="sub"><a class="sub" href="<?php echo
$TMPL['path'].'invite.php';?>"target="_blank" ><?php echo T_('Invite a
Friend');?>

> What do I need to input to get a height of 15 and width of 200?
>
>

My bad, can't even type it out.. LOL!

Question is: what do I need to add and/or remove to the line of code so it
will open in a pop-up or new window of height=200 and width of 150


Jerry Stuckle

unread,
Aug 8, 2010, 6:51:15 PM8/8/10
to

You can't do it in PHP. PHP is server side only, and you need something
client side. Try alt.html and/or comp.lang.javascript.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstu...@attglobal.net
==================

Raymond Schmit

unread,
Aug 9, 2010, 3:44:02 PM8/9/10
to
On Sun, 08 Aug 2010 18:51:15 -0400, Jerry Stuckle
<jstu...@attglobal.net> wrote:

>Dave wrote:
>> <li class="sub"><a class="sub" href="<?php echo
>> $TMPL['path'].'invite.php';?>"target="_blank" ><?php echo T_('Invite a
>> Friend');?>
>>
>>> What do I need to input to get a height of 15 and width of 200?
>>>
>>>
>>
>> My bad, can't even type it out.. LOL!
>>
>> Question is: what do I need to add and/or remove to the line of code so
>> it will open in a pop-up or new window of height=200 and width of 150
>>
>>
>
>You can't do it in PHP. PHP is server side only, and you need something
>client side. Try alt.html and/or comp.lang.javascript.


Correct - but PHP can write javascript coding in the web page PHP
creates ...
He can look at
http://www.yourhtmlsource.com/javascript/popupwindows.html

to find infos on how to do it using javascript.

Jerry Stuckle

unread,
Aug 9, 2010, 5:24:00 PM8/9/10
to

Which is just strings to PHP - and has absolutely nothing to do with PHP.

Dave

unread,
Aug 9, 2010, 8:23:20 PM8/9/10
to

"Jerry Stuckle" <jstu...@attglobal.net> wrote in message
news:i3prln$75a$1...@news.eternal-september.org...

> Raymond Schmit wrote:
>> On Sun, 08 Aug 2010 18:51:15 -0400, Jerry Stuckle
>> <jstu...@attglobal.net> wrote:
>>
>>> Dave wrote:
>>>> <li class="sub"><a class="sub" href="<?php echo
>>>> $TMPL['path'].'invite.php';?>"target="_blank" ><?php echo T_('Invite a
>>>> Friend');?>


You guys are both good help. looks like a combo of php and html.

Thanks!

rf

unread,
Aug 9, 2010, 9:06:04 PM8/9/10
to

"Dave" <davenl...@hotNOmailSPAM.com> wrote in message
news:ZZ08o.2136$yr6....@newsfe05.iad...

And you didn't pay attention.

Your question has absolutely nothing to do with PHP. It may just happen that
PHP is spitting out the code. It could equally have been Perl or C++ or any
other server side script. Doesn't mean your question would be on-topic in a
C++ group.

Your issue is purely a javascript one. Ask in comp.lang.javascript


Dave

unread,
Aug 9, 2010, 10:06:21 PM8/9/10
to

"rf" <r...@z.invalid> wrote in message
news:cC18o.3169$FH2....@viwinnwfe02.internal.bigpond.com...

sorry, meant to say javascript and html. but, I gotz da idea


Raymond Schmit

unread,
Aug 11, 2010, 10:54:51 AM8/11/10
to

I think that i give him the solution ->
http://www.yourhtmlsource.com/javascript/popupwindows.html

Jerry Stuckle

unread,
Aug 11, 2010, 12:37:07 PM8/11/10
to

And encourage more off-topic posts?

Plus there may be other, better solutions which are more appropriate in
his case. We don't know, because this is a PHP newsgroup and his
question is unrelated to PHP.

Dave

unread,
Aug 11, 2010, 8:38:50 PM8/11/10
to
oh gosh.. I created a monster...

Jerry Stuckle

unread,
Aug 11, 2010, 10:47:51 PM8/11/10
to
Dave wrote:
> oh gosh.. I created a monster...

No, you just didn't do some basic problem determination and as a result,
posted in the wrong newsgroup.

comp.lang.javascript would be a much better place for this type of
question, as indicated above.

Raymond Schmit

unread,
Aug 12, 2010, 10:44:42 AM8/12/10
to
On Wed, 11 Aug 2010 12:37:07 -0400, Jerry Stuckle
<jstu...@attglobal.net> wrote:

>Raymond Schmit wrote:
>> On Tue, 10 Aug 2010 11:06:04 +1000, "rf" <r...@z.invalid> wrote:
>>
>>> "Dave" <davenl...@hotNOmailSPAM.com> wrote in message
>>> news:ZZ08o.2136$yr6....@newsfe05.iad...
>>>> "Jerry Stuckle" <jstu...@attglobal.net> wrote in message
>>>> news:i3prln$75a$1...@news.eternal-september.org...
>>>>> Raymond Schmit wrote:
>>>>>> On Sun, 08 Aug 2010 18:51:15 -0400, Jerry Stuckle
>>>>>> <jstu...@attglobal.net> wrote:
>>>>>>
>>>>>>> Dave wrote:
>>>>>>>> <li class="sub"><a class="sub" href="<?php echo
>>>>>>>> $TMPL['path'].'invite.php';?>"target="_blank" ><?php echo T_('Invite a
>>>>>>>> Friend');?>
>>>>
>>>> You guys are both good help. looks like a combo of php and html.
>>> And you didn't pay attention.
>>>
>>> Your question has absolutely nothing to do with PHP. It may just happen that
>>> PHP is spitting out the code. It could equally have been Perl or C++ or any
>>> other server side script. Doesn't mean your question would be on-topic in a
>>> C++ group.
>>>
>>> Your issue is purely a javascript one. Ask in comp.lang.javascript
>>>
>>
>> I think that i give him the solution ->
>> http://www.yourhtmlsource.com/javascript/popupwindows.html
>
>And encourage more off-topic posts?
>

This is NOT a reason for "no help"

Jerry Stuckle

unread,
Aug 12, 2010, 12:19:35 PM8/12/10
to

The CORRECT help is to send him to the right newsgroup. Then he will
get GOOD answers to his questions!

Raymond Schmit

unread,
Aug 12, 2010, 6:01:50 PM8/12/10
to
On Thu, 12 Aug 2010 12:19:35 -0400, Jerry Stuckle
<jstu...@attglobal.net> wrote:

My answer was not good ?

Jerry Stuckle

unread,
Aug 12, 2010, 6:29:50 PM8/12/10
to

Nope. Insufficient information to determine whether that will suit his
needs or not. And this would not be the place to ask the appropriate
questions to get the necessary information. And if your answer isn't
correct for him, you just sent him off to waste possibly several hours
on a wild goose chase.

c.l.j has javascript experts who can ask the right questions and provide
the correct response.

Dave

unread,
Aug 12, 2010, 8:01:04 PM8/12/10
to
yup. created a monster...

Allodoxaphobia

unread,
Aug 12, 2010, 9:49:14 PM8/12/10
to
On Wed, 11 Aug 2010 19:38:50 -0500, Dave wrote:

> oh gosh.. I created a monster...

Don't give yourself so much credit!
There's been monsters on usenet for over 2 decades now.

Andy

unread,
Aug 13, 2010, 6:12:20 AM8/13/10
to

"Dave" <davenl...@hotNOmailSPAM.com> wrote in message

news:4X%8o.49017$F%7.3...@newsfe10.iad...
> yup. created a monster...

Luckily, I'm a monster killer!

Try this...


<?php
$popleft = 200; // popup position
$popdown =100; // popup position
$popname = "Invite"; // popup ref name
$popwidth = 200; // subject to browser min
$popheight = 15; // subject to browser min
$popscroll = "no"; // yes/no
?>

<html>
<head>

<?php
$popupscript = "<script type=\"text/JavaScript\"
language=\"javascript\">\n";
$popupscript .= "<!-- POPUP\n";
$popupscript .= "function winBRopen(theURL, Name, popW, popH, scroll){\n";
$popupscript .= "var winleft = " . $popleft . ";\n";
$popupscript .= "var windown = " . $popdown . "\n";
$popupscript .= "winProp =
'width='+popW+',height='+popH+',left='+winleft+',top='+windown+',scrollbars='+scroll+','\n";
$popupscript .= "Win = window.open(theURL, Name, winProp)\n";
$popupscript .= "if (parseInt(navigator.appVersion) >= 4){\n";
$popupscript .= "Win.window.focus();\n";
$popupscript .= "}\n";
$popupscript .= "}\n";
$popupscript .= "// - End of JavaScript - -->\n";
$popupscript .= "</script>\n";
echo $popupscript;
?>

</head>
<body>

<li class="sub"><a class="sub" href="<?php echo

$TMPL['path'].'invite.php';?>" target="_blank" onClick="winBRopen('<?php
echo $TMPL['path'].'invite.php';?>','<?php echo $poptitle;?>','<?php echo
$popwidth;?>','<?php echo $popheight;?>','<?php echo $popscroll;?>');return
false;"><?php echo T_('Invite a Friend');?></a></li>

</body>
</html>


... should be phpy enough to keep the moaners away ;)

Andy

Erwin Moller

unread,
Aug 13, 2010, 7:11:42 AM8/13/10
to


Hi Andy,

The above JavaScript suggestions are poor.
I thought I let you know. ;-)

To name a few:
* It includes ancient <!-- comment blocks. Name me a browser that needs
that.

* It uses browsersniffing where none is needed. (All experts advise you
to never use browsersniffing).

* It uses target (invalid for HTML4 STRICT validation, OK for
Transitional, but you don't know what the OP is serving).

* It is very poorly readable. (In my humble opinion)

You say you are a monster killer. :-)
I say you created a bigger monster. ;-)

I am 100% with Jerry on this one. (You just proved him right with the
above code.)
Please go to a JavaScript group to get decent advice.

Regards,
Erwin Moller

PS: Andy, I appreciate it you try to help. But your suggestion is poor.
No hard feelings I hope. :-)


--
"There are two ways of constructing a software design: One way is to
make it so simple that there are obviously no deficiencies, and the
other way is to make it so complicated that there are no obvious
deficiencies. The first method is far more difficult."
-- C.A.R. Hoare

Andy

unread,
Aug 13, 2010, 7:20:58 AM8/13/10
to

"Erwin Moller"
<Since_humans_read_this...@spamyourself.com> wrote in
message news:4c65286b$0$22939$e4fe...@news.xs4all.nl...


No hard feelings whatsoever, in fact it's nice to receive constructive
criticism without the usual snide remarks ;)

Andy

Has the OP posted this in a javascript newsgroup yet?

Dave

unread,
Aug 13, 2010, 6:13:20 PM8/13/10
to

> Has the OP posted this in a javascript newsgroup yet?
>

OP?

If referring to me, not yet.. I'm just sitting back and watching then "fun"

Andy

unread,
Aug 13, 2010, 7:13:47 PM8/13/10
to

"Dave" <davenl...@hotNOmailSPAM.com> wrote in message

news:5sj9o.63338$YX3....@newsfe18.iad...

'ere, don't tell the others, but did you try my solution yet?

Andy

Jerry Stuckle

unread,
Aug 13, 2010, 8:30:48 PM8/13/10
to

He'd be much better off going to c.l.j to get GOOD advice.

You code is not very good - as Erwin noted. If you want to post
javascript, please do so in the appropriate place.

And BTW - attempting to make it on topic here by wrapping some
javascript values in PHP variables makes your code even worse.

Andy

unread,
Aug 13, 2010, 8:41:06 PM8/13/10
to

"Jerry Stuckle" <jstu...@attglobal.net> wrote in message

news:i44o3o$j75$1...@news.eternal-september.org...

You got me! I wanted to help the OP and not incur the wrath of the seasoned
pros ;)

Jerry Stuckle

unread,
Aug 13, 2010, 8:50:55 PM8/13/10
to
Andy wrote:
>
>
> "Jerry Stuckle" <jstu...@attglobal.net> wrote in message
> news:i44o3o$j75$1...@news.eternal-september.org...
>> Andy wrote:
>>>
>>>
>>> "Dave" <davenl...@hotNOmailSPAM.com> wrote in message
>>> news:5sj9o.63338$YX3....@newsfe18.iad...
>>>>
>>>>> Has the OP posted this in a javascript newsgroup yet?
>>>>
>>>> OP?
>>>> If referring to me, not yet.. I'm just sitting back and watching
>>>> then "fun"
>>>>
>>>
>>> 'ere, don't tell the others, but did you try my solution yet?
>>>
>>> Andy
>>
>> He'd be much better off going to c.l.j to get GOOD advice.
>>
>> You code is not very good - as Erwin noted. If you want to post
>> javascript, please do so in the appropriate place.
>>
>> And BTW - attempting to make it on topic here by wrapping some
>> javascript values in PHP variables makes your code even worse.
>>
>
> You got me! I wanted to help the OP and not incur the wrath of the
> seasoned pros ;)

The best way to help him would be to get him to ask in the appropriate
place.

Raymond Schmit

unread,
Aug 14, 2010, 5:28:33 PM8/14/10
to
On Thu, 12 Aug 2010 18:29:50 -0400, Jerry Stuckle
<jstu...@attglobal.net> wrote:

The OP was asking:


What do I need to input to get a height of 15 and width of 200?

And in the first example given at my given url
> http://www.yourhtmlsource.com/javascript/popupwindows.html
We can read:
newwindow=window.open(url,'name','height=400,width=200');

I agree he asked for 14 and 200 instead of 400 and 200 :-)

Anyway, i had furnished THE GOOD answer !

Jerry Stuckle

unread,
Aug 14, 2010, 7:33:30 PM8/14/10
to

No, you did not.

Raymond Schmit

unread,
Aug 15, 2010, 5:15:42 AM8/15/10
to
On Sat, 14 Aug 2010 19:33:30 -0400, Jerry Stuckle
<jstu...@attglobal.net> wrote:

You did not explain why ? Have you a better solution ?
i have just given the answer of his question how to have height and
width - that on only one sentence - more concise and precise is not
possible.

J.O. Aho

unread,
Aug 15, 2010, 5:44:18 AM8/15/10
to

If you had read the thread, you would have noticed that Jerry advocates for
not give answers for off topic subjects like this one, which should from the
beginning been posted in a javascript newsgroup as this has nothing to do with
PHP, no matter if you generate the javascript with PHP or hard code the
javascript.

I have to agree with Jerry this time and his reply from the 9th of August,
00:51 CEST was the best reply that OP could get here, but for some reason a
long rant for/against posting a javascript reply here has been keeping on for
a long time, too long time.

I think everyone would agree on that you rather see PHP related posts here
than chit chats about cars, medicine, viagra and so on... so pleace try to
keep off topic threads as short as possible and point those who ask to a
possible place where to find the answer they are looking for.

--

//Aho

Jerry Stuckle

unread,
Aug 15, 2010, 9:09:39 AM8/15/10
to

Yes, I did. You do not know if that is the best solution - or even a
solution which will work for this user. It is only ONE solution - one
which might not even work in his situation.

The correct answer is to get the user to the proper newsgroup where they
can investigate his needs properly and give him the best solution.

That's why there are so many different newsgroups - so that one can get
good answers from the experts. Not half-assed answers from someone who
thinks they know what they're doing.

Dave

unread,
Aug 15, 2010, 6:10:11 PM8/15/10
to

"Andy" <an...@NOSPAMmanyplay.com> wrote in message
news:jU99o.5951$ss1.5344@hurricane...


hehehe.. these guys are funny!

Anyways, I tried Andy's suggestion, did work. errored out on the

','200','15','no');return false;">Invite a Friend

line.

I tried including it in a .js file, <php include=file> but still same
results.
The file is a Template file being called from another part of the program.

Not to worry, we'll keep at it.

Jerry Stuckle

unread,
Aug 15, 2010, 8:07:32 PM8/15/10
to

... which is EXACTLY why I referred you to an appropriate newsgroup -
where you will get GOOD answers to your questions - not garbage like
you've gotten here.

Andy

unread,
Aug 16, 2010, 4:27:19 AM8/16/10
to

"Dave" <davenl...@hotNOmailSPAM.com> wrote in message

news:7BZ9o.66931$4B7....@newsfe16.iad...

It only errored out because you didn't reconstruct the lines after pasting
from the newsreader wordwrap ;)

Andy

0 new messages