I'm trying to add an onclick popup to my site. The problem is most popup generators on the net tell you to put code in the head of the popup page, but i'm using a php file... How would i do this with php?
You would put the code inside the <head> and </head> tags on your page. If the HTML code is being generated by PHP, then you will either have to exit out of PHP or echo the script so that it is also generated by the parser before being sent to the browser.
vanductai, it depends on how the PHP script is structured in the first place. If everything is being output by PHP (rather than just the dynamic parts being "inlined") then that would be one way to do it. Another being to just echo the code so it's generated as well. If it's inline, then it might not even be necessary and can be added normally.
I'm Sorry but you just went over my head. Could you give me of an example popup script that would work fine outside of the <?php ?> tags? I have no <head>.
<?php data here ?> <?php data here ?> <style type="text/css"> <!-- a:link { text-decoration: none; } a:visited { text-decoration: none; } a:hover { text-decoration: none; } a:active { text-decoration: none; } --> </style> <div align="right"><a href="?action=logout">Log Out</a> </div> <br> <center> <table width="510" height="35" border="1"> <tr> <th width="115" scope="col">1</th> <th width="128" scope="col">2</th> <th width="92" scope="col">3</th> <th width="46" scope="col">4</th> <th width="95" scope="col">5</th> </tr> </table> <table width="510" border="1"> <tr border="0"><th width="37" scope = "col"></th><th width="155" scope="col"></th><th width="92" scope="col"></th><th width="45" scope="col"></th><th width="94" scope="col"></th></tr> <?php data here ?> </table> </center> Code (markup):
Ok, you can just add it normally (as you would with a normal HTML file) right after the STYLE element (<style></style> tags).