Foros del Web » Programando para Internet » PHP »

No muestra registro!

Estas en el tema de No muestra registro! en el foro de PHP en Foros del Web. Antes , muestro mis archivos sombrero.php Código PHP: <?php # FileName="Connection_php_mysql.htm" # Type="MYSQL" # HTTP="true" $hostname_general  =  "***********" ; $database_general  =  "***************" ; $username_general  =  "**********" ; $password_general  ...
  #1 (permalink)  
Antiguo 16/07/2009, 19:28
 
Fecha de Ingreso: julio-2006
Mensajes: 254
Antigüedad: 17 años, 9 meses
Puntos: 0
No muestra registro!

Antes , muestro mis archivos
sombrero.php
Código PHP:
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_general "***********";
$database_general "***************";
$username_general "**********";
$password_general "*******************";
$general mysql_pconnect($hostname_general$username_general$password_general) or trigger_error(mysql_error(),E_USER_ERROR); 
?><?php
if (!isset($_SESSION)) {
  
session_start();
}
$MM_authorizedUsers "";
$MM_donotCheckaccess "true";

// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers$strGroups$UserName$UserGroup) { 
  
// For security, start by assuming the visitor is NOT authorized. 
  
$isValid False

  
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username. 
  // Therefore, we know that a user is NOT logged in if that Session variable is blank. 
  
if (!empty($UserName)) { 
    
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login. 
    // Parse the strings into arrays. 
    
$arrUsers Explode(","$strUsers); 
    
$arrGroups Explode(","$strGroups); 
    if (
in_array($UserName$arrUsers)) { 
      
$isValid true
    } 
    
// Or, you may restrict access to only certain users based on their username. 
    
if (in_array($UserGroup$arrGroups)) { 
      
$isValid true
    } 
    if ((
$strUsers == "") && true) { 
      
$isValid true
    } 
  } 
  return 
$isValid
}

$MM_restrictGoTo "/logeo.php";
if (!((isset(
$_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers$_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {   
  
$MM_qsChar "?";
  
$MM_referrer $_SERVER['PHP_SELF'];
  if (
strpos($MM_restrictGoTo"?")) $MM_qsChar "&";
  if (isset(
$QUERY_STRING) && strlen($QUERY_STRING) > 0
  
$MM_referrer .= "?" $QUERY_STRING;
  
$MM_restrictGoTo $MM_restrictGoTo$MM_qsChar "accesscheck=" urlencode($MM_referrer);
  
header("Location: "$MM_restrictGoTo); 
  exit;
}
?>
<?php
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  
$theValue get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  
$theValue function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? "'" doubleval($theValue) . "'" "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}
}

$editFormAction $_SERVER['PHP_SELF'];
if (isset(
$_SERVER['QUERY_STRING'])) {
  
$editFormAction .= "?" htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset(
$_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
  
$updateSQL sprintf("UPDATE usuarios SET casa=%s WHERE usuario=%s",
                       
GetSQLValueString($_POST['seis'], "text"),
                       
GetSQLValueString($_SESSION['MM_Username'], "text"));

  
mysql_select_db($database_general$general);
  
$Result1 mysql_query($updateSQL$general) or die(mysql_error());

  
$updateGoTo "/sombrero2.php";
  if (isset(
$_SERVER['QUERY_STRING'])) {
    
$updateGoTo .= (strpos($updateGoTo'?')) ? "&" "?";
    
$updateGoTo .= $_SERVER['QUERY_STRING'];
  }
  
header(sprintf("Location: %s"$updateGoTo));
}

$colname_Recordset1 "-1";
if (isset(
$_SESSION['MM_Username'])) {
  
$colname_Recordset1 $_SESSION['MM_Username'];
}
mysql_select_db($database_general$general);
$query_Recordset1 sprintf("SELECT * FROM usuarios WHERE usuario = %s"GetSQLValueString($colname_Recordset1"text"));
$Recordset1 mysql_query($query_Recordset1$general) or die(mysql_error());
$row_Recordset1 mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 mysql_num_rows($Recordset1);
?>
<!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">
<!-- DW6 -->
<head>
<!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
<title>Entertainment - Text</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="mm_entertainment.css" type="text/css" />
</head>
<body bgcolor="#14285f">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr bgcolor="02021e">
    <td width="400" colspan="2" rowspan="2" nowrap="nowrap"><img src="mm_entertainment_image.jpg" alt="Header image" width="400" height="140" border="0" /></td>
    <td width="360" height="58" nowrap="nowrap" colspan="2" id="logo" valign="bottom">Expresso Hogwarts</td>
    <td width="100%">&nbsp;</td>
  </tr>
  <tr bgcolor="02021E">
    <td height="57" nowrap="nowrap" colspan="2" id="tagline" valign="top">Él no te morderá.. capaz..<br />      </td>
    <td width="100%">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="5" bgcolor="#cc3300"><img src="mm_spacer.gif" alt="" width="1" height="2" border="0" /></td>
  </tr>

   <tr>
    <td colspan="5"><img src="mm_spacer.gif" alt="" width="1" height="2" border="0" /></td>
  </tr>

   <tr>
    <td colspan="5" bgcolor="#cc3300"><img src="mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>
  </tr>

  <tr>
    <td colspan="5" id="dateformat">&nbsp;<br />
    <a href="/index.php">Home</a> -<a href="clases.php"> Clases</a> - <a href="/diagon/index.php">Diagon</a><br />    </td>
  </tr>
  <tr>
    <td width="156" valign="top">&nbsp;</td>
   <td colspan="2" valign="top"><br />
    <table border="0" cellspacing="0" cellpadding="2" width="504">
        <tr>
          <td class="subHeader">Sombrero Seleccionador</td>
        </tr>
        <tr>
          <td class="bodyText"><p align="center">&nbsp; </p>
            <p>¿Qué es el sombrero seleccionador? Es un objeto, que selecciona la casa a la cual sos apto para ir..</p>
            <p>Se dice que a Gryffindor, de color rojo y dorado, van los valientes... que a Hufflepuff, negra y amarilla, los leales y que a Slytherin , los viles ... No nos olvidemos de Ravenclaw, donde los astutos tienen su lugar..</p>
            <p>¿Así qué? ¿A cuál irás?</p>
            <p align="center"><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b5/Blason_Gryffondor.svg/545px-Blason_Gryffondor.svg.png" alt="Gryffindor" width="105" height="119" /><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Blason_Poufsouffle.svg/200px-Blason_Poufsouffle.svg.png" alt="Gryffindor" width="105" height="119" /><img src="/imagenes/545px-Blason_Serdaigle.svg.png" alt="Gryffindor" width="105" height="119" /><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/9/97/Blason_Serpentard.svg/200px-Blason_Serpentard.svg.png" alt="Gryffindor"
  #2 (permalink)  
Antiguo 16/07/2009, 19:28
 
Fecha de Ingreso: julio-2006
Mensajes: 254
Antigüedad: 17 años, 9 meses
Puntos: 0
Respuesta: No muestra registro!

Código PHP:
width="105" height="119" /></p>
            <p align="center">Pero eso solo lo decidirá el sombrero... a proposito..</p>
            <p align="center">¿Quieres empezar de una vez con las preguntas?<br />
            (Hechas por <a href="mailto: [email protected]">daiuh</a>)</p>
            <form action="<?php echo $editFormAction?>" method="POST" name="form1" target="som" id="form1">
              <p align="center"><strong>1) Si tuvieras qe escoger una profesión en el mundo de los muggles ¿Por cuál optarias?</strong><br />
                a) Juez o maestro  
                  <label>
                  <input type="radio" name="uno" id="radio" value="h" />
                  </label>
                <br />
                b) Médico o cientifico 
                <input type="radio" name="uno" id="radio2" value="r" />
                <br />
                c) Político 
                <input type="radio" name="uno" id="radio3" value="s" />
                <br />
                d) Bombero 
                <input type="radio" name="uno" id="radio4" value="g" />
                <br />
  <strong>2) ¿Cuáles son tus vacaciones ideales?</strong><br />
                a) Roma 
                <input type="radio" name="dos" id="radio5" value="r" />
                <br />
                b) París, Londres, Nueva York
                <input type="radio" name="dos" id="radio6" value="s" />
                <br />
                c) Asia 
                <input type="radio" name="dos" id="radio7" value="h" />
                <br />
                d) Cualquier país exótico 
                <input type="radio" name="dos" id="radio8" value="g" />
                <br />
  <strong>3) ¿Cuál es tu pelicula favorita?</strong><br />
                a) Las de Indiana Jones 
                <input type="radio" name="tres" id="radio9" value="g" />
                <br />
                b) Buscando a Nemo 
                <input type="radio" name="tres" id="radio10" value="h" />
                <br />
                c) Ocean's Eleven 
                <input type="radio" name="tres" id="radio11" value="s" />
                <br />
                d) Grease 
                <input type="radio" name="tres" id="radio12" value="r" />
                <br />
  <strong>4) ¿Cuál es el objeto de tus sueños?</strong><br />
                a) El mapa del merodeador 
                <input type="radio" name="cuatro" id="radio13" value="s" />
                <br />
                b) La recordadora 
                <input type="radio" name="cuatro" id="radio14" value="h" />
                <br />
                c) Un escreguto 
                <input type="radio" name="cuatro" id="radio15" value="r" />
                <br />
                d) Una Nimbus 2000
                <input type="radio" name="cuatro" id="radio16" value="g" />
                <br />
  <strong>5) ¿Cuál es tu materia favorita?</strong><br />
                a) DCAO 
                <input type="radio" name="cinco" id="radio17" value="g" />
                <br />
                b) Pociones 
                <input type="radio" name="cinco" id="radio18" value="s" />
                <br />
                c) CCM 
                <input type="radio" name="cinco" id="radio19" value="h" />
                <br />
                d) Encantamientos e HM
                <input type="radio" name="cinco" id="radio20" value="r" />
                <br />
  <strong>6) ¿A que le dedicas tu tiempo libre?</strong><br />
                a) A gastar bromas 
                <input type="radio" name="seis" id="radio21" value="s" />
                <br />
                b) Leer un buen libro 
                <input type="radio" name="seis" id="radio22" value="r" />
                <br />
                c) Juegas ajedrez con un amigo
                <input type="radio" name="seis" id="radio23" value="h" />
                <br />
                d)  Fútbol 
                <input type="radio" name="seis" id="radio24" value="g" />
                <br />
  <strong>7) ¿Que epoca de la historia te gustaria visitar?</strong><br />
                a) La antigüedad 
                <input type="radio" name="siete" id="radio25" value="g" />
                <br />
                b) La edad media 
                <input type="radio" name="siete" id="radio26" value="s" />
                <br />
                c) La epoca de miguel angel 
                <input type="radio" name="siete" id="radio27" value="r" />
                <br />
                d) La nuestra 
                <input type="radio" name="siete" id="radio28" value="h" />
              </p>
              <p align="center">
                <label>
                <input type="submit" name="button" id="button" value="enviar" />
                </label>
                <br />
                            </p>
              <p align="center">&nbsp;</p>
              <p align="center"></p>
              <input type="hidden" name="MM_update" value="form1" />
            </form>
            <p align="center">&nbsp;</p>
            <p align="center">&nbsp;</p>
            <p align="center"><iframe width="500
           " height="200" name="som"></iframe>&nbsp;</p>
            <p align="center">&nbsp;</p>
            <p align="center">&nbsp;</p>
            <p align="center">&nbsp;</p>
            <p align="center">&nbsp;</p>
            <p align="center">&nbsp;</p>
            <p align="center">&nbsp;</p>
            <p align="center">&nbsp;</p>
            <p align="center">&nbsp;</p>
            <p align="center">&nbsp;</p>
            <p align="center">&nbsp;</p>
            <p align="center">&nbsp;</p>
            <p align="center">&nbsp;</p>
            <p align="center">&nbsp;</p>
            <p align="center">&nbsp;</p>
            <p align="center">&nbsp;</p>
            <p align="center">&nbsp;</p>
            <p align="center">&nbsp;</p>
            <p align="center">&nbsp;</p>
            <p align="center">&nbsp;</p>
            <p align="center">&nbsp;</p>
            <p align="center">&nbsp;</p>
            <p align="center">&nbsp;</p>
            <p align="center">&nbsp;</p>
            <p align="center">&nbsp;</p>
            <p align="center">&nbsp;</p></td>
        </tr>
      </table></td>
    <td width="100">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td width="156">&nbsp;</td>
    <td width="244">&nbsp;</td>
    <td width="260">&nbsp;</td>
    <td width="100">&nbsp;</td>
    <td width="100%">&nbsp;</td>
  </tr>
</table>
<br />
</body>
</html>
<?php
mysql_free_result
($Recordset1);
?>
sombrero2.php
Código PHP:
<?php
#conexion
?>
<?php
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  
$theValue get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  
$theValue function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? "'" doubleval($theValue) . "'" "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}
}

$colname_casa "-1";
if (isset(
$_SESSION['MM_Username'])) {
  
$colname_casa $_SESSION['MM_Username'];
}
mysql_select_db($database_general$general);
$query_casa sprintf("SELECT * FROM usuarios WHERE usuario = %s"GetSQLValueString($colname_casa"text"));
$casa mysql_query($query_casa$general) or die(mysql_error());
$row_casa mysql_fetch_assoc($casa);
$totalRows_casa mysql_num_rows($casa);
?>
<!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>Untitled Document</title>
<style type="text/css">
<!--
body {
    background-color: #3366FF;
}
.style1 {
    font-family: Geneva, Arial, Helvetica, sans-serif;
    color: #FFFFFF;
}
.style2 {
    font-family: Georgia, "Times New Roman", Times, serif;
    font-weight: bold;
    font-size: 12px;
    color: #FFFFFF;
}
-->
</style></head>

<body>
<div align="center"><span class="style1">Usted fue seleccionado</span></div>
<p align="center" class="style2">&nbsp;</p>
<p align="center" class="style2">Su casa:</p>
<p align="center" class="style2"></p>
<p align="center" class="style2"><?php echo $row_casa['casa']; ?></p>
<p align="center" class="style2">&nbsp;</p>
</body>
</html>
<?php
mysql_free_result
($casa);
?>
El asunto es que no me imprime el ultimo echo!
(Pd.: Sobre el primer formulario, lo añade a la base correctamente)
(Pd2.: MM_Username, si, esta bien eso.)
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 10:37.