Jump to content

echo alert not working


robert_gsfame

Recommended Posts

i have this code

if(!empty($_SESSION['username'])){

$val="window.location.href='test1.php'";}else{

$val="alert('Need login session')";}

 

echo "<input type=button value=Button onclick=$val>";

 

when i change the $val alert with alert('Login'), it works..... so the problem is that the alert cannot contain space..how can i do this?

 

 

 

thanks

 

 

Link to comment
https://forums.phpfreaks.com/topic/203932-echo-alert-not-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.