Functions

I have a function where I would like the user to see a POP up message before I exit the user from a form etc. This is what it looks like. The message doesn’t pop up but the user does get closed off from the form ? Any ideas ?

function CheckLogin()
{
sc_lookup(ds_user, “Select SessionID from Staff where Email = ‘[var_loginuser]’”);
$sessionid = session_id();
$dbsessionid = {ds_user [0] [0]};
if ($dbsessionid !== $sessionid)
{
alert(“It appears you are already logged in. Please click Log Off and Log back in. Thanks Mate!”); - This is not working
sc_exit();
}
}

Re: Functions

Hi!

I think you should be using: sc_alert("…");

or

echo"<script> alert(‘Message’)</script>";

Re: Functions

Thanks. I used this following similar to what you suggested.

function CheckLogin()
{
sc_lookup(ds_user, “Select SessionID from Staff where Email = ‘[var_loginuser]’”);
$sessionid = session_id();
$dbsessionid = {ds_user [0] [0]};
if ($dbsessionid !== $sessionid)
{
?>
<SCRIPT LANGUAGE=“javascript”>

alert(“It appears you are already logged somewhere else. Please click Log Off and Log back in. MSG by Security Administrator”);

</SCRIPT>
<?php
sc_exit();
}
}

Paul