Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8299131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:02:18+00:00 2026-06-08T16:02:18+00:00

i have one php function which verify admin login like that if($vAdmin==1) { $_SESSION[‘admin’]=admin;

  • 0

i have one php function which verify admin login like that

    if($vAdmin==1)
{
    $_SESSION['admin']="admin";
    header("location:index.php");
}
else
{
    $errMsg="Invalid Username or Password.";
}

This work perfect but i want to show the div which show the error message, so i defined the div like this and its hidden div in style.

      <div class="notification">Invalid username or password. (Type anything)</div>

i have changed the above function to

    if($vAdmin==1)
{
    $_SESSION['admin']="admin";
    header("location:index.php");
}
else
{?>
$('div.notification').fadeIn();
setTimeout(function() {
$('div.notification').fadeOut('slow');
}, 3000);   
<?}
    ?>

my basic purpose is when its not verified just show the div and hide it.

but its not working?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T16:02:22+00:00Added an answer on June 8, 2026 at 4:02 pm

    Change the else part of your code to the following:

    else
    { 
    echo <<<EOD
    <script type="text/javascript">
    $(document).load(function() {
    $('div.notification').fadeIn();
    setTimeout(function() {
    $('div.notification').fadeOut('slow');
    }, 3000); 
    });  
    </script>
    EOD;
    }
    

    I’m also assuming you’re including the jQuery library somewhere prior to where this script tag is added. If you’re not, make sure you do.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have like 50 different php files which all use the mail function. After
Currently, I have one php function which is running with cron. It's the function
I have a PHP file with one simple echo function: echo 'アクセスは撥ねりません。'; but when
I have been tearing my hair with this one for a while. index.php: $(document).ready(function(){
i have one php file which process adding of record in Database fro array.
I have one line in php file like this: <a class=hide-if-no-js onclick=findPosts.open( 'media[]','<?php echo
I have problem with session in cakephp.I have one file chat.php that is in
I have one form in a PHP (5.2.9-1) application that causes IIS (Microsoft-IIS/6.0) to
i have one setinterval method which call php script every 3 sec to check
I have a problem. I have 2 php scripts, one which sends xml data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.