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? Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.