Posted by sathyashrayan on 06/26/07 06:09
Dear Group,
Please look at the following demo link.
http://www.itsravi.com/demo/new_pms/admin/addproject.php
I am trying to implement the "more attachment" and "more url" tasks in that
page. The data base design is like this. Keeping a separate table for the
"more file upload" (File uploaded directly to mysql). If the user closes
after simply uploading the files without submitting the whole project
information, or an exception occurs then the db table with extra files and
url is inserted un-necessary. So I thought to put all the uploaded
information in a array. At the end of submitting the full project
information in the db the array values will get stored in the corresponding
url and file table which is the child table which has got the FK key points
to the corresponding project (parent)table.
Following is the code I wrote for inputting the multiple url upload.
<?php
$number_tot = $number; /*if 3 given in the text box then 3 box to get urls*/
print "<form name=more_url_comp action=more_url_comp.php method=post>";
for($i=1 ; $i<= $number_tot ; $i++)
{
print "More Url $i:<input type='text' name='url_comp_'.$i><br>";
$more_url_comp[] = "url_comp_".$i; /*All the url name array*/
$test = $_REQUEST['url_comp_'.$i]; /*This is not wrking*/
}
echo '<input type="submit" name="more_comp_url" value="Upload Now!">';
print "</form>";
I got really stuck with the following. I don't know who to get the
$test = $_REQUEST['url_comp_'.$i]
in a array. Since the variable $i getting appended in the end. If, on the
other hand, I use array in the name of the text box such as text[], then can
I use serialize and unserialize function. If this can be done then there is
no need to use a separate db table to hold the value for url. Or I am
missing some thing very basic.?
I have not started to implement this with multiple file upload to the
mysql directly. I don't know what could be the problem that will arise in
that situation.
Any help will be very help full. Thanks.
[Back to original message]
|