Jump to content

WebStyles

Members
  • Posts

    1,216
  • Joined

  • Last visited

Everything posted by WebStyles

  1. mysql PASSWORD() hashes are 41 bytes (I think). How big is your password field in the database? maybe it's being truncated? I still believe you should be testing this with a simple password first. also remove the password() function and insert 123 in database as password to test, just so you can figure out where the problem is.
  2. you shouldn't even be seeing them. can you post the code please?
  3. when they type into an html text area the returns are sent as \n (most probably), but if you want to display them in html you have to convert them to <br /> echo str_replace("\n","<br />",$string); hope this helps
  4. you can convert all returns with: str_replace("\n\r","whatever_you_want",$string);
  5. there are several things that could be improved in your code. 1. you should really consider using some sort of hash for your passwords, even if it's just md5(). If you want to make it even more secure, add some salt. 2. when you grab the inserted username and password, use trim($_POST['fu_pass']) to clean the input. things you can check: 1. if the problem is when logging in, then the file register.php has nothing to do with it since the login function and form are both in index.php 2. I'm assuming you have inserted a username and password manually into the database for testing purposes. Use a simple password like 123 to test first, just so you can be absolutely sure you're typing it correctly. 3. I'm assuming you do not allow duplicate usernames (?) your login sql statement could be limited to 1. 4. you're grabbing all info from database where user = $user and pass=$pass, so if nothing is returned, how do you know it was a wrong password and not a wrong username? Consider grabbing all info where user=$user and then comparing the password. try these first, and you should find the problem, otherwise, post your results and I'll have another look at it. hope this helps.
  6. it's actually the other way round: if($gold != '0' && $gold != ''){ // load the file because gold exists }else{ echo 'you dont have any gold'; }
  7. replace the if statement with this and try again: if($gold != '0' && $gold != '') // to account for the fact that it may be empty, and also the fact that the number may be a string and not an integer. hope this helps.
  8. ok, well what you need to do is this: 1. create a form (I'm sure you can figure out how to do this simply by googling it) 2. create a combo box (dropdown menu) 3. create the text field 4. create the submit button once you have this, I'll help you connect the combobox to the database to pull out dynamic content.
  9. That's kind of a vague question. Depends on what script does, who has access to it, how servers are set up, what permissions your mysql user/pass has, how apache is configured, how php is configured, how mysql is configured... (etc...) Can you post the code / example of what you wish to make more secure? thanks,
  10. http://www.phpfreaks.com/forums/index.php?topic=317054.0 deals with a similar issue. they used: preg_match_all('/\d\d-[a-z][a-z][a-z]-\d\d\d\d/i', $text) to find a date with the format dd-MON-dddd. Can you figure it out from here?
  11. You can use something like addslashes() before storing in database and stripslashes() when retrieving, allowing them to use more characters. Setting too many restrictions often makes many people give up. if you still want to restrict everything, just to be on the safe side, you can do two things: 1. automatically convert invalid characters to something else: strtr($string, $from, $to); (http://php.net/manual/en/function.strtr.php) or $new = preg_replace(“/[^a-zA-Z0-9\s]/”, “”, $string); 2. just check if they exist and send out an error warning. ctype_alnum($string); (http://php.net/manual/en/function.ctype-alnum.php) hope this helped
  12. oh dear. It's one thing to try and ask for help, it's another to just say want you need and expect someone to do it for you. If you try, I'll help you until the problem is solved, but you have to try. thanks
  13. you can also add formatting: echo number_format($defineProducts[6]['price'],2,".",","); check out http://pt.php.net/manual/en/function.number-format.php for other formatting options.
  14. man, that's kind of funny. I would change hosting account to a decent one.
  15. you may not have a php.ini file yet. on the page I sent you there are also instructions for creating your own php.ini if the host supports custom php.ini.
  16. several things to try here: http://www.bala-krishna.com/how-to-fix-missing-a-temporary-folder-error-in-wordpress/
  17. please show the code you have so far.
  18. try this: $sql="SELECT count(*) as total FROM `staff` WHERE `category` = 'C Category'"; Keep in mind that phpMyAdmin adds LIMIT 0,30 to the end of your queries. hope this helps,
  19. ok, imagine something like this: (I'm making this up as I go along, and not testing it on a server, so there may be typos) getCategoryList($id){ $conn = conn('database'); // database connection, wont go into details here $q = mysql_query("select `id`,`categoryName` from `tableName` where `parentId` = '$id'",$conn); $list = array(); while($r=mysql_fetch_assoc($q)){ $list[$r['id']]=$r['categoryName']; } @mysql_close($conn); return $list; } $list = getCategoryList(0); // first level : MAIN CATEGORIES $subs = getCategoryList(2); // list of sub categories belonging to Main Category nr 2 $subSubs = getCategoryList(6); // list of Sub-Sub-Categories belonging to Sub-Category nr 3 each array is returned as $arrayName[catID]= CatName, so it's easy to grab the next id and pull sub categories out of the database. hope this helps,
  20. simple: a sub-sub-category could have a sub-category id as a parent ID a sub-sub-sub-category would have a sub-sub-category id as parent ID
  21. There are many different ways to do that. Personally I would just use a parentID Variable... something like table structure: id (int primary key), categoryName (varchar), parent (int) then whenever you add a new category, use the parent value to link it to another category. this way you know the top categories are the ones that have 0 in the parent field (i.e. nothing above them) and all the others will be related to each other. This example shows database entries: 1,Category1,0 2,Category2,0 3,Category3,0 then you can add some sub-categories to, lets say, category 2: 4,Sub1,2 5,Sub2,2 6,Sub3,2 this way, when you click on category2, all you need to pass along is the id field, then grab all other categories that have parent = that id. Hope this makes sense
  22. have you tried: $site = 'ssl://'.$domain_name; ? Another forum has this code marked as working, although I did not test it, the difference seems to be the ssl:// part. <?php $SSL_Check = @fsockopen("ssl://www.domain.com/", 443, $errno, $errstr, 30); if (!$SSL_Check) { echo "SSL Not Available"; } else { echo "SSL Available"; fclose($SSL_Check); }?> hope this helps
  23. in that case try my second option: 1. create a folder (lets call it TEMP) 2. change permissions: chmod 777 TEMP 3 add ini_set('upload_tmp_dir','TEMP'); at the top of your script (assuming both script and folder are in same directory, otherwise add full path to folder) Hope this helps.
  24. Do you have access to your php.ini or httpd.conf files? you can set the tmp_upload folder there, or you can use something like: ini_set('upload_tmp_dir','folder name'); make sure the folder you choose or create has the correct permissions. hope this helps.
×
×
  • 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.