PDA

View Full Version : Some help required in script



me.prosenjeet
03-31-2011, 12:56 PM
Hello all,

Can you please suggest what I should do?
I have a script which has the old flow chart feature...
"If this then that else this"


if ($diff<=0)
{
if (strpos($deactivate,"://")!==FALSE) { header("Location: $deactivate\n\n"); exit; }
show($deactivate);
}
else
{
show($active);
}
?>

$deactivate/$active are actually two html/php page that will show as per condition.
How can I add a feature/code so that before showing $deactivate there is a session when the user can enter his email(may be a popup) and that is sent automatically to the admin when $deactivate page opens.

Thanks in advance for the help, appreciate if the explaination is simple and for a novice like me

djmatt
04-08-2011, 04:07 PM
if you wanted to use a popup, you could use javascript's prompt box:
prompt("question","defaultvalue");

or, instead of calling the result page, you could call a form with the question and the "action" of the form would be the desired page.

felgall
04-08-2011, 04:17 PM
if you wanted to use a popup, you could use javascript's prompt box:
prompt("question","defaultvalue");

That isn't a good idea as it doesn't cater for those with JavaScript disabled - or who use the "disable JavaScript" checkbox that the prompt box provides in some browsers that allows JavaScript to be killed for the current page.

It should be done with the server side script. You will need an extra web page to request the email address.