| | |
Parse Error in Class
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jun 2009
Posts: 12
Reputation:
Solved Threads: 0
I am writing this simple code. I used this class in PHP 10 minutes ago and now when I did it again it gives me this error. I cannot see the difference
This is the error I get:
Parse error: syntax error, unexpected $end in C:\xampp\htdocs\Lessons\Arrays\test.php on line 26
I would really appreicate someones help in this as I am new to OOP in PHP.
Thanks
PHP Syntax (Toggle Plain Text)
<?php class user { public $Username; public $FullName; public $Password; public $LoggedIn; public $JoinDate; public function changePassword($newPass) { $this->Password = md5($newPass); { } $user = new user(); $user->Username = 'Username'; $user->FullName = 'Name'; $user->Password = 'password'; echo $user->Username; echo $user->changePassword($newPass); ?>
This is the error I get:
Parse error: syntax error, unexpected $end in C:\xampp\htdocs\Lessons\Arrays\test.php on line 26
I would really appreicate someones help in this as I am new to OOP in PHP.
Thanks
0
#2 24 Days Ago
Your } for your changePassword function is a {. Also, you don't need to specify public for all of those variables, scope defaults to public.
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
![]() |
Similar Threads
- Parse error: syntax error, unexpected $end in (PHP)
- Parse Error? (PHP)
- Parse error: syntax error, unexpected $end (PHP)
- Help Needed Parse error: syntax error (PHP)
- PHP Parse error: parse error, unexpected T_STRING in F:\downloads\cats-0.6.1\index.ph (PHP)
- Parse error please help (PHP)
- Parse Error T_STRING - Help Please (PHP)
- PHP Parse error: parse error, unexpected T_STRING (PHP)
- Need Help With Parse Error... (PHP)
Other Threads in the PHP Forum
- Previous Thread: save file xls or txt
- Next Thread: How to Update a record in a database
| Thread Tools | Search this Thread |
# 5.2.10 action address apache api array auto autoincrement beginner binary broken cakephp checkbox class classes cms code cron curl database date dehasher destroy display dissertation domain dynamic echo echo$_get[x]changingitintovariable... email error errorlog fatalerror file files folder form forms function functions google href htaccess html if-else image images include insert ip javascript joomla legislation limit link load login mail masterthesis menu mlm multiple mysql mysqlquery oop open paypal pdf persist php popup problem query radio random record recursion remote script search server sessions sms sockets source space sql syntax system table tutorial update upload url validator variable video web youtube






