1 Answer
  • 0
Votes
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /var/www/html/cnasolution/site/application/views/question.php
Line: 191
Function: _error_handler

File: /var/www/html/cnasolution/site/application/controllers/Questions.php
Line: 419
Function: view

File: /var/www/html/cnasolution/site/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Javascript to hide a popup

I have this script to show a popup as the page loads:

$(function () {     var overlay = $('
'); overlay.show(); overlay.appendTo(document.body); $('.popup').show(); $('.close').click(function () { $('.popup').hide(); overlay.appendTo(document.body).remove(); return false; }); $('.x').click(function () { $('.popup').hide(); overlay.appendTo(document.body).remove(); return false; }); });

And it works fine. Now I've been asked to hide the popup if the user has already seen this page, so I've appended to the above code

 function hidePopup()  {     $('.popup').hide();     overlay.appendTo(document.body).remove();     return false;  } 

But when I call it from a PHP script, it does not show the popup but the overlay is still there.

The PHP code is as follows:

session_start();         if(!isset($_SESSION['seenPopup'])){         echo "";         $_SESSION['seenPopup']=true;         }else{             echo "";         } 
Download script demo [LINK] [Origin]
Download script demo [LINK 2] [Onedrive] Download script demo [LINK 2] [Google drive]