Ver Mensaje Individual
  #7 (permalink)  
Antiguo 29/08/2010, 10:57
Avatar de zerokilled
zerokilled
Javascripter
 
Fecha de Ingreso: abril-2009
Ubicación: Isla del Encanto, La Borinqueña [+>==]
Mensajes: 8.050
Antigüedad: 15 años
Puntos: 1485
Respuesta: variables de variables sin variable [solucionado]

a largo plazo, nada en particular. a corto plazo, familiarizarme con php. por el momento solo estaba explorando las variables relacionada a datos de formularios. pero el tema mas bien vino por como antes explique, no queria verme en la necesidad de declarar variables. es la costumbre que tengo de escribir la menor cantidad de codigo posible. para que se hagan una idea de lo que he ido experimentando, http://phpscripting.awardspace.us/form.php.
Código PHP:
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>PHP Scripting</title>
<script type='text/javascript' src="http_request.js"></script>
<script type="text/javascript" src="form_ajax.js"></script>
<style type='text/css'>
pre{
height:25em;
border:thin solid #9cf;
overflow:auto;
}

div{
margin:1em;
width:35em;
float:left;
}
</style>
</head>

<body>
<form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<input type="text" name="name" />: name,
<input type="text" name="domain" />: domain,
<input type="text" name="shortcomment" />: a short comment,
<input type="file" name="somefile" /> your file.<br />
method: <select onchange="this.form.method = this.value">
<option value="get">get</option>
<option value="post">post</option>
<option value="put">put</option>
<option value="head">head</option></select>,
enctype: <select onchange="this.form.enctype = this.value">
<option value="application/x-www-form-urlencoded">urlencoded</option>
<option value="multipart/form-data">multipart</option>
</select> <label><input type="checkbox" id="ajax" /> Send with AJAX?</label>
<input type="submit" />
</form>

<?php
echo '<div>$_SERVER:<pre>';
print_r($_SERVER);
echo 
'</pre></div>';

echo 
"<div>\$_{$_SERVER['REQUEST_METHOD']}:<pre>";
print_r(${"_$_SERVER[REQUEST_METHOD]"});
echo 
'</pre></div>';
?>

<div>Ajax:<pre id="ajaxResponse"></pre></div>
</body></html>
__________________
la maldad es una virtud humana,
y la espiritualidad es la lucha del hombre contra su maldad.