 
			
				14/07/2013, 19:02
			
			
			     |  
      |    |    |    Fecha de Ingreso: julio-2013  Ubicación: Guerrero  
						Mensajes: 15
					  Antigüedad: 12 años, 3 meses Puntos: 0     |        |  
  |      Respuesta: Funcionar javascrip desde php        Gracias por responder, 
El primer archivo(en html) 
lo cargo con un boton   
<?php session_start(); require 'cookie.php'; //continua en el siguiente bloque ?>   
		<?php   		     
			session_start();              		//crea la cookie   
			if(isset($_POST['login']))    
			{   
			$completa = $_POST['pass'];   
			$comparar = md5 ($completa);    	//codifica lo escrito en md5   
			$clave = '9088'; 			//Reemplazar por tu contraseña   
			$final = md5 ( $clave ); 		//la codifica md5   
			   if ( $comparar == $final ) {   
    			       $_SESSION['listo'] = true;   
    			       header('Location: index.php'); 	//redirige a la pagina despues de inicias sesion   
    			      exit;   
			   } else    
			   {   
				?>   
				<script type="text/javascript">   
				<!--   
				alert('Contraseña Incorrecta')   
				//-->   
				</script>   
                                <?php       
		                  }   
		                  }			                       				   
			 ?>           
				<form method="post" action="">   
				<text style="font-weight:bold;">   
				<FONT size=5 color=blue face="customfont">   
				<marquee bgcolor = white = 100% scrolldelay = 0 >ALEJANDRO</marquee>   
				</FONT>   
				</text>   
				<center><input onClick="document.location.href='index1.php'" type="button" name="Submit" value="subir archivos"> </center>   
				<center><input onClick="document.location.href='ordenado.php'" type="button" name="Submit" value="Descargar archivos"> </center>   
				<center><input onClick="document.location.href='ordenadoborrar.ph  p'" type="button" name="Submit" value="Borrar archivos"> </center>  <center><input onClick="document.location.href='indexpdf.html'" type="button" name="Submit" value="Convertir a PDF"> </center>   
				<center><text style="font-weight:bold;"><font color=green>Conectado</font></text></center>   
				<!--<center><input type="password" name="pass"></center>-->   
				<!--<center><input type="submit" name="login" value="INICIAR" "></center> -->   
				<center><input type="button" name="Deslog" value="CERRAR" onClick="document.location.href='logout.php'"></center>   
			</form>	       
Que es el ultimo boton de abajo con value "Convertir a PDF", ya estando en esa nueva ventana al cargar el archivo no se ejecuta ningun codigo   
con el boton cargo esto,(indexpdf.html) y es aqui donde no puedo hacer andar el escript   
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
    <title>MultiConverter example</title>  <script type="text/javascript" src="archivo.js"></script> 
</head> 
<body>   
<h3>MultiConverter ConvertApi.com example, show how to retriew API data and convert files using client side JavaScripts</h3>         
<form id="form" method="post" enctype="multipart/form-data" target="iframe">   
    <div id="step1"> 
        Step1: select  source file:<br /> 
        <input type="file" id="file" name="File" size="0" />   
    </div>   
    <br />   
    <div id="step2" style="display: none;"> 
        Step2: select destination format:<br /> 
        <select id="outputFormat" name='OutputFormat'> 
        </select>   
        <br /><br /> 
        <input type="submit" id="submit" value="Convert" /> 
    </div>   
    <br />   
    <div id="step3" style="display: none;"> 
        Step3: Here is resulting url links.<br />  
        <small>*You can choose another file or another output format to repeat convertation.</small><br /><br /> 
    </div>   
    <input type="hidden" name="StoreFile" value="true" />    <center><input onClick=" " type="button" name="Submit" value="Cargar funcion"> </center>//Como invoco el script y trate el archivo seleccionado     
</form>   
<div id="load_api" style="display: none;"> 
Load availiable file formats from <i><b><span></span></b></i>  
</div>   
</body> 
</html>   
Aca arriba invoco al "archivo.js" que es el codigo en java script y con otro boton despues de haber cargado un archivo, trato de invocar el script pero no se como 
Gracias         
					
						Última edición por etalejandroet; 14/07/2013 a las 19:11           |