Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. try echoing the $sql 's personally i don't see the problem unless your getting errors.. or posting something weird
  2. echo chigley that will work.. ALSO read the rules and use code tags
  3. happens to us all not ad bad as when i tested a script on one site while uploading it to another..
  4. try $batch = (int)$_GET['batch ']; $aSQL = "SELECT tableB.groupname,tableB.values,tableB.result FROM tableA, tableB WHERE (tableA.groupname= tableB.groupname) AND tableB.batch = $batch"; i assume the get is batch and the value will be a number ie ?batch=123
  5. i don't see the reason for the encrypted part!! ??? it will take alittle longer will little (if anyone) benefit! i understand the idea but not the reason.. one way protection is designed for this encryption isn't.. you could use 2 salts which can be random and stored in the database with the username etc.. ie md5(md5("pass"."salt1").md5("pass"."salt2")) but at some point its going to be overkill also always remember the weakest point in the protection is never at the frontdoor, its normally the backdoor/window! creating a over complex login system is usless if you don't maintain the security once they have logged inn..
  6. i tested the code i sent.. it works fine.. the problem is in something not posted
  7. <? $test = 005; print "<SCRIPT LANGUAGE=\"javascript\"><!--\n"; print "function new_window()\n"; //<---missed the ; print " {\n"; print " OpenWindow=window.open(\"../test/test_image.php?pump=".$test."\", \"newwin\", \"height=300, width=400,toolbar=no,scrollbars=\"+scroll+\",menubar=no\");\n"; print " } \n"; print "//--></SCRIPT>\n"; ?> option #2 <?php $test = 005; ?> <SCRIPT LANGUAGE="javascript"> <!-- function new_window() OpenWindow=window.open("../test/test_image.php?pump=<?php echo $test ?>", "newwin", "height=300, width=400,toolbar=no,scrollbars=scroll,menubar=no"); } //--> </SCRIPT>
  8. you can NOT "decrypt" MD5.. you can have a database with all the decrypted values.. this is NOT decrypting.. also the "lookup" will fail with a simple change ie $password = "Hello"; $hash = md5($password."1"); //thats a very time change as for password you should use MD5 + salt (like the appending of the 1) instead of decrypting it you get the password the user has entered (to login) and MD5 it and compare that to the MD5 password in the database EDIT: as a side note sha1 is more secure but slightly slower
  9. SELECT <column_name> FROM <Table1>, <Table2> WHERE (Table1.column = Table2.column) ie SELECT tableB.groupname,tableB.values,tableB.result FROM tableA, tableB WHERE (tableA.groupname= tableB.groupname)
  10. @DeadEvil, please read the question first!! as for a Fuzzy Matching RegEx, i am not 100% sure..
  11. Try this.. seams to work fine <?php $IPs = "192.168.1.1,192.168.1.2,192.168.1.3"; //$IPs = "192.168.1.1"; preg_match_all('/\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/', $IPs, $result, PREG_PATTERN_ORDER); $result = $result[0]; //print_r($result); foreach($result as $IP) { echo "$IP<br />"; } ?>
  12. add echo "Found:".mysql_num_rows($query3); before the while($row1 = mysql_fetch_array($query3, MYSQL_ASSOC)){ just to check its finding records
  13. what about if ( mysql_fetch_array($techMatch) === true) { $tNum = $techMatch['t_num']; } else # new tech so insert new
  14. humm try <?php session_start(); $errors =$_SESSION['errors']; //var_dump($errors); //uncomment if doesn't work and post the output if(count($errors) > 0) { foreach($errors as $errorlog) { echo "$errorlog<br>"; } } ?>
  15. in that case the problem isn't their.. the code isn't parsing that far.. check the if statements or post more code
  16. Humm OK try change while($row1 = mysql_fetch_array($query3)){ to while($row1 = mysql_fetch_array($query3, MYSQL_ASSOC)){ if this fails try die("linetest"); //check to see if it gets here while($row1 = mysql_fetch_array($query3, MYSQL_ASSOC)){
  17. can you post the echoed SQL statement
  18. yes if you MD5 the same file your get the same HASH.
  19. Use Flash as a player..
  20. Yep.. but if you do need to declare twice then think if you need all the extended classes, of course you can have an extension of an extension of an extension of an extension etc so you can declare in the middle.. its all about planning ahead! EDIT: if this topic is closed please click Topic Solved (bottom left)
  21. OK change <?php session_start(); echo "<pre>"; print_r($_SESSION['errors']); ?> to <?php session_start(); foreach ($_SESSION['errors'] as $errorlog) { echo "$errorlog<br>"; } ?>
  22. I had basically the same question (see link) and user:448191's reply was very cool but simply put if $parent took up (100kb) and $child took (excluding the extension 50kb) 150kb, then if you declare them both it will use up 250kb BUT if you needed 2 instance but only the core ($parent) for 1 instance then you could have 1 parent and 1 child.. i hope that makes sense! OK heads hurting now!
  23. <?php session_start(); $host="localhost"; $username="username"; $password="password"; $db_name="wezzsmusic"; $tbl_name="wmusers"; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $errors = array(); $_SESSION['errors']= array(); //ADDED if (empty($_POST['username'])) { $errors[] = 'Please supply a username'; } if (empty($_POST['password']) || strlen($_POST['password']) < 6) { $errors[] = 'You entered an invalid password'; } if (empty($_POST['email']) || strpos($_POST['email'], '@') === false) { $errors[] = 'You entered an invalid email'; } $check = "SELECT * FROM wmusers where username='".$_POST['username']."' LIMIT 1"; $checkresult = mysql_query($check); if (mysql_num_rows($checkresult) != 0) { $errors[] = 'You entered a taken username'; } $check2 = "SELECT * FROM wmusers where email='".$_POST['email']."' LIMIT 1"; $checkresult2 = mysql_query($check2); if (mysql_num_rows($checkresult2) != 0) { $errors[] = 'You entered a taken email'; } $_SESSION['errors'] = $errors; //ADDED if (count($errors)) { header("Location: register.php"); exit; } else { $sql = "INSERT INTO wmusers VALUES ('0', '".$_POST['username']."', '".$_POST['password']."', '".$_POST['email']."', '0')"; mysql_query($sql) or die ("Couldn't execute $sql: " . mysql_error()); } ?> in register.php <?php session_start(); echo "<pre>"; print_r($_SESSION['errors']); ?> **UNTESTED
  24. Tried and tested code Note: the parent to myparent etc <?php class myparent { var $config = ""; function initiate() { $this->config = "hello world"; } } class mychild extends myparent { function display() { $content = $this->config; return $content; } } //$parent = new parent; //removed $child = new mychild; //$parent->initiate(); //removed $child->initiate(); $content = $child->display(); echo $content; ?>
  25. class child extends parent tells the system to include the parent see and old example of mine extends
×
×
  • 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.