Foros del Web » Programando para Internet » PHP »

Esto es posible??

Estas en el tema de Esto es posible?? en el foro de PHP en Foros del Web. VEREIS MI DUDA RADICA EN SI SE PUEDE INSERTAR JAVASCRIPT EN PHP!! PARECE UNA TONTERIA PERO NO LO ES!! OS PONGO UN EJEMPLO: Código: <?php ...
  #1 (permalink)  
Antiguo 27/04/2002, 19:10
 
Fecha de Ingreso: abril-2002
Mensajes: 43
Antigüedad: 21 años, 11 meses
Puntos: 0
Esto es posible??

VEREIS MI DUDA RADICA EN SI SE PUEDE INSERTAR JAVASCRIPT EN PHP!! PARECE UNA TONTERIA PERO NO LO ES!! OS PONGO UN EJEMPLO:
Código:
  <?php

ob_start("ob_gzhandler");

/************************************************************************/
/* PHP-NUKE: Advanced Content Management System                         */
/* ============================================                         */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi ([email protected])         */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

foreach ($HTTP_GET_VARS as $secvalue) {
    if (eregi("<[^>]*script*\"?[^>]*>", $secvalue)) {
	die ("I don't like you...");
    }
}

if (eregi("mainfile.php",$PHP_SELF)) {
    Header("Location: index.php");
    die();
}

require_once("config.php");
require_once("includes/sql_layer.php");
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
$mainfile = 1;Y SIGUE Y SIGUE Y SIGUE...... ?>
DONDE TENDRIA QUE PONER EL JAVASCRIPT SI NO HAY TAG <HEAD></HEAD> NI BODY NI NA!! ALGUNO SABE COMO HACERLO??
  #2 (permalink)  
Antiguo 28/04/2002, 13:48
Avatar de eloi  
Fecha de Ingreso: marzo-2002
Mensajes: 149
Antigüedad: 22 años
Puntos: 0
Re: Esto es posible??

Pues debes poner <head><script></script></head> al principio del todo, antes de <?php

<hr size="1"><font face="Verdana">[B]¿Buscas algun código?<br><input id="q"> <input type="submit" value="Buscar" onclick="document.location = &quot;http://www.webpersonal.net/elosan/indicecods.htm?info=enter,todos,&quot;+q.value+&qu ot;,0&quot;">
  #3 (permalink)  
Antiguo 28/04/2002, 16:58
Avatar de epplestun  
Fecha de Ingreso: octubre-2001
Mensajes: 1.621
Antigüedad: 22 años, 4 meses
Puntos: 5
Re: Esto es posible??

bueno lo primero de todo tendrias k saber k el javascript tira del lado del clietne por lo cual tu haciendo un echo &quot;&quot;; ya funcionaria por lo cual haz echo 'code';
te dejo aki un ejemplo:

&lt;?
echo(&quot;&lt;script language=\&quot;JavaScript\&quot;&gt;\n&quot;);
echo(&quot;document.write(\&quot;HOLA\&quot;)&quot ;);
echo(&quot;&lt;/script&gt;\n&quot;);
echo(&quot;resto del code&quot;);
?&gt;

<table style="border:1px solid black"><tr><td><center>
<embed width="88" height="144" src="http://www.alaplaya.com/~epplestun/yo.swf"></td></td><font face=verdana size=1>Ivan Rodriguez el poder es [B]PHP</p></td></tr></table>
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 08:04.