/    Sign up×
Community /Pin to ProfileBookmark

PHP open new window

in a script, i need for a new window to open, but i cant find anything on this in the documentation! like i know header(‘location:blah’) is a redirect, is there anyway to make a new window open?? stupid how JS could do it, but i dont like being JS dependant.

to post a comment
PHP

23 Comments(s)

Copy linkTweet thisAlerts:
@pyroFeb 10.2004 — Since PHP runs server-side, and you are trying to spawn a new window client side, you will have to use JavaScript to do this.
Copy linkTweet thisAlerts:
@Ben_RogersFeb 10.2004 — But, really think about it. Since PHP runs before the page loads, someone could open a billion windows and screw the comp up so much if it had that power...

Also, there's always target="_blank"... and if you're looking for it open onload, please reconsider that's very annoying.
Copy linkTweet thisAlerts:
@Sux0rZh_jc0rzauthorFeb 12.2004 — true that it would be annoying, but not where im using it. someone types into a chatbox "/help" and it opens the help page. thus they'd be expecting it. not exactly annoying then, eh? ?

sux about using JS.. i'll just have it display in the chatbox "If you do not have JavaScript enabled, the page can be found here: http://blah..". that should work to cover my arse. automatically opens if u have JS and if u dont, it gives you a link. good enough for me!

thanks.
Copy linkTweet thisAlerts:
@Ben_RogersFeb 12.2004 — what about target="_blank" ? That opens a link in a new window, and if it's a button you want you could always use CSS to make a link to look like a button.

and, true thatd be fine.
Copy linkTweet thisAlerts:
@Sux0rZh_jc0rzauthorFeb 12.2004 — making target="_blank" doesn work, because its a chatbox, and when they type /help then hit submit, the script is called at which point, if it reads that they typed in /help, it will open the page. so there is no button for them to click. =/
Copy linkTweet thisAlerts:
@pyroFeb 12.2004 — [i]Originally posted by omega [/i]

[B]what about target="_blank"?[/B][/QUOTE]
It's been depreciated in strict DOCTYPES, that's what.
Copy linkTweet thisAlerts:
@Ben_RogersFeb 12.2004 — it had its uses
Copy linkTweet thisAlerts:
@chris9902Feb 12.2004 — how ironic.

to view a page on not using pop-ups you have to load a new window
Copy linkTweet thisAlerts:
@Ben_RogersFeb 12.2004 — right click, open in same window.

but what i like to do more is right click, open in new tab. there needs to be a target for that, then if the borswer isnt mozilla it just opens in the same window.
Copy linkTweet thisAlerts:
@SamFeb 12.2004 — Center Click -> new tab in background

EDIT: opens in foreground if you go into options -> advanced -> Browsing -> and uncheck Open Links in Background
Copy linkTweet thisAlerts:
@Ben_RogersFeb 12.2004 — huh? whats center click, and what browser do you have?
Copy linkTweet thisAlerts:
@SamFeb 12.2004 — firefox, if you push downwards on the mousewheel (as if it were a button) rather than scroll it, it opens links in a new tab.

Netscape will also do this if you go into

Edit -> Preferences -> Navigator -> Tabbed Browsing -> Open Tabs instead of windows for -> Middle-Click

EDIT: [URL=http://www.avantbrowser.com]avant[/URL], a much cleaner IE derivative, also has a nice tabbed browsing setup.
Copy linkTweet thisAlerts:
@Ben_RogersFeb 12.2004 — ok, let me revise:

if the browser doesn't include a tab feature, THEN it'll open in the same window.
Copy linkTweet thisAlerts:
@Paul_JrFeb 12.2004 — [i]Originally posted by samij586 [/i]

[B]Center Click -> new tab in background

EDIT: opens in foreground if you go into options -> advanced -> Browsing -> and uncheck Open Links in Background [/B]
[/QUOTE]

Wow, sweet! I didn't know that. That's a handy tidbit of information right there, thanks! ?
Copy linkTweet thisAlerts:
@SamFeb 12.2004 — no prob... Love tabbed browsing
Copy linkTweet thisAlerts:
@pyroFeb 12.2004 — [i]Originally posted by samij586 [/i]

[B]firefox, if you push downwards on the mousewheel (as if it were a button) rather than scroll it, it opens links in a new tab.[/B][/QUOTE]
And Firefox seems to have fixed the bugs the Firebird had with this. On some sites, that didn't work. They all seem to work fine now. Awesome feature, for sure.
Copy linkTweet thisAlerts:
@Paul_JrFeb 12.2004 — [i]Originally posted by samij586 [/i]

[B]no prob... Love tabbed browsing [/B][/QUOTE]

Yes! Tabbed browsing gives me a warm, fuzzy feeling. :p
Copy linkTweet thisAlerts:
@BonnerFeb 13.2004 — Why dont you use PHP to call a JavaScript file that either opens a frame in the same window or asks for a users preferences upon execution?
Copy linkTweet thisAlerts:
@chris9902Feb 13.2004 — that middle click thing is cool

thanks
Copy linkTweet thisAlerts:
@Ben_RogersFeb 13.2004 — hm, well about js, unless you're using includes statements so the code is being put together, how would you call a js file?
Copy linkTweet thisAlerts:
@SamFeb 13.2004 — just like you would from normal html
Copy linkTweet thisAlerts:
@Ben_RogersFeb 13.2004 — the normal html way would be a link with an onclick statement for me....
×

Success!

Help @Sux0rZh_jc0rz spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.8,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...