HTML Code

<?php  $id=1;?>
<a href="" onClick="popitup('popup1.php?id=<?php echo $id;?>')">Open</a>

Javascript Code

<script type="text/javascript">
function popitup(url) {
newwindow=window.open(url,'name','height=200,width=150');
if (window.focus) {newwindow.focus()}
return false;
}
</script>
Answer from Blue Rose on Stack Overflow
🌐
W3Schools
w3schools.com › howto › howto_js_popup.asp
How To Create Popups
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.
🌐
Xlinesoft
xlinesoft.com › phprunner › docs › how_to_display_any_page_in_a_popup.htm
How to display a page in a popup window
Do not allow closing the window if the 'Product Name' field is empty: var popup = Runner.displayPopup( { url: "products_add.php", header: 'Add new product', footer: '<a href="#" onclick="window.popup.close();return false;">Close window</a>', afterCreate: function(popup) { window.popup = popup; }, beforeClose: function(popup) { if ($('iframe').contents().find("input#value_ProductName_1").val()=="") return false; else return true; } }); Example 8 ·
🌐
DaniWeb
daniweb.com › programming › web-development › threads › 199982 › popup-open-popup-onclick-help
php - Popup \ Open Popup onclick Help | DaniWeb
Afternoon everyone – Onclick of “contact “Pop-Up “Contact-Sms-Centre.php' Can anyone help with this – iv got a php page that returns the following as part of a set of results · <a href='Contact-Sms-Centre.php'>Contact</a> $city $country<hr ... <html> <head> </head> <body> <?php print "<script type='text/javascript'>"; print "window.open('Contact-Sms-Centre.php','new_window1','status=1,scrollbars=0,resizable=0,menu=no,left=450,top=275,width=450,height=350');"; print "</script>"; ?> </body> </html>
🌐
Sololearn
sololearn.com › en › Discuss › 1000357 › how-to-add-popup-window-in-php-
How to add popup window in php ? | Sololearn: Learn to code for FREE!
Put this in your header: <script> function myFunction() { alert("I am an alert box!"); // this is the message in "" } </script> And this in your body: <input type="button" onclick="myFunction()" value="Show alert box"> from the link below : ...
🌐
W3Schools
w3schools.com › howto › howto_js_popup_form.asp
How To Create a Popup Form With CSS
You can learn more about this in our PHP tutorial. <!-- A button to open the popup form --> <button class="open-button" onclick="openForm()">Open Form</button> <!-- The form --> <div class="form-popup" id="myForm"> <form action="/action_page.php" class="form-container"> <h1>Login</h1> <label for="email"><b>Email</b></label> <input type="text" placeholder="Enter Email" name="email" required> <label for="psw"><b>Password</b></label> <input type="password" placeholder="Enter Password" name="psw" required> <button type="submit" class="btn">Login</button> <button type="button" class="btn cancel" onclick="closeForm()">Close</button> </form> </div>
🌐
Foolishdeveloper
foolishdeveloper.com › popup-window-in-php
How to Create Popup Window in PHP (Tutorial + Code)
February 13, 2024 - For example, the following code ... in a popup box: You can also use PHP to generate the message that will be displayed in the alert box. For example, you can store a message in a variable and then use the variable in the alert function: You can also use PHP to create a link or a button that when clicked, will trigger the alert box. For example, you can create a link with an onclick attribute that calls the alert function: It’s also possible to create a modal window with more ...
Find elsewhere
🌐
PopupSmart
popupsmart.com › popupsmart conversion rate optimization & digital marketing blog › how to create a php popup for your website in 2025
How to Create a PHP Popup for Your Website in 2025
December 24, 2025 - You need to use the echo statement to output the desired content for the popup window. Then you can add the code to your website’s code injection part. You can create alert windows, confirm windows and prompt windows with PHP.
🌐
Delft Stack
delftstack.com › home › howto › php › php popup window
How to Create a Popup Window in PHP | Delft Stack
March 11, 2025 - This tutorial introduces creating a popup window in PHP. Learn how to enhance user experience with customizable popups using HTML, CSS, and JavaScript, along with PHP for dynamic content. Explore simple methods and code examples to effectively implement popups in your web projects.
🌐
DaniWeb
daniweb.com › programming › web-development › threads › 423819 › onclick-content-display-popup-page
php - onclick content display popup page | DaniWeb
Quod audire reformidans cu vix, nam erat dolore ei.</p>'; ?> <script type="text/javascript"> function pop_it(){ var thispop = window.open('', '', 'width=400,height=480,resizeable,scrollbars'); thispop.document.write('<?php echo $pop;?>'); thispop.document.close(); } </script> <a href="#" onclick="pop_it()">Abracadabra </a> ... I mentioned ligthtbox type popups as they aren't blocked as a rule.
🌐
SitePoint
sitepoint.com › php
Php pop up window broken. Help? - PHP - SitePoint Forums | Web Development & Design Community
January 2, 2019 - The url is the currentpage.php# which is the href link # in the onclick script.
🌐
SitePoint
sitepoint.com › php
Show Image in a pop-up window using PHP and Javascript - PHP - SitePoint Forums | Web Development & Design Community
September 8, 2009 - If you want to show an image in ... of html code function myWindow(i,t,wid,hei) { var day= new Date(); var id = day.getTime(); //Full screen var w = (window.width); var h = (window.height); ......
🌐
PHPBuilder
board.phpbuilder.com › d › 10267000-popup-window-in-php
Popup window in PHP? - PHPBuilder Forums
February 2, 2004 - Hey all, I am slowly learning how this all works, but one thing I cannot get to work, I need to have the comment link on http://wildcat.arizona.edu/papers/9...