Jump to content

benanamen

Members
  • Content Count

    1,800
  • Joined

  • Last visited

  • Days Won

    33

Everything posted by benanamen

  1. benanamen

    What is wrong with this line?

    The result is an array. You cant echo an array. Do this.... echo '<pre>', print_r($user, true), '</pre>';
  2. benanamen

    Table form input to output to 2nd page table

    Here is a quickie example. (TMTOWTDI) <?php $array_A = [2, 6, 8, 11, 14, 18, 24]; $array_B = [1, 2, 9, 10, 13, 14, 25, 28]; $array_C = [1, 3, 7, 9, 13, 15, 20, 21, 24]; $array_D = [4, 5, 12, 22, 23, 27, 28, 29]; $input = '2,15,37,13,28'; $parts = explode(',', $input); foreach ($parts as $part) { if (in_array($part, $array_A)) { $group_a[] = $part; } if (in_array($part, $array_B)) { $group_b[] = $part; } if (in_array($part, $array_C)) { $group_c[] = $part; } if (in_array($part, $array_D)) { $group_d[] = $part; } } echo '<pre>', print_r($group_a, true), '</pre>'; echo '<pre>', print_r($group_b, true), '</pre>'; echo '<pre>', print_r($group_c, true), '</pre>'; echo '<pre>', print_r($group_d, true), '</pre>';
  3. benanamen

    Table form input to output to 2nd page table

    I understand what you are asking. What is the purpose of this and where do the four arrays come from?
  4. benanamen

    What is wrong with this line?

    You can always run it and see. It's pretty simple. Look at your query. You are selecting EVERYTHING in the row. You should specify the columns you want instead of SELECT *. Naming it $user would be a bad name since it has more than just the user in the result. How about naming it $result?
  5. benanamen

    What is wrong with this line?

    Allow me to direct you to using PDO. Here is a tutorial to get you going. https://phpdelusions.net/pdo
  6. benanamen

    What is wrong with this line?

    NEVER EVER put variables in your query. Your code is vulnerable to an SQL Injection Attack. Use Prepared Statements.
  7. benanamen

    Query echo works in phpmyadmin, but not php script

    htmlentities is an output function and for HTML output. Why are you using it on your input? What if you need to use the data that is not for HTML Output? Also, you need to use Prepared Statements. Never ever put variables in your query.
  8. benanamen

    Accessing uploaded file data

    You VERY MUCH should be! Anyways, I am sure you have learned things in your quest which is always a good thing and you can't knock a guy for trying. You have to start somewhere. By the way, your response a couple posts back was what I was trying to get at when I was asking what you are really doing instead of how you are trying to do it. It is much better for us to know that as the opener so we can properly respond to you.
  9. benanamen

    Accessing uploaded file data

    The best way to find out if you "missed" anything is to post your code on a repo for peer review. Based on the questions you have been asking I would personally have to question your ability to write a secure encryption algorithm which is no small task, but then you could be a wizard mathematician for all I know. Best thing is to show us the code. EDIT: Nothing personal by the way
  10. Photo? Pictures are for hanging on the wall. Post your code using the code tags (<> on the menu)
  11. benanamen

    Accessing uploaded file data

    Best I can tell is it is some kind of homemade file encrypter.
  12. benanamen

    Accessing uploaded file data

    You still you still haven't told us what your really trying to do. What is the point of all this code?
  13. benanamen

    Accessing uploaded file data

    Tell tell us about the real problem at hand instead of telling us how you're attempting to solve the real problem.
  14. benanamen

    how to select two tables in update query

    You already have the POST variables, just use them. Yes Nothing. Just leave the action= out completely. Because it leaks sensitive info that is only good to hackers and useless to the user. You turn on error reporting in the local dev php.ini and you also log the errors.
  15. benanamen

    how to select two tables in update query

    There are several issues with the code you posted. $_SERVER['PHP_SELF'] is vulnerable to an XSS Attack. You need to check the REQUEST METHOD, not rely on the name of a button or hidden field in order for the script to work. Do not create variables for nothing Your code is vulnerable to an SQL Injection Attack. Never ever put variables in your query. You need to use Prepared Statements. Do not output internal system errors to the user.
  16. What you describe is exactly what the built-in session functions do. Why is that not acceptable?
  17. It would be much more helpful to tell us exactly what you are doing and why you are trying to do it the way you are.
  18. What is the real problem that you're trying to solve with this?
  19. You are correct. Bitbucket has free private repos.
  20. I knew nothing about this and found the answer in 2 seconds using this web tool called google. https://help.github.com/articles/what-is-my-disk-quota/ https://help.github.com/articles/about-storage-and-bandwidth-usage/
  21. benanamen

    Url Accepted with space

    If you copy paste the URL from the browser you will see that the space is transformed to %20. You should not have the spaces in the first place. Spaces are considered unsafe according to the RFC.
  22. benanamen

    fatal error: call to a member function

    Your curly braces are messed up. If you used a proper IDE you would see these basic problems. There are other issues as well including trying to call a private property. Overall, this is a pretty bad Class. I will let the other members comment further. EDIT: couple more comments: The connection parrameters should not be hard coded in the class. You should not be outputting internal system errors to the users. The querys should be passed, not hard coded nor the HTML, the connection should do just that, with the CRUD operations in another class. The path you are on will require you to always have to edit the class every time you use it. Think "Single Responsibility".
  23. benanamen

    Dont get all information in the mail.

    You are not uploading files so there is no reason to use enctype="multipart/form-data" . Just leave out the enctype and it will use the default.
  24. benanamen

    Dont get all information in the mail.

    Your error checking logic is wrong. If you submit a proper form the POST fields will always be set (except unchecked checkboxes) so they will always be in the POST array and your error checks will never run. You need to trim the POST array, then check for empty. You need to compose the body of the email with the expected variables. Right now the message only contains the message field. Post your form code here while your at it..
  25. benanamen

    classes, interfaces and methods

    An Interface does not "call" anything. I think the manual description is pretty clear what an Interface does. Source: http://php.net/manual/en/language.oop5.interfaces.php
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.