Pls. help me with this code :) the alert box is not appearing and it goes directly to homebody_admin.php
I want the homebody_admin.php to appear after I click the ok button on alert box pls help.
Your help is highly appreaciated! thanks in advance :)

if($password!= mysql_result($result, 0))  
    echo ("<SCRIPT LANGUAGE='JavaScript'>
        window.alert('You entered an incorrect password!')
    //echo "You entered an incorrect password"; 

Recommended Answers

All 6 Replies

Try using a semicolon after the window.alert() or additional attributes to the script-tag like type.

It's not appearing, because you're rendering content on the current page, then immediately redirecting the user to a different page, before they see the content.

<script type="text/javascript">
if(confirm('You entered an incorrect password'))
    window.location = 'homebody_admin.php';

Thank you so much for your help! yey! :)

echo ("<SCRIPT LANGUAGE='JavaScript'>
window.alert('You entered an incorrect password!')

Try this.

echo( " <script language='JavaScript'>  
             alert('You entered an incorrect password!');

I hope your problem is solved. If it is, help others know the thread is solved.


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.