-
Posts
2,134 -
Joined
-
Last visited
-
Days Won
42
Posts posted by benanamen
-
-
2 hours ago, snowymasta said:
I'm really struggling to find whats wrong with this code.
The first thing you need to do is stop mixing obsolete mysql_* code with mysqli.
-
35 minutes ago, phpnew said:
To change the currency you change the locale in the second line
If you passed it in as a parameter you would never have to edit anything and could use the function for any currency
-
I have been using MVP (Model - View - Presenter) for some time. Works quite well.
-
By the way, your test_input function is a block of code from the 90's that needs to be taken behind the barn and shot and buried forever. Surprised to still see that floating around. Additionally, NEVER EVER put variables in your query. You need to use prepared statements
-
What is this "bridge" you created? What do you mean "doesn't allow direct access to mysql Server"? What does Mysql have to do with where you are putting your Php code?
-
Why are you using Cookies for the login instead of sessions? Do you know the differences?
-
1. If those are your real column names you need to change them to something meaningful. Nobody knows what BBB or YYY or CCC means.
2. You likely have a DB design problem that needs to be normalized.Tell us about this data and what it represents.
- 1
-
Hi Unique Idea Man, AKA UIman, AKA visiter52, aka 2020. After THREE years of us trying to teach you about Mysqli and coding under your various alt's across numerous forums, are we really right back at at the very beginning as though you have never seen this stuff?
-
$_SERVER['PHP_SELF'] is vulnerable to an XSS Attack. Just delete the action completely.
48 minutes ago, gw1500se said:Your action parameter is just doing an echo. It is not calling the script.
Yes, it is, but it is a Security problem and shouldn't be used. You "could" use it if you enclosed it in htmlspecialchars but that is just sloppy. Cleaner to leave the action out completely.
- 1
-
print "<p style='color:red;'>Could not delete the blog entry because :<br/>" .mysqli_error($dbc);
- 1
-
3 hours ago, benanamen said:
custom exemption function
Ooops, meant exception.
-
You can use set_exception_handler to create a custom exemption function.
https://www.php.net/manual/en/function.set-exception-handler.php
-
<a href="tel:123-456-7890">123-456-7890</a>
-
This page may be of help to you. We all started at the beginning.
-
What is the real problem you are trying to solve by doing this? What is the high level overview of what you have going on?
-
OP, do not create duplicate posts.
Duplicate of https://forums.phpfreaks.com/topic/310907-help-to-add-redirect-url-to-submit-button/
-
The else is not needed.
function tax_invoice($state, $subtotal, $credit, $shipping) { if ($state == "FL") { return ($subtotal - $credit + $shipping) * .07; } return 0; }
-
Allow me to introduce you to the NOT conditional.
-
You do realize there is a difference between == and = right?
-
What is the real problem you are trying to solve by doing this?
-
You first need to fix your DB design. Consecutive numbered columns is a red flag your DB is wrong. Look up "Database Normalization" and then fix the DB.
-
6 hours ago, Barand said:
The ghost of Jacques still walks these corridors
LOL, that's exactly where I got that from. He really has been a ghost. Hasn't shown up anywhere.
-
Op, you would do better to separate the first and last names into their own columns. A simple use case example for using only the last name would be the intro to a letter. As is, you would have to do some code gymnastics just to get the last name only.
Dear Mr. Doe,
-
1 hour ago, gw1500se said:
I don't think that would cause a syntax error. We need to see the preceding code.
I know. That was just an "in addition to the problem". I agree the problem is the preceding code.
MySQL Backup using PDO
in MySQL Help
Posted
The best way to do DB backups is not with PDO. What you want to do is write a shell script that acts directly on the DB and set up a CRON job to run it at whatever intervals.