This file contains 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
$password = $_POST['password']; | |
$hashed_password = password_hash($password, PASSWORD_DEFAULT); | |
// Query the database for username and password | |
// ... | |
if(password_verify($password, $hashed_password)) { | |
// If the password inputs matched the hashed password in the database | |
// Do something, you know... log them in. |
This file contains 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 | |
/** | |
* In this case, we want to increase the default cost for BCRYPT to 12. | |
* Note that we also switched to BCRYPT, which will always be 60 characters. | |
*/ | |
$options = [ | |
'cost' => 12, | |
]; | |
$hash1 = password_hash("mandeep", PASSWORD_BCRYPT, $options); |
This file contains 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 | |
header('Location: vendor-dashboard-listing.php?success=1'); | |
?> | |
// after this paste this code on that page where you have to displace success bootstrap alert message | |
<?php | |
This file contains 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['update_psss'])){ | |
$oldpassword = $_POST['oldpassword']; | |
$newpassword = $_POST['newpassword']; | |
$confirmnewpassword = $_POST['confirmnewpassword']; | |
if ($oldpassword==$oldpassworddb){ | |
This file contains 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['delete_acc'])) | |
{ | |
$login_id = ""; | |
if (isset($_SESSION['id'])) { | |
$login_id = $_SESSION['id']; | |
} | |
if(isset($_POST['listing'])){ | |
$listing = $_POST['listing']; | |
$view_vender_query1 = " DELETE FROM venders WHERE venderID= $listing"; |
This file contains 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 | |
$result = mysql_query('SELECT SUM(value) AS value_sum FROM codes'); | |
$row = mysql_fetch_assoc($result); | |
$sum = $row['value_sum']; | |
?> |
This file contains 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['submit'])){ | |
$img1 = pathinfo($_FILES["image"]["name"], PATHINFO_EXTENSION); | |
$name1 = rand(1,5000).".".$img1; | |
move_uploaded_file($_FILES["image"]["tmp_name"],"./images/$name1"); | |
$sql = "UPDATE venders SET image1 = '$name1' WHERE id=2"; | |
$query = mysqli_query($connection, $sql); |
This file contains 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 | |
// image upload query | |
if(count($_FILES["image"]["tmp_name"]) > 0) | |
{ | |
for($count = 0; $count < count($_FILES["image"]["tmp_name"]); $count++) | |
{ | |
$image_file = addslashes(file_get_contents($_FILES["image"]["tmp_name"][$count])); | |
$query = "INSERT INTO images (productID, image) VALUES ('$id_guests', '$image_file')"; | |
$result= mysqli_query($connection,$query); |
This file contains 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($_GET['view'])){ | |
$v_id = $_GET['view']; | |
} | |
$query = "SELECT * FROM products WHERE id = $v_id"; | |
$select_image = mysqli_query($connection, $query); | |
while($row = mysqli_fetch_assoc($select_image)){ | |
$id = $row['id']; | |
$product_name = $row['product_name']; |
This file contains 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
<select class="form-control" name="product_category_id" data-placeholder="Choose a Category" tabindex="1"> | |
<?php | |
$query = "SELECT * FROM category"; | |
$select_image = mysqli_query($connection, $query); | |
while($row = mysqli_fetch_assoc($select_image)){ | |
$id = $row['id']; | |
$cat_title = $row['cat_title']; | |
?> | |
<option value="<?php echo $cat_title; ?>" <?php if($product_category_id==$cat_title) echo 'selected="selected"'; ?>><?php echo $cat_title; ?></option> | |
<?php } ?> |
OlderNewer