Jump to content


Photo

PHP popup with input from a form


  • Please log in to reply
2 replies to this topic

#1 zarfan

zarfan
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 04 August 2006 - 06:32 PM

Hi,

i would like to make a php popup window based on some information from a form

currently a value is passed into the PHP script then i am forwarwed to another another site

my script is as follows

<?php

@$productID = addslashes($_POST['productID']);

if (strlen($productID) == 0 )
{
die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Invalid productID</font></p>");
}

header("Location: products/$productID/index.html'");

?>

but i now i would like to change this abit so that the productID page is opened in a new popup window and that and i return to my last viewed page, can anyone code this small script for me please

thanks





#2 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 04 August 2006 - 06:43 PM

use javascript...

die("<script>window.open(urlgoeshere,'','parametersgohere')</script>");

Refer to one of the millions of pages for the arguements for window.open...such as:

http://www.javascrip...aq/openinga.htm

#3 zarfan

zarfan
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 05 August 2006 - 10:59 AM

hi i tried what you said but it didnt work, here is my code now


<?php

@$productID = addslashes($_POST['productID']);

if (strlen($productID) == 0 )
{
die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Invalid productID</font></p>");
}
die("<script>window.open(products/$productID/index.html,'','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=800,height=600')</script>");


?>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users