473,382 Members | 1,375 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,382 software developers and data experts.

Error of:Parse error: syntax error, unexpected '$username' (T_VARIABLE) in C:\wamp\ww

php registration form
Expand|Select|Wrap|Line Numbers
  1. USERNAME:<input type="text" name="username" value=""></br>
  2. PASSWORD:<input type="text" name="password" value=""></br>
  3. PHONE:<input type="text" name="phone" value=""></br>
  4. <input type="submit" name="submit" value="submit">
  5.     </form>
  6. <?php
  7. if(isset($_POST["submit"])){
  8. $username=$_POST["username"];
  9. $password=$_POST["password"];
  10. $phone=$_POST["Phone"];
  11.  
  12. $con=mysql_connect ("localhost","root","") or die ("Could not connect to MySql");
  13. mysql_select_db ("ewd") or die ("No database");
  14.  
  15.  
  16. $query=mysql_query("select * from ewdexcercxciseusers where username ='".$username."'");
  17. $numrows=mysql_num_rows($query);
  18. if($numrows==0)
  19. {
  20. $sql="INSERT INTO ewdexcercxciseusers(username, password, phone) VALUES ("$username", "$password", "$phone")";
  21.  
  22. $result=mysql_query($sql);
  23.  
  24. if($result){ 
  25.   echo "account successfully created";
  26.   }else{
  27.   echo "failure!";
May 14 '14 #1
5 2053
can someone please help
May 14 '14 #2
Could this be the problem?
php registration form
USERNAME:<input type="text" name="username" value=""></br>
PASSWORD:<input type="text" name="password" value=""></br>
PHONE:<input type="text" name="phone" value=""></br>
<input type="submit" name="submit" value="submit">
</form>
<?php
if(isset($_POST["submit"])){
$username=$_POST["username"];
May 14 '14 #3
Dormilich
8,658 Expert Mod 8TB
it would help to see the full error message.
May 15 '14 #4
Whats wrong with that code?
May 15 '14 #5
Dormilich
8,658 Expert Mod 8TB
post the full error message and I tell you.
May 15 '14 #6

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

Similar topics

3
by: Nathan Sokalski | last post by:
When trying to submit data to an Access database using ASP.NET I recieve the following error: System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr) +41...
8
by: Kevin Murphy | last post by:
Using PG 7.4.3 on Mac OS X 10.2.8, the following "insert into ... select ..." statement completed and then announced a syntax error, which seems bizarre. (Don't be confused by the fact that the...
5
by: r.nikhilk | last post by:
Hi, Currently, we are porting C++ applications from 32 bit to 64 bit on AIX platform. (The current version of AIX is 5.3 and xlC verison is 8.0). We are able to compile the applications by...
2
by: technocraze | last post by:
Hi guys, I have encountered this error when updating the values to the MS Acess table. Error : Update on linked table failed. ODBC sql server error Timeout expired. MS Acess is my front end and...
2
by: Shrutisinha | last post by:
I am getting this error in unix .. syntax error near unexpected token `(' when i am running my parser , can anybody help me plzz .. i am new to all this thanks
9
by: sudhanshu | last post by:
Hi friends, I am facing this error in my vb 6.0 code. The code is... Dim conn As New ADODB.Connection Dim cmd As New ADODB.Command Private Sub cmdOK_Click()
9
by: ajd335 | last post by:
Hi all... I am getting an error Parse error: syntax error, unexpected $end in http:/..... on line 117...(117 is the EOF).. can you plz help me out..I have checked out for the < , > ,{ ,} etc.......
2
by: rahul more | last post by:
Hiiii I am making my project in VB6.0 and my back end is Access 2003. I hav one problem..... When I going to save data into database, at at cmdSave_Click event, VB giving me error(Error mentioned...
4
by: fadhili | last post by:
hello, can anyone help me please am getting the following error Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.