1
Chris03
Executing javascript in PHP
  • 2004/3/31 0:56

  • Chris03

  • Quite a regular

  • Posts: 372

  • Since: 2004/2/22


How would i execute a script in PHP..?

here is the script.

<SCRIPT LANGUAGE="JavaScript" SRC="kickassamd_tracking/track.js"></SCRIPT>

it is for my site stats tracking from METASUN software, but its in ASP which i know wont work so figured using Jscript would but where would i put this script...? I have also looked at other PHP trackers but none i like! This script needs to be ran everytime a user hits the site! Thanks in advanced!

2
fatman
Re: Executing javascript in PHP
  • 2004/3/31 5:04

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13


If it needs to go in every page then stick it in your main theme file. This should be:

/themes/[themename]/theme.html

You can copy past it exactly how you have it. Just about anywhere in the page will work. Probably sticking it in the footer of the page would be best.


3
fatman
Re: Executing javascript in PHP
  • 2004/3/31 5:11

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13


actually if you wanted to you should use

<SCRIPT LANGUAGE="JavaScript" SRC="<{$xoops_url}>/kickassamd_tracking/track.js"></SCRIPT>

assuming your .js file is uploaded to the kickassamd_tracking folder

4
Chris03
Re: Executing javascript in PHP
  • 2004/3/31 5:46

  • Chris03

  • Quite a regular

  • Posts: 372

  • Since: 2004/2/22


they arent that is the problem and i tried the theme thing but it ignores it...?

5
fatman
Re: Executing javascript in PHP
  • 2004/3/31 8:09

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13


check to make sure your loading a new view of the page and the site isnt loading a cached template. This can be set in the System -> General Preferences section of admin.

If you look at your page source after the page loads and it doesn't show your Javascript link then you are most likely loading a cached view.

else if your javascript is in your souce the failure could be in the actual javascript file.

HTH

Login

Who's Online

84 user(s) are online (62 user(s) are browsing Support Forums)


Members: 0


Guests: 84


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits