Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
0 user currently in Programming. | 3 guests
Acmlm's Board - I2 Archive - Programming - PHP and Javascript
  
User name:
Password:
Reply:
 

UserPost
Tuvai
Posts: 191/211
You output Javascript the same way in PHP as you output HTML.
Rydain
Posts: 111/738
Both languages have different purposes. JavaScript is a client-side language interpreted by the browser. PHP is a server-side language - a web server parses PHP files to create HTML, which it displays to the person viewing your site. JS is perfect for the mouseovers you described, but pulling data out of MySQL requires a server-side language like PHP (because the server can see the database, but - assuming proper security on your web server - a random person viewing the page can't). You can certainly use both at once - just have the PHP script that generates a page spit out the necessary JavaScript, or save the JavaScript to an external file and make sure that you link to it in the head of the generated page.
Dragato
Posts: 20/25
Is it possible to use Javascript and PHP together, for the list of affiliates on my site I use javascript to show the sites 88x31 when you hover over the link.

But now that I've made an affiliate application feature which stores them all in the MySQL database I need it to list all of the affilates that have been acceted, obviously using PHP. So would it be possible to keep the javascript, or is there a PHP function which would do the trick?

Javascript by the way:

image0=new Image
image1=new Image

image0.src=http://rpg-ascension.aerocore.net/images/8831b.gif
image1.src=http://hg.aerocore.net/images/8831c.gif

a href=http://hg.aerocore.net onMouseOver=document.imagename02.src=image1.src onMouseOut=document.imagename02.src=image0.src target=_blank
Acmlm's Board - I2 Archive - Programming - PHP and Javascript


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.003 seconds.