We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,325 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

PHP / JavaScript alert problem!

Hey guys i have a little problem!! :confused:

I am trying to prompt a JavaScript alert before the html headers and when this happens i does not style my footer from css.

Heres my code:

if ($queryupdate) { echo "<script>alert('Your password has been updated!')</script>"; } else { echo "<script>alert('Your password has not updated!')</script>"; }

Does any body know how this can be fixed?

Thanks,
Marais

4
Contributors
4
Replies
15 Hours
Discussion Span
2 Years Ago
Last Updated
5
Views
marases
Junior Poster in Training
91 posts since Sep 2010
Reputation Points: 21
Solved Threads: 7
Skill Endorsements: 0

It worked for me.
Try this:

if ($queryupdate) {
    echo "<script type=\"text/javascript\">alert('Your password has been updated!')</script>";
} else {
    echo "<script type=\"text/javascript\">alert('Your password has been updated!')</script>";
}

Check $queryupdate's value.

nevvermind
Light Poster
37 posts since Sep 2010
Reputation Points: 11
Solved Threads: 15
Skill Endorsements: 0

Fist... do this...

if ($queryupdate) {
    echo "<script type='text/javascript'>alert('Your password has been updated!')</script>";
    } else {
    echo "<script type='text/javascript'>alert('Your password has been updated!')</script>";
    }

And then, maybe, it won't be styled because first run alert and all stop...

P0lT10n
Posting Whiz in Training
236 posts since Apr 2010
Reputation Points: 13
Solved Threads: 30
Skill Endorsements: 0

thanks, so will this work before the html headers??

And then still style??

Thanks,
Marais

marases
Junior Poster in Training
91 posts since Sep 2010
Reputation Points: 21
Solved Threads: 7
Skill Endorsements: 0

I mean, when alert is prompted, all stop processing until you press ok or what you have to press...

P0lT10n
Posting Whiz in Training
236 posts since Apr 2010
Reputation Points: 13
Solved Threads: 30
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0726 seconds using 2.72MB