473,382 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Open new window using javascript with php

I have to open new window without clicking link or url.. i need to
open autometically when entered the inside of my webpage. can any one
help this task..
Aug 14 '08 #1
4 7488
On Aug 14, 12:18*am, Arivu PHP <arivusudar...@gmail.comwrote:
I have to open new window without clicking link or url.. i need to
open autometically when entered the inside of my webpage. can any one
help this task..
<?php

$url = 'http://someplace.com/someresource.html';

echo "<script>window.location=$url;<script>";

?>

or Only by using php

<?php

$url = 'http://someplace.com/someresource.html';

header("Location: $url");

?>

Thanks!!!
Raashid bhatt
2008
Aug 14 '08 #2
On Aug 14, 12:23*am, raashid bhatt <raashid_...@yahoo.comwrote:
On Aug 14, 12:18*am, Arivu PHP <arivusudar...@gmail.comwrote:
I have to open new window without clicking link or url.. i need to
open autometically when entered the inside of my webpage. can any one
help this task..

<?php

$url = 'http://someplace.com/someresource.html';

echo "<script>window.location=$url;<script>";

?>

or Only by using php

<?php

$url = 'http://someplace.com/someresource.html';

header("Location: $url");

?>

Thanks!!!
Raashid bhatt
2008
if u want to open new window
<?php

$url = 'http://someplace.com/someresource.html';
$str =
"<script>
window.open($url,'New window');</script>";

echo $str;

?>
Aug 14 '08 #3
raashid bhatt wrote:
$url = 'http://someplace.com/someresource.html';
echo "<script>window.location=$url;<script>";
results in wrong js-code! JS also requires string literals enclosed by
Single- or Doublequotes.

So long, Ulf
Aug 14 '08 #4
Arivu PHP wrote:
I have to open new window without clicking link or url.. i need to
open autometically when entered the inside of my webpage. can any one
help this task..
Whether the javascript is created by PHP or just in the file is immaterial.

Try comp.lang.javascript for the javascript code. Then just place it in
the file. No PHP required.

Just beware that it won't work for people who have disabled javascript.
It also won't work for those with popup blockers installed.

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

Aug 14 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Matt | last post by:
My problem is when the user click the submit button, it will launch another new window for the request page. I want to confirm we cannot use JavaScript open window functions to open a request page?...
6
by: lukeo | last post by:
I'm shelling out to an .asp (or htm) page from an application. I want to show this in a window without the address bar, etc... Is there a way I can redirect this page using javascript to a page...
6
by: Les | last post by:
Hi, I'd like to find out how to use the window.open() script in Fireworks MX. I have posted my question in the Fireworks forum but didn't get any replies. Since it's javascript, maybe someone...
2
by: Raptor | last post by:
I'm a complete Javascript n00b, using a snippet I found on the web. I'll probably be buying a Javascript book. What's the authoritative on-line resource for Javascript, like php.net is for PHP? ...
10
by: Marshall Dudley | last post by:
When I do the following line in Netscape, the popup loads as it should, but the parent window usually, but not always, reloads as well. <a href="#"...
2
by: Samir Pandey | last post by:
Hello, I am using the following javascript code to open a new window. Somehow, IE always opens a new window. It doesn't open target url in the window name given. All i want is, if there is a...
7
by: Peter Aitken | last post by:
I want to include a button that has rollover effects and also is a link to a page that will open in a new window. Here's the code I am using: <A...
9
by: gleverett | last post by:
I have been searching the 'Net, and I can't find the right solution here. I am writing some PHP pages that utilize some Javascript. The script works in Mozilla/Netscape, but fails in IE. I don't...
7
by: Toccoa | last post by:
After considerable googling - I mean searching with Google(r) - I could not find javascript on a button or <a href=... to close a window in the latest versions of IE and FireFox. There seemed...
6
by: bushi | last post by:
hi everyone! i have diplayed my hyperlinks in a iframe.when i redirect to next page.the next page also open in the same frame,but i want to open a new browser window,when i click on the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.