473,545 Members | 2,688 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Parse error: syntax error, unexpected '$true' (T_VARIABLE) in C:\xampp\htdocs \downloa

2 New Member
Parse error: syntax error, unexpected '$true' (T_VARIABLE) in C:\xampp\htdocs \download\regis ter.php on line 19
Apr 14 '18 #1
1 2592
petipeti156
2 New Member
<?php
$db = new mysqli('localho st','root','',' felhasznalok');
if (isset($_POST['submit'])) {
$errors = array();
$true = true;
if (empty($_POST['username'])) {
$true = false;
array_push($err ors, "A felhasználónév üres!");
}
if (empty($_POST['password'])) {
$true = false;
array_push($err ors, "A jelszó üres!");
}
if (empty($_POST['password_2'])) {
$true = false;
array_push($err ors, "A jelszó megerősítés üres!");
}
if (!($_POST['password']==$_POST['password_2'])
$true = false;
array_push($err ors, "A jelszavak nem egyeznek!");
}
if ($true) {
$username = mysqli_real_esc ape_string($db, $_POST['username']);
$password = mysqli_real_esc ape_string($db, $_POST['password']);
$password = md5($password);

$sql = "INSERT INTO users(username, password, Date) VALUES('$
username', '$password' ,NOW())";
$db->query($sql);
session_start() ;
$_SESSION['username'] = $username;
header('locatio n: home.php');

}
}
$db->close();
?>
<html>
<head>

</head>
<body>
<form action="registe r.php" method="POST"/>
username<input type="text" name="username"/>
password<input type="password" name="password"/>
re_password<inp ut type="password" name="password_ 2"/>
<input value="Regisztr áció" type="submit" name="submit"/>
</form>
<?php
if (!empty($errors )) {
foreach ($errors as $key) {
echo $key. "<br/>";
}


}

?>
</body>
</html>
Apr 14 '18 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1455
by: james2432 | last post by:
Parse error: syntax error, unexpected T_VARIABLE in /var/www/LukeSite/validateform.php on line 27 validateform.php <?php session_start(); if(empty($_SESSION)||!isset($_SESSION)){ header("Location: index.php?lang=fr"); exit; }
3
5177
by: brkseven | last post by:
Looking for help with this Contact Form. The error is on line 1, but that' doesn't mean a lot, I think. In fact, a php syntax check passed it, but I was hoping for an easy syntax error, it looks more complicated now. Anyway, here's the error: "Parse error: syntax error, unexpected T_VARIABLE in...
5
1924
by: Adam Pelling | last post by:
I'm getting this error Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/neblncbt/public_html/forum/includes/acp/acp_board.php on line 69 Here is the acp_board.php file <?php /** * * @package acp
3
3343
by: SUNN | last post by:
Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /Users/Sunn/Song/usersong/profile.php on line 113 This is the line 113 <script src=\"<?=$jspath?>moderate.js?<?=VERHASH?>\" type=\"text/javascript\"></script> <? } ?> Pls help me to correct this error, thanks alot.
7
4659
by: aquilina | last post by:
This is my code..unexpected T_VARIABLE in C:\wamp\www\job_detail.php on line 15 <div class="h3">Features</div> <div class="mainbox"> <ul id="features"> <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error());
2
2979
by: vivekphp | last post by:
<?php $auth = 0; if(isset($_SERVER)) { $uname = $_SERVER; $pwd = $_SERVER; $fp = fopen("user.txt","r"); while($line = fgets($fp))
2
2076
by: Cody DeWert | last post by:
My code (from a template) is saying: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' When i open the .php in dreamweaver, it confirms the error. the code is: <?php if ($menu->getActive() == $menu->getDefault()) { echo "More Cosmetics Store VirtueMart Templates at <a rel="nofollow"...
4
2085
by: thiagorisan | last post by:
Hi Guys.. I Heave the problem with my script of BPPennyMultiBid. This is Error: Parse error: syntax error, unexpected '"' in /home/thi8isju/public_html/bid_classic.php on line 159 This is the code: <?
0
7502
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7692
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7946
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7457
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6026
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3491
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3470
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1921
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.