Script Error
|
|||
|
Rank: ? (3)
Member #: 29659 |
Ok, I've used the Login Script, copied and pasted everything correcltly, but I get this error:
Fatal error: Undefined class name 'db' in /home/truedrea/public_html/my/db_connect.php on line 19 Fatal error: Undefined class name 'db' in /home/truedrea/public_html/my/db_connect.php on line 31 And this is my page in db_connect.php: Code:
Can someone please help me? » Post edited 2007-09-10, 07:28am by relpats_eht.
|
||
|
|||
|
|||
|
Rank: ? (4821)
Member #: 3416 |
do you have PEAR installed? if not, i would expect it to fail at the require_once line at the top. then again if you have your own file named DB.php it would use that instead, and then you'd probably get this error.
my mind is like a steel trap! it only hangs on to the big stuff. visit my forums at track7.org
|
||
|
|||
|
|||
|
Rank: ? (767)
Member #: 11085 |
As misterhaan has said, the reason for your error is likely that you do not have PEAR installed. This is not, however, your problem. This is your problem: "Ok, I've used the Login Script, copied and pasted everything correcltly but I get this error" That login script is part of a tutorial and not very well suited for use in a real application via copy and paste. It is useful for learning, but one doesn't learn by copy and pasting.
- relpats_eht
|
||
|
|||
|
|||
|
Rank: ? (4821)
Member #: 3416 |
very good point, relpats_eth -- i hadn't fully read the original post and missed that part
my mind is like a steel trap! it only hangs on to the big stuff. visit my forums at track7.org
|
||
|
|||
|
|||
|
Rank: ? (3)
Member #: 29659 |
Yes, but isn't it also suppose to tell you what to do to make users sign up and login in the tutorial??? And how do I install PEAR?
|
||
|
|||
|
|||
|
Rank: ? (767)
Member #: 11085 |
No, the purpose of the tutorial is simply to show the basic mechanics of a login script (and for the more aptly aware, that simple scripts are much more secure than complex ones).
As to installing PEAR, I am just going to point you to chapter 2 in the PEAR manual and also state (as I don't believe in posts being a solitary RTFM) that you will need to be developing on a local machine with PHP to be able to install. If you aren't working locally (that is, you upload everything to a website to run it), then you will have to ask your host to install PEAR. If you are not working locally and your host refuses to install PEAR, alert me to it and I will write up a second copy of that tutorial without the PEAR dependency (In fact, I may do that anyway, as this is quite a common problem.)
- relpats_eht
|
||
|
|||
|
|||
|
Rank: ? (3)
Member #: 29659 |
They said "NO"... I guess they have a lot of people on there servers and then they'd have to install it for everyone and prices will go up.... just a thought though... I'm not a host so yeah...
|
||
|
|||
|
|||
|
Rank: ? (767)
Member #: 11085 |
Not really, they would only need to install it once (or once for each server, maybe) and PEAR is free.
Nonetheless, I'll get working on that PEAR-free port.
- relpats_eht
|
||
|
|||
|
|||
|
Rank: ? (883)
Member #: 3 |
|||
|
Please login or register to post a reply.