-
Posts
2,134 -
Joined
-
Last visited
-
Days Won
42
Posts posted by benanamen
-
-
17 hours ago, slotegraafd said:
i wouldnt know how to use the pdo you suggested
Sounds like a great opportunity to learn something new. I just happen to know about a great PDO tutorial that is easy to understand with great copy/paste code examples. If you get stuck with it come on back and we will help you out.
https://phpdelusions.net/pdo -
You have absolutely no code that does anything with your query string. Start with this tutorial and then give it another try.
-
1
-
-
12 hours ago, 684425 said:
from right. No decimal. First comma after 3 digits and then commas after every 2 digits
That is an interesting number format I have never seen. Could you please tell us what that is about and what it represents.
-
2 hours ago, nadav_rock said:
i am new to php. can you give me the code for the simple if else statment?
Since you are new, you may not know the authors of Php have offered a free manual. You will need to refer to this manual all throughout your programming journey so best to bookmark it. Php Manual.
Here is the specific manual page that will teach you about if/elsif/else.
https://www.php.net/manual/en/control-structures.elseif.php -
All you need is a simple if else checking $_SERVER['HTTP_HOST'] and setting the connection parameters accordingly
-
I got mixed up on who was saying what. I thought @SaranacLakesaid that regarding what he was trying to do.
-
Ok, so a subscription _ types lookup table with subscription_type_id, subscription_type_description
Then in data table you have subscription_type_id keyed to the lookup table.
-
Seems to me it would be better to have contract_start and contract_end date columns. If you will be needing historical data then you would have a table for storing each term start/end dates keyed to the user_id.
You will also gain a lot of flexibility with being able to do date calculations and Analytics.
-
1 hour ago, maxxd said:
Firefox has an Edit and Resend button you can use to craft a new request. This just sends the request and shows the response in the dev tools, it won't cause the page to change or trigger and result processing in javascript.
That is incorrect. It does exactly what it says, it resends the request. If you modified the request, the modification is sent. You likely didn't test it properly. Test it on a request that updates a database record and see what happens.
-
9 minutes ago, larry29936 said:
the ip's were imported into varbinary(32) fields.
And there is your REAL problem.....
-
1 minute ago, larry29936 said:
That's the way it imported into the table.
Is that the way it is in the CSV file?
-
23 minutes ago, larry29936 said:
I also have to deal with IPv6 ip's.
The you should be using INET6_ATON
24 minutes ago, larry29936 said:I'm comparing to another table has a start and end ip in that format
Ok, Why is it in that format?
-
57 minutes ago, larry29936 said:
I need the ip in a "0x249f94bd7" format.
Why?
-
Quote
To store values generated by INET_ATON(), use an INT UNSIGNED column
https://dev.mysql.com/doc/refman/8.0/en/miscellaneous-functions.html#function_inet-aton
-
8 minutes ago, SaranacLake said:
it's not like they can read what was submitted, right?
"They" sure can! Not only read it, but manipulate it and even send parameters that are not in your form. This is why you need a whitelist of expected/allowed fields and validation.
-
That would be better. You would look up the price from the db when you need to actually do something with it.
-
47 minutes ago, SaranacLake said:
would I want to use a hidden HTML field to submit the "product_price"
No, it is trivial for a user to change the price submitted.
-
How about telling us what the real problem is that you are trying to solve with this code.
-
You need to do a JOIN with the table the holds the user info. You only need one query.
-
2 hours ago, etopal said:
I think the end solution was a very simple one
Except that isn't the solution. For one, if you dont kill the script after a header redirect, the rest of the code still runs. Using a sequential numbering of pages points to a serious design flaw. If you have a million users, are you really going to have and maintain a million pages?
-
That is a very poorly coded script and is very vulnerable to an XSS Attack.
-
24 minutes ago, requinix said:
What you really need is a column for the shortened form of the location.
I agree. Stop doing code gymnastics and just store the data the way you want it.
-
9 hours ago, zeus69 said:
"What have you tried so far?"
What should I answer this question? I didn't do anything@zeus69, on an programming help forum it is expected that you have first made some sort of attempt at solving the problem you are asking about even if it's just a google search. That is why you get asked "What have you tried so far?" You said "I didn't do anything", thus the lack of interest in helping you.
You need to make some sort of attempt at solving the problem yourself. If you get stuck, post on a forum what the overall problem is that you are trying to solve and what attempts you made at solving it along with the results you got and the results you expect to get.
I would suggest you read through this page before posting on any help forums.
http://www.catb.org/~esr/faqs/smart-questions.html -
On 4/20/2020 at 2:25 AM, bsmither said:
This difference is causing existing code to not be able to correctly parse that output.
Your doing something wrong. Code should not be parsing print_r.
Syntax error thrown when no syntax error
in PHP Coding Help
Posted
Is FUNCTION_NOT_FOUND actually a defined constant? The logic makes no sense. If the function exists, it is "Not found"?