Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open a new window using PHP

Tags:

javascript

php

Is there any way to open a new window or new tab using PHP without using JavaScript.

like image 530
Warrior Avatar asked Nov 28 '22 11:11

Warrior


2 Answers

Nope, a window can only be opening by adding target="_blank" attribute (invalid in Strict (X)HTML, but valid in HTML5) or using JavaSript's window.open(url '_blank').

PHP runs server side - therefore it can generate the HTML or JavaScript, but it can't directly interact with the client.

like image 137
alex Avatar answered Dec 10 '22 21:12

alex


Short answer: No.

PHP is a server side language (at least in the context of web development). It has absolutely no control over the client side, i.e. the browser.

like image 22
Felix Kling Avatar answered Dec 10 '22 22:12

Felix Kling