Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: alert popup?

  1. #1
    Regular Coder
    Join Date
    Feb 2003
    Location
    California
    Posts
    925
    Thanks
    0
    Thanked 0 Times in 0 Posts

    alert popup?

    I read of an alert, but my question is that I query a db to find out if a value exists or not, if it does then do nothing. If it doesn't I want an alert or popup thing to warn the user that there are no values stored in the db for some value. Does that make sense? Can I do it?


    Jason

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Yes in a manner of speaking. You can use PHP to write out the necessary javascript for the alert box.


    Once your query or whatever is done and you have a variable set up just for that value then:

    PHP Code:

    $variable 
    //value from database

    if(!is_null($variable)){
        echo 
    "<script language=\"Javascript\">";
        echo 
    "alert('It was there')";
        echo 
    "</script>";

    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    Regular Coder
    Join Date
    Feb 2003
    Location
    California
    Posts
    925
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks, worked beautifully.....


    Jason


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •