Total beginner with PHP:
I have an form based on table data that the user can add any number of rows too, currently I’m calling the data in my .php like:
$para01 = $_POST["1_0"];
$url01 = $_POST["1_1"];
$para02 = $_POST["2_0"];
$url02 = $_POST["2_1"];
etc.
I’d like a way call the table data, so I can cater for x amount of rows
So, my pseudo code would be:
- for each row, apply cell id 0 to $url and id 1 to $para
- then echo url and para in some html
- repeat until all rows have been expressed.
You should use arrays!
a simple way to do it would be to call all post variables, and then sort them with php…
I did it for you really quick, assuming the form input fields look like:
formstart
url1
para1
url2
para2
url3
para3
and so on…
submit
endform
Edit
You would pair them like this…