-
Need help with PHP
aight got it, so to resolve the problem of case insensitive on login i should make a query with LOWER() to get the unique user insteed of a "Fake use"?
-
Need help with PHP
i tryed and get no result when the lower was outside the substring so i think you meant this way "SELECT * FROM id_users WHERE substring(LOWER(`username`), 1, 1) = '$list' ORDER BY LOWER(username) ASC LIMIT $startIndex, $perPage" it works perfectly but is that a good way to do it whit case-sensitive? i mean, even if user have received an email containing their info
-
Need help with PHP
Yup ok so here's my query to get all members and i have done it to have a limit per page "SELECT * FROM id_users ORDER BY LOWER(username) ASC LIMIT $startIndex, $perPage" This method worked fine to get the full list(binary), but when it comes to show only users who have their name starting with A for exemple: heres the code "SELECT * FROM id_users WHERE substring(`username`, 1, 1) = '$list' ORDER BY LOWER(username) ASC LIMIT $startIndex, $perPage" It only shows those who have a capital "A" as the $_GET['list'] result is "A" and get only lower case if result is "a" ----------- Now when its not set to binary It let me login with ex: "Kenji_-" even if my real username is "kenji_-" so when i get to my profile it should show me the menu to edit my profile and such as im the auth user, but it shows me the menu for a visitor(add bud, send message, etc). Hope you can help me out on this one cause i dont know which one to use and how to fix the error of it. -----------
-
Need help with PHP
so why binary's there if latin1_swedish_ci is case sensitive? does it have its own purpose else then being case sensitive? also, when its not set to binary i can log with the username i got even if i change some letters to uppercase or lowercase :s
-
Need help with PHP
thanks, ive been workin on something with your method and worked perfectly. Now i got a simple question but dont know why it does that and i dont know how can it be resolved. On the page where i can see the members who are registered to the site, they are in order from A to Z but the thing is, that they select and post user who have a capital letter at the beggining of their name and print after all others who doesnt. like the exemple below: AVERY Dan Ninjit SteadyCactus // then lowercase db_ g-enius kiwi thanks again for the tips.
-
Need help with PHP
isnt it possible to do that with cookies? and if yes... how can i do that?
-
Need help with PHP
its even worst... im still lost and its dark oh thats my glasses !!! Seriously im not into it, im just trying to learn this huge language... so i guess this is new for me any ressource would be a good help
-
Need help with PHP
Alright, so ive been trying for few hours now to bring something to my custom build forum. I really dont know how its called but it shows user when theres new post in a topic etc. So i've made a table for each user who are "authenticate" and not only registered to the site. My connection with the create table for each user <?php $host = "localhost"; $user = "username"; $pass = "password"; $data = "database"; $conn = mysql_connect($host, $user, $pass) or die(mysql_error()); mysql_select_db($data, $conn) or die(mysql_error()); $sql9 = "SELECT * FROM id_users WHERE `user_activation` = '1'"; $rs9 = mysql_query($sql9, $conn) or die(mysql_error()); $numofrows9 = mysql_num_rows($rs9); while($row9 = mysql_fetch_array($rs9)){ mysql_query("CREATE TABLE IF NOT EXISTS `id_userforum_".$row9['username']."` ( `userforum_id` int(11) NOT NULL auto_increment, `userforum_viewed` varchar(255) NOT NULL default '0', `userforum_parentid` varchar(255) NOT NULL default '', PRIMARY KEY (`userforum_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5"); The above part work fine as i can see all table for each user in the database This part is where nothin happen. seems like theres nothing there. No rows insert, or updated $userforum = "SELECT * FROM `id_userforum_".$row9['username']."` WHERE `userforum_parentid` = '".$id."'"; $userresult = mysql_query($userforum) OR die(mysql_error()); if (mysql_num_rows($userresult) >= 1) { list($mytotal) = mysql_fetch_array($userresult); if ($mytotal != 0) { mysql_query("UPDATE `id_userforum_".$row9['username']."` SET `userforum_viewed`='0' WHERE `userforum_parentid`='$id' LIMIT 1") or die('Cannot update row!'); } else { mysql_query("INSERT INTO id_userforum_".$row9['username']."(userforum_viewed,userforum_parentid) values('0', '$id')") or die('Cannot insert row!'); } } } ?> Does anyone see what i might did wrong or have any other way to do it
-
PHP Login...
edited my post and also i tryed to login as admin but says there was a field blank. So im wondering, what should have been a secure login and how could i make it work so eacxh time you press login, it login and not just return you to the home page till you finaly get logged in after multiple times tryin.
-
PHP Login...
Alright, so i got a login script done since quite a while now and i have trouble with it, seems like sometimes the user/pass isnt sent and just get you back to the main page like it should do but without being logged in. So heres the code, if someone can help me out on this... <?php if (isset($_GET['sec'])) { if ($_GET['sec'] == 'logout') { setcookie("username",'',time()-(60*60*24*365), "/" ); } } //if session ID matches IP address if ( $_SESSION['ip'] != $_SERVER['REMOTE_ADDR']) { session_regenerate_id(); $_SESSION = array(); } //if not logged in if ( !isset($_SESSION['username']) ) { //not logged in and is attempting to if ($_POST['Register']) { header("Location: index.php?register=1"); } if ($_POST['Login']) { $user = ($_POST['username']); $pass = ($_POST['password']); $ip = ($_POST['ip']); if (!$user | !$pass) { echo ''; } else { $pass = md5($pass); $query = "SELECT * FROM `id_users` WHERE username = '$user' AND password = '$pass' AND user_activation = '1' LIMIT 1"; $query = mysql_query($query); if (mysql_num_rows($query) == 1) { $_SESSION['username'] = $user; mysql_query("UPDATE `id_users` SET `user_session` = 1, `user_ip` = '{$_SERVER['REMOTE_ADDR']}' WHERE `username` = '{$_SESSION['username']}'"); $_SESSION['ip'] = $_SERVER['REMOTE_ADDR']; while ($row = mysql_fetch_assoc($query)) { $_SESSION['user_level_id'] = $row['user_level_id']; } /* setcookie("username", $_SESSION['username'], mktime()+(86400*30*90), "/"); setcookie("lastsave", time(), mktime()+(86400*30*90), "/"); */ header("Location: index.php"); } elseif($row['user_activation'] == '') { print''; } else { print ''; } } } else { print ''; } //already logged in } elseif (($_SESSION['user_level_id']) == '1' && $row['user_activation'] == '1') { print ''; if (isset ($_POST['logout']) ) { session_destroy(); setcookie("username",'',time()-(60*60*24*365) , "/" ); } if (isset ($_POST['admin_panel']) ) { header("Location: index.php?sec=admin"); } } elseif(($_SESSION['user_level_id']) >= 2) { print''; if (isset ($_POST['logout']) ) { session_destroy(); setcookie("username",'',time()-(60*60*24*365) , "/" ); } print_r($_COOKIE); } ?>
-
Portfolio redesign
Well, the second would be the besst of the 2 site but i have to say that i didnt really saw improvement in your graphics skills.
-
Website Browser Problems
the real question would be, do you have some php in your website coding...
-
Where's the best place to get wallpapers from?
well, sometimes when im tired to see the same wallpaper... i open photoshop and create something till i like the result then set it on
-
Fooooooottttbbbballllll !
Both are real sport but they play it differently, but yeah... canada still made the hockey and football... i mean Ice Hockey and american football
-
Imitating Iframe or Finding Dynamic Heigh Iframe Solution
i can see that people still use that explorer browser(No offence)