calling javascript function from php code

Codes here !

Moderators: egami, macek, gesf

Post Reply
php-forum Fan User
php-forum Fan User
Posts: 622
Joined: Fri Aug 05, 2011 9:53 am

Fri Aug 31, 2012 11:27 pm

You cannot call Javascript from PHP, PHP is only executed on the server, whilst Javascript is a client side language.
What you can do with PHP is to create the HTML that reflects what you want, so if you had...

Code: Select all

     <div id="display">
    <?php echo $name; ?>
Then this part of the html will only be included only when you have the fields set.

Post Reply