This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///classes ..................... | |
<?php | |
class saveusers | |
{ | |
protected $name; | |
protected $message; | |
protected $password; | |
protected $id; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this is to show the data from database ,list page | |
//form list page | |
{ | |
//echo "show"; | |
$mysql = mysqli_connect('localhost', 'root', '', 'leapfrog'); | |
$query = "select * from users"; | |
$result = mysqli_query($mysql, $query); | |
//echo $result; | |
// while($row = mysqli_fetch_assoc($result)){ | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//insert into database | |
// create save.php file and write this code there, submit from a from which has fields, [message, name, password] | |
$name = $_POST['name']; | |
$message = $_POST['message']; | |
$password = $_POST['password']; | |
$query = "insert into users (name, message, password ) VALUES( '$name', '" .$message ."', '$password')"; | |
$query = "select * from users"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if (isset($_POST)) { ?> | |
<div class="container"> | |
<table class="table-condensed table-hover table-bordered" > | |
<tr> | |
<?php | |
if(!empty($_POST)) | |
{ | |
foreach ($_POST as $tablehead => $value) { | |
?> | |
<th> <?php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if (isset($_POST["table"])) { ?> | |
<div class="container"> | |
<table class="table-condensed table-hover table-bordered" > | |
<tr> | |
<?php | |
if(!empty($_POST)) | |
{?> | |
<th><?php echo implode('</th><th>', array_keys($_POST)); ?></th> | |
<?php } | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//echo '<pre>'; | |
//print_r( $_POST); | |
//die; | |
?> | |
<html> | |
<head> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<!-- Latest compiled and minified CSS --> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> | |
<!-- Optional theme --> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous"> | |
<!-- Latest compiled and minified JavaScript --> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//$array = [ | |
// 'cycling', | |
// 'hiking', | |
// 'running' | |
//]; | |
// | |
// | |
//$array = [ |