0

Hello i am trying to create a script that will allow for the user to click a link and pop up page opens up with the content from the same page
e.g

<?php
$option = $_GET['option'];
?>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function topWindow(){
popup = window.open("page1.php?option=<?php echo $option; ?>","scrollbars=no");
}
// End -->
</SCRIPT>

<?php
// list
echo "<a href=$PHP_SELF?option=1 onclick=\"topWindow()\">Link 1 </a>";
echo "<a href=$PHP_SELF?option=2 onclick=\"topWindow()\">Link 2 </a>";
echo "<a href=$PHP_SELF?option=3 onclick=\"topWindow()\">Link 3 </a>";

if ($option == 1)
{
 // show this data in pop up
}
if ($option == 2)
{
 // show this data in pop up
}
?>

Edited by nats01282: n/a

3
Contributors
5
Replies
7
Views
6 Years
Discussion Span
Last Post by diafol
0

You didn't say what the problem was, if there is a problem. Smants is right, I'd have said the same thing. Either that or I've got the wrong end of the stick. Are you proposing this as a tutorial / code snippet?

@smants - felt I had to redress the balance of the rep. when it happens to me, I just swell the old ignore list by a unit. :)

Edited by diafol: n/a

0

as i have said im trying to create a script that will allow for the user to click a link and pop up page opens up with the content from the same page...

i have put the code on that i have written but its not working? thts why i posted it

0

> as i have said im trying to create a script that will allow for the user to click a link and pop up page opens up with the content from the same page...

i have put the code on that i have written but its not working? thts why i posted it

You didn't say it wasn't working nor did you state which bit wasn't working.

Well, your code is mangled in many ways:

No html structure.
$_GET should be conditional - error if no option in querystring and js will fail
script tag should have type attribute instead of language
should quote urls in a tags
end handlers with a ';'
it's $_SERVER

Once you sort that lot out, post it again and state clearly what's not working. No point getting shirty with somebody that may have helped you if you outlined the nature of the problem.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.