Ver Mensaje Individual
  #3 (permalink)  
Antiguo 12/12/2012, 21:21
XxSoulDarkxX
 
Fecha de Ingreso: agosto-2012
Ubicación: Lima, Peru
Mensajes: 51
Antigüedad: 14 años, 1 mes
Puntos: 0
Respuesta: Mensaje warning en php

Cita:
Iniciado por pateketrueke Ver Mensaje
Los primeros mensajes de error son bastante comunes, lee lo siguiente:
http://www.forosdelweb.com/wiki/PHP:...n_line_4%22%3F

El último error no es tan sencillo de solucionar pues no es un error de código sino de conexión, es mejor que uses PDO para poder controlar la excepción y que de una vez migres a MySQLi, lee lo siguiente:
http://www.forosdelweb.com/f18/anunc...ecada-1008145/
Hola, la verdad no puedo encontrar el error. Soy nuevo en php y bases de datos, y es mi primera web algo compeja, te pego el codigo haber si me ayudas a encontrar el error.

Código PHP:
<?php require_once('Connections/conexion_usuarios.php'); ?>
<?php
//empieza el codigo para la validacion del usuario
//initialize the session
if (!isset($_SESSION)) {
  
session_start();
}
// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset(
$_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
  
$logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset(
$_GET['doLogout'])) &&($_GET['doLogout']=="true")){
  
//to fully log out a visitor we need to clear the session varialbles
  
$_SESSION['MM_Username'] = NULL;
  
$_SESSION['MM_UserGroup'] = NULL;
  
$_SESSION['PrevUrl'] = NULL;
  unset(
$_SESSION['MM_Username']);
  unset(
$_SESSION['MM_UserGroup']);
  unset(
$_SESSION['PrevUrl']);
  
$logoutGoTo = "index.php";
  if (
$logoutGoTo) {
    @
header("Location: $logoutGoTo");
    exit;
  }
}
?>
<?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 = "ingreso.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
$colname_consulta_usuario 
= "-1";
if (isset(
$_SESSION['MM_Username'])) {
  
$colname_consulta_usuario = (get_magic_quotes_gpc()) ? $_SESSION['MM_Username'] : addslashes($_SESSION['MM_Username']);
}
mysql_select_db($database_conexion_usuarios, $conexion_usuarios);
$query_consulta_usuario = sprintf("SELECT `user` FROM usuarios WHERE `user` = '%s'", $colname_consulta_usuario);
$consulta_usuario = mysql_query($query_consulta_usuario, $conexion_usuarios) or die(mysql_error());
$row_consulta_usuario = mysql_fetch_assoc($consulta_usuario);
$totalRows_consulta_usuario = mysql_num_rows($consulta_usuario);
//termina codigo para la conexion
//termina codigo para la conexion//termina codigo para la conexion
//termina codigo para la conexion
?>
<?php 
require_once('Connections/con_imag.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (
PHP_VERSION < 6) {
    
$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_insert"])) && ($_POST["MM_insert"] == "form1")) {
    
$tipo_prod = $_POST["lstTipo"];
//Guardar imagen
    
if (is_uploaded_file($_FILES['fleImagen']['tmp_name']))  { // verifica haya sido cargado el archivo
        
$ruta= "images/$tipo_prod/".$_FILES['fleImagen']['name'];
        
move_uploaded_file($_FILES['fleImagen']['tmp_name'], $ruta);
    if (
is_uploaded_file($_FILES['fleimagen_grande']['tmp_name']))  { // verifica haya sido cargado el archivo
        
$ruta1= "images/$tipo_prod/".$_FILES['fleimagen_grande']['name'];
        
move_uploaded_file($_FILES['fleimagen_grande']['tmp_name'], $ruta1);
    if (
is_uploaded_file($_FILES['fleimagenmuestra1']['tmp_name']))  { // verifica haya sido cargado el archivo
        
$ruta2= "images/$tipo_prod/".$_FILES['fleimagenmuestra1']['name'];
        
move_uploaded_file($_FILES['fleimagenmuestra1']['tmp_name'], $ruta2);
    if (
is_uploaded_file($_FILES['fleimagenmuestra2']['tmp_name']))  { // verifica haya sido cargado el archivo
        
$ruta3= "images/$tipo_prod/".$_FILES['fleimagenmuestra2']['name'];
        
move_uploaded_file($_FILES['fleimagenmuestra2']['tmp_name'], $ruta3);
        }
        }
    }
    }  
// Referencia, Imagen, Tipo, Precio, Nombre, Descripcion
$insertSQL = sprintf("INSERT INTO notebooks ( codigo, fabricante, Tipo, serie_modelo, nombre_modelo, precio, Imagen, imagen_grande, imagenmuestra1, imagenmuestra2, descripcion, descripcioncorta, sistema_operativo, procesador, chipset, memoria_instalada, memoria_maxima, disco_duro, unidad_optica, monitor, graficos, usb_30, usb_20, vga_monitor, hdmi_monitor, displayport, salida_audifonos, entrada_microfono, alimentacion_ca, rj_11, rj_45, interfaz_red, conexion_inalambrica, bluetooth ,bateria, audio, camara_web, teclado, dimensiones, peso, garantia, en_venta) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s,  %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                       
GetSQLValueString($_POST['txtcodigo'], "int"),
                       
GetSQLValueString($_POST['lstfabricante'], "text"),
                       
GetSQLValueString($_POST['lstTipo'], "text"),
                       
GetSQLValueString($_POST['txtserie_modelo'], "text"),
                       
GetSQLValueString($_POST['txtnombre_modelo'], "text"), "text"),
                       
GetSQLValueString($_POST['txtentrada_microfono'], "text"),
                       
GetSQLValueString($_POST['txtalimentacion_ca'], "text"),
                       
GetSQLValueString($_POST['txtrj_11'], "text"),
                       
GetSQLValueString($_POST['lsten_venta'], "text"));
  
mysql_select_db($database_con_imag, $con_imag);
  
$Result1 = mysql_query($insertSQL, $con_imag) or die(mysql_error());
  
$insertGoTo = "ingreso_exitoso.php";
  if (isset(
$_SERVER['QUERY_STRING'])) {
    
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    
$insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  @
header(sprintf("Location: %s", $insertGoTo));
}
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
Recorte el codigo porque es muy largo, espero sea suficiente.