javascript - Get var from a PHP page -


i'm having problem php. send data page page. it's in php. need take input value , combobox value. , don't know how it.

here's php :

<?php  session_start();  $q = intval($_get['q']);  $db = mysql_connect('localhost', 'root', 'root');  mysql_select_db('projet',$db);    $sql2 = "select idcontrole, nomcontrole controle iduser='".$_session['id']."'"; $req2 = mysql_query($sql2) or die('erreur sql !<br>'.$sql2.'<br>'.mysql_error());  echo'<select id="controlechoix" name="controlechoix">';  while ($data2 = mysql_fetch_array($req2)){     echo '<option value="'.$data2['idcontrole'].'">'.$data2['nomcontrole'].'</option>'; }  echo '</select>'; echo '<input type="hidden" name="selected_text" id="selected_text" value="" />';    $sql = "select id, nom, prenom user groupe ='".$q."'"; $req = mysql_query($sql) or die('erreur sql 2!<br>'.$sql.'<br>'.mysql_error());  echo '<ul class="list-group">';  while ($data = mysql_fetch_array($req)){      echo '<li class="list-group-item"><strong>nom</strong>  : '.$data['nom'].' <br> <strong>prénom</strong>  : '.$data['prenom'].'<br>';     echo '<input type="text" name="note" id="note"/> &nbsp;&nbsp;&nbsp;';     echo '<a class="label label-success" href="ajouternote.php?var1='.$data2['idcontrole'].'&var2='.$data['id'].'&var3='.$test.'"><i class="fa fa-fw fa-check"></i></a></li>';  } echo '</ul>'; echo '<a class="btn btn-primary" href="#">ajouter toutes les notes</i></a></li>';  ?>   

i need send input note.value, select controlechoix.value , intval q i've received page.

as seem use sessions, transfer data 1 page using these $_session variables.

https://secure.php.net/manual/en/book.session.php

edit: please keep in mind isn't secure @ all. values can changed user. using might want validate values first, before using.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -