www.webdeveloper.com
Results 1 to 6 of 6

Thread: php: creating alert

  1. #1
    Join Date
    May 2003
    Posts
    11

    Question php: creating alert

    I am new to using PHP, i like to know how can i create an alert box similar to those created in javascript??

  2. #2
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    PHP runs server side, so you can't make an alert with it. You can use PHP to write a javascript alert though, or just echo some text to the screen...

  3. #3
    Join Date
    May 2003
    Posts
    11
    thx, think i got it, u mean to jump put of php and write a javascript statement for the alert rite??

    just another question, if i were to get an error that says:

    syntax error near unexpected token `<html>'

    what does it mean?? or how should i solve it??

  4. #4
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    1. Yes, either jump out of PHP, or write it using PHP using echo or print

    2. Post the code that is giving you trouble...

  5. #5
    Join Date
    May 2003
    Posts
    11
    this is the code:

    <html>
    <head>
    <title>Admin Login</title>
    </head>
    <body bgcolor=#F0FFFF>
    <?
    $user=$HTTP_POST_VARS["user"];
    $password=$HTTP_POST_VARS["password"];

    if(empty($user)||empty($password))
    {
    ?>
    <script language="javascript">
    <!--
    alert("Login Error!!! Please check your login details and login again.");
    //-->
    </script>
    <?
    }
    ?>
    </body>
    </html>

  6. #6
    Join Date
    May 2003
    Posts
    11
    Thx anyway, I've solved it

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles