|
|
 |
Ap茅ndice M. Lista de Protocolos/Envolturas Soportadas
La siguiente es una lista de los varios protocolos estilo URL que
PHP tiene integrado para su uso con las funciones del sistema de
archivos, tales como fopen() y
copy(). Adicionalmente a estas envolturas, y a
partir de PHP 4.3.0, usted puede escribir sus propias envolturas
usando scripts PHP y stream_wrapper_register().
Todas las versiones de PHP. Usada expl铆citamente
mediante file:// a partir de PHP
4.3.0 /ruta/hacia/archivo.ext ruta/relativa/hacia/archivo.ext archivoEnDirActual.ext C:/ruta/hacia/archivo_win.ext C:\ruta\hacia\archivo_win.ext \\servidor_smb\recurso_compartido\ruta\hacia\archivo_win.ext file:///ruta/hacia/archivo.ext
file:// es la envoltura predeterminada usada
por PHP, y representa el sistema de archivos local. Cuando se
especifica una ruta relativa (una ruta que no comienza con /, \,
\\, o una letra de unidad en windows), la ruta provista ser谩
aplicada contra el directorio de trabajo actual. En muchos casos
茅ste es el directorio en el cual reside el script, a menos
que haya sido modificado. Al usar la sapi CLI, 茅ste es, por
defecto, el directorio desde donde fue llamado el script.
Con algunas funciones, como fopen()
y file_get_contents(), include_path
puede usarse opcionalmente tambi茅n para las b煤squedas
de rutas relativas.
Tabla M-1. Resumen de Envoltura
add a note
User Contributed Notes
Lista de Protocolos/Envolturas Soportadas
ben dot johansen at gmail dot com
29-Aug-2006 11:02
Example of how to use the php://input to get raw post data
//read the raw data in
$roughHTTPPOST = file_get_contents("php://input");
//parse it into vars
parse_str($roughHTTPPOST);
if you do readfile("php://input") you will get the length of the post data
ben dot johansen at gmail dot com
29-Aug-2006 12:33
In trying to do AJAX with PHP and Javascript, I came upon an issue where the POST argument from the following javascript could not be read in via PHP 5 using the $_REQUEST or $_POST. I finally figured out how to read in the raw data using the php://input directive.
Javascript code:
=============
//create request instance
xhttp = new XMLHttpRequest();
// set the event handler
xhttp.onreadystatechange = serviceReturn;
// prep the call, http method=POST, true=asynchronous call
var Args = 'number='+NbrValue;
xhttp.open("POST", "http://<?php echo $_SERVER['SERVER_NAME'] ?>/webservices/ws_service.php", true);
// send the call with args
xhttp.send(Args);
PHP Code:
//read the raw data in
$roughHTTPPOST = file_get_contents("php://input");
//parse it into vars
parse_str($roughHTTPPOST);
heitorsiller at uol dot com dot br
07-Jul-2006 07:55
For reading a XML stream, this will work just fine:
<?php
$arq = file_get_contents('php://input');
?>
Then you can parse the XML like this:
<?php
$xml = xml_parser_create();
xml_parse_into_struct($xml, $arq, $vs);
xml_parser_free($xml);
$data = "";
foreach($vs as $v){
if($v['level'] == 3 && $v['type'] == 'complete')
$data .= "\n".$v['tag']." -> ".$v['value'];
}
echo $data;
?>
PS.: This is particularly useful for receiving mobile originated (MO) SMS messages from cellular phone companies.
opedroso at NOSPAMswoptimizer dot com
12-Apr-2006 11:07
php://input allows you to read raw POST data. It is a less memory intensive alternative to $HTTP_RAW_POST_DATA and does not need any special php.ini directives.
Example use:
$httprawpostdata = file_get_contents("php://input");
When reading a base64 encoded stream using php://input, be aware that you do not need to decode it, it will automatically be done for you.
nyvsld at gmail dot com
27-Nov-2005 10:28
php://stdin supports fseek() and fstat() function call,
while php://input doesn't.
drewish at katherinehouse dot com
24-Sep-2005 11:50
Be aware that contrary to the way this makes it sound, under Apache, php://output and php://stdout don't point to the same place.
<?php
$fo = fopen('php://output', 'w');
$fs = fopen('php://stdout', 'w');
fputs($fo, "You can see this with the CLI and Apache.\n");
fputs($fs, "This only shows up on the CLI...\n");
fclose($fo);
fclose($fs);
?>
Using the CLI you'll see:
You can see this with the CLI and Apache.
This only shows up on the CLI...
Using the Apache SAPI you'll see:
You can see this with the CLI and Apache.
nargy at yahoo dot com
24-Sep-2004 03:16
When opening php://output in append mode you get an error, the way to do it:
$fp=fopen("php://output","w");
fwrite($fp,"Hello, world !<BR>\n");
fclose($fp);
aidan at php dot net
27-May-2004 03:34
The contants:
* STDIN
* STDOUT
* STDERR
Were introduced in PHP 4.3.0 and are synomous with the fopen('php://stdx') result resource.
lupti at yahoo dot com
29-Nov-2003 02:04
I find using file_get_contents with php://input is very handy and efficient. Here is the code:
$request = "";
$request = file_get_contents("php://input");
I don't need to declare the URL filr string as "r". It automatically handles open the file with read.
I can then use this $request string to your XMLparser as data.
sam at bigwig dot net
15-Aug-2003 08:02
[ Editor's Note: There is a way to know. All response headers (from both the final responding server and intermediate redirecters) can be found in $http_response_header or stream_get_meta_data() as described above. ]
If you open an HTTP url and the server issues a Location style redirect, the redirected contents will be read but you can't find out that this has happened.
So if you then parse the returned html and try and rationalise relative URLs you could get it wrong.
| |
|
| Chiste de... M閐icos | | Confianza | - Pues sabe, el otro día fuí al médico y me habló de usted.
- ¿Y qué le dijo?
- Que ya que teníamos un poco de confianza y me podia hablar de tú. | | Chistes en tu mail | | ©ContenidosGratis |
| Inicio | Acción | Estrategia | Palabras | Puzzles | Solitarios | Foro Trucos |  | Cake Mania Jugadores: 6835 Categoría del juego: Acción Objetivo del juego: Ayuda a Jill a recuperar la pasteler韆 de su abuela llevando su propia pasteler韆; consigue clientes y gana dinero. |
|  | Rainbow Web Jugadores: 2199 Categoría del juego: Puzzles Objetivo del juego: Rompe un pegajoso hechizo y salva un reino de fantas韆 en Rainbow Web. Tendr醩 toneladas de diversi髇 mientras juegas a este m醙ico desaf韔 para la mente. |
|  | Mahjongg Fortuna Jugadores: 12462 Categoría del juego: Solitarios Objetivo del juego: Velocidad y habilidad mental son las armas más importantes en esta versión de un antiguo juego asiático. Despeja el tablero lo antes posible haciendo clic en las fichas iguales y gánate la fama eterna de la puntuación más alta. |
|  | Chainz 2 Jugadores: 6955 Categoría del juego: Puzzles Objetivo del juego: Entra en el mundo de las combinaciones con Chainz 2: Relinked, emocionante secuela del exitazo del a駉 pasado, Chainz. Gira eslabones y crea combinaciones de 3 m醩. |
|  | Delicious Jugadores: 4405 Categoría del juego: Acción Objetivo del juego: 縀res un as de la multitarea? 縌uieres que tus clientes est閚 contentos? ues Delicious es tu juego! Sacia el apetito de los clientes y tenlos contentos; o te arriesgues! |
|  | Bookworm Jugadores: 4568 Categoría del juego: Palabras Objetivo del juego: Junta las letras para formar palabras. ¡Las palabras más largas valen más puntos! |
|  | Zuma Jugadores: 4976 Categoría del juego: Acción Objetivo del juego: Controla el 韉olo de la rana de piedra de los antiguos Zuma en este intrigante enigma de acci髇. ispara bolas para formar conjuntos de tres, pero si dejas que lleguen a la calavera dorada morir醩! |
|  | Jewel of Atlantis Jugadores: 3798 Categoría del juego: Puzzles Objetivo del juego: Descubre la ciudad hundida de la Atl醤tida y busca valiosos tesoros. Viaja m醩 all de las profundidades del mar y vive trepidantes aventuras en Jewel of Atlantis. |
|  | Jewel Quest Jugadores: 3727 Categoría del juego: Puzzles Objetivo del juego: Convierte la arena de la antigua selva en oro tan r醦ido como puedas juntando grupos de 3 elementos. os grupos m醩 grandes valen m醩 puntos! |
|  | Bejeweled 2 Jugadores: 3659 Categoría del juego: Puzzles Objetivo del juego: Con cuatro modos de juego 鷑icos y fascinantes, nuevas piezas de juego explosivas e imponentes fondos planetarios, Bejeweled 2 es mucho m醩 adictivo que nunca. |
|
|