PHP doesn't process... I think

We are still not on the same page. I full well understood what you said. I am saying you should not use a submit button check AT ALL.

Unless I am mistaken, you were saying you shouldn’t use JUST the submit button check. And I am calm, just keeping the info straight. There is a whole lot of code out there that is failing and the coder doesn’t even know it and if the user reports it he likely doesn’t know why.

1 Like

I’m with ya. That’s why all the passwords are hashed.

I’ll check into it. I appreciate all the responses.

Confused. What does hashed passwords have to do with this?

after a couple of fixes the error log stops showing any records. So, I’m guessing it isn’t seeing anything to log.

Did you make the change I said? If the problem is what I think it is there is not going to be anything in the error log. It will just silently fail which is what I was just referring to in post #23. By the way, what browser and version are you using?

If the change I mentioned still doesn’t work you can zip up your files to me and I will take a look at it.

I’m sure there are many issues. I created this script from various sources. One of them being an old copy of Kevin Yanks creating a database driven website. I have recently acquired the newer version of this book. I’ll be updating as much of the code as is needed. Right now there is very little security built into the site. Not to worry, though. The site is not viewable by the public. I password protected the root directory through Cpanel.

The code is sloppy and needs some work. The more I read the replies the more I realize I need to re-focus and get it right.

Don’t know. SpacePhoenix was going on about hashed passwords for some reason. Thought I’d agree with him.

This login.inc.php file that you excerpted this code from is not mine. It is from a tutorial on YouTube by a guy called mmtuts where he shows how to create a complete login system. This part of the code is viewable at 43:30 in this video: https://youtu.be/xb8aad4MRx8

I haven’t done it yet. To be honest it has been a long day. I’m just following up on the replies and I plan on sitting down tomorrow and digging into all of this.

Gotcha. Not sure why he mentioned it. Your code is using hashed passwords. Anyways, if you get stuck with whatever you’re doing let me know and I will be happy to help.

If your looking at new code, I would suggest you study something that uses PDO. Here is a good tutorial to get you going. https://phpdelusions.net/pdo

Post #9.

Cool. Thanks for the help. You don’t happen to live in Boise, Idaho do you? JK… kinda.

I’ll print that out and study it. The new version of “database driven websites” deals with PDO’s as well. The new version is called PHP & MYSQL Novice to Ninja.

My new database connection code is actually from the updated version.

<?php
try
{
   $conn = new PDO( 'mysql:host=$mysqlserver;dbname=$dbname', '$mysqlusername', '$mysqlpassword'
           ); 
} 
catch (Exception $ex) {
}
    $output = 'Unable to connect to the database server.';
    
    exit();
?>
1 Like

That’s great. You are off to a good start. There is something I will need to teach you about later regarding try/catch blocks but for now it is ok while you learn PDO. We can save it for another thread. At least that code block doesn’t do the horrendous security issue of outputting internal system errors to the user.

2 Likes

Did everybody miss this? Holy cat whiskers batman!

Get rid of HostGator and find a real host if that’s what they gave you. It’s not 1986 any more :wink:

In actuality, if you have HG then you have a cPanel, and in cPanel you should be able to change your PHP version. At the very least set it to version 5.6 but it’s perfectly ok to get on 7.0 or greater now. Especially since you are writing your own code.

I don’t think the version was your problem, but there is no reason to learn to code and build something on 5.4! Have HG change your version and then make sure PHP is set as a handler for *.php files, which your files should be. And that “index.php” is pretty much your main entry point.

If stuff between PHP tags is “being ignored”, it could be you aren’t outputting anything in the first place? Or there is an error that is silently failing, showing you nothing (hence you need to change error reporting options).

You can also create a file in your root folder and just call it “phpinfo.php” and then insert the code:

<?php
phpinfo();

And then access this file from the URL of your domain. “mynewdomain.com/phpinfo.php”. And see if it works. By all means, it should. If not, it’s your HostGator configuration and you should hop on their live chat and tell them about it.

Cheers

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.