Some Database Fatal Error - php

I want to install php code with XAMPP. I created new database and called it s13. After that i have pasted my all codes to the folder s13.
this what I actually recieving error
Fatal error: Call to a member function __() on a non-object in C:\xampp\htdocs\s13\content\themes\default\templates_c\90f81337a2395d597b1b2483c3c3bf40f723241a.file.header.tpl.php on line 199
My config php code
<?php
define('DB_NAME', 's13')
;
define('DB_USER', 'root');
define('DB_PASSWORD', '');
define('DB_HOST', 'localhost');
define('DEBUGGING', true);
?>
and this what i actually recieving error code
<body page="{$page}" ub="{$userArray.Blocked}">
<!-- Common JS -->
<script>var SITE_URL = '{$SITE_URL}/';</script>
<script type="text/javascript" src="{$SITE_URL}/js/core.common.js"></script>
<!-- Common JS -->
{if $userExist}
<!-- Common [User Exist] JS -->
<script type="text/javascript" src="{$SITE_URL}/js/core.common.signedin.js"></script>
<script type="text/javascript" src="{$SITE_URL}/js/core.chat.js"></script>
<!-- Common [User Exist] JS -->
{if $userArray.Verified == "N"}
<!-- Verify Bar -->
<div class="verifyBarHolder">
<div class="verifyBar">
<div class="verifyBarContent">
<div class="right">
<span class="uiButtonText black resendEmail">{$translate->__("Resend Confirmation Email")}</span> · <span class="uiButtonText black changeEmail">{$translate->__("Change Email Address")}</span>
</div>
{$userArray.UserFirstName}, {$translate->__("go to")} <strong>{$userArray.UserEmail}</strong> {$translate->__("to complete the sign-up process")}.
</div>
</div>
</div>
<!-- Verify Bar -->
{/if}
<!-- Header -->
<div class="headerBarHolder">
<div class="headerBar {if $userArray.Verified == "N"}afterVerify{/if}">
<div class="header">
<!-- Logo -->
<div class="logo"><span>{$translate->__("Home")}</span></div>
<!-- Logo -->
<!-- Search -->
<div class="search">
<form id="searchForm" class="relative" action="{$SITE_URL}/search.php" method="get">
<span class="glass"><i></i></span>
<input class="uiInput searchInput" type="text" name="q" value="{$translate->__("Search")}" />
</form>
</div>
<!-- Search -->
<!-- Navigation -->
<div class="navigation">
<ul class="list">
<li class="item" title="{$translate->__("Home")}">
<a class="navApp homeIcon" href="{$SITE_URL}/home.php"></a>
</li>
<li class="item">
<div class="icon relative">
<div class="navApp profileIcon" id="profileIcon"></div>
<!-- Profile Menu -->
<div class="subMenu toRight navigationMenu">
<ul>
<li><a class="menuItem" href="{$SITE_URL}/{$userArray.UserName}">{$translate->__("Profile")}</a></li>
<li><a class="menuItem" href="{$SITE_URL}/settings/">{$translate->__("Settings")}</a></li>
</ul>
</div>
<!-- Profile Menu -->
</div>
</li>
<li class="item">
<div class="icon relative">
<div class="navApp messagesIcon" id="messagesIcon"><span class="counter hidden" id="msgCounter"></span></div>
<!-- Messages Menu -->
<div class="subMenu toRight navigationMenu">
<ul class="navMenu" id="liveMessages">
<li>
<div class="navMenuTitle">
<div class="right">
{$translate->__("See All")}
</div>
<strong>{$translate->__("Messages")}</strong>
</div>
</li>
</ul>
</div>
<!-- Messages Menu -->
</div>
</li>
<li class="item">
<div class="icon relative">
<div class="navApp notificationsIcon" id="notificationsIcon"><span class="counter hidden" id="notifiCounter"></span></div>
<!-- Notifications Menu -->
<div class="subMenu toRight navigationMenu">
<ul class="navMenu" id="liveNotifications">
<li>
<div class="navMenuTitle">
<div class="right">
{$translate->__("See All")}
</div>
<strong>{$translate->__("Notifications")}</strong>
</div>
</li>
</ul>
</div>
<!-- Notifications Menu -->
</div>
</li>
</ul>
</div>
<!-- Navigation -->
<!-- Sign Out -->
<div class="signOut">
<a class="navApp signoutIcon right" href="{$SITE_URL}/signout/" title="{$translate->__("Log Out")}"></a>
</div>
<!-- Sign Out -->
</div>
</div>
</div>
<!-- Header -->
{else}
<!-- Common [User Non-Exist] JS -->
<script type="text/javascript" src="{$SITE_URL}/js/core.common.unsignedin.js"></script>
<!-- Common [User Non-Exist] JS -->
<!-- Header -->
<div class="headerBarHolder userNonExist">
<div class="headerBar userNonExist">
<div class="header">
<!-- Logo -->
<div class="logo userNonExist"><span>{$translate->__("Home")}</span></div>
<!-- Logo -->
<!-- Search -->
<div class="search userNonExist">
<form id="searchForm" class="relative" action="{$SITE_URL}/search.php" method="get">
<span class="glass"><i></i></span>
<input class="uiInput searchInput" type="text" name="q" value="{$translate->__("Search")}" />
</form>
</div>
<!-- Search -->
{if $page != "signin"}
<!-- Sign In -->
<div class="signIn">
<div class="relative">
<span>{$translate->__("Have an account?")}<a class="signInBox ml5" href="{$SITE_URL}/signin/"><span>{$translate->__("Sign in")}</span></a></span>
<div id="signInMenu" class="signInMenu">
<form action="{$SITE_URL}/signin/" method="post">
<div class="inline mb10 pt10 pb10" style="width: 210px; border-bottom: 1px solid #333333;">
<div class="left pt5 mr10">
<span>{$translate->__("Sign in with")}</span>
</div>
<div class="left">
<a class="connect-facebook-vsmall" title="{$translate->__("Sign in with")} Facebook" href="{$SITE_URL}/connect/facebook/"></a> <a class="connect-twitter-vsmall" title="{$translate->__("Sign in with")} Twitter" href="{$SITE_URL}/connect/twitter/"></a>
</div>
</div>
<p class="mb10">
<label class="inputLabel" for="username_email">{$translate->__("Username or email")}:</label>
<input type="text" name="username_email" tabindex="1" />
</p>
<p class="mb10">
<label class="inputLabel" for="email">{$translate->__("Password")}:</label>
<input type="password" name="password" tabindex="2" />
</p>
<p class="mb10 pb10" style="border-bottom: 1px solid #333333;">
<input type="submit" name="submit" value="{$translate->__("Sign in")}" class="uiButton pr10 pl10" tabindex="4" />
<input type="checkbox" id="remember" name="remember" value="yes" tabindex="3"/>
<label for="remember">{$translate->__("Remember me")}</label>
</p>
<p class="mb5">{$translate->__("Forgot your password?")}</p>
<p>{$translate->__("Create a new account")}</p>
</form>
</div>
</div>
</div>
<!-- Sign In -->
{/if}
</div>
</div>
</div>
<!-- Header -->
{/if}

The error means, that at least one of variables assigned to Smarty is not an object for example maybe $translate is not an object. It is not connected directly to Database
Of course database has nothing in common with folders, so I have no idea why you wrote that you created database s13 and put all your data to s13 folder. Database and foldername where you have files on your server can be different.

Related

Issue with label text post image upload in php

First of all, a big thanks for considering the question.
This is more of a ui related query, i have a product management page through which a new product can be added to ecommerce site, the issue i am facing is :
After uploading the file (profilepic) input, the label defined for file name is somehow pushing the button used to upload the pic the pic to the right instead of displaying the name on the right side.
The code is in the middle snippet, scrolling all the way to the bottom of the snippet, you should be able to locate it.
I have attached an image of the same.
Kindly help me with this issue, post file upload, i want the label to come on the right side next to the upload button
<!DOCTYPE html>
<html lang="en">
<body class="dashboard-upload">
<!--================================
START DASHBOARD AREA
=================================-->
<section class="dashboard-area">
<div class="dashboard_menu_area">
<div class="container">
<div class="row">
<div class="col-md-12">
<ul class="dashboard_menu">
<li>
<a href="index.php">
<span class="lnr lnr-home"></span>Sales</a>
</li>
<li>
<a href="">
<span class="lnr lnr-cog"></span>Store</a>
</li>
<li>
<a href="dashboard-setting.html">
<span class="lnr lnr-cog"></span>Landing Page</a>
</li>
<li>
<a href="dashboard-setting.html">
<span class="lnr lnr-cog"></span>Manage Users</a>
</li>
<li>
<a href="dashboard-setting.html">
<span class="lnr lnr-cog"></span>Digital Wallet</a>
</li>
<li class="active">
<a href="">
<span class="lnr lnr-upload"></span>Upload New Item</a>
</li>
<li>
<a href="dashboard-manage-item.html">
<span class="lnr lnr-briefcase"></span>Support Tickets</a>
</li>
</ul>
<!-- end /.dashboard_menu -->
</div>
<!-- end /.col-md-12 -->
</div>
<!-- end /.row -->
</div>
<!-- end /.container -->
</div>
<!-- end /.dashboard_menu_area -->
<div class="dashboard_contents">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="dashboard_title_area">
<div class="pull-left">
<div class="dashboard__title">
<h3>Upload Your Item</h3>
</div>
</div>
</div>
</div>
<!-- end /.col-md-12 -->
</div>
<!-- end /.row -->
<div class="row">
<div class="col-lg-8 col-md-7">
<form action="#">
<div class="upload_modules">
<div class="modules__title">
<h3>Item Name & Description</h3>
</div>
<!-- end /.module_title -->
<div class="modules__content">
<div class="form-group">
<label for="category">Select Category</label>
<div class="select-wrap select-wrap2">
<select name="country" id="category" class="text_field">
<option value="garina">Garina Game Cards</option>
<option value="pubg">Pubg Game Cards</option>
<option value="ps">Play Station</option>
<option value="xbox">Xbox</option>
<option value="netflix">Netflix</option>
<option value="itunes">Itunes</option>
<option value="google">Google Play</option>
</select>
<span class="lnr lnr-chevron-down"></span>
</div>
</div>
<div class="form-group">
<label for="product_name">Product Name
<span>(Max 100 characters)</span>
</label>
<input type="text" id="product_name" class="text_field" placeholder="Enter your product name here...">
</div>
<div class="form-group no-margin">
<p class="label">Short Description</p>
<input type="text" id="product_name" class="text_field" placeholder="Short Description.">
</div>
<div class="form-group no-margin">
<p class="label">Long Description</p>
<input type="text" id="product_name" class="text_field" placeholder="Long Description">
</div>
<!-- end /.modules__content -->
</div>
<!-- end /.upload_modules -->
<div class="upload_modules module--upload">
<div class="modules__title">
<h3>Image</h3>
</div>
<!-- end /.module_title -->
<div class="modules__content">
<div class="form-group">
<div >
<!-- Image is being uploaded here -->
<div class="custom_upload">
<label for="profilepic">
<input type="file" id="profilepic" name="profilepic" class="files">
<span class="btn btn--round btn--sm">Choose File</span>
</label>
<label for="profilepic"></label>
</div>
<!-- end /.custom_upload -->
<div >
<div >
</div>
</div>
<!-- end /.progress_wrapper -->
</div>
<!-- end /.upload_wrapper -->
</div>
<!-- end /.form-group -->
</div>
<!-- end /.upload_modules -->
</div>
<!-- end /.upload_modules -->
<div class="upload_modules">
<div class="modules__title">
<h3>Others Information</h3>
</div>
<!-- end /.module_title -->
<div class="modules__content">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="dimension">Release Date</label>
<input type="text" id="dimension" class="text_field" placeholder="Date first available" value="<?php $day=date("d"); $month=date("m"); $year=date("Y"); $date="$day/$month/$year"; echo $date;?>">
</div>
<div class="form-group">
<label for="dimension">Updated On</label>
<input type="text" id="dimension" class="text_field" placeholder="Last Updated On"value="<?php $day=date("d"); $month=date("m"); $year=date("Y"); $date="$day/$month/$year"; echo $date;?>">
</div>
</div>
<!-- end /.col-md-6 -->
</div>
<!-- end /.row -->
<!-- end /.col-md-6 -->
</div>
<!-- end /.row -->
</div>
<!-- end /.upload_modules -->
</div>
<!-- end /.upload_modules -->
<div class="upload_modules with--addons">
<div class="modules__title">
<h3>Price</h3><br><br>
<label>For Regular Users</label>
<input type="text" id="rlicense" class="text_field" placeholder="00.00">
<br>
<label>For Premium Users</label>
<input type="text" id="rlicense" class="text_field" placeholder="00.00">
</div>
<!-- end /.module_title -->
<!-- end /.modules__content -->
</div>
<!-- end /.upload_modules -->
<!-- submit button -->
<button type="submit" class="btn btn--round btn--fullwidth btn--lg">Add New Item</button>
</form>
</div>
<!-- end /.col-md-8 -->
<div class="col-lg-4 col-md-5">
<aside class="sidebar upload_sidebar">
<div class="sidebar-card">
<div class="card-title">
<h3>Upload Details</h3>
</div>
<div class="card_content">
<div class="card_info">
<h4>Image Upload</h4>
<p>Please use an imahe of only png/jpg/jpeg format so that nothing in the site breakes.</p>
</div>
<div class="card_info">
<h4>Upload Location</h4>
<p>This product will be available in the store post submission without any delays.</p>
</div>
<div class="card_info">
<h4>Getting Error ?</h4>
<p>Make sure all details are filled, clear your browser cache or try in private mode. If the problem continues, this can be a serious issue in the software kindly connect with the developer as soon as possible at adity#xyberneo.com</p>
</div>
</div>
</div>
<!-- end /.col-md-4 -->
</div>
<!-- end /.row -->
</div>
<!-- end /.container -->
</div>
<!-- end /.dashboard_menu_area -->
</section>
<!--================================
END DASHBOARD AREA
=================================-->
<!--//////////////////// JS GOES HERE ////////////////-->
<!-- inject:js -->
<script src="js/vendor/jquery/jquery-1.12.3.js"></script>
<script src="js/vendor/jquery/popper.min.js"></script>
<script src="js/vendor/jquery/uikit.min.js"></script>
<script src="js/vendor/bootstrap.min.js"></script>
<script src="js/vendor/chart.bundle.min.js"></script>
<script src="js/vendor/grid.min.js"></script>
<script src="js/vendor/jquery-ui.min.js"></script>
<script src="js/vendor/jquery.barrating.min.js"></script>
<script src="js/vendor/jquery.countdown.min.js"></script>
<script src="js/vendor/jquery.counterup.min.js"></script>
<script src="js/vendor/jquery.easing1.3.js"></script>
<script src="js/vendor/owl.carousel.min.js"></script>
<script src="js/vendor/slick.min.js"></script>
<script src="js/vendor/tether.min.js"></script>
<script src="js/vendor/trumbowyg.min.js"></script>
<script src="js/vendor/waypoints.min.js"></script>
<script src="js/dashboard.js"></script>
<script src="js/main.js"></script>
<script src="//maps.googleapis.com/maps/api/js?key=AIzaSyBeySPFGz7DIUTrReCRQT6HYaMM0ia0knA"></script>
<script src="js/map.js"></script>
<!-- endinject -->
<script>
var profilePic = document.getElementById('profilepic'); /* finds the input */
function changeLabelText() {
var profilePicValue = profilePic.value; /* gets the filepath and filename from the input */
var fileNameStart = profilePicValue.lastIndexOf('\\'); /* finds the end of the filepath */
profilePicValue = profilePicValue.substr(fileNameStart + 1); /* isolates the filename */
var profilePicLabelText = document.querySelector('label[for="profilepic"]').childNodes[2]; /* finds the label text */
if (profilePicValue !== '') {
profilePicLabelText.textContent = profilePicValue; /* changes the label text */
}
}
profilePic.addEventListener('change',changeLabelText,false); /* runs the function whenever the filename in the input is changed */
</script>
</body>
</html>
Use span tag before input tag
Try this

How to use PHP display unique user data to a html page

currently I have a website with a basic login, I was just wondering how I would display a the name,skill and description of the unique user who is logged in.This is what I have done so far.I can only find articles on how to display data into table.This is the updated code:
<?php
include('session.php');
require 'config.php';
$sql = "SELECT * FROM profile";
$result = $conn->query($sql);
//echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "<br>";
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="profile.css">
</head>
<body>
<ul>
<li>Home</li>
<li>PostJob</li>
<li>Find Job</li>
<li>How It Works</li>
<li>Notifications</li>
<li>Message</li>
<li>profile</li>
</ul>
<h1>Welcome To Bid4MyJob</h1>
<li>edit profile</li>
<div id="ProfilePage">
<div id="LeftCol">
<div id="Photo"></div>
<div id="ProfileOptions">
a
</div>
</div>
<div id="Info">
<p>
<strong>Name:<?php echo $row["name"]?></strong>
<!--<span>James</span>-->
</p>
<p>
<strong>Skill:<?php echo $row["skill"]?><</strong>
<!--span>James</span>-->
</p>
<!-- <p>
<strong>review:<?php /*echo $row["review"]*/?><</strong>
<span>james</span>
</p> -->
<p>
<strong>Description:<?php echo $row["description"]?><</strong>
<span>James</span>
</p>
<!--<p>
<strong>Name:</strong>
<span>james</span>
</p>-->
</div>
<!-- Needed because other elements inside ProfilePage have floats
<div style="clear:both"></div>-->
</div>
</body>
</html>
Picture of database table:
https://imgur.com/a/XYTLY
Session.php:
<?php
include('config.php');
session_start();
$user_check = $_SESSION['login_user'];
$ses_sql = mysqli_query($conn,"select email_adress from customer where email_adress = '$user_check' ");
$row = mysqli_fetch_array($ses_sql,MYSQLI_ASSOC);
$login_session = $row['email_adress'];
if(!isset($_SESSION['login_user'])){
header("location:login.php");
}
?>
Login.php:
<?php
include("config.php");
session_start();
if($_SERVER["REQUEST_METHOD"] == "POST") {
// username and password sent from form
$myusername = mysqli_real_escape_string($conn,$_POST['username']);
$mypassword = mysqli_real_escape_string($conn,$_POST['password']);
$sql = "SELECT customer_id FROM customer WHERE email_adress = '$myusername' and password = '$mypassword'";
$result = mysqli_query($conn,$sql);
$row = mysqli_fetch_array($result,MYSQLI_ASSOC);
$active = $row['customer_id'];
$count = mysqli_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row
if($count == 1) {
$_SESSION['login_user'] = $myusername;
header("location: index2.php");
}else {
$error = "Your Login Name or Password is invalid";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Login | Bid4MyJob</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Bid4MyJob">
<meta name="author" content="James Wood">
<!-- CSS -->
<link href="assets/css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="assets/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="assets/css/main.css" rel="stylesheet" type="text/css">
<link href="assets/css/my-custom-styles.css" rel="stylesheet" type="text/css">
<!-- IE 9 Fallback-->
<!--[if IE 9]>
<link href="assets/css/ie.css" rel="stylesheet">
<![endif]-->
<!-- GOOGLE FONTS -->
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400italic,400,600,700' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Roboto+Condensed:300,300italic,400italic,700,400,300' rel='stylesheet' type='text/css'>
<!-- FAVICONS -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/repute144x144.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/repute114x114.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ico/repute72x72.png">
<link rel="apple-touch-icon-precomposed" href="assets/ico/repute57x57.png">
<link rel="shortcut icon" href="assets/ico/favicon.png">
</head>
<body>
<!-- WRAPPER -->
<div class="wrapper">
<!-- NAVBAR -->
<nav class="navbar navbar-default " role="navigation">
<div class="container">
<!-- TOPBAR -->
<div class="topbar">
<ul class="list-inline top-nav">
<li>
<div class="btn-group">
<button type="button" class="btn btn-link dropdown-toggle btn-xs" data-toggle="dropdown"><img src="assets/img/flags/United-Kingdom.png" alt="United Kingdom"> United Kingdom <span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right country-selector" role="menu">
<li>
<img src="assets/img/flags/United-Kingdom.png" alt="United Kingdom"> United Kingdom
</li>
<li>
<img src="assets/img/flags/Japan.png" alt="Japan"> Japan
</li>
<li>
<img src="assets/img/flags/China.png" alt="China"> China
</li>
<li>
<img src="assets/img/flags/Germany.png" alt="Germany"> Germany
</li>
</ul>
</div>
</li>
<li>Help</li>
<li>Support</li>
</ul>
<div class="searchbox">
<form method="post">
<div class="input-group input-group-sm">
<input type="text" class="form-control" placeholder="search ...">
<span class="input-group-btn">
<button class="btn btn-default" type="button"><i class="fa fa-search"></i></button>
</span>
</div>
</form>
</div>
</div>
<!-- END TOPBAR -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#main-nav">
<span class="sr-only">Toggle Navigation</span>
<i class="fa fa-bars"></i>
</button>
<a href="index.html" class="navbar-brand navbar-logo navbar-logo-bigger">
</a>
</div>
<!-- MAIN NAVIGATION -->
<div id="main-nav" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li>
HOME
</li>
<li>
HOW IT WORKS
</li>
<li>
POST JOB
</li>
<li>
FIND JOB
</li>
<li>
SIGN UP
</li>
<li>
LOGIN
</li>
</ul>
</div>
<!-- END MAIN NAVIGATION -->
</div>
</nav>
<!-- END NAVBAR -->
<!-- BREADCRUMBS -->
<div class="page-header">
<div class="container">
<h1 class="page-title pull-left">Login</h1>
<ol class="breadcrumb">
<li>Home</li>
<li class="active">Login</li>
</ol>
</div>
</div>
<!-- END BREADCRUMBS -->
<!-- PAGE CONTENT -->
<div class="page-content">
<div class="col-md-6">
<!-- LOGIN FORM -->
<h2 class="section-heading">Login Form</h2>
<form class="form-horizontal" role="form" action = "" method = "post">
<div class="form-group">
<label for="username" class="control-label sr-only">Email</label>
<div class="col-sm-12">
<div class="input-group">
<input type="email" class="form-control" id="username" name = "username" placeholder="Email">
<span class="input-group-addon"><i class="fa fa-envelope"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label for="password" class="control-label sr-only">Password</label>
<div class="col-sm-12">
<div class="input-group">
<input type="password" class="form-control" id="password" name="password" placeholder="Password">
<span class="input-group-addon"><i class="fa fa-lock"></i></span>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-12">
<label class="fancy-checkbox">
<input type="checkbox">
<span>Remember me</span>
</label>
</div>
</div>
<div class="form-group">
<div class="col-sm-12">
<button type="submit" class="btn btn-primary"><i class="fa fa-sign-in"></i> Sign in</button>
</div>
</div>
</form>
<br>
<p><em>Don't have an account yet?</em> <strong>Sign Up</strong>
<br>
<em>Forgot your password?</em> Recover Password</p>
<!-- END LOGIN FORM -->
</div>
</div>
<br>
<br>
<div class="row">
<div class="col-md-6">
<!-- LOGIN FORM WITH LABEL -->
<!-- END LOGIN FORM WITH LABEL -->
</div>
<div class="col-md-6">
<!-- SIMPLE FORM -->
<!-- END SIMPLE FORM -->
</div>
</div>
<br>
<br>
<!-- INLINE FORM -->
<!-- END INLINE FORM -->
</div>
</div>
</div>
</div>
<!-- END PAGE CONTENT -->
<!-- FOOTER -->
<footer>
<div class="container">
<div class="row">
<div class="col-md-4">
<!-- COLUMN 1 -->
<h3 class="sr-only">ABOUT US</h3>
<img src="assets/img/logo/repute-logo-light.png" class="logo" alt="Repute">
<p>Proactively aggregate B2B initiatives before extensive channels. Monotonectally extend interactive methods of empowerment through excellent applications. Rapidiously synergize visionary products with sticky technology.</p>
<br>
<address class="margin-bottom-30px">
<ul class="list-unstyled">
<li>Unit 5, Block B Nesfield Road
<br/> Colchester, Essex CO4 3ZL 222222</li>
<li>Phone: 01206 588 000</li>
<li>Email: sales#universalwebdesign.co.uk</li>
</ul>
</address>
<!-- END COLUMN 1 -->
</div>
<div class="col-md-4">
<!-- COLUMN 2 -->
<h3 class="footer-heading">USEFUL LINKS</h3>
<div class="row margin-bottom-30px">
<div class="col-xs-6">
<ul class="list-unstyled footer-nav">
<li>About Us</li>
<li>News</li>
<li>Community</li>
<li>Career</li>
<li>Blog</li>
</ul>
</div>
<div class="col-xs-6">
<ul class="list-unstyled footer-nav">
<li>Press Kit</li>
<li>FAQ</li>
<li>Terms</li>
<li>Privacy Policy</li>
<li>Contact Us</li>
</ul>
</div>
</div>
<!-- END COLUMN 2 -->
</div>
<div class="col-md-4">
<!-- COLUMN 3 -->
<div class="newsletter">
<h3 class="footer-heading">NEWSLETTER</h3>
<p>Get the latest update from us by subscribing to our newsletter.</p>
<form class="newsletter-form" method="POST">
<div class="input-group input-group-lg">
<input type="email" class="form-control" name="email" placeholder="youremail#domain.com">
<span class="input-group-btn"><button class="btn btn-primary" type="button"><i class="fa fa-spinner fa-spin"></i><span>SUBSCRIBE</span></button>
</span>
</div>
<div class="alert"></div>
</form>
</div>
<div class="social-connect">
<h3 class="footer-heading">GET CONNECTED</h3>
<ul class="list-inline social-icons">
<li><i class="fa fa-facebook"></i></li>
<li><i class="fa fa-twitter"></i></li>
<li><i class="fa fa-google-plus"></i></li>
<li><i class="fa fa-rss"></i></li>
</ul>
</div>
<!-- END COLUMN 3 -->
</div>
</div>
</div>
<!-- COPYRIGHT -->
<div class="text-center copyright">
©2018 Bid4MyJob. All Rights Reserved.
</div>
<!-- END COPYRIGHT -->
</footer>
<!-- END FOOTER -->
</div>
<!-- END WRAPPER -->
<!-- JAVASCRIPTS -->
<script src="assets/js/jquery-2.1.1.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/plugins/autohidingnavbar/jquery.bootstrap-autohidingnavbar.min.js"></script>
<script src="assets/js/repute-scripts.js"></script>
</body>
</html>
You need a field on Profile that links to the customer table (or viceversa).
email can be in both tables, then you can link to your $login_session
SELECT * FROM profile WHERE email = '$login_session' LIMIT 1
In this case, take care and do not let users to change their email (without verification they own it) and do not let create a new account with the same credentials as another one.
But as a good practice on DB, it is better to have profile_id on customer
session.php
$ses_sql = mysqli_query($conn,"select email_adress, profile_id from customer where email_adress = '$user_check' ");
index.php
$sql = "SELECT * FROM profile WHERE profile_id = $profile_id LIMIT 1";
BTW:
- Try to separate concerns, between database and presentation layer. You should read more about MVC.

Issue in inserting data using PHP and MySQLi

My code is working fine, but the problem is I can't insert data with same userid. Like only I can add only row with userid same in row - how can I insert data with same rows?
I can't add same thing in next rows like userid = 1 email= test#test.com message=hello.
Like when I send from userid 1 message is = hello and email = hassan#test.com, but when I send it again with different message its not inserting into database and sending previous message.
<?php
//mysqli connectivity, select database
$connect= new mysqli("localhost","root","","demo") or die("ERROR:could not connect to the database!!!");
//extract all html field
extract($_POST);
if(isset($save))
{
//store textarea values in <pre> tag
$msg="$a";
//insert values in textarea table
$query="insert into textarea values('','$e','$msg')";
$connect->query($query);
echo "Data saved";
$query1="select * from textarea";
$result=$connect->query($query1);
while($row=$result->fetch_array())
{
$email = $row['email'];
$message1 =$row['message'];
}
$type = "xml";
$tos = preg_replace('#\s+#',',',trim($email));
$id = "id";
$pass = "pass";
$lang = "English";
$mask = "VOGUE";
// Data for text message
$to = "$tos";
$message = "$message1";
// Prepare data for POST request
$data = "id=".$id."&pass=".$pass."&msg=".$message."&to=".$to."&lang=".$lang."&mask=".$mask."&type=".$type;
// Send the POST request with cURL
$ch = curl_init('http://www.outreach.pk/api/sendsms.php/sendsms/url');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch); //This is the result from Outreach
curl_close($ch);
}
?>
<html>
<head>
<style>
input,textarea{width:250px}
textarea{height:200px}
input[type=submit]{width:150px}
</style>
<!--
* #Package: Ultra Admin - Responsive Theme
* #Subpackage: Bootstrap
* #Version: 1.0
* This file is part of Ultra Admin Theme.
-->
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<meta charset="utf-8" />
<title> Admin : Sms Send</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta content="" name="description" />
<meta content="" name="author" />
<link rel="shortcut icon" href="assets/images/favicon.png" type="image/x-icon" /> <!-- Favicon -->
<link rel="apple-touch-icon-precomposed" href="assets/images/apple-touch-icon-57-precomposed.png"> <!-- For iPhone -->
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/images/apple-touch-icon-114-precomposed.png"> <!-- For iPhone 4 Retina display -->
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/images/apple-touch-icon-72-precomposed.png"> <!-- For iPad -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/images/apple-touch-icon-144-precomposed.png"> <!-- For iPad Retina display -->
<!-- CORE CSS FRAMEWORK - START -->
<link href="assets/plugins/pace/pace-theme-flash.css" rel="stylesheet" type="text/css" media="screen"/>
<link href="assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<link href="assets/plugins/bootstrap/css/bootstrap-theme.min.css" rel="stylesheet" type="text/css"/>
<link href="assets/fonts/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css"/>
<link href="assets/css/animate.min.css" rel="stylesheet" type="text/css"/>
<link href="assets/plugins/perfect-scrollbar/perfect-scrollbar.css" rel="stylesheet" type="text/css"/>
<!-- CORE CSS FRAMEWORK - END -->
<!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - START -->
<!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - END -->
<!-- CORE CSS TEMPLATE - START -->
<link href="assets/css/style.css" rel="stylesheet" type="text/css"/>
<link href="assets/css/responsive.css" rel="stylesheet" type="text/css"/>
<!-- CORE CSS TEMPLATE - END -->
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class=" ">
<!-- START TOPBAR -->
<div class='page-topbar '>
<div class='logo-area'>
</div>
</div>
<!-- END TOPBAR -->
<!-- START CONTAINER -->
<div class="page-container row-fluid">
<!-- SIDEBAR - START -->
<div class="page-sidebar ">
<!-- MAIN MENU - START -->
<?php include('header.php'); ?>
<!-- MAIN MENU - END -->
</div>
<!-- SIDEBAR - END -->
<!-- START CONTENT -->
<section id="main-content" class=" ">
<section class="wrapper" style='margin-top:60px;display:inline-block;width:100%;padding:15px 0 0 15px;'>
<div class='col-lg-12 col-md-12 col-sm-12 col-xs-12'>
<div class="page-title">
<div class="pull-left">
<h1 class="title">Form Validations</h1> </div>
</div>
</div>
<div class="clearfix"></div>
<div class="col-lg-6">
<section class="box ">
<header class="panel_header">
<h2 class="title pull-left">Message Validations</h2>
</header>
<form method="post">
<table width="200" border="1">
<tr>
<td>Email</td>
<td><textarea type="text" name="e" /></textarea></td>
</tr>
<tr>
<td>Message</td>
<td><textarea placeholder="contents" name="a"></textarea></td>
</tr>
<tr>
<td colspan="2">
<input type="submit" value="Save" name="save"/>
<input type="submit" value="Display" name="disp"/>
</td>
</tr>
</table>
</form>
</section></div>
</section>
</section>
<!-- END CONTENT -->
<div class="page-chatapi hideit">
<div class="search-bar">
<input type="text" placeholder="Search" class="form-control">
</div>
<div class="chat-wrapper">
<h4 class="group-head">Groups</h4>
<ul class="group-list list-unstyled">
<li class="group-row">
<div class="group-status available">
<i class="fa fa-circle"></i>
</div>
<div class="group-info">
<h4>Work</h4>
</div>
</li>
<li class="group-row">
<div class="group-status away">
<i class="fa fa-circle"></i>
</div>
<div class="group-info">
<h4>Friends</h4>
</div>
</li>
</ul>
<h4 class="group-head">Favourites</h4>
<ul class="contact-list">
<li class="user-row" id='chat_user_1' data-user-id='1'>
<div class="user-img">
<img src="data/profile/avatar-1.png" alt="">
</div>
<div class="user-info">
<h4>Clarine Vassar</h4>
<span class="status available" data-status="available"> Available</span>
</div>
<div class="user-status available">
<i class="fa fa-circle"></i>
</div>
</li>
<li class="user-row" id='chat_user_2' data-user-id='2'>
<div class="user-img">
<img src="data/profile/avatar-2.png" alt="">
</div>
<div class="user-info">
<h4>Brooks Latshaw</h4>
<span class="status away" data-status="away"> Away</span>
</div>
<div class="user-status away">
<i class="fa fa-circle"></i>
</div>
</li>
<li class="user-row" id='chat_user_3' data-user-id='3'>
<div class="user-img">
<img src="data/profile/avatar-3.png" alt="">
</div>
<div class="user-info">
<h4>Clementina Brodeur</h4>
<span class="status busy" data-status="busy"> Busy</span>
</div>
<div class="user-status busy">
<i class="fa fa-circle"></i>
</div>
</li>
</ul>
<h4 class="group-head">More Contacts</h4>
<ul class="contact-list">
<li class="user-row" id='chat_user_4' data-user-id='4'>
<div class="user-img">
<img src="data/profile/avatar-4.png" alt="">
</div>
<div class="user-info">
<h4>Carri Busey</h4>
<span class="status offline" data-status="offline"> Offline</span>
</div>
<div class="user-status offline">
<i class="fa fa-circle"></i>
</div>
</li>
<li class="user-row" id='chat_user_5' data-user-id='5'>
<div class="user-img">
<img src="data/profile/avatar-5.png" alt="">
</div>
<div class="user-info">
<h4>Melissa Dock</h4>
<span class="status offline" data-status="offline"> Offline</span>
</div>
<div class="user-status offline">
<i class="fa fa-circle"></i>
</div>
</li>
<li class="user-row" id='chat_user_6' data-user-id='6'>
<div class="user-img">
<img src="data/profile/avatar-1.png" alt="">
</div>
<div class="user-info">
<h4>Verdell Rea</h4>
<span class="status available" data-status="available"> Available</span>
</div>
<div class="user-status available">
<i class="fa fa-circle"></i>
</div>
</li>
<li class="user-row" id='chat_user_7' data-user-id='7'>
<div class="user-img">
<img src="data/profile/avatar-2.png" alt="">
</div>
<div class="user-info">
<h4>Linette Lheureux</h4>
<span class="status busy" data-status="busy"> Busy</span>
</div>
<div class="user-status busy">
<i class="fa fa-circle"></i>
</div>
</li>
<li class="user-row" id='chat_user_8' data-user-id='8'>
<div class="user-img">
<img src="data/profile/avatar-3.png" alt="">
</div>
<div class="user-info">
<h4>Araceli Boatright</h4>
<span class="status away" data-status="away"> Away</span>
</div>
<div class="user-status away">
<i class="fa fa-circle"></i>
</div>
</li>
<li class="user-row" id='chat_user_9' data-user-id='9'>
<div class="user-img">
<img src="data/profile/avatar-4.png" alt="">
</div>
<div class="user-info">
<h4>Clay Peskin</h4>
<span class="status busy" data-status="busy"> Busy</span>
</div>
<div class="user-status busy">
<i class="fa fa-circle"></i>
</div>
</li>
<li class="user-row" id='chat_user_10' data-user-id='10'>
<div class="user-img">
<img src="data/profile/avatar-5.png" alt="">
</div>
<div class="user-info">
<h4>Loni Tindall</h4>
<span class="status away" data-status="away"> Away</span>
</div>
<div class="user-status away">
<i class="fa fa-circle"></i>
</div>
</li>
<li class="user-row" id='chat_user_11' data-user-id='11'>
<div class="user-img">
<img src="data/profile/avatar-1.png" alt="">
</div>
<div class="user-info">
<h4>Tanisha Kimbro</h4>
<span class="status idle" data-status="idle"> Idle</span>
</div>
<div class="user-status idle">
<i class="fa fa-circle"></i>
</div>
</li>
<li class="user-row" id='chat_user_12' data-user-id='12'>
<div class="user-img">
<img src="data/profile/avatar-2.png" alt="">
</div>
<div class="user-info">
<h4>Jovita Tisdale</h4>
<span class="status idle" data-status="idle"> Idle</span>
</div>
<div class="user-status idle">
<i class="fa fa-circle"></i>
</div>
</li>
</ul>
</div>
</div>
<div class="chatapi-windows ">
</div> </div>
<!-- END CONTAINER -->
<!-- LOAD FILES AT PAGE END FOR FASTER LOADING -->
<!-- CORE JS FRAMEWORK - START -->
<script src="assets/js/jquery-1.11.2.min.js" type="text/javascript"></script>
<script src="assets/js/jquery.easing.min.js" type="text/javascript"></script>
<script src="assets/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="assets/plugins/pace/pace.min.js" type="text/javascript"></script>
<script src="assets/plugins/perfect-scrollbar/perfect-scrollbar.min.js" type="text/javascript"></script>
<script src="assets/plugins/viewport/viewportchecker.js" type="text/javascript"></script>
<!-- CORE JS FRAMEWORK - END -->
<!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - START -->
<script src="assets/plugins/jquery-validation/js/jquery.validate.min.js" type="text/javascript"></script> <script src="assets/plugins/jquery-validation/js/additional-methods.min.js" type="text/javascript"></script> <script src="assets/js/form-validation.js" type="text/javascript"></script> <!-- OTHER SCRIPTS INCLUDED ON THIS PAGE - END -->
<!-- CORE TEMPLATE JS - START -->
<script src="assets/js/scripts.js" type="text/javascript"></script>
<!-- END CORE TEMPLATE JS - END -->
<!-- Sidebar Graph - START -->
<script src="assets/plugins/sparkline-chart/jquery.sparkline.min.js" type="text/javascript"></script>
<script src="assets/js/chart-sparkline.js" type="text/javascript"></script>
<!-- Sidebar Graph - END -->
<!-- General section box modal start -->
<div class="modal" id="section-settings" tabindex="-1" role="dialog" aria-labelledby="ultraModal-Label" aria-hidden="true">
<div class="modal-dialog animated bounceInDown">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Section Settings</h4>
</div>
<div class="modal-body">
Body goes here...
</div>
<div class="modal-footer">
<button data-dismiss="modal" class="btn btn-default" type="button">Close</button>
<button class="btn btn-success" type="button">Save changes</button>
</div>
</div>
</div>
</div>
<!-- modal end -->
</body>
</html>
If your need duplicate rows, remove indexes from the table:
ALTER TABLE `textarea`
DROP INDEX `message`
DROP INDEX `user_id`
DROP INDEX `numb`
DROP PRIMARY KEY;
The above is one statement.
Please also read the manual

Unable to connect phpMyAdmin database to my website

I am having trouble connecting a database i have created in phpMyAdmin to my web page using PHP. I am pretty sure my code is correct in both the html and php files and my DB and table names are correct, but when i try to use the registration form, it does nothing. I am using jQuery mobile, so have tried it with and without the data-ajax="false" attribute to no avail. What am i missing here? Thanks for any answers :) I have included the relevant html and php code below, it is the register form in the register page I am trying to connect to the DB.
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1; minimum-scale=1;">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<link href="/projects/ibill_v3/css/mainstyles.css" rel="StyleSheet"/>
<link href="/projects/ibill_v3/css/register.css" rel="StyleSheet"/>
<link href="/projects/ibill_v3/css/login.css" rel="StyleSheet"/>
<link href="/projects/ibill_v3/css/home.css" rel="StyleSheet"/>
<link href="/projects/ibill_v3/css/record_session.css" rel="StyleSheet"/>
<link href="/projects/ibill_v3/css/viewsessions.css" rel="StyleSheet"/>
<link href="/projects/ibill_v3/css/email.css" rel="StyleSheet"/>
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
<script src="script.js"></script>
<script type='text/javascript' src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"></script>
<script type='text/javascript'>
$(document).on('pageinit', function(){
$('#registerForm').validate({ // initialize the plugin
// rules & options
});
});
</script>
<script type='text/javascript'>
$(document).on('pageinit', function(){
$('.loginform').validate({ // initialize the plugin
// rules & options
});
});
</script>
</head>
<body>
<!--********************************REGISTER PAGE**********************************************-->
<!--****************************************************************************************-->
<!--********************************HEADER**********************************************-->
<div data-role="page" id="register">
<div data-role="header" data-id="foo1" data-position="fixed">
<div class='cssmenu'>
<ul>
<li class='active'><a href='#home'>Home</a></li>
<li><a href='#sessionrecord'>Record a Session</a></li>
<li><a href='#viewsessions'>View Sessions</a></li>
<li><a href='#email'>E-mail an Invoice</a></li>
</ul>
</div>
</div>
<!--********************************HEADER**********************************************-->
<!--********************************MAIN**********************************************-->
<div data-role="main" class="ui-content">
<img class="mainlogo" src="/projects/ibill_v3/img/ibill logo.png" alt="iBill Logo" width="250" height="190">
<section class="registerform">
<h1>The iBill Invoicing App for Activity Instructors</h1>
<p>Register below</p>
<form data-ajax="false" method="POST" action="register.php" >
<ul>
<li>
<label for="username">Username</label>
<input type="text" name="username" id="username" class="required" minlength="5" placeholder="enter username (min-5 characters)">
</li>
<li>
<label for="firstname">Firstname</label>
<input type="text" name="firstname" id="firstname" class="required" minlength="5" placeholder="enter firstname">
</li>
<li>
<label for="username">Surname</label>
<input type="text" name="surname" id="surname" class="required" minlength="5" placeholder="enter surname">
</li>
<li>
<label for="email">Email</label>
<input type="email" name="email" id="email" class="required email" placeholder="yourname#email.com">
</li>
<li>
<label for="password">Password</label>
<input type="password" name="password" id="password" class="required" minlength="6" placeholder="enter password">
</li>
<li>
<label for="confirmpassword">Confirm Password</label>
<input type="password" name="confirmpassword" id="confirmpassword" class="required" minlength="6" placeholder="re-enter password">
</li>
<div id="registerbutton">
<input type="submit" value="Register">
</div>
</ul>
</form>
</section>
</div>
<!--********************************MAIN**********************************************-->
<!--********************************FOOTER**********************************************-->
<div data-role="footer">
<footer class="footer">
<p>awilliams©</p>
</footer>
</div>
</div>
<!--********************************REGISTER PAGE**********************************************-->
<!--****************************************************************************************-->
<!--********************************LOGIN PAGE**********************************************-->
<!--****************************************************************************************-->
<!--********************************HEADER**********************************************-->
<div data-role="page" id="login">
<div data-role="header" data-id="foo1" data-position="fixed">
<div class='cssmenu'>
<ul>
<li class='active'><a href='#home'>Home</a></li>
<li><a href='#sessionrecord'>Record a Session</a></li>
<li><a href='#viewsessions'>View Sessions</a></li>
<li><a href='#email'>E-mail an Invoice</a></li>
</ul>
</div>
</div>
<!--********************************HEADER**********************************************-->
<!--********************************MAIN**********************************************-->
<div data-role="main" class="ui-content">
<img class="mainlogo" src="/projects/ibill_v3/img/ibill logo.png" alt="iBill Logo" width="250" height="190">
<section class="loginform">
<form action="form.php" method="post">
<ul>
<li><label for="usermail">Email</label>
<input type="email" name="usermail" placeholder="yourname#email.com" class="required"></li>
<li><label for="password">Password</label>
<input type="password" name="password" placeholder="enter password" minlength="6"></li>
<li>
<div id="loginbutton">
<input type="submit" value="Login"></li>
</div>
<div id="registerbutton">
<input type="submit" value="Register"></li>
</div>
</ul>
</form>
</section>
</div>
<!--********************************MAIN**********************************************-->
<!--********************************FOOTER**********************************************-->
<div data-role="footer">
<footer class="footer">
<p>awilliams©</p>
</footer>
</div>
</div>
<!--********************************LOGIN PAGE**********************************************-->
<!--****************************************************************************************-->
<!--********************************HOME PAGE**********************************************-->
<!--***************************************************************************************-->
<!--********************************HEADER**********************************************-->
<div data-role="page" id="home">
<div data-role="header" data-id="foo1" data-position="fixed">
<div class='cssmenu'>
<ul>
<li class='active'><a href='#home'>Home</a></li>
<li><a href='#sessionrecord'>Record a Session</a></li>
<li><a href='#viewsessions'>View Sessions</a></li>
<li><a href='#email'>E-mail an Invoice</a></li>
</ul>
</div>
</div><!-- /header -->
<!--********************************HEADER**********************************************-->
<!--********************************MAIN**********************************************-->
<div data-role="main" class="ui-content">
<img class="mainlogo" src="/projects/ibill_v3/img/ibill logo.png" alt="iBill Logo" width="250" height="190">
<section class="maincontent">
<h1>The iBill Invoicing App for Activity Instructors</h1>
<p>iBill is a cross-platform app that allows you track and manage activity sessions on the go.</p>
<br>
<p>Record an activity session to get started!</p>
<div style="text-align:center">
Record a Session
</div>
</section>
</div>
<!--********************************MAIN**********************************************-->
<!--********************************FOOTER**********************************************-->
<div data-role="footer">
<footer class="footer">
<p>awilliams©</p>
</footer>
</div>
</div>
<!--********************************FOOTER**********************************************-->
<!--********************************HOME PAGE**********************************************-->
<!--***************************************************************************************-->
<!--********************************RECORD SESSION PAGE************************************-->
<!--***************************************************************************************-->
<!--********************************HEADER**********************************************-->
<div data-role="page" id="sessionrecord">
<div data-role="header" data-id="foo1" data-position="fixed">
<div class='cssmenu'>
<ul>
<li class='active'><a href='#home'>Home</a></li>
<li><a href='#sessionrecord'>Record a Session</a></li>
<li><a href='#viewsessions'>View Sessions</a></li>
<li><a href='#email'>E-mail an Invoice</a></li>
</ul>
</div>
</div><!-- /header -->
<!--********************************HEADER**********************************************-->
<!--********************************MAIN**********************************************-->
<div data-role="main" class="ui-content">
<img class="mainlogo" src="/projects/ibill_v3/img/ibill logo.png" alt="iBill Logo" width="250" height="190">
<section class="maincontent">
<h1>Record a session using the form below</h1>
<form method="post" action="" id="sessionRecord">
<fieldset>
<select name="typeofactivity" id="typeofactivity" data-native-menu="false">
<option>Type of Session</option>
<option value="surf">Surf</option>
<option value="coast">Coasteer</option>
<option value="bodyboard">Bodyboard</option>
<option value="climbing">Cornish Challenge</option>
</select>
</fieldset>
<fieldset>
<select name="employer" id="employer" data-native-menu="false">
<option>Employer</option>
<option value="nac">Newquay Activity Centre</option>
<option value="coastline">Coastline Coasteer</option>
</select>
</fieldset>
<form method="post" action="PHP HERE!">
<label for="datetime">Date and Time of Session</label>
<input type="datetime-local" data-clear-btn="false" name="datetime" id="datetime" value="">
</form>
<form method="post" action="PHP HERE!">
<label for="amount">Amount (GBP)</label>
<input type="number" data-clear-btn="true" name="amount" id="amount" value="">
</form>
<div id="submitbutton">
<input type="submit" value="Submit">
</div>
</form>
</section>
</div>
<!--********************************MAIN**********************************************-->
<!--********************************FOOTER**********************************************-->
<div data-role="footer">
<footer class="footer">
<p>awilliams©</p>
</footer>
</div>
</div>
<!--********************************FOOTER**********************************************-->
<!--********************************RECORD SESSION PAGE************************************-->
<!--***************************************************************************************-->
<!--********************************VIEW SESSIONS PAGE************************************-->
<!--***************************************************************************************-->
<!--********************************HEADER**********************************************-->
<div data-role="page" id="viewsessions">
<div data-role="header" data-id="foo1" data-position="fixed">
<div class='cssmenu'>
<ul>
<li class='active'><a href='#home'>Home</a></li>
<li><a href='#sessionrecord'>Record a Session</a></li>
<li><a href='#viewsessions'>View Sessions</a></li>
<li><a href='#email'>E-mail an Invoice</a></li>
</ul>
</div>
</div><!-- /header -->
<!--********************************HEADER**********************************************-->
<!--********************************MAIN**********************************************-->
<div data-role="main" class="ui-content">
<img class="mainlogo" src="/projects/ibill_v3/img/ibill logo.png" alt="iBill Logo" width="250" height="190">
<section class="maincontent">
<!--MAIN CONTENT GOES HERE-->
</section>
</div>
<!--********************************MAIN**********************************************-->
<!--********************************FOOTER**********************************************-->
<div data-role="footer">
<footer class="footer">
<p>awilliams©</p>
</footer>
</div>
</div>
<!--********************************FOOTER**********************************************-->
<!--********************************VIEW SESSIONS PAGE************************************-->
<!--***************************************************************************************-->
<!--********************************EMAIL AN INVOICE PAGE************************************-->
<!--***************************************************************************************-->
<!--********************************HEADER**********************************************-->
<div data-role="page" id="email">
<div data-role="header" data-id="foo1" data-position="fixed">
<div class='cssmenu'>
<ul>
<li class='active'><a href='#home'>Home</a></li>
<li><a href='#sessionrecord'>Record a Session</a></li>
<li><a href='#viewsessions'>View Sessions</a></li>
<li><a href='#email'>E-mail an Invoice</a></li>
</ul>
</div>
</div><!-- /header -->
<!--********************************HEADER**********************************************-->
<!--********************************MAIN**********************************************-->
<div data-role="main" class="ui-content">
<img class="mainlogo" src="/projects/ibill_v3/img/ibill logo.png" alt="iBill Logo" width="250" height="190">
<section class="maincontent">
<!--MAIN CONTENT GOES HERE-->
</section>
</div>
<!--********************************MAIN**********************************************-->
<!--********************************FOOTER**********************************************-->
<div data-role="footer">
<footer class="footer">
<p>awilliams©</p>
</footer>
</div>
</div>
<!--********************************FOOTER**********************************************-->
<!--********************************EMAIL AN INVOICE PAGE************************************-->
<!--***************************************************************************************-->
</body>
<?php
$servername = "localhost";
$username = "root";
$password = "cornwall";
$con=mysqli_connect('localhost','root','cornwall','ibill');
// This code creates a connec'tion to the MySQL database in PHPMyAdmin named 'ibill':
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
// The connection is then checked, if it fails, an echo is sent back to the page stating a connection error.
$username = $_POST['username'];
$firstname = $_POST['firstname'];
$surname = $_POST['surname'];
$emailaddress = $_POST['emailaddress'];
$password = $_POST['password'];
$confirmpassword = $_POST['confirmpassword'];
//These are the different PHP variables that store my posted data.
$register="INSERT INTO user_details (username, firstname, surname, emailaddress, password,) VALUES ('$username', '$firstname', '$surname', '$emailaddress', '$password')";
echo $register;
$result=mysqli_query($con, $register);
//This is the query that will be sent to the MySQL server.
header('Location: http://localhost/projects/ibill_v3/html/main.html#login');
exit();
//This directs the user to the relevant page after successful registration.
?>
First of all, read this article about SQL injection: How can I prevent SQL injection in PHP?.
There is an error in you SQL query. In your PHP file, replace this line:
$result=mysqli_query($con, $register);
with this:
if(mysqli_query($con,$register) === FALSE){
echo mysqli_error($con);
}
To display errors in PHP code, add these lines:
/** Error reporting */
error_reporting(E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
Ref: How do I get PHP errors to display?

php & html form alignment problems

I want to add a simple form above my right side bar, however the php is miss aligning the form and squashing the form itself picture
I simply want the table to display within the confines of the rest of the side bar, yet I can't seem to figure it out no matter what I do, below is the code for the page, I know there should be a simple solution, but I can't see it.
<body>
<include file="Common:tracking" />
<include file="Common:header" />
<div class="container">
<div class="section">
<div class="wrapshow">
<div class="body">
<div class="article-list">
<ul>
<volist name="blog_list" id="item">
<li>
<div class="head">
<a href="{$item.href}"
class="btn_view_detail"
><img src="{$item.url_picture}" alt="{$item.title}" title="{$item.title}" /></a>
</div><!-- end head -->
<div class="body">
<h3>
<a href="{$item.href}"
class="btn_view_detail" >{$item.title}</a>
</h3>
<div class="tag">
<!--
Blogging
|
Leave a comment
!-->
</div><!-- end tag -->
<div class="con">
{$item.content}
</div><!-- end con -->
<div class="bar">
<a href="{$item.href}"
class="link btn_view_detail">Details<i class="iconfont icon-arrows-right-bottom"></i></a>
<a href="{$item.href}"
class="date btn_view_detail">{$item.dateline_post|date='m/d/Y',###}</a>
</div><!-- end bar -->
</div><!-- end body -->
</li>
</volist>
</ul>
</div><!-- end article-list -->
<div class="paging">
{$page}
</div><!-- end paging -->
</div><!-- end body -->
<div class="site">
<div class="section">
<div class="serve-apply">
<div class="body">
<ul>
<volist name="index_mid4" id="item">
<li>
<h4>{$item.title}</h4>
{$item.content}
<i class="{$item.title_sub}"></i>
</li>
</volist>
</ul>
</div><!-- end body -->
<div class="side shake-an">
<form action="{:U('Contact/quickAdd')}" class="frm_contact">
<input type="hidden" name="type" value="1" />
<h3>Request <em>FREE</em> Trial</h3>
<div class="form-element">
<input type="text" class="form-text blue" name="customer_name" id="username" placeholder="Full Name" />
<label for="username" class="iconfont icon-user"></label>
</div><!-- end form-element -->
<div class="form-element">
<input type="text" class="form-text blue" name="email" id="username" placeholder="Email" />
<label for="username" class="iconfont icon-letter"></label>
</div><!-- end form-element -->
<div class="form-element">
<input type="text" class="form-text blue" name="city" id="username" placeholder="Preferred City" />
<label for="username" class="iconfont icon-map"></label>
</div><!-- end form-element -->
<div class="form-element last">
<button type="submit">Submit</button>
</div><!-- end form-element -->
</form>
</div><!-- end side -->
</div><!-- end serve-apply -->
</div><!-- end section -->
<div class="categories">
<div class="head">
<h3>categories</h3>
</div><!-- end head -->
<div class="body">
<ul>
<volist name="category_list" id="item">
<li><a href="{$item.href}"><em>{$item['title']}</em>
<i class="num"></i></a></li>
</volist>
</ul>
</div><!-- end body -->
</div><!-- end categories -->
<div style="clear:both;" />

Categories