Foros del Web » Programando para Internet » Javascript »

JavaScript + Include PHP por GET EROR!!

Estas en el tema de JavaScript + Include PHP por GET EROR!! en el foro de Javascript en Foros del Web. hola! tengo un problemita, tengo un reproductor para radio en flash y tiene su archivo config, necesito pormedio de get hacer la llamada para que ...
  #1 (permalink)  
Antiguo 18/11/2011, 22:51
Avatar de ajalex  
Fecha de Ingreso: agosto-2003
Mensajes: 122
Antigüedad: 20 años, 8 meses
Puntos: 0
Exclamación JavaScript + Include PHP por GET EROR!!

hola!

tengo un problemita, tengo un reproductor para radio en flash y tiene su archivo config, necesito pormedio de get hacer la llamada para que haga el include del config

tengo este codigo que ya me habian dado donde contrate:
Código:
<script type="text/javascript"><!--
dbPlayer_station = "all";
dbPlayer_autoplay = "true";
dbPlayer_mode = "mini";
//-->
</script>
<script type="text/javascript" src="http://localhost/aacplayer/player.js"></script>
yo le quiero añadir esta instancia:
Código:
dbPlayer_cfgplayerid = "negromaricacom_8000";
y queda así:
Código:
<script type="text/javascript"><!--
dbPlayer_station = "all";
dbPlayer_autoplay = "true";
dbPlayer_mode = "mini";
dbPlayer_cfgplayerid = "negromaricacom_8000";
//-->
</script>
<script type="text/javascript" src="http://localhost/aacplayer/player.js"></script>
ahora mi archivo player.js hace la llamada a mi archivo manager.php para iniciar el reproductor, y dentro de manager.php se encuentra el include a mi config

segun yo enteoria nadamas era añadir la instancia incluirla en el js y se hace la llamada a mi archivo config y queda así el js

Código:
	//init public vars

	this.station = typeof dbPlayer_station != "undefined"? dbPlayer_station : "";
	this.autoplay = typeof dbPlayer_autoplay != "undefined"? dbPlayer_autoplay : "";
	this.skin = typeof dbPlayer_skin != "undefined"? dbPlayer_skin : "default";
	this.mode = typeof dbPlayer_mode != "undefined"? dbPlayer_mode : "mini";
	this.shoutcastid = typeof dbPlayer_cfgplayerid != "undefined"? dbPlayer_cfgplayerid : "";

	//init private vars

	this.id = "dbPlayer_" + dbPlayer_instances.length;
	this.playerid = typeof dbPlayer_playerid != "undefined"? dbPlayer_playerid : this.playerid;
	this.path = typeof dbPlayer_path != "undefined"? dbPlayer_path : this.url + "/AACplayer.swf";
	this.width = typeof dbPlayer_width != "undefined"? dbPlayer_width : (this.mode == "mini"? 300 : (this.mode == "large"? 600 : "100%"));
	this.height = typeof dbPlayer_height != "undefined"? dbPlayer_height : (this.mode == "mini"? 50 : (this.mode == "large"? 250 : "100%"));
	this.manager = typeof dbPlayer_manager != "undefined"? dbPlayer_manager : this.url + "/manager.php?cfgid=" + this.shoutcastid;
	this.proxy = typeof dbPlayer_proxy != "undefined"? dbPlayer_proxy : "";
si se fijan queda: this.url + "/manager.php?cfgid=" + this.shoutcastid; para hacer la llamada a mi config y en mi archivo manager.php tengo esto:

require "configs/".trim($_GET["cfgid"]).".php";

debería funcionar pero no cuando entro directo por navegador a manager.php?cfgid=negromaricacom_8000 veo correctamente el xml que genera, pero cuando lo hace el script en js no hace nada, ya hasta en el js hice un document.write y si me imprime el valor almacenado en la instancia pero lo rraro es que no ejecuta el get ene sta aprte:

Código:
this.manager = typeof dbPlayer_manager != "undefined"? dbPlayer_manager : this.url + "/manager.php?cfgid=" + this.shoutcastid;
alguien que me pueda ayudar?

grcaias1!!

Etiquetas: funcion, include, js, php
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 06:32.