Need Help Creating Registration/Login Form |
Hi guys! Total CI noob here! Just so we're on the same page, I'm following this tutorial: http://www.kodingmadesimple.com/2015/08/...ation.html
Which covers creating a registration form in Code Igniter with some validation and whatnot. My code looks exactly as it is shown in the tutorial. I have my database set up: My browser is displaying the form fine: But after filling out the fields and submitting the form, I get this error in Safari: Any idea what's causing this? If you need any more information, I will be happy to give it to you.
Found out something. Guess I'm supposed to change my "base_url", which I found in the "application/config.php" file. Right now it's set to blank. What exactly am I supposed to set it to? I tried setting it to "localhost:8888/theFolderMyCodeIgniterFilesAreIn" and I just got a 404 error.
Could be a permissions setting in Safari's options.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Hi. I confess I'm not familiar with ::1 notation, and you can't google for strings like that, so I found nothing.
Clearly, Safari can open pages on your server, since you get as far displaying the form. When the form is displayed, what is the URL in the browser's address bar? Is it ::1/something/something or is it localhost/something/something? Are you already familiar with PHP? Maybe try to narrow down the point at which it gets that error. You can do this by inserting an exit; statement in your code until the error message appears. That is, if execution hits the exit statement before whatever is causing the error, execution will end and you won't get the error. If that happens, move the exit statement forward. When you get the error, it means you moved the exit statement ahead of the error. If you did this line by line, the line above the exit statement is causing the error.
Hey, don't work without a PHP debugger. Several free IDEs have this features built in. Two are NetBeans and CodeLobster. Without a debugger, it's like you're driving with a blindfold on -- you are going to crash!
I would guess that it would work if you used http://localhost or http://127.0.0.1 instead of http://::1.
See: http://superuser.com/questions/877587/wh...-127-0-0-1 It would seem that in order for Apache to work with ipv6, there is some configuration that needs to be done.
Your database structure suggests that you are planning of storing the passwords (or a simple hash) in your database. If you have little or no experience in creating a secure login functionality then I would suggest using an existing auth library from people who have such experience.
Some popular ones out there are: Ion Auth Community Auth (02-09-2016, 06:38 AM)Diederik Wrote: Your database structure suggests that you are planning of storing the passwords (or a simple hash) in your database. If you have little or no experience in creating a secure login functionality then I would suggest using an existing auth library from people who have such experience. That's a good point, but the OP describes himself as a "total CI noob," so what he's working on is probably not going into production. He's just learning.
Hey, don't work without a PHP debugger. Several free IDEs have this features built in. Two are NetBeans and CodeLobster. Without a debugger, it's like you're driving with a blindfold on -- you are going to crash!
(02-08-2016, 06:26 PM)InsiteFX Wrote: Could be a permissions setting in Safari's options. I tested it in Firefox (without setting the base_url in the config and got the same kind of message. When I tested it in Chrome, the signup button did absolutely nothing. (02-08-2016, 07:03 PM)RobertSF Wrote: Hi. I confess I'm not familiar with ::1 notation, and you can't google for strings like that, so I found nothing. When the form page is loaded up, it says "localhost:8888" in the address bar. No subfolder or anything afterward. My route.php is set up so that the default controller is the controller handling the user_registration_view.php (my form), so that's what loads up automatically. I've dabbled in PHP, but it's been quite a while and I need to refresh on it. (02-08-2016, 07:37 PM)skunkbad Wrote: I would guess that it would work if you used http://localhost or http://127.0.0.1 instead of http://::1. I'm not sure why it's going to ::1. I'm physically typing in "localhost:8888" to get to the form, just like I usually do when i'm working in my local server and want to preview a file. Yet, upon submitting the form, the address switches to ::1. Do you guys have any comment on the "base_url" thing? It had gotten rid of the ::1 error when I set it to "http://localhost:8888/myProjectFolder." Which I guess is progress? (haha) Now it just says "The requested URL /myProjectFolder/index.php/User/register was not found on this server." Not sure what the User/register is supposed to be, but I'm guessing it has to do with the code below in the user_registration_view.php : Code: <div class="row"> I know it's accessing index.php (which right now is just whatever Code Igniter has for it as code by default) because the "Index File" config is set to : $config['index_page'] = 'index.php'; I'm assuming I would change that to the home page of my site (after the successful registration), correct? Either way, I don't know what the User/register is at the end of that address. But that's probably what's causing the 404 error now. (02-09-2016, 09:50 AM)RobertSF Wrote:(02-09-2016, 06:38 AM)Diederik Wrote: Your database structure suggests that you are planning of storing the passwords (or a simple hash) in your database. If you have little or no experience in creating a secure login functionality then I would suggest using an existing auth library from people who have such experience. Yeah, I'm trying to learn it currently. Watched a course on Lynda, read some of the documentation, figured I'd try to tackle it...And failing pretty hard right now ^^' |
Welcome Guest, Not a member yet? Register Sign In |