Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Popup Window with PHP Variables and Open.Window 1

Status
Not open for further replies.

Zych

IS-IT--Management
Apr 3, 2003
313
US
Hello All,

I have page with a simple form on it. When the submit key is hit I want to take what was inputed and popup a window with a open.window function in it. For example I would like it to do something like this:
'window.open('$_POST['url1']')'
I know this will not work as written but I don't know how to popup a new window automatically in PHP using a javascript window.open funtion.
How can this be done?
 
PHP: Server side.
JavaScript: client side.

PHP can print client-side code that is later executed in the client, but that has nothing to do with PHP.
Your question is best posted in the JavaScript forum.

Anyway:
You would refer to the name attributed of the input fields using syntax like document.form.fieldname.value
Again, ask the JavaScript guys.
 
You know I keep forgetting that. I have now done it all in javascript and it seems to be working fine. I think I want to combine them to some extent but I will put that in another post.

Thanks,

Zych
 
Hi ,
you can do in somenthing like:

Code:
<?php
// some php code
//...
?>
<SCRIPT >
window.open('<?php echo $_POST['url1'] ?>', other_param,... );
</SCRIPT>
<?php
// some other php code 
?>


Evetually you have to urlencode() the $_POST['url1']

Regards,

Marcel

___
____
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top