?
Solved

pop up window

Posted on 2005-04-24
5
Medium Priority
?
365 Views
Last Modified: 2013-11-28
Hi all,

I've been asking a few questions this week, thanks for everyone's patience. I'm developing a small school report system. What I'm trying to do is once a pupil is selected, a pop up window is created with their report in it. The trouble is, the form will be using variables from the url i.e. $_GET and the pop up I want will not have an address bar (you know, the neat small windows that pop up with user information)...is there a way round this?

Kate
0
Comment
Question by:katneej
  • 3
  • 2
5 Comments
 
LVL 27

Expert Comment

by:Diablo84
ID: 13854731
Hi Kate,

I am not quite sure i understand the problem. Even if the address bar is not displayed in the pop up window, provided the query string was present in the URL to be loaded, the GET array will still be populated.

For example, if you had a file containing:

<script language="JavaScript">
window.open ("test.php?test=value","mywindow","width=300,height=200");
</script>

and test.php contained:

<?php
print_r($_GET);
?>

Test.php, when displayed as a pop up would show:

Array ( [test] => value )

Ie. The index, 'test', is present in the GET array.

Diablo84
0
 

Author Comment

by:katneej
ID: 13854987
Hi Diablo,

Thats brilliant. Any how  I would call the javascript pop-up window from the php statment, i.e.

 echo "<td ><a href='javascript:window.open('editor.php?group=$GroupID')'>Group $GroupName</a></td>";

doesn't seem to work, wouldn't i have to send the url to a seperate function?
0
 
LVL 27

Accepted Solution

by:
Diablo84 earned 2000 total points
ID: 13854997
The main problem there is the quotes.

You would have to do something like this:

echo "<td ><a href=\"#\" onClick=\"window.open('editor.php?group=$GroupID');return false;\">Group $GroupName</a></td>";

Note that the backslash is used to escape the quotes that are to be outputted.

Or, if you wanted to size it to specific dimensions:

echo "<td ><a href=\"#\" onClick=\"window.open('editor.php?group=$GroupID','WindowName','width=300,height=200');return false;\">Group $GroupName</a></td>";

Diablo84
0
 

Author Comment

by:katneej
ID: 13855042
wow, very impressed, thanks very much...the pop up window will be a form you see which interfaces with the MySql database, i thought it would look a lot more professinal in its own pop-up...I think I will use a bigger size for it than usual because I wouldn't want the box to be small for the form..

anyway, thanks very very much for you help!

Katie :)
0
 
LVL 27

Expert Comment

by:Diablo84
ID: 13855060
no problem :)

Diablo84
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Read on to get a few ideas on how to promote your next corporate event.
Read this article and get to know some best tips for outsourcing client PPC work to a white label PPC agency.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses
Course of the Month13 days, 12 hours left to enroll

755 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question