rocky3015 Posted September 17, 2008 Share Posted September 17, 2008 Hi! I want to use javascript and php code together. combining html and javascript is fine but how do i combine php and javascript codes? and can javascript code run from a .php file? Link to comment https://forums.phpfreaks.com/topic/124588-php-code-in-javascript/ Share on other sites More sharing options...
F1Fan Posted September 17, 2008 Share Posted September 17, 2008 Sure you can. You can do it two ways: 1) include the php file as a javascript file ?> <scrypt type="text/javascript" src="javascript.php"></script> <?php 2) include the file as a php file: ?> <scrypt type="text/javascript"> <?php include ("javascript.php"); ?> </script> <?php Link to comment https://forums.phpfreaks.com/topic/124588-php-code-in-javascript/#findComment-643506 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.