List all form data via POST or GET

Asked

Viewed 1,118 times

0

I’m with a problem that I can not solve I’m finishing a site that will be used for a football pool, follow the link (http://bolaobr.arwmontagememanutencao.com.br) on the "bettors" page displays a list of registered bettors with the score of each and at the end of the line a button to fetch the result, which is sent via post to page that displays the points and the sum of them, would like a help to capture all bettors and add their points.

Below the link of the sending script (page bettors) that be in a txt http://bolaobr.arwmontagememanutencao.com.br/bolaobr/script01_ajuda.txt

I would like to know how to capture all bettors via post or get and add their respective points at the end of the row that would be the last column(td), at first I can capture only 1 bettor and add their points via post or get. It seems that the page that receives the data does not read every url.

These are the parameters received in the index.

index.php?rodada=1&apt=Azarado&rodada=1&apt=F2p&jogo1=7&jogo2=10&busca=Buscar+Resultado&rodada=1&apt=luizinho&rodada=1&apt=M2c&jogo1=7&jogo2=7&jogo3=7&jogo4=10

I just can’t capture the last.

apt=M2c&jogo1=7&jogo2=7&jogo3=7&jogo4=10

I’d like to capture them all and add up their values.

  • Voce can post the table structure?

  • The question is not clear, it seems that you want us to create an algorithm and pass the code ready for you. It would be more objective to post exactly what your problem is. [help/dont-Ask]

  • I do not want code ready friend, so much so that I posted the link of my code that makes the sending of data via POST, I did not post the code because it is very large, including posted the link of the site I am building. I can capture only one bettor and add up your points I would like help to capture all the bettors and add up the points, already tried via GET and saw that all the data are going to url but I can only capture one follows the link from the script of the page that receives the http data://bolaobr.arwmontagememanutencao.com.br/bolaobr/script01_ajuda2.txt

  • Maybe this reference will help you with the sum of the values, from a glance and see if this is what you need, otherwise be clearer in your need. Sum Values in Tables

2 answers

1


Hello, everyone, and thank you for trying to help me. Thank God I was able to calculate with an "array" and "array_search" follows below the table link with complete. http://bolaobr.arwmontagememanutencao.com.br/bolaobr/scriptForm.txt Below is the code for the calculation

$valores = array($valor, $valor1, $valor2, $valor3, $valor4, 

$valor5, $valor6, $valor7, $valor8, $valor9 );
               if(array_search($valor, $valores) !== false){
                   $calculando = $valor + $valor1 + $valor2 + $valor3 + 

$valor4 + $valor5 + $valor6 + $valor7 + $valor8 + $valor9;
                   echo "$calculando";
               }else{
                }

This is the link from the site that I finished looking at the "Bettors" page and see the result. http://bolaobr.arwmontagememanutencao.com.br/bolaobr

0

You can use the $_REQUEST to pick up all the values and then pass them to the variables;

 // Usando o laço foreach...
foreach ($_REQUEST as $nome_campo => $valor_campo) {

//Exibi o campo e o valor contido
echo $nome_campo . " => " . $valor_campo . "<br />";

//Cria uma variavel para somar os campos
$somar += $valor_campo;

}
//Exibi os valores somados
echo $somar;

You can simply leave the sum variable inside the foreach to count and then display it.

  • Ola Rafael returns the same thing, before only captures the last bettor.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.