Jump to content

rblake81

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Everything posted by rblake81

  1. Hi jmr3460, You shouldn't have any errors showing up. You can fix the undefined indexes by checking to see that the $_POST data has actually been set before you assign it to your variables. $fname = isset($_POST['fname']) ? $_POST['fname'] : ""; $lname = isset($_POST['lname']) ? $_POST['lname'] : ""; $address = isset($_POST['address']) ? $_POST['address'] : ""; and repeat for the rest of them.. The code is checking to see if the variable has been set (http://nz2.php.net/isset). If it has then it assigns the $_POST data to the variable. If it hasn't been set it will assign it an empty string. This will fix your undefined index errors. Cheers
  2. Hi jmr3460, In answer to your section question, yes you can upload files like images and data files to a MYSQL database, using the BLOB field type, however, for improved performance, it is usually better to upload files to the server and reference them in the database (ie. put the path to the file in the database and use that to find the file that you uploaded to the server). And yes you can use global variables but it's not a good idea. Here's some reading: http://blog.case.edu/gps10/2006/07/22/why_global_variables_in_php_is_bad_programming_practice http://c2.com/cgi/wiki?GlobalVariablesAreBad Cheers
  3. woops ignore my previous comment....just realised i was completely wrong
  4. Hi all, If my web hosting provider is running PHP through CGI will my .htaccess file still be able to Rewrite? For example will this still work : RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php [L] I understand that I wont be able to place PHP directives in the .htaccess file, but I'd still like to be able to redirect. Any idea?
  5. Hi Wiernusz, You need to check that the $_POST data are actually assigned values before you use them in that fashion. $value1 = isset($_POST['val1']) ? $_POST['val1'] : ""; $value2 = isset($_POST['val2']) ? $_POST['val2'] : ""; etc.... Then you can write your code: if((empty($value1)) || (empty($value2))) { etc.. }
  6. Typically after the user has submitted their login credentials you would apply the same hashing technique to the password supplied and then match it against the one stored in the database.
×
×
  • Create New...

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.