Foros del Web » Programando para Internet » PHP »

xampp Error Generador de .htpasswd

Estas en el tema de xampp Error Generador de .htpasswd en el foro de PHP en Foros del Web. hola buenas no me ejecutar Generador se sale codigo php error Código PHP: <?php  ////////////////////////////////////////////////////////  // .htpasswd Maker  v1.0 - sebflipper Copyright 2004  //  //            http://www.sebflipper.com               //  //                                                    //  // This script will generate an encrypted password    //  //       for .htpasswd and .htaccess files            //  ////////////////////////////////////////////////////////  ?>   <HTML>  <HEAD>  ...
  #1 (permalink)  
Antiguo 10/07/2010, 15:10
Avatar de HasGvio  
Fecha de Ingreso: junio-2010
Mensajes: 14
Antigüedad: 13 años, 10 meses
Puntos: 0
xampp Error Generador de .htpasswd

hola buenas no me ejecutar Generador se sale codigo php error





Código PHP:
<?php 
//////////////////////////////////////////////////////// 
// .htpasswd Maker  v1.0 - sebflipper Copyright 2004  // 
//            http://www.sebflipper.com               // 
//                                                    // 
// This script will generate an encrypted password    // 
//       for .htpasswd and .htaccess files            // 
//////////////////////////////////////////////////////// 
?> 

<HTML> 
<HEAD> 
<TITLE>.htpasswd Maker</TITLE> 
<style type="text/css"> 
<!-- 
body { 
    font-family: Arial, Helvetica, sans-serif; 
    font-size: x-small; 


table { 
    font-size: x-small; 

--> 
</style> 
</HEAD> 
<BODY> 

<? 

if ( isset($_POST[user]) && isset($_POST[password1])) 

 if( 
$_POST[password1] == $_POST[password2] ) 
  { 

    
/*$pfad = $DOCUMENT_ROOT . dirname($PHP_SELF) . "/.htpasswd"; 
    $safe= dirname ($PHPSELF); 



    $htaccess_text = "AuthType Basic\n". 
    "AuthName \"\"\n". 
    "AuthUserFile $pfad\n". 
    "require valid-user\n";*/ 
     
    
$user $_POST[user]; 
    
$password1 $_POST[password1]; 

    for (
$i 0$i count ($user); $i++) 
    { 
     
$htpasswd_text .= "$user[$i]:".crypt($password1[$i],CRYPT_STD_DES).""
    } 


       echo 
"First make a file called .htaccess put this in it:<br><br> 

       AuthName \"Password Protected Directory\"<br> 
       AuthType Basic<br> 
       AuthUserFile /your/server/path/.htpasswd<br> 
       require valid-user<br><br> 

       Then make a file called .htpasswd. Below is the text you need to enter into your .htpasswd file, then upload both the file to the directory you want to protect!"

       echo 
"<p><hr></p>"
       echo 
nl2br($htpasswd_text); 
       echo 
"<p><hr></p>"
  } 
  else 
  { 

      echo 
"<p><hr></p>"
      echo 
"<b>Passwords do not match</b>"
      echo 
"<p><hr></p>"

  } 


?> 
<script language="javascript"> 
<!-- 
function ValidateForm() { 

for (i = 0; i < document.forms[0].elements.length; i++) { 
       if (document.forms[0].elements[i].value == "") { 
     switch (document.forms[0].elements[i].type) { 
       case "text": 
         alert('Please complete all fields before submitting'); 
         document.all.submit.style.visibility='visible'; 
         return false; 
         break; 

       case "textarea": 
         alert('Please complete all fields before submitting'); 
         document.all.submit.style.visibility='visible'; 
         return false; 
         break; 

       case "file": 
         alert('Please complete all fields before submitting'); 
         document.all.submit.style.visibility='visible'; 
         return false; 
         break; 
     } 
       } 
     } 
    return true; 
    } 
//--> 
</script> 
<FORM METHOD="POST" ACTION="<? echo $PHP_SELF?>" onSubmit='return ValidateForm()'> 
<table> 
<tr><td>Username:</td><td><INPUT TYPE="TEXT" NAME="user[]"></td></tr> 
<tr><td>Password:</td><td><INPUT TYPE="PASSWORD" NAME="password1[]"></td></tr> 
<tr><td>Password again:</td><td><INPUT TYPE="PASSWORD" NAME="password2[]"></td></tr> 
<tr><td><center><INPUT type=submit name="submit" VALUE="Encrypt" onclick="document.all.submit.style.visibility='hidden'"> 
</FORM> 
</center></td></tr> 
</table> 
<p>Note: We do NOT store your usernames and passwords.</p> 
<p>.htpasswd Maker v1.2 designed by <a href="http://www.sebflipper.com" target="_blank">Seb Flipper</a></p> 
</BODY> 
</HTML>
saludos
  #2 (permalink)  
Antiguo 10/07/2010, 15:14
Avatar de maycolalvarez
Colaborador
 
Fecha de Ingreso: julio-2008
Ubicación: Caracas
Mensajes: 12.120
Antigüedad: 15 años, 9 meses
Puntos: 1532
Respuesta: xampp Error Generador de .htpasswd

para usar ssl debes de colocar en el url "https/localhost" y aceptar la advertencia del navegador
  #3 (permalink)  
Antiguo 10/07/2010, 15:26
Avatar de HasGvio  
Fecha de Ingreso: junio-2010
Mensajes: 14
Antigüedad: 13 años, 10 meses
Puntos: 0
Respuesta: xampp Error Generador de .htpasswd

Cita:
Iniciado por maycolalvarez Ver Mensaje
para usar ssl debes de colocar en el url "https/localhost" y aceptar la advertencia del navegador
oke no tengo eso ssl me faltaron ?
  #4 (permalink)  
Antiguo 10/07/2010, 15:31
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Respuesta: xampp Error Generador de .htpasswd

Cita:
Iniciado por HasGvio Ver Mensaje
oke no tengo eso ssl me faltaron ?
en realidad tu problema es que el script que utilizas usa <? cuando debería ser <?php.... solo eso... ;)
__________________
Y U NO RTFM? щ(ºдºщ)

No atiendo por MP nada que no sea personal.
  #5 (permalink)  
Antiguo 10/07/2010, 15:40
Avatar de HasGvio  
Fecha de Ingreso: junio-2010
Mensajes: 14
Antigüedad: 13 años, 10 meses
Puntos: 0
De acuerdo Respuesta: xampp Error Generador de .htpasswd

Cita:
Iniciado por pateketrueke Ver Mensaje
en realidad tu problema es que el script que utilizas usa <? cuando debería ser <?php.... solo eso... ;)
jaja si muchas gracias

code editaron

Código PHP:
<?php 
//////////////////////////////////////////////////////// 
// .htpasswd Maker  v1.0 - sebflipper Copyright 2004  // 
//            http://www.sebflipper.com               // 
//                                                    // 
// This script will generate an encrypted password    // 
//       for .htpasswd and .htaccess files            // 
//////////////////////////////////////////////////////// 
?> 

<HTML> 
<HEAD> 
<TITLE>.htpasswd Maker</TITLE> 
<style type="text/css"> 
<!-- 
body { 
    font-family: Arial, Helvetica, sans-serif; 
    font-size: x-small; 


table { 
    font-size: x-small; 

--> 
</style> 
</HEAD> 
<BODY> 

<?PHP 

if ( isset($_POST[user]) && isset($_POST[password1])) 

 if( 
$_POST[password1] == $_POST[password2] ) 
  { 

    
/*$pfad = $DOCUMENT_ROOT . dirname($PHP_SELF) . "/.htpasswd"; 
    $safe= dirname ($PHPSELF); 



    $htaccess_text = "AuthType Basic\n". 
    "AuthName \"\"\n". 
    "AuthUserFile $pfad\n". 
    "require valid-user\n";*/ 
     
    
$user $_POST[user]; 
    
$password1 $_POST[password1]; 

    for (
$i 0$i count ($user); $i++) 
    { 
     
$htpasswd_text .= "$user[$i]:".crypt($password1[$i],CRYPT_STD_DES).""
    } 


       echo 
"First make a file called .htaccess put this in it:<br><br> 

       AuthName \"Password Protected Directory\"<br> 
       AuthType Basic<br> 
       AuthUserFile /your/server/path/.htpasswd<br> 
       require valid-user<br><br> 

       Then make a file called .htpasswd. Below is the text you need to enter into your .htpasswd file, then upload both the file to the directory you want to protect!"

       echo 
"<p><hr></p>"
       echo 
nl2br($htpasswd_text); 
       echo 
"<p><hr></p>"
  } 
  else 
  { 

      echo 
"<p><hr></p>"
      echo 
"<b>Passwords do not match</b>"
      echo 
"<p><hr></p>"

  } 


?> 
<script language="javascript"> 
<!-- 
function ValidateForm() { 

for (i = 0; i < document.forms[0].elements.length; i++) { 
       if (document.forms[0].elements[i].value == "") { 
     switch (document.forms[0].elements[i].type) { 
       case "text": 
         alert('Please complete all fields before submitting'); 
         document.all.submit.style.visibility='visible'; 
         return false; 
         break; 

       case "textarea": 
         alert('Please complete all fields before submitting'); 
         document.all.submit.style.visibility='visible'; 
         return false; 
         break; 

       case "file": 
         alert('Please complete all fields before submitting'); 
         document.all.submit.style.visibility='visible'; 
         return false; 
         break; 
     } 
       } 
     } 
    return true; 
    } 
//--> 
</script> 
<FORM METHOD="POST" ACTION="<?PHP echo $PHP_SELF?>" onSubmit='return ValidateForm()'> 
<table> 
<tr><td>Username:</td><td><INPUT TYPE="TEXT" NAME="user[]"></td></tr> 
<tr><td>Password:</td><td><INPUT TYPE="PASSWORD" NAME="password1[]"></td></tr> 
<tr><td>Password again:</td><td><INPUT TYPE="PASSWORD" NAME="password2[]"></td></tr> 
<tr><td><center><INPUT type=submit name="submit" VALUE="Encrypt" onclick="document.all.submit.style.visibility='hidden'"> 
</FORM> 
</center></td></tr> 
</table> 
<p>Note: We do NOT store your usernames and passwords.</p> 
<p>.htpasswd Maker v1.2 designed by <a href="http://www.sebflipper.com" target="_blank">Seb Flipper</a></p> 
</BODY> 
</HTML>

Etiquetas: generador, htpasswd, xampp
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 00:20.