Jump to content

Jedijon

Members
  • Content count

    18
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Jedijon

  • Rank
    Member
  1. .dropbtn { background-color: #4CAF50; color: white; padding: 10px; font-size: 16px; border: none; } .dropdown { position: relative; display: inline-block; } .dropdown-content { display: none; position: absolute; background-color: #f1f1f1; min-width: 800px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: 1; } .dropdown-content img { width: 32px; height: 32px; margin: 3px; position: relative; float: left; } .dropdown-content a { color: black; padding: 12px 16px; text-decoration: none; display: block; } .dropdown-content a:hover {background-color: #ddd;} .dropdown:hover .dropdown-content {display: block;} .dropdown:hover .dropbtn {background-color: #3e8e41;} /* HIDE RADIO */ [type=radio] { position: absolute; opacity: 0; width: 0; height: 0; } /* IMAGE STYLES */ [type=radio] + img { cursor: pointer; } /* CHECKED STYLES */ [type=radio]:checked + img { outline: 2px solid #f00; } <div class="dropdown"> <button class="dropbtn">Dropdown</button> <div class="dropdown-content"> <form name="form" action="icons-submit/submit_icon-default.php" method="post"> <input type="radio" id="icon_default" name="icon_default" value="icons/default.jpg" onchange='if(this.value != 0) { this.form.submit(); }'> <img src="icons/default.jpg"> <input type="text" id="id" name="id" value=" . $row['id'] . " style="background: transparent;border: none;font-size: 0;"> </form> <form name="form" action="icons-submit/submit_icon-default.php" method="post"> <input type="radio" id="icon_default" name="icon_default" value="icons/default.jpg" onchange='if(this.value != 0) { this.form.submit(); }'> <img src="icons/default.jpg"> <input type="text" id="id" name="id" value=" . $row['id'] . " style="background: transparent;border: none;font-size: 0;"> </form> <form name="form" action="icons-submit/submit_icon-Grass_Block.php" method="post"> <label> <input type="radio" id="icon_grass-block" name="icon_grass-block" value="icons/Grass_Block.png"onchange='if(this.value != 0) { this.form.submit(); }'> <img src="icons/Grass_Block.png"> </label> <input type="text" id="id" name="id" value=" . $row['id'] . " style="background: transparent;border: none;font-size: 0;"> </form> <form name="form" action="icons-submit/submit_icon-gear.php" method="post"> <label> <input type="radio" id="icon_gear" name="icon_gear" value="icons/Gear.png"onchange='if(this.value != 0) { this.form.submit(); }'> <img src="icons/Gear.png"> </label> <input type="text" id="id" name="id" value=" . $row['id'] . " style="background: transparent;border: none;font-size: 0;"> </form> </div> </div>
  2. Jedijon

    How to make it insert info from session

    Query looks like: SELECT * FROM datakeyWarning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, string given in /srv/disk1/2648096/www/site/test/index.php on line 35 It shows the session data
  3. Jedijon

    How to make it insert info from session

    Error message Parse error: syntax error, unexpected ';', expecting ',' or ')' in /srv/disk1/2648096/www/site/test/index.php on line 20
  4. Jedijon

    How to make it insert info from session

    I have that <?php // Initialize the session session_start(); // Check if the user is logged in, if not then redirect him to login page if(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true){ header("location: ../login"); exit; } ?>
  5. Jedijon

    How to make it insert info from session

    <?php $con=mysqli_connect("IP","Username","Password","Database name"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_query($con,"SELECT * FROM {$_SESSION['datakey']}"; echo "<table border='1'> <tr> <th></th> <th></th> <th></th> <th></th> <th></th> </tr>"; while($row = mysqli_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['column1'] . "</td>"; echo "<td>" . $row['column2'] . "</td>"; echo "<td>" . $row['column3'] . "</td>"; echo "<td>" . $row['column4'] . "</td>"; echo "<td>" . $row['column5'] . "</td>"; echo "</tr>"; } echo "</table>"; mysqli_close($con); ?>
  6. Jedijon

    How to make it insert info from session

    $_SESSION['datakey'] contains the name of the table
  7. Jedijon

    How to make it insert info from session

    It will grave the info from the login SESSION
  8. Jedijon

    How to make it insert info from session

    Didn't work $result = mysqli_query($con,"SELECT * FROM {$_SESSION['datakey']}";
  9. Jedijon

    How to make it insert info from session

    $result = mysqli_query($con,"SELECT * FROM table name"); but where the table name goes I wan't it use $_SESSION['datakey'] to get the table name
  10. Jedijon

    How to make it insert info from session

    I don't wan't it to be inserted into the database but use the session info as the name of the table to grave data from for the html table
  11. Jedijon

    How to make it insert info from session

    Like this $result = mysqli_query($con,"INSERT * FROM $_SESSION['datakey']";
  12. $result = mysqli_query($con,"SELECT * FROM $_SESSION['datakey']";
  13. Jedijon

    How to add a delete button to this

    Thank you I figure it out
  14. Jedijon

    How to add a delete button to this

    Thank you for all the help
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.