Jump to content

unidox

Members
  • Posts

    557
  • Joined

  • Last visited

    Never

Everything posted by unidox

  1. unidox

    Templating

    I agree with Blade, allowing users to imput code can seriously effect the security of other profile pages.
  2. Or you can just do if less than.
  3. You are correct, as a safe practice I always stress to enclose most strings with ` due to some reserved words such as group. `group` would fix it.
  4. Just wondering if this is to simple? Can this easily be bypassed? How can I improve it? Thanks function captcha() { $rand = rand(1,15); $rand2 = rand(1,15); $math = array("+", "-"); if ($rand < $rand2) { $math = "+"; } else { $math = array_rand($math); } if ($math == "+") { $_SESSION['captcha'] = $rand + $rand2; return $rand . " " . $math . " " . $rand2; } else { $_SESSION['captcha'] = $rand - $rand2; return $rand . " " . $math . " " . $rand2; } }
  5. Can I ask what smarty is?
  6. Lets say I have an .htm page called page.htm. Inside index.php is this: $template = file_get_contents("page.htm"); $template = str_replace("<{CONTENT}>",include("content.php"),$template); Would that work, or how else would I do it?
  7. This is my code: $i = 0; $allow = "abcdefghijkmnpqrstuvwxyz23456789"; while ($i < 18) { // Generates 8 Digit Activation Number srand((double)microtime()*1000000); for($i=0; $i<24; $i++) { $activation .= $allow[rand()%strlen($allow)]; } echo $activation . "<br />"; $i++; } What I am trying to do it output 18 lines of activation codes. But its only outputting one line. How do I fix this?
  8. You can also use the header() function, but make sure you have ob_start(); on top of page.
  9. unidox

    Why?

    I tried this but still not working .... <?php $codes_used = array( array("Unidox", "0"), array("Ro0t", "0"), //<newuser> ); function find_user($user) { $out = false; $i = 0; foreach ($codes_used as $cud) { if ($user == $cud[0]) { $out = true; } $i++; } return $out; } if (find_user("Unidox")) { echo "True"; } else { echo "False"; } ?>
  10. unidox

    Why?

    I am trying to get this to work, but its not... Whats wrong? <?php $codes_used = array( array("Unidox", "0"), array("Ro0t", "0"), //<newuser> ); function find_user($user) { $out = false; $cnt = count($codes_used); $i = 0; while ($i < $cnt) { if ($user == $codes_used[$i][0]) { $out = true; } $i++; } return $out; } if (find_user("Unidox")) { echo "True"; } else { echo "False"; } ?>
  11. Well I just want to change 1 digit from 1 array, but other arrays might have a 1 also, so is there anyway to edit a line as a whole?
  12. Ok, is there anyway I can update one of those arrays? Thanks
  13. But the thing is I am adding a user from adduser.php and need to save the file users.php.
  14. you still dont get it lol, here is my file. <?php // Code here. $GLOBALS["users"]=array( array("admin","password",1,2,1,"",7,1), array("steve","password",1,2,1,"",7,1), ); ?> That code works, what I am trying to do is make a form that adds something like this: <?php // Code here. $GLOBALS["users"]=array( array("admin","password",1,2,1,"",7,1), array("steve","password",1,2,1,"",7,1), array("martin","password",1,2,1,"",7,1), ); ?> Just add another array. Get it?
  15. No, the code I have was pasted, just changed the passwords and usernames.
  16. I have a file users.php and what I am trying to do is lets say I have the following code: <?php // some code here; // users array $GLOBALS["users"]=array( array("admin","password",1,1,1,"2",7,1), array("steve","password",1,1,1,"2",7,1), ); ?> what I am trying to do is make a script that will add the array to the array, without deleting the code on top. How would I do that? Thanks
  17. unidox

    Faster?

    Well it is for a license script. It checks license.php on a remote server with a license key and server info using get, and then license.php outputs a 1 for yes, 0 for no.
  18. Well I am going to use elseif, like.... if (($_GET['s'] == 'news') && (in_array("news", $array))) { do something } elseif (($_GET['s'] == 'threads') && (in_array("news", $array))) { do something } else { echo "Sorry, this action was not able to be performed."; } I want to add an elseif ($error) { echo "You do not have access."; }
  19. I have this if statement: if (($_GET['s'] == 'news') && (in_array("news", $array))) { is there anyway that if its not in the array, I can make a var like $error. ? Thanks
  20. Crayon Violent, your code works, but if there isint all 5, it doesnt close the row. How do I do that?
  21. I am having some trouble. I am trying to make a gallery that shows the images 5 acrosse, and unlimited down. So like: Image Image Image Image Image Image Image Image Image Image Image Image Like that. But I dont know how to use a while loop, the only way I use with while displays only 1 column. How do I do this? Thanks
  22. Try this: <?php require('connect.php'); ?><?php $ipaddress=$_SERVER['REMOTE_ADDR']; $thedate=date("m:d:y"); $thetime=date("H:i:s"); mysql_query("INSERT INTO `intowar1` (ipaddress, thedate, name, thename) VALUES ('$ipaddress', '$thedate','" . mysql_real_escape_string($_GET['name']) . "', '$thetime')") or die("Theres an error. Please try again."); ?>
  23. I have a string like http://site.com and I want to search the string for http://, and I was wondering how I would go about doing that. Thanks
×
×
  • 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.