Hello,
I'm trying to write a program that will POST information when executed. I can't explain well so I'm going to show how the program works.
This program is intended to run from console (not from web) like this:
php /home/user/upload.php /home/user/documents/2009Final/income.doc
When executed, I want the program to fill up the appropriate fields and POST. Here is the <form> section of the webpage I want it filled.
<form enctype="multipart/form-data" action="http://192.168.0.10/takeupload.php" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="4194304" />
<table border="1" cellspacing="0" cellpadding="10">
<tr><td align=center class=colhead colspan=2><b>File Upload</b></td></tr>
<tr><td class="heading" valign="top" align="right">File</td><td valign="top" align=left><input type=file name=file size=80>
</td></tr>
<tr><td class="heading" valign="top" align="right">Name</td><td valign="top" align=left><input type="text" name="name" size="80" />
</td></tr>
<tr><td class="heading" valign="top" align="right">Description File</td><td valign="top" align=left><input type=file name=nfo size=80><br>
</td></tr>
<tr><td class="heading" valign="top" align="right">Description</td><td valign="top" align=left><textarea name="descr" rows="10" cols="80"></textarea></td></tr>
<tr><td class="heading" valign="top" align="right">Type</td><td valign="top" align=left><select name="type">
<option value="0">(Select One)</option>
<option value="1">Final Report</option>
<option value="2">Income Report</option>
<option value="3">Semi-Final Report</option>
</select>
</td></tr>
<tr><td align="center" colspan="2"><input type="submit" class=btn value="Send" /></td></tr>
</table>
</form>
In this case, I want the program to fill up the values like this:
File: /home/user/documents/2009Final/income.doc
Name: income.doc
Description File: /home/user/documents/2009Final/description.txt
Description: Content of description.txt
Type: 1 (Income Report as the file name is income.doc)
Now the first question is, how can I load the arguements given and load it in, for example, $location? (In this case, /home/user/documents/2009Final/income.doc)
Second question is, how can I make it fill the form automatically(? not exactly filling) and POST?
Is this even possible?
Thanks