Jump to content

Monkuar

Members
  • Posts

    987
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Monkuar

  1. Lol, I hate editing in putty, why not just edit the files through ssh ftp? can use notepad++ or whatever, something similiar and easier to read, command prompt editing is insanely OP.
  2. and then state you will use which will result in values < 1000 I think kicken correctly deduced that what you REALLY want is a number between 0 and 9999 which is always padded to four digits. So, the number 41 will be 0041. If that is what you want, then the solution he provided is what you should probably use. The more time you take into specifying your requirements as accurately and completely as possible will greatly increase your chances of getting the correct answer the first time. how would .rand(0,9).''.rand(0,9).''.rand(0,9).''.rand(0,9).' result in a number less than 1000? I thought if becomes 0, it will just show 0, so what if all were 0 it would show 0000 right? or maybe if 1 became 5 and all became zero, it would do 0050 ? or would I need to set them all to a different variable and do it like this $var1 = rand(0,9); $var2 = rand(0,9); $var3 = rand(0,9); $var4 = rand(0,9); and then do $var1.$var2.$var3.$var4 right? numbers can only be 0001 to 9999 nothing more or less Edit: Actually I just am using this: $rand1 = rand(0,9); $rand2 = rand(0,9); $rand3 = rand(0,9); $rand4 = rand(0,9); $db->query('UPDATE daily4 set start_time = '.time().', correct_number = "'.$rand1.''.$rand2.''.$rand3.''.$rand4.'"'); works fine
  3. Hey, I used it but it doesn't seem to show. Code: if (str_in_array('1', $tickets)){ echo "Yes I found a match"; } Var_dump of $tickets (getting from a while loop) array 0 => string '1265' (length=4) 1 => string '1315' (length=4) 2 => string '1979' (length=4) 3 => string '2361' (length=4) 4 => string '2621' (length=4) 5 => string '3199' (length=4) 6 => string '3214' (length=4) 7 => string '3224' (length=4) 8 => string '3671' (length=4) 9 => string '3825' (length=4) 10 => string '3846' (length=4) 11 => string '4375' (length=4) 12 => string '4782' (length=4) 13 => string '5188' (length=4) 14 => string '5643' (length=4) 15 => string '5703' (length=4) 16 => string '5762' (length=4) 17 => string '6376' (length=4) 18 => string '6517' (length=4) 19 => string '6867' (length=4) 20 => string '7487' (length=4) 21 => string '7553' (length=4) 22 => string '8670' (length=4) 23 => string '9126' (length=4) 24 => string '9757' (length=4) Even though the first 0,1,2,3 have 1 it's still not showing "echo "Yes I found a match". Hmm any ideas? All I want to do is check each ARRAY value individually, It sucks balls that in_array doesn't support this... thought your function I thought would work so it might be on my end, dunno yet.
  4. This code doesn't work:... if (in_array('1', $tickets)){ echo "Yes"; } var_dump($tickets) : array 0 => string '1808' (length=4) 1 => string '8224' (length=4) 2 => string '8513' (length=4) 3 => string '8564' (length=4) 4 => string '9727' (length=4) This code works: if (in_array('1808', $tickets)){ echo "Yes"; } I just want to FIND the "1" NOT the whole "1808"........
  5. your right, i apologize. i just hate working with php and then switching back to javascript, javascript is kinda identical but some shit just confuses the hell out of me, :-\ and ya the only thing bugged was prob my brain the arrays in javascript is what really piss me off, not even close to what im familiar with arrays with php (IMO)
  6. nevermind... sorry as u can tell i clearly no idea how to work with this ij ust fixed it by doing this for (var i = 0; i < c; i++) { d(rnd(0,9)); d(rnd(0,9)); d(rnd(0,9)); d(rnd(0,9)); } if anyone has this same problem their is the fix, while loops are bugged like a mofo in js, man i hate js lol
  7. im completely stuck.. All I need to do is add another d(v4)... for (var i = 0; i < c; i++) { v3 = v2 = v1 = rnd(0, 9); while (v2 == v1) v2 = rnd(0, 9); while (v3 == v1 || v3 == v2) v3 = rnd(0, 9); d(v1); d(v2); d(v3); } I added the d(v4) to the variables here: for (var i = 0; i < c; i++) { v4 = v3 = v2 = v1 = rnd(0, 9); while (v2 == v1) v2 = rnd(0, 9); while (v3 == v1 || v3 == v2) v3 = rnd(0, 9); d(v1); d(v2); d(v3); d(v4); } But I need to add something to the while loops, not sure I am so stuck >_< I just need to beable to use that other v4 so it's random and the rnd returns a function: function rnd(l_, h_) { return Math.round((Math.random() * (h_ - l_)) + l_); } Thanks Anyone with JS knowledge tell me what actually am I doing wrong/etc? Looking and seeking some nice help hehe, I Want to tackle this bug/problem I Cannot fathom this anymore, lol
  8. first, dunno if spamer or not, secondly why did u copy that guys theme/website? 3rdly, i dont even see a search bar on the 2nd website on the top right? IF not, you need to look into http://www.tutorialspoint.com/mysql/mysql-like-clause.htm if you're looking to use a little search for your site or site(s), have a wonderful day oh btw, Welcome to PHPF!!!
  9. LOL..... these guys are helping you voluntarily... sit back and take there advice with NO grain of salt, that is the only way to succeed, trust me, I know. sit back and enjoy the ride, trust me, they know what they're talking about
  10. I agree with Philip, it just depends how good your work is, or it just depends on what the project is.... I Think you just made this topic because you're probably excited about getting to work! Which it's not wrong! It's just that I don't think we can give you a honest answer Hopefully maybe once you start getting some work done a couple times and free ball it, you'll get a sense on how good you are and how good others think of you, and that is when you can increase the your price IMO, good luck Also, @ Philip, it depends on the indian, lol! If he is a pro or something and codes in the area you need, no wrong in seeing what he can do for 5$/hour, 5$USD is aLOT in india, or 3rd world countries
  11. oops, i did mean 0, sorry about that, ok well i just used the 0,9999 instead as it's shorter code... blah thanks all edit, wait nevermind actually 0000,9999 bcz i cant have numbers below 1000 edit, wait nevermind i just will use $db->query('UPDATE daily4 set start_time = '.time().', correct_number = "'.rand(0,9).''.rand(0,9).''.rand(0,9).''.rand(0,9).'"'); bcz if i do rand(0,9999) it will show a number below 1000 like "251" or something, they have to be 4 numbers
  12. <?php echo rand ( 1000 , 9999 ) ?> <br> <?php echo rand(0,9).rand(0,9).rand(0,9).rand(0,9) ?> generating these 2 0000 to 9999 random numbers? doesn't matter which way right? both will always be 0 - 9 correct? which way would be the "proper" way?
  13. $result = $db->query('SELECT gold from users WHERE id IN ('.$ids100.')') or error('Unable to fetch forum topic count', __FILE__, __LINE__, $db->error()); while ($gold = $db->fetch_assoc($result)){ $usersgold[] = $gold['gold']; } foreach (array_unique($winninguser_ids100) as $user_id[$usersgold]){ echo var_dump($user_id) .'<br>'; } var_dump shows NULL/blank? why? I need to pass the $usersgold[] as a key for each $user_id, how? In other words, I need to the $usersgold[] array to pass through with $user_id so I can use it in the for loop.
  14. The pro Indians on freelancer dot com charge around only 5$ hour
  15. oops, I meant where the aces = 11 if the total value is less than 21 or whatever, that's the only feature i don't have working, it's 100% serverside and everything works, pikachu what u mean?
  16. Hey, i never really touched php classes/etc so it's honestly like a whole new ball game, hehe. I really look at that code like a new life cuz I don't really understand the top half of it all, im more of a old fashion php kid, so i apologize. guess it's time to learn though right? Thanks for it and i'll use it to the best of my knowledge, lol im currently extracting this: $query = $db->query("SELECT l.*,m.id,m.username,m.star FROM daily4_tickets as l LEFT JOIN users m ON (m.id=l.user_id) ORDER BY date ASC") or error('Unable to send the message.', __FILE__, __LINE__, $db->error()); $winning_number = 1992; while($dailycheck = $db->fetch_assoc($query)) { $tickets[$dailycheck['user_id']] = explode(',', $dailycheck['numbers']); var_dump($tickets); //Check if a user matched a Ticket if (in_array(1992, $tickets[$dailycheck['user_id']])) { $winninguser_ids[] = $dailycheck['user_id']; } //Check if a user matched 2 numbers in order //??? //Check if a user matched all 4 numbers but not in order?? //??? } echo implode(",", $winninguser_ids); I will incorporate your code or try too once iget around with it, my var_dump is array 271 => array 0 => string '1413' (length=4) 1 => string '1812' (length=4) 2 => string '2325' (length=4) 3 => string '2326' (length=4) 4 => string '2623' (length=4) 5 => string '3236' (length=4) 6 => string '3738' (length=4) 7 => string '3932' (length=4) 8 => string '5156' (length=4) 9 => string '6169' (length=4) 10 => string '6264' (length=4) 11 => string '7873' (length=4) 12 => string '8586' (length=4) 13 => string '9497' (length=4) 14 => string '1992' (length=4) array 271 => array 0 => string '1312' (length=4) 1 => string '2527' (length=4) 2 => string '5451' (length=4) array 271 => array 0 => string '7071' (length=4) 1 => string '8184' (length=4) array 271 => array 0 => string '2528' (length=4) 1 => string '8089' (length=4) array 271 => array 0 => string '6789' (length=4) array 271 => array 0 => string '6789' (length=4) 1 => string '8987' (length=4) array 271 => array 0 => string '6789' (length=4) array 271 => array 0 => string '7654' (length=4) array 271 => array 0 => string '7654' (length=4) 106 => array 0 => string '2421' (length=4) 1 => string '1992' (length=4) 271,106 so im kinda on the other road as your script atm, but like I said, i will save it and use it once I get setted in on php CLASSES and stuff. right now, I just need to know how to differentiate between matching only 2 numbers in order and 4 all correct but in the wrong order.. hehe
  17. Okay, users can select numbers: 0000 to 9999 I already finished to check inputs serverside. The problem is let's say I have: 1413,1812,2325,2326,2623,3236,3738,3932,5156,6169 Now, that is USER JOE. If USER Joe picks those numbers, I will need to find out the following: *Match 4 numbers in the correct order win <b>100%</b> of the jackpot. (Odds: 1 in 10,000)<br> *Match 2 numbers in the correct order win <b>40%</b> of the jackpot. (Odds: 1 in 833)<br> *Match 4 numbers in the wrong order win <b>20%</b> of the jackpot. (Odds: 1 in 417)<br> And the correct number, let's say is "8521"; So what kind of php functions should i be dealing with here? I will need to foreach seperate them $numbers = "1413,1812,2325,2326,2623,3236,3738,3932,5156,6169"; foreach(explode(',', $numbers) as $num_set) { //Need to find how to match my 8521 with the numbers here } Long story short, I will be extracting this data from my MYSQL table called "daily4_tickets" and it will have rows of data for all my users with their chosen numbers. Hope I am going in the right place, I know i need to use some type of array_key matching, need some help to move me into the right direction, thank you
  18. the css line here is dark enough for me, but im on a beautiful 25 incher led monitor, i tried this forum on my moms older monitor a 19inch 2005 samsung i think, and the line does not seem bold enough, mostly depends on browser iuno but i think on ipb they fix it anyway dunno what style phpf will have but on the default it's fine iuno
  19. im trying to figure out how to store the results of a simple slot machine game via php/mysql. let's say a user pushes the slot button, all 3 spin, while all 3 spin, obviously what they really WON should be done serverside via ajax or whatever, then just use javascript to show them what they won/lost. i can do this project im not asking for freelancing work. they're alot of jquery slot machine scripts already out their im just asking if you can help me on HOW TO Store the results in MYSQL, like should I make 3 columns for slot1,slot2,slot3 right? then just check serverside if slot1,slot2,slot3 = to anything that MATCHES to give the user points/etc right? thanks for your advice, again not looking for freelancing job, just advice on how to make it 100% server side thank you check here: http://www.casino-del-mundo.com/ bunch of games here with flash as well, i can incorporate flash with php easily, just need a way to make sure im storing in mysql correctly
  20. i've created a blackjack game, can u add me to the list too? it just doesn't support jokers yet, but does work with a mysql db for security. (no sessions, purely serverside) pretty good too. dealer stands on 17's, hit stand/run/etc.
  21. DUDE HELL YA I took your code and slammed it like a BAWS function spoiler(a){ a.parentNode.className == 'spoiler' ? a.parentNode.className='spoiler revealed' : a.parentNode.className='spoiler'; } <div class="spoiler"> <input type="button" value="Spoiler" onclick="spoiler(this)"/> <div class="spoiler-content"> hey </div> </div> CSS: .spoiler > .spoiler-content { display: none; } .spoiler.revealed > .spoiler-content { display: block; } now no need to worry about id's/etc LOVE IT! TOPIC SOLVED BABY!!! THANK YOU LOL
  22. thanks req, but i dont think i can do a "Show/hide" button with that technique so lets scratch that one for now maybe i should re-word my question my bad. is there anyway to put this preg_replace in a loop so I can use a $i++; ? i just need to do something like this: $text = preg_replace( "#\[spoiler\](.+?)\[/spoiler\]#is", "<input type='button' value='Spoiler' onclick=\"if(pe('spoiler$i++;').style.display=='none') {pe('spoiler').style.display=''}else{pe('spoiler').style.display='none'}\"><div id='spoiler' style='display:none'>\\1</div>", $text, 6, $spoilercount ); see the $i++; ? then ofcourse do that for all id's while( preg_match( "#\[spoiler\](.+?)\[/spoiler\]#ies", $text ) ) { $spoiler++; $text = preg_replace( "#\[spoiler\](.+?)\[/spoiler\]#is", "$spoiler<input type='button' value='Spoiler' onclick=\"if(pe('spoiler').style.display=='none') {pe('spoiler').style.display=''}else{pe('spoiler').style.display='none'}\"><div id='spoiler' style='display:none'>\\1</div>", $text, 6, $spoilercount ); } the $spoiler++ only produces 1 and 1, not 1,2 not working damn im getting closE!
  23. Are u just advertising your site or..? If so, that's against the rules.. view-source:http://www.adultquestion.com/login/ they're inside <pre> tags outside of the </script> tag...............
  24. $text = preg_replace( "#\[spoiler\](.+?)\[/spoiler\]#is", "<input type=button value='Spoiler' onclick=\"if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }\" /><div style=display:none><div class=quote1>Spoiler</div><div class=quote2>\\1</div></div>", $text, 6, $spoilercount ); This is my minature bbcode spoiler tag I am making. The problem is, if they use this 2 times, it will work, but if they click on any the first one will always show. I need to give each div a ID.... so is there a way where I can use $i++ and give a div a id1, id2, id3, on each iteration of replacing?
  25. LOL this is the future for sure. I would totally walk around stores wearing one of these, I would look like a bad ass! wait.. i mean i'd wait until more people would wear them, they're pretty expensive, lmao i'd wear them but but not in public yet, wait until they increase in trend.
×
×
  • 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.