The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Picking up regular HTML table data in PHP
post Mar 10 2019, 01:57 AM
Post #1


Group: Members
Posts: 27
Joined: 11-June 15
Member No.: 22,710

Hi, I have some code which works to transfer a column of table data to php. I show the HTML and part of the php below.

HTML creating the HTML web page:
echo("<td ><input type='textbox' name='fooMelody[]' value='$ParticipateMelody' readonly style='width:10px' onclick='funcInsertM(this.value,$CurrRow)'></td>\n");

PHP recieving the data from the web page
foreach($_POST['fldKFSongNumber'] as $fldKF_SongNumber){
      $fldKF_SongNumber = TestInput($con,$_POST['fldKFSongNumber'][$RowCnt]);
      $fooMelody = TestInput($con,$_POST['fooMelody'][$RowCnt]);
      $RowCnt=$RowCnt + 1;

As you can probably tell from the POST the table is inside a form.

I now have a need now to transfer the song name down to PHP. However it is not part of an input textbox but rather inside an anchor as shown below.
echo("<td><a href='/BIAB/$fldKF_BIAB_File' download>$fldSNF_SongName</a></td>\n");

So I tried this
echo("<td><a name='fooSongName[]' value='$fldSNF_SongName' href='/BIAB/$fldKF_BIAB_File' download>$fldSNF_SongName</a></td>\n");

along with this in PHP
fooSongName = TestInput($con,$_POST['fooSongName'][$RowCnt]);

and it says it cannot find $_POST['fooSongName'][$RowCnt]).

I tried a couple of things without success. One included trying it with a different column that is not an input text box but also does not have href (that failed). I also read over the anchor <a> and it does not seem to have a value attribute. I even went as far as doing a google search "how can I put a not condition in a google search" thinking I would do what I often do which is to put generic parts of the command into the google search but this time require that the word "input" not be found. Unfortunately there seems to be no such google search command. So once again sneaky determined John comes up with a work around solution to his lack of knowledge. I could create a hidden column in the table which has the input textbox format with a duplicate of the song name info (I recently learned how to create hidden columns). But I am betting there is a better way. Is there?

Any help would be appreciated.


This post has been edited by bowlesj: Mar 10 2019, 02:17 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


- Lo-Fi Version Time is now: 24th August 2019 - 04:59 PM