Foros del Web » Programando para Internet » PHP »

como puedo?

Estas en el tema de como puedo? en el foro de PHP en Foros del Web. Hola amigos como podria hacer esto con que me ayuden con esto, ya podre convertir todo mi codigo .. por ejemplo tengo este codigo Código ...
  #1 (permalink)  
Antiguo 24/05/2009, 19:31
Avatar de jamesjara  
Fecha de Ingreso: mayo-2008
Ubicación: san jose
Mensajes: 449
Antigüedad: 16 años
Puntos: 7
como puedo?

Hola amigos como podria hacer esto con que me ayuden con esto, ya podre convertir todo mi codigo
..

por ejemplo tengo este codigo
Código 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;
}

yo lo uso aproximadamente casi 50 veces en un sistema, me gustaria usarlo solo en una pàgina php y llamarlo, ejemplo usar un <?php include('funciones.php'); ?>

tambien si me ayudan con estas dos
Código PHP:
$editFormAction $_SERVER['PHP_SELF'];
if (isset(
$_SERVER['QUERY_STRING'])) {
  
$editFormAction .= "?" htmlentities($_SERVER['QUERY_STRING']);
}
$colname_po "-1";
if (isset(
$_POST['id'])) {
  
$colname_po $_POST['id'];

__________________
X7CLOUD El webservice latino!
Compatible
con mysql,sql,sqlitte.
Compatible con extjs , sencha , smargwt, Gwt , Jquery , Charts, Streaming.
  #2 (permalink)  
Antiguo 24/05/2009, 19:34
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: como puedo?

Tema trasladado desde PHP Orientado a Objetos

Pues ya tu mismo diste la respuesta, lo pones en un archivo y lo mandas a llamar con un include.

El otro codigo que expones no entiendo que es lo que quieres hacer.

Saludos.
  #3 (permalink)  
Antiguo 24/05/2009, 19:38
Avatar de jamesjara  
Fecha de Ingreso: mayo-2008
Ubicación: san jose
Mensajes: 449
Antigüedad: 16 años
Puntos: 7
Respuesta: como puedo?

ahh cooll, si la lo segundo era una tontera jeje gracias
__________________
X7CLOUD El webservice latino!
Compatible
con mysql,sql,sqlitte.
Compatible con extjs , sencha , smargwt, Gwt , Jquery , Charts, Streaming.
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:30.