-
Posts
2,965 -
Joined
-
Last visited
Everything posted by mikesta707
-
Need to upload data not files. Help with script?
mikesta707 replied to Chrisj's topic in PHP Coding Help
data not files? does that mean you need to upload data that isn't a file? have you looked into a database? please explain your problem better -
<?php if($_SESSION['username']) { include('menu.php'); echo "Welcome, ".$_SESSION['username']; } else { ?> <form action="login.php" method="post"> <p align="right"><label><b>Username:</b> <input type="text" name="username" size="10" value="<? echo $username; ?>"></label> <label><b>Password:</b> <input type="password" name="password" size="10" value=""></label> <input type="submit" value="Login!"> </p> </form> <?php } ?> try that? [/code]
-
Just tested your code and it works perfectly on my server
-
$totrow = 0 while($cr2=mysql_fetch_array($res2)){ $totrow+=$cr2["total"]; ///the $totrow will echo below 5 time each price in database 5.67 which the total should be 28.35 // echo $cr2["total"]; } echo "total: $totrow";
-
[SOLVED] Looking for Some Clarification Regarding My Php Files
mikesta707 replied to Modernvox's topic in PHP Coding Help
are the include paths in your php pages absolute or relative? -
just remove any html that is in the included page. Having multiple head and html tags in the same page is not valid HTML anyways. Unless you absolutely need the html. if you post the page though, I can give a more definite answer
-
I don't see why not.
-
you can append more variables to the url with the & symbol. IE index.php?id=5&othervar=othervalue
-
replace the base64_encoded version of unset with the base64_encoded version of hello. $file = file_get_contents('code.php'); $file = str_replace('<?php', '', $file); $file = str_replace('<?', '', $file); $file = str_replace('?>', '', $file); $file = str_replace(base64_encode('unset'), base64_encode('hello'), $file);
-
create a loop of md5 until there are now md5's to make left
mikesta707 replied to Jnerocorp's topic in PHP Coding Help
theoretically function createAll($length = 6){ $used = array(); $chars = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','R','S','T','U','V','W', 'X','Y','Z','1','2','3','4','5','6','7','8','9','0'); $x = 0; while ($x < pow(count($chars), $length)){ $word = ""; for ($i = 0; $i < length; $i++){ $word .= $chars[rand(0, count(chars))]; } if (!in_array($word, $used)){ $used[] = $word; $x++; } } print_r($used); } createAll(); that might work. But that exceeded the max execution time of 60 seconds on my local host. but like cags said for just 6 character strings (and that is ONLY 6 character strings, not 5 character or below) that you are going to have over 300 million different words. And then you have to md5 them? the function I just wrote probably won't be able to execute unless you let your server run for a while. are you trying to make a rainbow table or something? -
that is because this base64_decode('ZWNobyAidW5zZXQiOw==') which results in unset isn't executed when you call file_get_contents. the variable file looks like $file = "eval(base64_decode('ZWNobyAidW5zZXQiOw=='));";
-
post the error? assuming your $_POST['box'] array isn't infintely long that for loop wouldn't cause an infinite loop
-
$savelocation="./upload/".$horseid."test.jpg"; ?
-
what does the file variable look like?
-
Attitudes toward foreign programmers
mikesta707 replied to foreignprogrammer's topic in Miscellaneous
ahh makes sense. I am a student so I do probably average around 5-10 dollars a day on food, and have some 12 hour days (2 jobs + full time school) But i have vacations and weekends so its all gravy in the end I suppose -
I'm a real man, so I play PC games. I still don't understand how you can play a shooter without a mouse
-
Detecting "hack" attempts is a pretty broad topic, but for your specific case (IE detecting multiple login attempts) you could have a session store how many times they fail to log in (or a cookie if you want, but it would be mroe secure with a session) You could also use abazoskibs idea of storing the ip address.
-
what should it be? that is exactly what your code should be doing. $string = $characters[mt_rand(0, count($characters))]; that will store a single character (a random one) into the $string variable. what do you want your code to do?
-
Attitudes toward foreign programmers
mikesta707 replied to foreignprogrammer's topic in Miscellaneous
Pretty much what I do are you a college student? -
i think here $string = $characters[mt_rand(0, $characters)]; you want it to be $string = $characters[mt_rand(0, count($characters))]; right now that basically looks like $string = $characters[mt_rand(0,"!@$%^&*()-==_[]\{}|;':,./<>?0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" )]; which doesn't really make sense
-
maybe the query shouldn't return the results in descending order
-
Attitudes toward foreign programmers
mikesta707 replied to foreignprogrammer's topic in Miscellaneous
lol 5 dollars a day to eat. and 12 hours a week at 30 days per month? thats just absurd. -
oh sorry, yeah $string = str_replace("\n", '', $string); forgot about that