javascript et php

javascript et php - HTML/CSS - Programmation

Marsh Posté le 28-05-2005 à 11:36:08    

Salut,
Est ce qu'on peut récupérer une variable php dans un javascript qui est dans la même page?
 

Reply

Marsh Posté le 28-05-2005 à 11:36:08   

Reply

Marsh Posté le 28-05-2005 à 11:54:54    

Heuuu...
 
Ils ne se placent pas trop au même niveau hein, es tu sûr d'avoir bien compris comment fonctionnent PHP et Javascript?


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r
Reply

Marsh Posté le 28-05-2005 à 12:09:16    

Effectivement, entre serveur et client !
Le souci que j'ai c'est d'imprimer plusieurs pages (la même)avec juste un champ différent.

Reply

Marsh Posté le 28-05-2005 à 12:10:36    

et alors?


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r
Reply

Marsh Posté le 28-05-2005 à 15:11:20    

Le php sert à générer la page : tu peux donc très bien générérer ta variable javascript avec la valeur de ton choix :

Code :
  1. var js_var = "<?php print $php_var; ?>";

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed