473,386 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to fix Parse error in PHP code?

Hello all
I am trying to create registration form. I am using wampserver 2.0. The code I am using is below. I am trying to fix that problem but I can't. Any help would be appreciated.

Error:
Parse error: parse error in C:\wamp\www\reg.php on line 20

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. if(isset($_POST['reg'])){
  3. $name = strlen($_POST['nickas']);
  4. if($name <= 3){
  5. print "Prisijungimo vardo ilgis turi buti ne mazesnis nei 3 simboliai!!!";
  6. }else{
  7. if($_POST['e-mail'] == ""){
  8. print "Neivestas e-mailas!!!";
  9. }else{
  10. if($_POST['password'] == ""){
  11. print "Neivedei slaptazodzio!!!";
  12. }else{
  13. if($_POST['password'] != $_POST['password2']){
  14. print "Slaptazodziai mesutampa!!!";
  15. }else{    
  16. require "connect.php";
  17. $pass = md5($_POST['password']);
  18. $data = date("Y-m-d H-i-s");
  19. mysql_query("INSERT INTO `users` (nickas,e-mail,password,data)
  20. //error is here
  21. VALUES (`".$_POST['nickas']."`, '"$_POST['e-mail']."', '$pass'", '$data'")");
  22. print "Uzsiregistravai sekmingai!!!"
  23. }
  24.  
  25. }
  26. }
  27. }
  28. }
  29. ?>
  30. <form action="reg.php" method="post" />
  31. Prisijungimo vardas:
  32. <input type="text" name="nickas" /><br>
  33. Slaptazodis:
  34. <input type="password" name="password" /><br>
  35. Slaptazodzio pakartojimas:
  36. <input type="password" name="password2" /><br>
  37. E-mailas:
  38. <input type="text" name="e-mail" /><br>
  39. <input type="submit" name="reg" value="Toliau">
  40. </form>
connect.php code is:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $prisijungimas = mysql_connect("localhost", "root", "***") or die ("Klaida.")
  3. mysql_select_db("duomenubaze");
  4. ?>
Nov 21 '10 #1
1 1738
sidhx
50
hey look on this line
VALUES (`".$_POST['nickas']."`, '"$_POST['e-mail']."', '$pass'", '$data'")"); change this to
VALUES ('".$_POST['nickas']."', '".$_POST['e-mail']."', "'.$pass.'", "'.$data.'")");
Nov 22 '10 #2

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

Similar topics

2
by: entoone | last post by:
I'm getting the following error Parse error: parse error, expecting `','' or `';'' in /home/notarywe/public_html/php/update2.php on line 108 Here is line 108 <input type="text" name="ud_first"...
3
by: Marten van Urk | last post by:
I got the following error in my page Parse error: parse error, unexpected T_ELSE in line 25 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Club</title>...
2
by: Salim | last post by:
Hi people, keep getting this errorParse error: parse error, unexpected T_STRING in order_fns.php line 91. the code is below for the file and I've indicated line 91 <?php function...
6
by: Ehartwig | last post by:
I recently created a script for user verification, solved my emailing issues, and then re-created the script in order to work well with the new PHP 5 that I installed on my server. After...
8
by: Wescotte | last post by:
The error message Parse error: syntax error, unexpected $end in FILE on line X is one I run into frequently and I know the cause is I missed an ending quote. Is there an easy way to determine...
4
by: strgzr3745 | last post by:
I am very new to programming and am trying to get this pattern finder program to compile. Everytime I try I get the following: error: parse error before 's' This error appears in line 26 in the...
1
by: fredie108 | last post by:
I've installed a link request script and when testing the link request form I get this: Parse error: syntax error, unexpected '@' in /home/mybusiness/public_html/output.php on line 91 I then...
1
epots9
by: epots9 | last post by:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/html/xxx.php on line xxx I get that message when i try to run my...
1
by: Phaelle | last post by:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' What does that error mean? I canīt find the mistake!! In another script, I have got another kind of mistake : parse...
14
by: dbldeegd | last post by:
My Java Script executes fine on an test HTML page, but on the required page which is php results in an error. the page The script drops in message box when the page is loaded since the script...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...

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.