oren.gozlan Posted November 2, 2006 Share Posted November 2, 2006 First time with PHP.What i'm trying to do is to have a apache server (using WAMP) to catch a post request to the server and dump the posted file to the disk (windows)Help ... ??? Link to comment https://forums.phpfreaks.com/topic/25903-newbe-php-help/ Share on other sites More sharing options...
heckenschutze Posted November 2, 2006 Share Posted November 2, 2006 Perhaps be more specific... Link to comment https://forums.phpfreaks.com/topic/25903-newbe-php-help/#findComment-118327 Share on other sites More sharing options...
HuggieBear Posted November 2, 2006 Share Posted November 2, 2006 If you just want to put the contents of what was posted in a file then try this (with comments included):[code]<?php// file name and location$file_to_write = "/var/tmp/post.txt";// open the file for writing and assign to a resource id ($file)$file = fopen($file_to_write, "w"); // write a header to the filefwrite($file, "The following entries were posted:\n\n");// write a row in the file for each of the posted elementsforeach ($_POST as $key => $value){ fwrite($file, "$key: $value\n");}// close the filefclose($file);?>[/code]Incidentally, I took these instructions directly from the [url=http://uk.php.net/manual/en/]PHP Manual[/url]! A first stop for every PHP Newbie.RegardsHuggie Link to comment https://forums.phpfreaks.com/topic/25903-newbe-php-help/#findComment-118336 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.