You are here: Re: Post request, server side php scrript: not using forms « PHP Programming Language « IT news, forums, messages
Re: Post request, server side php scrript: not using forms

Posted by george on 09/08/06 18:12

On 8 Sep 2006 10:30:15 -0700, Vinay Nagrik wrote...
>
>Hello Group members,
>I have access to server side php script which takes parameters from a
>form and processes
>the buffer and saves the file.
>
>However, I, as an implementor, do not have the luxury to use form based
>scripts. All I want
>to do is telnet to server and type in whole buffer/filename and use
>
>Header for Content_disposition.
>
>For buffers I would use
>
>Content-Disposition: inline // Send the buffer
>
>
>and if I want to send a file "a.b" and I want server to save this file
>on the server in
>filename "abcde" then I will send the file content as buffer and
>include the following
>header
>
>Content-Disposition: attachment; filename=abcde;
>
>I want the server to echo the content of the buffer and save the file
>in the filename variable.
>
>I am successful using the form, but this is not what I want to do. I
>want to telnet to the server
>which can take the post request and follow my wishes.
>
>The following two scripts do not serve my purpose. because they are
>designed to work with
>forms. Could someone tell me what need I change in these scripts so
>that these will work
>with the command line.
>
>*********************Two scripts do not serve my purpose
>
><?php
>$uploaddir = '/var/www/uploads/';
>$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
>
>echo '<pre>';
>if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
> echo "File is valid, and was successfully uploaded.\n";
>} else {
> echo "Possible file upload attack!\n";
>}
>
>echo 'Here is some more debugging info:';
>print_r($_FILES);
>
>print "</pre>";
>
>?>
>
>and ----------------
>
><?php
>print_r($_POST);
>?>
>
>*****************************
>
>Thanks in advance.
>
>nagrik
>

Since you're using telnet you can probably run a PHP-based script from the
command line like "php -f /path/to/phpscript.php". More detail on that can be
found here.

http://www.php.net/manual/en/features.commandline.php

Since you wouldn't be able to submit the form the "post" method wouldn't work so
you might need to use the "get" ($_GET variables) method.

george
--
Help a Community by Participating in Ours
We donate your subscription fees to the charity you choose
100% of your first month, 10% thereafter.
http://newsguy.com/charity.asp

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация