-
Posts
2,134 -
Joined
-
Last visited
-
Days Won
42
Posts posted by benanamen
-
-
I do feel tables still have a good use when a table is desired as shown by the OP.
Yeah.., no, not whatsoever. Not an opinion, just a fact. As @Jaques1 has correctly pointed out, tables are for tabular data. Period.
-
No, you dont "Got it". @mac_gyver gave you the correct response.
Using tables for page layout went out in the 90's. You need to use CSS.
-
You are using obsolete code that has been removed from Php. Use PDO
-
No one can send you a message because you are new. I am available.
-
they all seem to do the same thing
The difference is in error handling. Per the manual:
-
If you only need one space, use your spacebar.
-
1
-
-
The only thing with line 3 is it is hard coded for linux. You would want to use DIRECTORY_SEPARATOR to set the proper slashes for Windows or Linux.
const PAGES_BASEDIR = __DIR__. DIRECTORY_SEPARATOR .'pages' . DIRECTORY_SEPARATOR;
-
-
it does what I need it to.
That is one of the biggest problems with "coders". If you are going to be a programmer, you need to get rid of the "It works so I will use it" mentality.
Did you even try to run the queries @Jaques1 provided you?
-
Re-reading the OP's response, I see he "says if any of them" are true then it changes, if ALL are false. "If they are all false". I didn't read it correctly.
-
If I understand correctly...
SELECT IF(streamStatus=true,"True Message","False Message") AS streamStatus FROM table_name
-
You have a handle of $row but are using $_row.
-
You mentioned security.php. start with that file.
-
We are not going to download a zip file. Post your code in the code tags.
-
DERP! Your right, second way won't even work. Thanks. (And no, no plaintext passwords. I know better)
-
Does it matter which way?SELECT username, password FROM users WHERE username=:username(Now compare password if valid username)ORSELECT username, password FROM users WHERE username=:username AND password = :password
-
Thanks for your feedback.
Oh. And for SEO you shouldn't use basename as that creates the opportunity for accessing a page through multiple URLs, which is not good.
This is only used in DB backend applications requiring logging in so SEO is of no concern.
-
I would like feedback on this basic single site entry procedural code. Any issues, improvements or comments? (included in index.php)
<?php /* * This file: display_pages.php * Acts as a Router to display pages * Restricts access to certain files * */ //------------------------------------------------------------------------ // Restrict access to these files //------------------------------------------------------------------------ // Specify some disallowed paths $restricted_files = array( 'header', 'footer', 'navbar', 'menu', ); //---------------------------------------------------------------------------------------- // Display Pages //---------------------------------------------------------------------------------------- if (isset($_GET['p'])) { $page = basename($_GET['p']); // If it's not a disallowed path, and if the file exists if (!in_array($page, $restricted_files) && file_exists("./includes/$page.php")) { $include = "./includes/$page.php"; } else { $include = './includes/404.php'; } } else { $include = './includes/default.php'; } ?>
-
Storing passwords in plaintext is very bad. You need to use password_hash and password_verify. You never ever insert user supplied data directly to the database. You need to use prepared statements. Overall, it looks like you are using some rather old code.
-
You are using obsolete Mysql code and are vulnerable to an SQL Injection Attack. Update to PDO.
-
Probably because you are mixing PDO with obsolete Mysql code.
Start at this tutorial and learn what is there before you try to move on.
-
Since your autoloader indiscriminately tries to include "classes/*.class.php",
Is the manual example a bad usage?
What else is there to know... about the code you posted? About autoloading in general? PSR-4? Namespaces?
Question was regarding the autoloader. I want to know it inside and out before I go on the the next item.
-
RE: spl_autoload_register
I am using the example code from the manual and it works.
spl_autoload_register(function ($class) { include 'classes/' . $class . '.class.php'; }); $valid_login = new LoginAttemptsLog($pdo); $valid_login->logSuccessfulAttempt('new_goodusername');
Through testing I see that it somehow reads new LoginAttemptsLog into $class and thinks it is a filename to look for in the classes directory. Do I need to understand anything more than this? What else is there to know about this?
-
I will just say, you have at least fifty percent more code than you need.
Multiple remote upload server to server help
in PHP Coding Help
Posted
Why don't you tell us more in detail exactly what you are doing. I believe this is an XY problem.