Menu
Hi, I am sorry if this has been covered elsewhere, but I’m still stuck after reading quite a lot of them.
Basically I’m trying to run a small javascript function from within some PHP script. Here is a very basic example of what i’m doing. (My javascript is in a separate .js file):
// Returns the day from a mySQL date string
function getDay(dateString){
day = dateString.substring(8,10);
return day;
}
-Then in the PHP code:
echo(“<script language=’javascript’ src=’functions.js’>getDay($date)</script>”);
Can anyone help? I realise i’m probably missing something very simple. Thanks