Jump to content

php?

Members
  • Posts

    252
  • Joined

  • Last visited

    Never

Everything posted by php?

  1. I believe I asked people to look at this who helped not criticize. In other words I never asked for your help, nor your comments.
  2. Could someone who actually wants to help and not criticize read this?
  3. I never said that I was going to remove anything.
  4. Doesn't list any errors in Notepad++ eiter
  5. Last time I posted a lot combined someone said I should seperate them so people don't get bored... just following suggestions. Besides it's not very appealing to read through many old comments to find out that that particular problem was solved.
  6. Are there any special text editors for like php? All I have is notepad and i'm curious.
  7. Thorpe this doesn't really have anything to do with the seperation of the tables. Yes I could do what you suggested before but it wouldn't solve this. In fact I would have to do almost the same thing. And every topic that ive posted have been solved and were different issues. I'm just adding different parts into the script.
  8. mhm Heres my set up... CREATE TABLE `pending` ( `ID` int(11) NOT NULL auto_increment, `Username` varchar(255) NOT NULL, `Password` varchar(255) NOT NULL, `Email` varchar(255) NOT NULL, `Active` int(11) NOT NULL default '0', `Level_access` int(11) NOT NULL default '2', PRIMARY KEY (`ID`), UNIQUE KEY `Username` (`Username`), UNIQUE KEY `Email` (`Email`) ) ENGINE=MyISAM;
  9. It seems like it should update... and there are no errors, so hmm
  10. Okay so according to the code below when I press accept it should update the field "Active" to 1 and then send it to a different table and delete it from the old table. Well it won't update the value of active to 1. It sends and everything, but the Active stays to 0. No errors are given. foreach($_POST['row_s'] as $key => $val){ $info = mysql_fetch_array(mysql_query("SELECT * FROM pending WHERE ID='".$key."'")); if($val == 1) { echo "{$info['Username']} is being accepted..."; [b]$update = mysql_query("UPDATE pending SET Active=1 WHERE ID='".$key."'") or die(mysql_error());[/b] mysql_query("INSERT INTO accepted SET Username='".$info['Username']."', Password='".$info['Password']."', Email='".$info['Email']."'"); // Moves user to new table echo "done <br>\n";
  11. Oh yeh hehe... thanks so much M8
  12. Wait.. one last little error. When you click accept test is being accepted...done test is being deleted...done it still moves it to the right place.. but it just displays the deleted part for some reason
  13. Oh wait no... for got to edit a part!!! IT works!!!!!! thanks northern
  14. t is being deleted...done 26 is being deleted...done Almost.. but now it displays 26 still =/
  15. Nevermind i got it... forgot a semicolon
  16. <?php function checkLogin($levels) { if(!$_SESSION['logged_in']) { $access = FALSE; } else { $kt = split(' ', $levels); $query = mysql_query('SELECT Level_access FROM users WHERE ID = "'.mysql_real_escape_string($_SESSION['user_id']).'"') or die(mysql_error().'<br />Query:'.$sql); $row = mysql_fetch_assoc($query); $access = FALSE; while(list($key,$val)=each($kt)) { if($val==$row['Level_access']) {//if the user level matches one of the allowed levels $access = TRUE; } } } if($access==FALSE) { header("Location: login.php"); } else { //do nothing: continue } } function valid_email($str) { return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE; } function checkUnique($field, $compared) { $query = mysql_query("SELECT `".mysql_real_escape_string($field)."` FROM `users` WHERE `".mysql_real_escape_string($field)."` = '".mysql_real_escape_string($compared)."'"); if(mysql_num_rows($query)==0) { return TRUE; } else { return FALSE; } } function numeric($str) { return ( ! ereg("^[0-9\.]+$", $str)) ? FALSE : TRUE; } function alpha_numeric($str) { return ( ! preg_match("/^([-a-z0-9])+$/i", $str)) ? FALSE : TRUE; } function random_string($type = 'alnum', $len = { switch($type) { case 'alnum' : case 'numeric' : case 'nozero' : switch ($type) { case 'alnum' : $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; break; case 'numeric' : $pool = '0123456789'; break; case 'nozero' : $pool = '123456789'; break; } $str = ''; for ($i=0; $i < $len; $i++) { $str .= substr($pool, mt_rand(0, strlen($pool) -1), 1); } return $str; break; case 'unique' : return md5(uniqid(mt_rand())); break; } } ?>
  17. php?

    Image Editor

    is utorrent a download manager?
  18. php?

    Image Editor

    Can u give me the download for the gimp without GTK,.... cuz i already downloaded gtk by itself
  19. php?

    Image Editor

    Omfg... 1 hour 20 minutes download time... and if my dial up disconnects anytime between i have to start over. Any smaller downloads of it..?
  20. *sigh* Unless i'm setting the error message up wrong..
  21. php?

    Image Editor

    Where do i download gimp at.. i go to gimp.org.. click on the ftp for 2.4.3 and then it comes up with a ton of stupid files and junk
  22. php?

    Image Editor

    Okay that one was shorter.. only 30 mins
  23. Thanks psy, that problem is solved And revraz adding the error to that page does nothing different..
  24. Fixed that as well but now........ Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\mylogin\functions.php on line 12 Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\mylogin\functions.php:12) in C:\xampp\htdocs\mylogin\functions.php on line 26 Functions.php <?php function checkLogin($levels) { if(!$_SESSION['logged_in']) { $access = FALSE; } else { $kt = split(' ', $levels); $query = mysql_query('SELECT Level_access FROM pending WHERE ID = "'.mysql_real_escape_string($_SESSION['user_id']).'"'); $row = mysql_fetch_assoc($query); $access = FALSE; while(list($key,$val)=each($kt)) { if($val==$row['Level_access']) {//if the user level matches one of the allowed levels $access = TRUE; } } } if($access==FALSE) { header("Location: login.php"); } else { //do nothing: continue } } function checkUnique($field, $compared) { $query = mysql_query("SELECT `".mysql_real_escape_string($field)."` FROM `pending` WHERE `".mysql_real_escape_string($field)."` = '".mysql_real_escape_string($compared)."'"); if(mysql_num_rows($query)==0) { return TRUE; } else { return FALSE; } } function numeric($str) { return ( ! ereg("^[0-9\.]+$", $str)) ? FALSE : TRUE; } function alpha_numeric($str) { return ( ! preg_match("/^([-a-z0-9])+$/i", $str)) ? FALSE : TRUE; } function random_string($type = 'alnum', $len = { switch($type) { case 'alnum' : case 'numeric' : case 'nozero' : switch ($type) { case 'alnum' : $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; break; case 'numeric' : $pool = '0123456789'; break; case 'nozero' : $pool = '123456789'; break; } $str = ''; for ($i=0; $i < $len; $i++) { $str .= substr($pool, mt_rand(0, strlen($pool) -1), 1); } return $str; break; case 'unique' : return md5(uniqid(mt_rand())); break; } } ?>
×
×
  • 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.