-
Posts
557 -
Joined
-
Last visited
Never
Everything posted by unidox
-
I agree with Blade, allowing users to imput code can seriously effect the security of other profile pages.
-
Or you can just do if less than.
-
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.
-
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; } }
-
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?
-
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?
-
You can also use the header() function, but make sure you have ob_start(); on top of page.
-
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"; } ?>
-
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"; } ?>
-
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?
-
Ok, is there anyway I can update one of those arrays? Thanks
-
But the thing is I am adding a user from adduser.php and need to save the file users.php.
-
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?
-
No, the code I have was pasted, just changed the passwords and usernames.
-
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
-
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.
-
you need to echo it.
-
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."; }
-
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
-
Crayon Violent, your code works, but if there isint all 5, it doesnt close the row. How do I do that?
-
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
-
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."); ?>
-
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