Jump to content

Archived

This topic is now archived and is closed to further replies.

zarfan

PHP popup with input from a form

Recommended Posts

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

[code]
@$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'");

?>[/code]

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



Share this post


Link to post
Share on other sites
use javascript...

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

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

http://www.javascripter.net/faq/openinga.htm

Share this post


Link to post
Share on other sites
hi i tried what you said but it didnt work, here is my code now

[code]

<?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>");


?>[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.