Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7934255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:35:40+00:00 2026-06-03T21:35:40+00:00

Total beginner with PHP: I have an form based on table data that the

  • 0

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.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T21:35:41+00:00Added an answer on June 3, 2026 at 9:35 pm

    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

    $i=1;
    $urls = array();
    $paras = array();
    foreach($_POST as $variable){
        if($i==1){
            array_push($urls,$variable);
            $i++;
        }else{
            array_push($paras,$variable);
            $i=1;
        }
    }
    echo'<table><tr><td>';
    foreach($urls as $url){
        echo $url.'<br />';
    }
    echo'</td><td>';
    foreach($paras as $para){
        echo $para.'<br />';
    }
    echo'</td></tr></table>';
    

    Edit

    You would pair them like this…

     $_POST = array('url1','paragraph1','url2','paragraph2','url3','paragraph3');
    $urls = array();
    $paras = array();
    $i=1;
    $c=0;
    foreach($_POST as $variable){
        if($i==1){
            array_push($urls,$variable);
            $i++;
        }else{
            array_push($paras,$variable);
            $i=1;
         $c++;
        }
    }
    
    echo'<table>';
    for($x=0;$x<$c;$x++){
       echo'<tr><td>'.$urls[$x].'</td><td>'.$paras[$x].'</td></tr>';
    }
    echo'</table>';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Total beginner question about jQuery: I have a Form that contains several TextBoxes (input
this is a total beginner question. My question is about data that you can
(note that I'm a total beginner in android programming) I have a class that
I am a total beginner in JS/XML. I have this simple code that needs
I am a total beginner in PHP and writes simple web apps in procedural
So, I am a total beginner in any kind of Windows related programming. I
I am a total beginner to programming and Django so I'd appreciate help that
I'm total beginner in js and JQuery and have to complete such task: I
I am a complete, total beginner in programming, although I do have knowledge of
I am a total Beginner in C++ and programming generaly. I have watched a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.