Calling data from a mysqladmin table using php form -


one of pages, index.php references table within mysqladmin login credentials. each row within table different user. i've got work fine. once logs in, content of index.php changes based on content of user row. each account page goes index.php, content dependent on user login.

my problem "refreshed" index.php page has form submit button doesn't work properly. form meant reference , call data table within same database. form action directed page, results.php. know data being called correctly because when enter results.php directly browser, can see entire table being called. obviously, i'll prevent happening later security reasons. however, when try results.php via form submit button, i'm redirected index.php (and logged out) rather results.php.

it seems second form following protocol specific first form, , don't know why. i've made sure form buttons within form. i'm looking general guidance. i'm trying possible?

this content of results.php

$link = mysqli_connect("xxxxx.xxxxmysql.com", "username", "pass", "localhost");  if($link === false){ die("error: not connect. " . mysqli_connect_error());  $sql="select * `table2` 1"; if($result = mysqli_query($link, $sql)){ if(mysqli_num_rows($result) > 0){     echo "<table 2>";         echo "<tr>";             echo "<th>first_name/th>";             echo "<th>last_name</th>";             echo "<th>address</th>";             echo "<th>zip_code</th>";         echo "</tr>";     while($row = mysqli_fetch_array($result)){         echo "<tr>";             echo "<td>" . $row['first_name'] . "</td>";             echo "<td>" . $row['last_name'] . "</td>";             echo "<td>" . $row['address'] . "</td>";             echo "<td>" . $row['zip_code'] . "</td>";         echo "</tr>";     }     echo "</table 2>";     // close result set     mysqli_free_result($result); } else{     echo "no records matching query found."; } } else{ echo "error: not able execute $sql. " . mysqli_error($link); }  // close connection mysqli_close($link); 

and content of form within index.php loads after user logs in

<form name="formsearch" method="post" action="results.php">                             <button type="button" id= "modalexit" class="close" data-dismiss="modal"  style=" width:0px; float:right; height:0px;" aria-hidden="true">&times;</button>                             <br>  <input name="first_name" style="width:50%; margin:auto;" type="text" size="40" maxlength="50" placeholder="first name"/>                             <input name="last_name" style="width:50%; margin:auto;" type="text" size="40" maxlength="50" placeholder="last name"/>                             <input name="address" style="width:50%; margin:auto;" type="text" size="40" maxlength="50" placeholder="address"/>                             <input name="zip_code" style="width:50%; margin:auto;" type="text" size="40" maxlength="50" placeholder="zip code"/><br>                             <input type="submit" action="results.php" name="submit" style="min-width:80px;"value="search" />                             </form> 

i'd appreciate help. have config.php file helps connect index.php mysql. not sure if matters.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -