-
Posts
2,134 -
Joined
-
Last visited
-
Days Won
42
Everything posted by benanamen
-
The answer is right in the error message: Permission denied You need to set the correct permissions on the directory you are trying to make directory's in for the user trying to make the directory.
-
No, it is not ok, Delete that whole function and read the post from Jaques1 here http://forums.phpfreaks.com/topic/298729-forgotten-password/?hl=%2Bopenssl_random_pseudo_bytes&do=findComment&comment=1523846 about http://php.net/manual/en/function.openssl-random-pseudo-bytes.php AND http://php.net/manual/en/function.mcrypt-create-iv.php
-
Look into Triggers By definition, a trigger or database trigger is a stored program that is executed automatically to respond to a specific event associated with table e.g., insert, update or delete.
-
You are using deprecated MySQL code. You need to use PDO with prepared statements.
-
Show you code for the key generation. This is where one of your problems is. @Jaques1 has posted good information on how this should be done so I am not going to repeat it.
-
Apparently whatever I thought I had remembered, I didn't remember right or was just plain wrong about what I thought I knew about what I forgot that I just remembered.
-
@Jaques1, good one.
-
Yes, but with the username AND password hacked you are logged in. You are not going to be able to login with just the username only. Test it and see. Dont forget, that was from way back in olden days like php3
-
Skip first line on import csv using php mysqli
benanamen replied to samuel_lopez's topic in PHP Coding Help
* Got locked out of previous post. If your csv ALWAYS has a header row you can use the code I just posted. To do it using file: $file = file("Your_File.csv"); array_shift($file); foreach($file as $f){ echo $f."<br />"; } -
Skip first line on import csv using php mysqli
benanamen replied to samuel_lopez's topic in PHP Coding Help
$row = 1; if (($handle = fopen("Your_File.csv", "r")) !== FALSE) { fgetcsv($handle, 10000, ","); while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { $num = count($data); $row++; for ($c=0; $c < $num; $c++) { echo $data[$c] . "<br />\n"; } } fclose($handle); } -
You will find the answer here: http://www.w3schools.com/php/php_arrays.asp
-
Is this homework? You only need the image name. foreach is your friend here.
-
What have you tried? We are not going to write it for you.
-
Taking user input from form to populate an array
benanamen replied to morrism35's topic in PHP Coding Help
Here ya go. This is not accounting for 12 names. You would just need to count the elements in the array before adding a new one. <?php session_start(); if ($_POST) { $_SESSION['signs'][] = $_POST['sign']; } if (isset($_SESSION['signs'])) { echo "Number of Elements: " . count($_SESSION['signs']); sort($_SESSION['signs']); echo "<pre>"; print_r($_SESSION['signs']); echo "</pre>"; } ?> <form method='post'> Type in a zodiac sign<input type='text' name='sign'> <input type='submit' name='submit' value='submit'> </form> -
Taking user input from form to populate an array
benanamen replied to morrism35's topic in PHP Coding Help
Not really sure what your doing but this will put the form data into an array. If you are wanting to save the array and keep adding to it you would need to put the data in a session. <?php if($_POST){ $signs[]=$_POST['sign']; echo "<pre>"; print_r($signs); echo "</pre>"; } ?> <form method='post'> Type in a zodiac sign<input type='text' name='sign'> <input type='submit' name='submit' value='submit'> </form> -
Recommended SQL datatype for BCRYPT hash
benanamen replied to NotionCommotion's topic in PHP Coding Help
@Jacques1, I was just having this very discussion with another programmer and your post came up in a search trying to find an answer to the correct column type for password storage. An internet search does not provide any definitive answers as to what and why. Your post here is the only one I found that gives any reasons. Can you expound on what you already said and is there any definitive sources as to the correct column type? As much as I would love to just say, "Beacuse Jacques1 says so", I need something more concrete and so far I cannot find it. -
You cant use $stmt Try this $data_chegada[] = array_merge($datatmp, array('num'=>$ixx));
-
There is nothing Mysqli about your code.
-
FYI: Your not "Stuck" with old Apache and you don't have to upgrade the OS to install it. All topics for a different thread. I would suggest you do some research on what to do before just starting a thread on it. For development you could always set up virtual servers on your computer and run anything anyway you want it. There is VMware and many other such software's to do it. Some free, some paid. I have just about every OS there is on my Windows 7 machine and even several OS versions of some of them.
-
Its not that hard for a hacker to know that your first name field is either fname, FirstName, firstName, or first_name. But do share. What would you name your first name form input and what would you name the db column for the same? Purposely naming one different than the other is really just a form of security by obscurity and we both know that although it is better than nothing, it is a worthless attempt at security.
-
Your problem is EXACTLY what I just told you about changing names around! Your values are :fname, :lname but you are binding :firstname :lastname You have just proven my point! $stmt = $db->prepare("INSERT INTO guest(fname, lname, email)VALUES(:fname, :lname, :email)"); $stmt->bindValue(':firstname', 'johnny'); $stmt->bindValue(':lastname', 'bob'); $stmt->bindValue(':email', 'jb@coit.me'); $stmt->execute(); @Barand, you didnt notice this (His last example. He keeps switching stuff around. Hard to keep up.).
-
Regarding your changing names around, firstname=dbcolumn fnname, lastname=dbcolumn lname, Just dont! It is a bad practice. if your DB column is fname then name your form field fname. Remember KISS - Keep It Simple Stupid And abandoning the 'age' issue, you should have understood what you were STILL doing wrong even after the correct answer was given to you instead of just walking away from it. You would have learned something.