Page 1 of 1

array help

Posted: Sun Apr 16, 2006 10:50 am
by jasondavis
I think I need to use an array but im lost and not very good at this.

I have this code

Code: Select all

<?php

$num = $_POST['num']; 
$num = $_GET['num']; 
?>
<html>
<table border="0" align="center" cellpadding=3>
<?php 
		for ($x = 1; $x <= $num; $x++) { 
?>
  <tr> 
                      <td><strong style="font-size:16px;">Picture <?php echo $x; ?></strong></td>
                      <td> <font size="-1">Photo URL:</font> 
                        <input type=text name="purl[<?php echo $x; ?>]" style="margin:1px"> <br /> 
                      </td>
                    </tr>

<?php 
		} 
?>
 <td><strong>Width:</strong></td>
                      <td><input type=text name="width" style="margin:1px" value="400"></td>
                    </tr>
                    <tr> 
                      <td height=10 style="border-top: thin solid #cccccc"></tr>
                  </table>
                  <div align=center><input type=submit value=Create! /><br />
                  </div>
                </form>

</html>
This gives me x amount of input fields, I then want to display the values of these inputs like this

Code: Select all

<div align=center><table width=400 border=0 align=center><tr><td><marquee width="$width">
<img src=>
<img src=>
<img src=>
<img src=>
</marquee></td></tr></table></div>

Re: array help

Posted: Sun Apr 16, 2006 7:44 pm
by timvw
jasondavis wrote:

Code: Select all

$num = $_POST['num']; 
$num = $_GET['num'];
Even if $_POST['num'] exits, $num will always be $_GET['num'].

Btw, could you try to explain your problem better? because i don't really understand it.