Jump to content
php.lv forumi

Pielabojiet


hEiti

Recommended Posts

function checkUser(){

if ((!isset($_SESSION['validUser'])) || ($_SESSION['validUser'] != true)){

header('Location: index.php');

}

 

seit ir funkcijas gabals ja lietotajs nav ielogojies tad vinsh tiek parmasts uz index.php, bet sakiet ludzu ka lai panaku kad tad kad parmet uz index.php reize atver popup?

vai ar itas jadara index.php faila?

Link to comment
Share on other sites

1) dafiga iekavu par daudz.

2) viens variants:

function checkUser(){
if (!isset($_SESSION['validUser']) || $_SESSION['validUser'] != true){
$_SESSION['vajagpopup']=true;
header('Location: index.php');
}
}

un iekš index.php

if ($_SESSION['vajagpopup']) {
echo "<script>window.open('popaps');</script>";
unset($_SESSION['vajagpopup'];
}

Link to comment
Share on other sites

×
×
  • Create New...