Why this hidden variable will not pass value?


#1

I really dont know what wrong with this hidden variable input. They will not pass value and nothing show up in the database. Could somebody point out what wrong with it? Thanks alot for your helps.

[code]
/code]

Below is the full form

[code]<?php
mysql_connect(“localhost”, “root”, “Mylovev1@”) or die("Error connecting to database: ".mysql_error());
/*
localhost - it’s location of the mysql server, usually localhost
root - your username
third is your password

    if connection fails it will stop loading the page and display an error
*/

mysql_select_db("usnailsandspa") or die(mysql_error());
/* tutorial_search is the name of database we've created */

?>

body, html { height: 100%; margin: 0; }

.bg {
/* The image used */
background-image: url(“images/checkin_bg.jpg”);

/* Full height */
height: 100%; 

/* Center and scale the image nicely */
background-position: center;
background-repeat: no-repeat;
background-size: cover;

}
#textboxid1
{
width: 340px;
height:24px;
font-size:14pt;
}
input[type=checkbox] {
transform: scale(1.8);
}
h2 {
font: 300 75px/1.5 ‘Pacifico’, Helvetica, sans-serif;
color: #ad0101;
text-shadow: 3px 3px 0px rgba(0,0,0,0.1), 7px 7px 0px rgba(0,0,0,0.05);
}

<?php $query = $_GET['phone']; $connection = new mysqli('localhost', 'root', 'Mylovev1@', 'usnailsandspa'); if ($connection->connect_errno > 0) { die ('Unable to connect to database [' . $connection->connect_error . ']'); } $sql = "SELECT * FROM customers where phone = ".$query.""; if (!$result = $connection->query($sql)) { die ('There was an error running query[' . $connection->error . ']'); } ?> <?php $rows = $result->num_rows; // Find total rows returned by database if($rows > 0) { $cols = 1; // Define number of columns $counter = 1; // Counter used to identify if we need to start or end a row $nbsp = $cols - ($rows % $cols); // Calculate the number of blank columns echo ''; while ($row = $result->fetch_array()) { if(($counter % $cols) == 1) { // Check if it's new row echo ''; } echo ''; if(($counter % $cols) == 0) { // If it's last column in each row then counter remainder will be zero echo ''; } $counter++; // Increase the counter } $result->free(); if($nbsp > 0) { // Add unused column in last row for ($i = 0; $i < $nbsp; $i++) { echo ''; } echo ''; } echo '

Gel Nails!

Customer Records
'.$row['fullname'].'&nbsp&nbsp&nbsp'.$row['phone'].'
What do you need done today?
&nbspRegular Pedi&nbsp &nbspShellac Pedi&nbsp &nbspRegular Meni&nbsp &nbspShellac Meni&nbsp
&nbspFullset&nbsp &nbspFill&nbsp &nbspDipping Powder&nbsp &nbspWaxing&nbsp &nbspFix


'; } ?>
/code]

And this is the code for member_submit.php

[code]<?php
header(‘Location:checkin.php’);
require ‘connection.php’;
$conn = Connect();
$fullname = $conn->real_escape_string($_POST[‘fullname’]);
$phone = $conn->real_escape_string($_POST[‘phone’]);
$appointment_date = $conn->real_escape_string($_POST[‘appointment_date’]);
$technictian = $conn->real_escape_string($_POST[‘technictian’]);
$regular_pedi = $conn->real_escape_string($_POST[‘regular_pedi’]);
$regular_meni = $conn->real_escape_string($_POST[‘regular_meni’]);
$shellac_pedi = $conn->real_escape_string($_POST[‘shellac_pedi’]);
$shellac_meni = $conn->real_escape_string($_POST[‘shellac_meni’]);
$fullset = $conn->real_escape_string($_POST[‘fullset’]);
$fill = $conn->real_escape_string($_POST[‘fill’]);
$dip = $conn->real_escape_string($_POST[‘dip’]);
$wax = $conn->real_escape_string($_POST[‘wax’]);
$fix = $conn->real_escape_string($_POST[‘fix’]);
$success = $conn->query($query);
$query2 = “INSERT INTO services (fullname, phone, appointment_date, technictian, regular_pedi, shellac_pedi, regular_meni, shellac_meni, fullset, fill, dip, wax, fix) VALUES(’” . $fullname . “’,’” . $phone . “’,’” . $appointment_date . “’,’” . $technictian . “’,’” . $regular_pedi . “’,’” . $shellac_pedi . “’,’” . $regular_meni . “’,’” . $shellac_meni . “’,’” . $fullset . “’,’” . $fill . “’,’” . $dip . “’,’” . $wax . “’,’” . $fix . “’)”;
mysql_query($query2);
$success = $conn->query($query2);

if (!$success) {
die("Couldn’t enter data: ".$conn->error);

}

echo "Thank You For Contacting Us
";

$conn->close();

?>/code][/code]


#2

I don’t see any input elements in your “full form” that have the name attributes of “fullname” or “phone”. Hidden or not, the html for those elements–I don’t see them…so they are not there to get posted. But…if that is not your problem…if I missed something…or because I don’t have all of the html to look at, if a field does not have a value to post, it does not get sent in with the POST request. The value does not exist in the $_POST array. When you try to access it the element value will be null.


#3

So you start off with obsolete mysql_* code and then jump into mysqli? You might want to start with fixing that first. Better yet, just start using PDO. https://phpdelusions.net/pdo