-
Posts
2,134 -
Joined
-
Last visited
-
Days Won
42
Everything posted by benanamen
-
Why don't you know? Why don't you test it and see for yourself.
-
Are your rules that anyone that uses IE8 is not allowed to use your script?
-
Seriously? Thats a joke right?
-
Pretty sure he is referring to me. After many back and forth with @Jaques1 and actual testing, it is a fact that using request method is the correct and failproof way to go. At this point I am pretty burned out on explaining the whys. Perhaps @Jaques1 will do it. One particular instance counting on a button to be submitted that will completely fail is with IE8. I don't want to hear about how its older or not many people use it. It is the default version for windows 7 and unless someone does an upgrade, that is what they have. If you don't care that your script will completely fail for all those users, then so be it. As Jaques1 would tell you, "It is naive to expect that every user is going to use YOUR form to submit data". And in the case of a user using cURL, they are not going to be submitting your button in the request and will have no way of even knowing you are expecting it for the script to work. You have to make way too many assumptions doing anything other than the foolproof if ($_SERVER['REQUEST_METHOD'] == 'POST') Do your own testing or ask @Jaques1 to explain it in detail. I was previously a if ($POST){} coder before @Jaques1 undisputedly schooled me.
-
Storing dynamically generated felds values into database
benanamen replied to michelle1404's topic in PHP Coding Help
You still have problems. You are wide open to an SQL Injection Attack. You NEVER EVER insert user supplied data directly to the database. You need to use prepared statements. Also, depending on the name of a button to be submitted will completely fail in certain circumstances. You need to use if ($_SERVER['REQUEST_METHOD'] == 'POST') -
I have never used a third-party framework and in all my years I've never found a "need" to use one. I do have to say that in all the projects I have worked on, I have been the only programmer and have built everything from the ground up so that could make a difference for some. I created a dynamic crud generator that can create an entire back end at the push of a button in a matter of seconds regardless of the amount of tables. Using the party model DB schema I can scale to Infinity on large projects with no problem. I would say just use the right tool for the right job. I am interested to see the feedback you get on this.
-
One cause of a blank page is using short tags when short tags are not enabled.
-
I must be using the mysql_fetch_array wrong, any help?
benanamen replied to EricOnAdventure's topic in MySQL Help
You are using obsolete MySQL code that has been completely removed from PHP. You need to use PDO with prepared statements. You also do not want to output server errors to the user. What is the user supposed to do with a server error message? It is also a security risk. -
Display Distinct data with each related data
benanamen replied to samuel_lopez's topic in PHP Coding Help
This is not even close to what the OP asked for. -
He is using bootstrap. The divs are correct.
-
The problem comes when upgrading to a newer version of bootstrap. You will lose all your changes or have to redo them all over again. If you override the variables in an external CSS file you will not have that problem.
-
I personally already understood the clarification you posted. I was making a dramatic point to the op to not use it without getting technical. The hows and the whys are neither here nor there. It just shouldn't be used. Good explanation for those that want to know why though.
-
Rule number one. You don't edit the bootstrap files. You override them somewhere else.
-
This code is all kinds of wrong. You are using obsolete code that has been removed from PHP. Md5 was cracked like 20 years ago. You need to ditch this code and start over. Depending on the name of a button to be submitted will completely fail in certain circumstances. The whole process of checking for a user name first before entering a new one is wrong as well. Using tables for page formatting went out in the 90s. You need to use CSS. I am on my phone at the moment so I can't get into detail. Others will give you more information.
-
More importantly, you are using obsolete code that has been completely removed from Php. You need to use PDO with prepared statements. https://phpdelusions.net/pdo Also, counting on the name of a button to be submitted for your script to work is a bad idea. It will completely fail in certain circumstances. You need to use if ($_SERVER['REQUEST_METHOD'] == 'POST') Its about time you start using HTML5 as well. Using tables and obsolete html for page layout went out 20 years ago (align="center"). You use CSS for page formatting. You also dont need to trim each individual input. You can trim the entire POST array at one time. Your code is seriously outdated and needs to be completely re-written.
-
Good catch @kicken!
-
date_default_timezone_set('America/New York'); http://php.net/manual/en/function.date-default-timezone-set.php The line you reference is for use in the actual php.ini. that you say you do not have access to. Per the manual re: date.timezone: The behaviour of these functions is affected by settings in php.ini. http://php.net/manual/en/datetime.configuration.php#ini.date.timezone You're on a dedicated server but you don't have root access?
-
You haven't shown how and where you are including the code. Nevertheless, change those echos to variables, i.e $var1, $var2 and then echo those variables where you want them AFTER the include file line wherever that is. Your include code is bad. You're missing something, like the Try.
-
Try posting the code you are using.
-
My point proven of the critique I gave yesterday under the website critique section.
-
You have almost two thousand code errors on your site. Pretty bad for being a "Programmers" website. Its not even close to being cross browser compatible. It looks totally different in every browser you view it in. Your lack of skill shows in your client sites as well. Same kinds of issues. You really shouldn't be charging people until you learn how to do things correctly.
-
Your server has numerous security issues and you are vulnerable to a Clickjacking Attack.
-
Really? Where does it say that?
-
You haven't posted anything about your database which is really where this starts. You should have a db column is_summer with a one or zero. Then in your code if (row['is_summer']){ // button code }
-
Apache server is already set up that way with a separate file that is included for each virtual host. Any reason you can't use apache? Not familiar with nginx config.