-
Posts
2,134 -
Joined
-
Last visited
-
Days Won
42
Posts posted by benanamen
-
-
One cause of a blank page is using short tags when short tags are not enabled.
-
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.
-
and when all the rows are in that array, loop through inside the table like:
$data = // your result in a single associative array foreach($data as $key => $value) { echo "<td>".$value['brand']."</td>"; echo "<td>".$value['category']."</td>"; echo "<td>".$value['product']."</td>"; }
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.
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
I dont' have access the the master php.ini file
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.
-
This code has absolutely nothing to do with databases or PDO.
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.
-
He said he can't modify the DB.
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.
-
I am interested to know what you are doing that requires that kind of formatting.
-
I would recommend the outdated tutorials be removed from the forum.
Here are at least two that should not be on the net.
http://forums.phpfreaks.com/topic/11585-mysql-data-retrieval/
http://forums.phpfreaks.com/topic/11587-mysql-data-retrieval-advanced/
-
There can only be one "WHERE". This line is wrong: AND WHERE
-
What your wanting to do with the colspan doesn't make any sense. To handle the other part is simple.
<table> <?php foreach ($result as $row) : ?> <tr><td><?= $row['some_column'] ?></td></tr> <?php endforeach; ?> </table>
-
Op, you're seriously just running your mouth and wasting people's time.
Laravel ORM (Eloquent) and the real world
in Frameworks
Posted · Edited by benanamen
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.