|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Enthusiast
![]() Join Date: Jan 2004
Location: singapore
Posts: 40
|
there are some problem to the signup script from the book of harry fueck's. any body who has the work around to it ?
it seems that they used an old quickform class, so the fatal error Call to undefined function: clearalltemplates(); line 71 anybody has the work around for this 6.php for access control? |
|
|
|
|
|
#2 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Jul 2003
Location: USA
Posts: 604
|
i just downloaded the QuickForm version 3.1.1 and it works now
|
|
|
|
|
|
#3 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Jul 2003
Location: USA
Posts: 604
|
my problem is this. If a user hits the login button on the login page, and they did not input the correct Username and password, it reloads 4.php. But then it will not allow me to log in using the correct username and password.
my ideas are this: if i use the logout function, then everything is fine. so would there be a possibility that when incorrect info is inputed, then the session variables would still have the incorrect userid and password, and prevents me from subiting new session variables. has anyone had these problems |
|
|
|
|
|
#4 |
|
SitePoint Enthusiast
![]() Join Date: Jan 2004
Location: singapore
Posts: 40
|
im using 3.2.1 and it doesnt work
|
|
|
|
|
|
#5 |
|
SitePoint resident know-it-all
![]() ![]() Join Date: Apr 2000
Location: Melbourne, Australia
Posts: 2,876
|
I've asked Harry to drop in and have a look at this thread.
|
|
|
|
|
|
#6 | ||
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Nov 2000
Location: Switzerland
Posts: 2,906
|
OK - first off on HTML_QuickForm, as Raskolnikov points out, they've changed the API since the book was published, so you need to make completely sure you've got the right version. If you use;
Code:
pear uninstall HTML_QuickForm # Make sure other versions are gone pear install http://pear.php.net/get/HTML_QuickForm-3.1.1.tgz Quote:
PHP Code:
Quote:
An alternative approach to create an account is to cheat and create one directly on the database, using SQL; Code:
INSERT into user SET login='harryf', password = md5('secretpass');
The general approach to security, used by the Auth class, is to throw out users to a "dumb page" (4.php) which is just a form and is safely outside of the application. This approach helps prevent accidents where you create a condition where an invalid user has access to something they shouldn't. That help at all? |
||
|
|
|
|
|
#7 |
|
SitePoint Enthusiast
![]() Join Date: Jan 2004
Location: singapore
Posts: 40
|
wow that was detailed~ =) thanks~ appreciate it. atleast i have some peace with the book. i can start creating a portal with ur technical help
|
|
|
|
|
|
#8 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Jul 2003
Location: USA
Posts: 604
|
H, thanks for the help. that all deffinitely makes sense.
this is what i have deducted from my attempts to fix this login problem. when i am utilizing page 4.php to login, i am successfull. but when i am at page "4.php?from=" (i get this by tring to surf directly to 5.php) I am unsuccessfull. Is there going to be a value for "from"? so far every time it shows up at the end of the url, there is no value to it. From what i can tell in the code, it should have a value = to the page location - REQUEST_URI, But nothing ever shows up in the addy line. Would this cause a login issue?? |
|
|
|
|
|
#9 |
|
SitePoint resident know-it-all
![]() ![]() Join Date: Apr 2000
Location: Melbourne, Australia
Posts: 2,876
|
Sounds like PHP isn't able to obtain a value for REQUEST_URI. One possible cause of this is that you might be running the CGI version of PHP (which is inefficient and lacks a number of features) instead of the Apache or IIS module version.
|
|
|
|
|
|
#10 |
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Nov 2000
Location: Switzerland
Posts: 2,906
|
The ?from= field the the Auth.php class generates is a "nive to have" feature - if someone is surfing your site, then has a break for a while, leaving their browser open, during which time their session times out, when they return they will be required to login again but the from value can help take them back to the page they were viewing.
As Kev points out, the from value is populated from $_SERVER['REQUEST_URI'] may not be available if you're using IIS or the CGI version of PHP. You can check where you have with the following; PHP Code:
PHP Code:
The following is a quick fix; PHP Code:
|
|
|
|
|
|
#11 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Jul 2003
Location: USA
Posts: 604
|
Frank, H, I think it is working. I have tested the login as many different ways as i can come up with and it works. I added the !empty portion of the if statement, and that seems to have worked.
when i php_sapi_name() it returned ISAPI. not totally for sure what that means, but i was pretty sure i did not install the CGI version of php. new question. every other part of this access control is working fine. registering, confirming, changing password, however, I am now getting this error ('Fatal error: Call to a member function on a non-object in c:\SPLIB\AccessControl\AccountMaintenance.php on line 111') when accessing 10.php. from accountMaintenance.php: PHP Code:
PHP Code:
from 10.php: PHP Code:
PHP Code:
thanks for all your help so far it has been greatly appreciated! |
|
|
|
|
|
#12 |
|
SitePoint Enthusiast
![]() Join Date: Sep 2003
Location: new
Posts: 40
|
PHP ANTHOLOGY Access Control clearAllTemplates ERROR
Have tried to download the latest HTML_QuickForm, but still am getting the error:
Fatal error: Call to undefined method HTML_QuickForm::setRequiredNoteTemplate() in I have tried to change the path all sort of things but still am stuck please assist I am using QuickForm version 3.1.1 I have also tried 3.2.3, but nothing seem to work. |
|
|
|
|
|
#13 |
|
SitePoint Zealot
![]() ![]() Join Date: Jun 2004
Location: The Netherlands
Posts: 130
|
Raskolnikov,
I have the exact same problem. Have you found a sollution up to now? ('Fatal error: Call to a member function on a non-object in c:\SPLIB\AccessControl\AccountMaintenance.php on line 111') thnx in advance.. |
|
|
|
|
|
#14 |
|
SitePoint Member
Join Date: Nov 2002
Posts: 16
|
Anybody find out what was causing their 'Fatal error: Call to a member function on a non-object...' error? I'm having the same problem and have yet to figure it out.
Incidentally, anybody happen to notice the error in 9.php (for sending forgotten passwords)? I couldn't figure out what was going wrong when every time I used the page I got the message: 'Problem sending you details. Please contact the site administrators.' Then I noticed that, because the script is written to send the "An email has been sent to..." message if (!$mail->Send()) (notice the !), it does the exact opposite of what it should! |
|
|
|
|
|
#15 |
|
SitePoint resident know-it-all
![]() ![]() Join Date: Apr 2000
Location: Melbourne, Australia
Posts: 2,876
|
Thanks for spotting the spurious '!', googo1p1ex! I'll add that to the errata page of the book ASAP.
As for the fatal error some of you are experiencing, I've traced it to this line in AccountMaintenance.php: PHP Code:
PHP Code:
|
|
|
|
|
|
#16 | |
|
SitePoint Member
Join Date: Jun 2005
Location: krypton
Posts: 10
|
Quote:
i have been getting this msg when i have used HTML_QuickForm-3.2 Fatal error: Call to undefined function: updateattribute() in .../public_html/HTML_QuickForm-3.2.4pl1/QuickForm.php on line 256 whats that all about, im using the latest quickform and still get the same msg, it seems like the updateAttribute() does exist... |
|
|
|
|
|
|
#17 |
|
SitePoint resident know-it-all
![]() ![]() Join Date: Apr 2000
Location: Melbourne, Australia
Posts: 2,876
|
The code in the book is written for QuickForm 3.1, so if you want to solve the problem quickly I would suggest installing that older version.
That said, are you sure you've got the error message right? The line in question calls updateAttributes, not updateAttribute. |
|
|
|
|
|
#18 |
|
SitePoint Zealot
![]() ![]() Join Date: Aug 2004
Location: Utah, USA
Posts: 136
|
Can you fix the sample code?
Hi Harry, Kevin;
Adding these fixes to the errata is nice but you solve a lot of our grief by fixing the sample files that are available for download. I just downloaded the files (15 Aug 2005) and the errors mentioned on this thread still exist. Thanks, Kevin Last edited by kmillecam; Aug 16, 2005 at 11:33. Reason: Fixed reference to "Harry" |
|
|
|
|
|
#19 |
|
SitePoint Evangelist
![]() ![]() ![]() ![]() Join Date: Nov 2004
Location: Mission Viejo
Posts: 403
|
Here is beating a dead horse...
I installed 3.1.1 and I get this: Fatal error: Only variables can be passed by reference in C:\PHP\PEAR\HTML\QuickForm.php on line 600 |
|
|
|
|
|
#20 |
|
SitePoint Evangelist
![]() ![]() ![]() ![]() Join Date: Nov 2004
Location: Mission Viejo
Posts: 403
|
Update this error: Fatal error: Only variables can be passed by reference in C:\php\PEAR\HTML\QuickForm.php on line 600
occurs after upgrading PHP to verision 5.0.5 Harry is there a conflict between Quick_Form 3.1.1 with PHP 5.0.5? If so is there a workaround we can implment short of trashing the script all together. I am using this access control class on a production machine. |
|
|
|
|
|
#21 |
|
SitePoint resident know-it-all
![]() ![]() Join Date: Apr 2000
Location: Melbourne, Australia
Posts: 2,876
|
I've recently uploaded an updated code archive for The PHP Anthology. Grab it and download it for many of the fixes mentioned above.
Tecknowjnkie, it definitely looks like PHP5 requires a more up-to-date version of QuickForm. Looks like you'll need to grab the latest version and then read the migration documentation to determine how to update the scripts to work with the current version. |
|
|
|
|
|
#22 |
|
SitePoint Evangelist
![]() ![]() ![]() ![]() Join Date: Nov 2004
Location: Mission Viejo
Posts: 403
|
Hi moonski
This is the same error I am receiving, did you read Kevin's reply above (msg#21)? I am converting the classes per the migration directive at PEAR. As soon as I have it working I will post a detailed work through:-) |
|
|
|
|
|
#23 | |
|
SitePoint Member
Join Date: Oct 2005
Posts: 1
|
Quote:
|
|
|
|
|
|
|
#24 |
|
SitePoint Member
Join Date: Nov 2005
Posts: 3
|
Thanks
Reinstalling QuickForm resolved issue |
|
|
|
|
|
#25 |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Nov 2005
Location: Moss, Norway.
Posts: 274
|
There is also an error in 7.php that is not fixed in the last version of the code archive. I also had some configuration problems. I have the PHP, MySQL, phpMyAdmin, Apache server and PEAR library that followed with XAMPP Version 1.5.2 for Windows Xp home edition.
First I installed SPLIB and the pear libraries on the root folder and made the following config.php file: <?php ini_set('include_path',ini_get('include_path') . '../SPLIB:' . '../pear:'); ?> I posted the edited version of 7.php in this thread, post number 5: OOP in PHP and MySQL tips: Start here. in the WPW Web Programming Discussion sub Forum. I have the following remarsk to the two books. Good enough on OO PHP. Configuration information and updated / corrected versions of the SPLIB library to later versions of external libraries like pear could have been better. Since you supply an email address when you buy the books, there could have been automatic updating of important threads like this one and of the code library. Since there is a chapter in volume II on the adapter pattern, is it not possible to adapt the code to later versions of pear? Proposal for revised editions of the books. My own view if someboydy changes an important class like HTML_QuickForm in the pear library, the old methods should still function. New updated methods should be given another name. Here are the most important changes in 7.php: // The image check field // Changed $form->addElement('image', ' ', '8.php', 'class="image"'); The change that starts with this line: $renderer =& $form->defaultRenderer(); are changed in 6.php that I downloaded with the updated SPLIB. It took some time for me to guess that there was an updated version of 6.php. If you want to learn serious PHP, buy the books. Learn yourself Design patterns. Buy the following book: Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides (1995): "Design Patterns: Elements of Reusable Object-Oriented Software." Addison-Wesley Professional ISBN 0201633612 |
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 13:57.











Linear Mode
