array -

wxdqz

New Member
Hello,

I want to have my user to create tables from web. So I am working on the following:

page.html --> create.php --> do_create.php

How they work as follows;

page.html --> gets "tableName" and "numberOfFields" for table.

create.php --> has the follloing code segment

<?php
for($i=0; $i<$numberOfFields; $i++){
?>


<tr>
<td>
<p class="content">Field <?php echo $i;?> name</p>
</td>
<td>
<input type="text" name="field_name" size="20" maxlength="20" value=http://www.phpbuilder.com/board/archive/index.php/"" >
</td>

<td>
<p class="content">Field <?php echo $i; ?> width</p>
</td>
<td>
<input type="text" name="field_width" size="10" maxlength="10" value="" >
</td>


<td>
<p class="content">Field <?php echo $i ?> type</p>
</td>
<td>
<select name="field_type">
<option value="int">Integer
<option value="varchar">Char
<option value="text">Text
</select>
</td>
</tr>



<?php
}
?>

do_create.php --> (this is the one that creates table)(I passed tableName and numberOfFields as HTML hidden values to this guy.)

I am having problems how to pass'field name', 'field width' and 'field type' . They will be given by the user, on the fly.

I have tried to use arrays but they did not seem to work for me..Since I do not know how to pass an array to other php file and I couldn't construct an array out of above code...

any hint, pointer would be greatly apprecaited.

if anybody has some idea of some other way of doing what I need to do, I really like to hear that.

thanks in advance.

aybike
 
Back
Top