1,105,409 Community Members

PHP / JavaScript alert problem!

Member Avatar
marases
Junior Poster in Training
93 posts since Sep 2010
Reputation Points: 11 [?]
Q&As Helped to Solve: 7 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
nevvermind
Light Poster
37 posts since Sep 2010
Reputation Points: 1 [?]
Q&As Helped to Solve: 15 [?]
Skill Endorsements: 0 [?]
 
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.

Member Avatar
P0lT10n
Posting Whiz in Training
237 posts since Apr 2010
Reputation Points: 3 [?]
Q&As Helped to Solve: 30 [?]
Skill Endorsements: 0 [?]
 
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...

Member Avatar
marases
Junior Poster in Training
93 posts since Sep 2010
Reputation Points: 11 [?]
Q&As Helped to Solve: 7 [?]
Skill Endorsements: 0 [?]
 
0
 

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

And then still style??

Thanks,
Marais

Member Avatar
P0lT10n
Posting Whiz in Training
237 posts since Apr 2010
Reputation Points: 3 [?]
Q&As Helped to Solve: 30 [?]
Skill Endorsements: 0 [?]
 
0
 

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

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: