Monkuar
Members-
Posts
987 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Monkuar
-
$correct = array("APNG","TIFF","RAW","BMP","SVG","WEBP","EXIF","PNM","PBM","PGM","PPM"); Now: if (in_array('PGM','TIFF',$correct)){ echo " You have 2 correct! "; } How would I go about making it search for arrays in arrays? The above does not WORK because it's searching for 2? How can i search for 2 or more?
-
This is solved.. looked like my host forgot to enable the ipt_recent module.. give me a Freaking break jee willy.
-
Need to grab incremental value if 2 OR MORE rows exist
Monkuar replied to Monkuar's topic in PHP Coding Help
I am wanting exactly that, sorry for not being clear enough. Here is my forums database. I need to left join my forums database with my online database: I am trying to make it so let's say if 3 people are in the in_forum id = 27, it will show (3 users browsing) next to the "ViP Forum" Because 3 rows = "27" which = 3 people viewing. -
$result = $db->query('SELECT user_id, ident,logged,star,in_forum,type FROM '.$db->prefix.'online ORDER BY logged DESC', true) or error('Unable to fetch online list', __FILE__, __LINE__, $db->error()); while ($pun_user_online = $db->fetch_assoc($result)) { if ($pun_user_online['in_forum'] >= 1){ $inforumids[$pun_user_online['in_forum']] = $i++; } } Database: My echo var_dump($inforumids);: array 36 => null 3 => int 1 I need it to be: 36 => 2 3 = > 1 Hence in my database, 2 users are in in_forum id 36. How to make the $i++ incrementer to grab only the count of the row if it's the same?
-
Hey, I am trying to run the following code: (Debian 6, 32 bit) OPENVZ. iptables -A INPUT -p tcp --dport 80 -m state --state NEW -m recent --set --name DDOS But I receive iptables: No chain/target/match by that name. Which I found out that xt_state needs to be enabled on the node. So I asked my host to do this. I Still receieve the same damn iptable error... I am trying to run this basic firewall: iptables -A INPUT -p tcp --dport 80 -m state --state NEW -m recent --set --name DDOS iptables -A INPUT -p tcp --dport 80 -m state --state NEW -m recent --update --seconds 10 --hitcount 20 --rttl --name DDOS -j DROP Anyone got any ideas why it wont let me do this? Yes I am on openVZ Also when I run : cat /proc/net/ip_tables_matches I get: mark mark owner limit owner length ttl tcpmss multiport multiport tos tos dscp icmp state udplite udp tcp Shouldn't state, be xt_state? my host said he enabled the xt_state module, wat is the problem ?
-
Simple, just set it in the middle, have an option in their User control panel to change it to a setting. Let's say 10 images is average. Or use a php script to detect what phone they're on or whatever to change it dynamically, google it there's tons of browser detection scripts to detect what kind of phone they're on. Or like I said, let them change it in the settings. If you cannot get the test speed, my recommendation is using something to detect what browser they're on, that would = what phone, and you could go from there, not 100% plausible idea, but better then nothing right?
-
If it's a 1 man job, I highly recommend not doing this arcade thing, as you would need to decompile each game add your own code to use with your server if u don't want hackers. This would take a lot of time. Or just have scores be verified by you.... but that would be pretty dumb. If you had thousands of users, you'd have no life !. I am not trying to be rude, but I've been where you're at, it's not worth it. These kind of arcade sites are not only pointless now, but even if you did get alot of players, you'll have hackers 24/7 just submitting 99999999 scores and you as the admin will go nuts. Now, don't get me wrong, if you got an idea, go for it and don't let what we say stop you. But... I think you know what to do from this point forward, I wish you the best,
-
*SIGH* Very basic Session help if you would be so kind...
Monkuar replied to Grantel's topic in PHP Coding Help
Wheres your <input type="submit" name="Submit" value="Submit"> button? I recommend learning a bit more html as well, -
Damn didn't know that soon. I am actually pretty anxious. Do you guys got a theme and stuff already working maybe a demo/beta up? Logo definitely has some nostalgia factor to it, I wouldn't like to see it go
-
i honestly cannot think of anything new to be added as I've barely touched the waters with php and i've been doing it for years, im a slow learner, but i am going it at it. most of my errors and decline of my coding is im not reading the full documentation or the parameters for each function, that always ends up me making topics on phpfreaks trying to re-invent the wheel of something, when im just missing a parameter for the function.... lmfao i do like that while else though, i've always wanted to do that. and im not going to lie, hall of famer has been pretty damn humble through this topic
-
Anyone know when the move will bE?
-
Dam PIKACHU, didn't even see that, wow that is awesome. $text=preg_replace(array_keys($smilies), array_values($smilies), $text,7, $amount); if ($amount > 10){ message("You have posted to many smilies."); } TOPIC SOLVED!! Holy moly that was cake! I think I need to do more reading...
-
Okay, i'll play. $string = ":gun2:"; if (preg_match_all("/" . preg_quote($string) . "/i", $text, $matches)) { if (count($matches[0]) > 10){ message("You have posted to many smilies, you are only allowed 10"); } } Now, Is it possible to turn this into a loop so that $string could = array_keys($smilies) ? So it checks them all? Because there is no way in hell I am making 55 more if statements, haha.
-
Hm, I changed it to $amount = $i++; And it'll echo out "55", which seems to be how many smilies I have total, problem is now I don't know how to differentiate between if a user used a preg_replace or not to count how many they used? if (preg_replace(array_keys($smilies), array_values($smilies), $text)){ $count++; } echo $count; exit; I use 5- 10 smilies, still outputs only 1? Wat the hell AFAIK this guy $count should be counting for me... incrementally..
-
$smilies=array ( '#(?<!\w):\)(?!\w)#i' => '<img src=img/smileys/smile.gif alt="">', '#(?<!\w):\((?!\w)#i' => '<img src=img/smileys/sad.gif alt="">', '#(?<!\w);\)(?!\w)#i' => '<img src=img/smileys/wink.gif alt="">', '#(?<!\w):cool2:(?!\w)#i' => '<img src=img/smileys/cool2.gif alt=":cool2:">', '#(?<!\w)(?!\w)#i' => '<img src=img/smileys/huh.gif alt="">', '#(?<!\w)\^_\^(?!\w)#i' => '<img src=img/smileys/happy.gif alt="">', '#(?<!\w)(?!\w)#i' => '<img src=img/smileys/ohmy.gif alt="">', '#(?<!\w)(?!\w)#i' => '<img src=img/smileys/tongue.gif alt="">', '#(?<!\w)(?!\w)#i' => '<img src=img/smileys/grin.gif alt="">', '#(?<!\w)(?!\w)#i' => '<img src=img/smileys/laugh.gif alt="">', '#(?<!\w)B\)(?!\w)#i' => '<img src=img/smileys/cool.gif alt="B)">', '#(?<!\w)(?!\w)#i' => '<img src=img/smileys/rolleyes.gif alt="">', '#(?<!\w)\-_\-(?!\w)#i' => '<img src=img/smileys/sleep.gif alt="">', '#(?<!\w)(?!\w)#i' => '<img src=img/smileys/wub.gif alt="">', '#(?<!\w):rofl:(?!\w)#i' => '<img src=img/smileys/rofl.gif alt=":rofl:">', '#(?<!\w):hail:(?!\w)#i' => '<img src=img/smileys/hail.gif alt=":hail:">', '#(?<!\w):blush:(?!\w)#i' => '<img src=img/smileys/blush.gif alt=":blush:">', '#(?<!\w):popcorn:(?!\w)#i' => '<img src=img/smileys/popcorn.gif alt=":popcorn:">', '#(?<!\w):yahoo:(?!\w)#i' => '<img src=img/smileys/yahoo.gif alt=":yahoo:">', '#(?<!\w):love:(?!\w)#i' => '<img src=img/smileys/love2.gif alt=":love:">', '#(?<!\w):unknow:(?!\w)#i' => '<img src=img/smileys/unknow.gif alt=":unknow:">', '#(?<!\w):drool:(?!\w)#i' => '<img src=img/smileys/drool.gif alt=":drool:">', '#(?<!\w):rifle:(?!\w)#i' => '<img src=img/smileys/rifle.gif alt=":rifle:">', '#(?<!\w):hi:(?!\w)#i' => '<img src=img/smileys/hi.gif alt=":hi:">', '#(?<!\w):negative:(?!\w)#i' => '<img src=img/smileys/negative.gif alt=":negative:">', '#(?<!\w):yoyo:(?!\w)#i' => '<img src=img/smileys/yo-yo.gif alt=":yoyo:">', '#(?<!\w):throat:(?!\w)#i' => '<img src=img/smileys/throat.gif alt=":throat:">', '#(?<!\w):cooldance:(?!\w)#i' => '<img src=img/smileys/CoolDance.gif alt=":cooldance:">', '#(?<!\w):wallbash:(?!\w)#i' => '<img src=img/smileys/headbash.gif alt=":wallbash:">', '#(?<!\w):fume:(?!\w)#i' => '<img src=img/smileys/ranting.gif alt=":fume:">', '#(?<!\w):pissed:(?!\w)#i' => '<img src=img/smileys/PissedOff.gif alt=":pissed:">', '#(?<!\w):evil:(?!\w)#i' => '<img src=img/smileys/devil.gif alt=":evil:">', '#(?<!\w):angel:(?!\w)#i' => '<img src=img/smileys/angel.gif alt=":angel:">', '#(?<!\w):finger:(?!\w)#i' => '<img src=img/smileys/finger.gif alt=":finger:">', '#(?<!\w):mgun:(?!\w)#i' => '<img src=img/smileys/machinegun.gif alt=":mgun:">', '#(?<!\w):banana:(?!\w)#i' => '<img src=img/smileys/banana.gif alt=":banana:">', '#(?<!\w):santa:(?!\w)#i' => '<img src=img/smileys/santa.gif alt=":santa:">', '#(?<!\w):heart2:(?!\w)#i' => '<img src=img/smileys/heart2.gif alt=":heart2:">', '#(?<!\w)(?!\w)#i' => '<img src=img/smileys/cry3.gif alt="">', '#(?<!\w)(?!\w)#i' => '<img src=img/smileys/unsure.gif alt="">', '#(?<!\w):hug:(?!\w)#i' => '<img src=img/smileys/hug.gif alt=":hug:">', '#(?<!\w):baby:(?!\w)#i' => '<img src=img/smileys/baby.gif alt=":baby:">', '#(?<!\w)(?!\w)#i' => '<img src=img/smileys/ph34r.gif alt="">', '#(?<!\w):thumbsup:(?!\w)#i' => '<img src=img/smileys/thumbsup.gif alt=":thumbsup:">', '#(?<!\w)(?!\w)#i' => '<img src=img/smileys/wacko.gif alt="">', '#(?<!\w):rant:(?!\w)#i' => '<img src=img/smileys/rant2.gif alt=":rant:">', '#(?<!\w):praise:(?!\w)#i' => '<img src=img/smileys/praise.gif alt=":praise:">', '#(?<!\w):drink:(?!\w)#i' => '<img src=img/smileys/drinks.gif alt=":drink:">', '#(?<!\w)(?!\w)#i' => '<img src=img/smileys/shrug.gif alt="">', '#(?<!\w):pcwhack:(?!\w)#i' => '<img src=img/smileys/pcwhack.gif alt=":pcwhack:">', '#(?<!\w):gun1:(?!\w)#i' => '<img src=img/smileys/gun1.gif alt=":gun1:">', '#(?<!\w):gun2:(?!\w)#i' => '<img src=img/smileys/gun2.gif alt=":gun2:">', '#(?<!\w):huglove:(?!\w)#i' => '<img src=img/smileys/huglove.gif alt=":huglove:">', '#(?<!\w):music:(?!\w)#i' => '<img src=img/smileys/music.gif alt=":music:">', '#<3#i' => '<img src=img/smileys/heart2.gif alt="<3">', '#<\_<#i' => '<img src=img/smileys/dry.gif alt="">', ); $text=preg_replace(array_keys($smilies), array_values($smilies), $text,7); foreach ($smilies as $chosen){ $amount .= $i++; if ($chosen >= 7){ message("You have posted to many smilies"); } } echo $amount; exit; Okay, as you can see I am limiting users to only post 7 smilies. But this right now is only letting them post 7 of EACH smiley. So in the end, they could actually post more than well 7 of each smileys, That is NOT What I want. I need your help! I need to beable to count each time they convert 1 smiley and give them a error message if they are trying to use more than 7. Right now my $amount echos: 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 Which is way off, it should only echo the count of smileys that were replaced?
-
<select> <?php $numlist = range(1, 160); shuffle($numlist); foreach ($numlist as $mynumbers){ echo '<option> '.$mynumbers.'</option>'; } ?> </select> marked as solved.. sorry brainfart
-
for instance: <select name="q1"> for ($numbers=1; $numbers<=160; $numbers++){ $numbers2 = mt_rand(1,160); echo "<option value={$numbers2}>{$numbers2}</option>"; } </select> I need to make it so, everytime this runs, it will always show the number "80" in the loop, every single time. Definitely hope this is possible. If you're wondering why, well because I am making this fun quiz and wants users to get annoyed by checking a dropdown list for the correct answer. Pretty much, need to show the number "80" in their, everytime this code executes
-
I dont think you can use HTML elements inside select stuff without the use of jquery or some type of js framework, or it will just look like a select element but it might be what requinx said. http://www.makeuseof.com/dir/ddslick-a-jquery-plugin-to-create-customized-dropdown-menus-with-images/ Try this, looks like you might beable to do what you want.
-
PHP Function to Generate HTML Table From MySQL
Monkuar replied to Danny620's topic in PHP Coding Help
Yeah, theres no page pagination with that script, seems kind of useless. Don't know what the developer was thinking. But if you want us to do work for you, go post this in the freelancers section, I am sure someone might help you. -
Flash is horrible, anyone can grab your swf and decompile it and hack it if they wanted to. All your games are easily hackable, unless you're telling me that you check each input/movement on a flash game with the server, which I doubt. Design is cool, good work but, flash games sites are a dime a dozen and it's the same motive as "I am going to create another Social Network site!"
-
How to prevent this html form based hack-cracking ?
Monkuar replied to ankur0101's topic in PHP Coding Help
Check the amount server side with paypal. Or simply check the minimum amount with $_POST. Paypal will call a hidden URL for the transaction, that you specify. I think it's the 'notify_url' variable. Just make sure no one can donate less than "XX" amount, you'll be fine. -
Yeah, this works. Lol, I figured this out before but I forgot to post. Thank you for helping me though, I marked this as solved.. Sometimes wen I make topics explaining what needs to be done/etc I ultimately help myself
-
You flamed someone who has been helping this board for months for no reason. http://forums.phpfreaks.com/index.php?topic=364244.msg1726021#msg1726021 all your posts are prob set to waiting moderation,. maybe if you continue to not flame in the future they might remove it. good luck !
-
Okay, been doing this for hours.. Here is what I am using: http://demo.tutorialzine.com/2010/06/css3-minimalistic-navigation-menu/demo.html Now, all I want to do is make it so when it slides, it slides to the left instead of the right! I know this is probably a stupid question.. But in the css properties after you download it Inside: #navigationMenu span{ I changed left:38px to left:0px, which moves the slider over, but I need to know how to make it so it slides to the left instead of right? I think it's because after a <a href tag? Any help guys?
-
escape everything! check for negative intervals, use mysql/sessions instead of cookies/etc/etc/etc lists goes on forever