Ver Mensaje Individual
  #4 (permalink)  
Antiguo 08/06/2007, 11:36
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 20 años, 4 meses
Puntos: 2135
Re: Variables PHP a Javascript

Código PHP:
<?php
include ("texto1.txt");
include (
"texto2.txt");
include (
"texto3.txt");
include (
"texto4.txt");

$textscript1 = $texto1;
$textscript2 = $texto2;
$textscript3 = $texto3;
$textscript4 = $texto4;
?>
<script language="javascript" type="text/javascript">
var textos = new Array();
textos[0] = '<b>'+<? echo $textscript1; ?>+'</b>';
textos[1] = '<b>'+<? echo $textscript2; ?>+'</b>';
textos[2] = '<b>'+<? echo $textscript3; ?>+'</b>';
textos[3] = '<b>'+<? echo $textscript4; ?>+'</b>';
var indice = 0;
</script>