php page wth no menubar and toolbar in explorer

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
hakiki_dolphin
Forum Newbie
Posts: 9
Joined: Thu Jan 30, 2003 3:00 pm

php page wth no menubar and toolbar in explorer

Post by hakiki_dolphin »

Hi,

I want to open the php page in explorer with no menubar and toolbar. What can I do this?
If you can help me, I will be very happy.
Sincerely.
Ahmet Kara

ahmet_k_2002@yahoo.com :?:
hurkle
Forum Newbie
Posts: 15
Joined: Tue Feb 11, 2003 1:21 pm
Location: Minnesota, USA

Post by hurkle »

The only way I've found to do this is with client side scripting, i.e. Javascript. When you use the window.open command, you can set a variety of parameters to 'no', which will give you the effect you're looking for.

This effect is usually referred to as a 'chromeless' browser window, you might want to do some searches to see if anyone has found a way to do this with php.

best of luck.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

PHP is serverside and by its very nature only prepares information to be dished out.

Think of the internet as a restaurant.

1. You order a meal (click on a link or type in a URL etc.)
2. The waiter takes your order and tells the cook what you have ordered.
3. The cook prepares your meal.
4. The waiter takes the meal from the kitchen to you - he serves you.

PHP is only involved in step 2. and 3.

What you want is like trying to change the way the waiter serves the meal, e.g. standing on one leg, singing "I'm a lumberjack", whatever.

PHP can't do this. Use Javascript. Check the window-object in the DOM. You'll see all the options available 8)

Website with Javascript tutorials:
http://www.devshed.com/
http://www.javascriptkit.com/
http://www.webmonkey.com/
User avatar
Kriek
Forum Contributor
Posts: 238
Joined: Wed May 29, 2002 3:46 am
Location: Florida
Contact:

Post by Kriek »

See window.open documentation.
Last edited by Kriek on Wed Feb 12, 2003 7:59 pm, edited 3 times in total.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

That one won't work. Try

Code: Select all

<SCRIPT LANGUAGE="JavaScript">
function launch() &#123;
	win0=window.open("test.html","","width='400',height='400',menubar=no location=no,toolbar=no,status=no,scrollbars=yes,resizable=yes");
&#125;
// write link
document.write('<A HREF="javascript:launch()">open window</A>')
</SCRIPT>
User avatar
Kriek
Forum Contributor
Posts: 238
Joined: Wed May 29, 2002 3:46 am
Location: Florida
Contact:

Post by Kriek »

Patrik's method is correct.

Now I remeber why I hate JavaScript =)
fractalvibes
Forum Contributor
Posts: 335
Joined: Thu Sep 26, 2002 6:14 pm
Location: Waco, Texas

Post by fractalvibes »

See: http://www.javascriptkit.com/ for some really good info on javascript info. As was previously stated, PHP cannot do this, as it is a client-side operation.

However - do not forget that the PHP can write out the javascript before it is sent to the browser, so if you need to build the js stuff conditionally, you can do so.

Also - did you know that you can put all your javascript into a file, save as
a php file, and include as you wish?
i.e.

<!-- new code to replace all inline javascript -->
<?php
include ("Cooljs.php");
?>

That included file is 100% javascript, all the functions within callable within the main page.

Phil J.
hakiki_dolphin
Forum Newbie
Posts: 9
Joined: Thu Jan 30, 2003 3:00 pm

Post by hakiki_dolphin »

Hi,
Thanks for your reply. I tried to do but I think I had some mistakes.
In login.php I take the username and password in a form from the user and send them into enter1.php. I want to enter1.php in the explorer with no menubar and toolbar. I try to add some java codes into it. There are the codes below. Where must I put the javascript codes in php codes for this? Or is there a different way to make a page with no menubar and toolbar?
If you can help me, I will very happy.

<HEAD>...</HEAD>


<script language="javascript">
function windowopen() { open ("sayfa_ismi.htm","","height=300,width=250,scrollbars=no,resizable=no,status=no,menubar=no,toolbar=no,location=no") }
</script>

<body>... </body>
OnLoad="javascript:windowopen()


Sincerely.

Ahmet Kara

ahmet_k_2002@yahoo.com
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Where must I put the javascript codes in php codes for this? Or is there a different way to make a page with no menubar and toolbar?
No, javascript is the way to go to have a window open with no menubar and toolbar.

PHP will output HTML and in HTML javascript-code can be located anywhere. However, it is recommended to keep javascript-code between the
<head> and </head>-tags.

Btw: note that the onload-event must be located in the <body>-tag.
Your code above should read:

Code: Select all

...
<body onLoad="windowopen();">
Post Reply