PDA

View Full Version : can i write javascript inside php


seco
04-14-2007, 09:45 AM
hi

i have php page and i want to check if the logged user is admin or not by php script if so ,i want to execute javascript

thanks in advance.

davidj
04-14-2007, 09:46 AM
how well do you know php

seco
04-14-2007, 10:35 AM
afraid so ..
a little

i will check the session for the logged user ..ok now
i want to run js after that checking

davidj
04-14-2007, 10:40 AM
lets see if you can understand this example...


if($condition == 1){

$onload = "onload=\"jsFunction()\"";

}else{

$onload = "";

}



html...

<body <?php echo $onload; ?> >

seco
04-14-2007, 05:57 PM
really thanks for reply