FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » classes in PHP
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: classes in PHP [message #180272 is a reply to message #180271] Sun, 03 February 2013 17:11 Go to previous messageGo to previous message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma:
Senior Member
Am 03.02.2013 18:04, schrieb Rita Ferreira:
> Hi,
> I'm new working with classes in PHP.
>
> I'm trying to make login, and I have a form in html which the action I would like to go to the login function located in a class file called UserControler.php.
> My form is in a php file but is not inside a class. I can't call the login function, it always give me error, so I tried to call a file called process.php file where there I call the login function, but it gives me error:
>
> It's something like this:
>
> form.php
>
> <form action="../process.php" method="post">
> (..)
>
> process.php
>
> <?php
> require("UserController.php");
>
> $a=new UserController;
> $a->login();
> ?>
>
>
> UserController.php
> <?php
>
> public class UserController

PHP Parse error: syntax error, unexpected 'public' (T_PUBLIC) in php shell code on
line 1


> {
>
> private $obj;
>
> function __construct( ){ }
>
> public function login()
> {}
> (..)
> }
>
>
> Does anybody can tell me why my code only works until the "$a->login();" in process.php? Is anything wrong?

For development, always turn on every error display and logging directive you can find.

Learn how to check the web server log.

/Str.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: change a string where have number after a word
Next Topic: Problem with readdir and ssh2
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 07:49:26 GMT 2024

Total time taken to generate the page: 0.04640 seconds