Monkuar
Members-
Posts
987 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Monkuar
-
hey, my birthday is imploded twice, using birthday[] and then imploding it again is what i think is causing it sorry, topic solved hahah
-
$birthday = implode(",",$_POST['BirthDay']); $bday = array( "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" ); echo $birthday['0']; exit; //var_dump($colorarrays); if (!in_array($birthday['0'], $bday)) { message("Please select a Correct Birthday, or u trying to hack"); } Okay, if I enter "55325" for my first birthday POST, it only shows "5" and thus making the in_array not work correctly how can i implode my data correctly ty
-
make the cookie hash match with the password in the db for the user
-
If it faster to use call all the table using *, or calling each individual row/field? Which is betteR: $result = $db->query('SELECT u.*, g.*, o.logged FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id LEFT JOIN '.$db->prefix.'online AS o ON o.user_id=u.id WHERE u.id='.intval($cookie['user_id'])) or error('Unable to fetch user information', __FILE__, __LINE__, $db->error()); $pun_user = $db->fetch_assoc($result); OR $result = $db->query('SELECT u.id,u.username,u.color,u.star/*ETCETC*ETC*ETC/blablahj....., g.*, o.logged FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id LEFT JOIN '.$db->prefix.'online AS o ON o.user_id=u.id WHERE u.id='.intval($cookie['user_id'])) or error('Unable to fetch user information', __FILE__, __LINE__, $db->error()); $pun_user = $db->fetch_assoc($result);
-
$stylesbought = explode(",", $user['color2']); //$user['color2'] is 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 (16 values to correspond at the bottom) $styles = array( 'Purple Orb' => array('#660099', '#CC99FF', '20.00',''.$stylesbought.''), 'Ms Beautiful' => array('#FFFDB5', '#D391FF', '30.00'), 'Blue Essense' => array('#2B8EFF', '#63CBFF', '50.00'), 'Pink Essence' => array('#FF08FF', '#E01DDA', '100.00'), 'Mythical Blue' => array('#0066ff', '#3300ff', '150.00'), 'Green Essence' => array('#39FF08', '#54FF7C', '200.00'), 'Leaf Green' => array('#67e03f', '#000000', '250.00'), 'Black Essense' => array('#000000', '#000000', '300.00'), 'Pikachu' => array('#F4FF54', '#000000', '400.00'), 'Charmander' => array('#FF0303', '#000000', '500.00'), 'Purity' => array('#ffffff', '#ffffff', '520.00'), 'Pink Steel' => array('#ffffff', '#ff00ff', '540.00'), 'Ice Crystal' => array('#ffffff', '#00ccff', '600.00'), 'Plated Steel' => array('#ffffff', '#363636', '700.00'), 'Red Steel' => array('#ffffff', '#ff3333', '700.00'), 'The Dark Knight' => array('#000000', '#736f6e', '800.00'), ); Okay, so people can buy these styles, let's say somone buys the The Dark knight for 800(Gold), I will update there $user['color2'] to 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 Hence 1 is the 16th one, and the 16th Array, the dark knight is #16 on the array, now, how do I explode that result and make it correspond with my multi demi array so it shows 'Purple Orb' => array('#660099', '#CC99FF', '20.00',''.$stylesbought.''), as $stylesbought will mark it at 1 (or bought). So for the purple orb, that is array #0, so my $user['color2'] would look like this: 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 Hence Purple orb is bought. Now I need to correspond this data to my multi demi array to show the user which styles he has bought. Any help? thx
-
$colorarray = isset($_POST['form']['color']) ? intval($_POST['form']['color']) : 0; $color = array( "1", "2", "3", "4", "5", "6", "7", "8", "8", "9", "10", "11", "12", "13", "14", "15", "16" ); if (in_array($color, $colorarray)) { echo "search found"; exit; }else{ echo "hacker"; exit; } i submit my $_POST['form']['color'] as 1 through 16 and it always says hacker?
-
Wow, I guess the trouble all started when I started to use multi dimensional arrays and try to get them integrated into my forloops. To be honest, your code will most likely be used on other stuff on my system aswell. You pretty much just slammed with me more code then I could handle ( I would ask questions about it) but meh, i'll just try to study it overnight. Topic Solved..
-
Blah bro, I give up, I done a brand new code, and IT STILL SHOWS it wrong! <table class=tuble> <?php $styles = array( 'Purple Orb' => array('#660099', '#CC99FF', '20.00'), 'Ms Beautiful' => array('#FFFDB5', '#D391FF', '30.00'), 'Blue Essense' => array('#2B8EFF', '#63CBFF', '50.00'), 'Pink Essence' => array('#FF08FF', '#E01DDA', '100.00'), 'Mythical Blue' => array('#0066ff', '#3300ff', '150.00'), 'Green Essence' => array('#39FF08', '#54FF7C', '200.00'), 'Leaf Green' => array('#67e03f', '#000000', '250.00'), 'Black Essense' => array('#000000', '#000000', '300.00'), 'Pikachu' => array('#F4FF54', '#000000', '400.00'), 'Charmander' => array('#FF0303', '#000000', '500.00'), 'Purity' => array('#ffffff', '#ffffff', '520.00'), 'Pink Steel' => array('#ffffff', '#ff00ff', '540.00'), 'Ice Crystal' => array('#ffffff', '#00ccff', '600.00'), 'Plated Steel' => array('#ffffff', '#363636', '700.00'), 'Red Steel' => array('#ffffff', '#ff3333', '700.00'), 'The Dark Knight' => array('#000000', '#736f6e', '800.00'), ); foreach ($styles as $value => $index) { $style .='<input type="radio" value="'.$i.'" name="form[color]"><b><a style="color:'.$index[0].';text-shadow:'.$index[1].' 2px 1px 1px" href="u.php?id='.$pun_user['id'].'">'.$pun_user['username'].'</a></b> (<b>'.$index[2].'</b> FG)<br>'; } $i = 0; $max_columns = 3; while($row = mysql_fetch_array($result)) { // open row if counter is zero if($i == 0) echo "<tr>"; } if($i < $max_columns) { for($j=$i; $j<$max_columns;$j++) echo "<td>$style</td>"; } ?> </tr> </table> Nicest code you're going to get, brand new output: It's working, but I don't want the data onto each new column... i want the data spread out, Can somone please help me? I seriously am stumped I have no idea what to do now. It should be spread out evenly, 4 color's on each colum, not 16 on each.... :confused: :confused:
-
Hey, Thanks for the response man. foreach ($styles as $value => $index) { $value .= $value; } echo ''.$value.'<input type="radio" value="'.$i.'" name="form[color]"><b><a style="color:'.$index[0].';text-shadow:'.$index[1].' 2px 1px 1px" href="u.php?id='.$pun_user['id'].'">'.$pun_user['username'].'</a></b> (<b>'.$index[2].'</b> FG)<br>'; Okay, I tried this, it's working fine colums/etc, but it's only showing "The Dark Knight" my last array on my $styles multi demi array, isn'tt he .= supposed to xfer the arrays over? Thanks if u can help
-
I cleaned it up, and it's really close! Problem is now, it's showing 2 rows of the same Data?!I Want to literally split it in half, so half of options on left column and other half on the right. $i=1; $selected=0; $uservalue=20; $numCols = 2; $numPerCol = ceil(1 / $numCols); echo "<table class=tuble><tr>"; for($col = 1; $col <= $numCols; $col++) { echo "<td>"; for($row = 0; $row < $numPerCol; $row++) { $resultRow = 1; if ($i<=$uservalue) { if ($i == $selected) { $checked = 'checked'; }else{ $checked = ''; } $styles = array( 'Purple Orb' => array('#660099', '#CC99FF', '20'), 'Ms Beautiful' => array('#FFFDB5', '#D391FF', '30'), 'Blue Essense' => array('#2B8EFF', '#63CBFF', '50'), 'Pink Essence' => array('#FF08FF', '#E01DDA', '100'), 'Mythical Blue' => array('#0066ff', '#3300ff', '150'), 'Green Essence' => array('#39FF08', '#54FF7C', '200'), 'Leaf Green' => array('#67e03f', '#000000', '250'), 'Black Essense' => array('#000000', '#000000', '300'), 'Pikachu' => array('#F4FF54', '#000000', '400'), 'Charmander' => array('#FF0303', '#000000', '500'), 'White Purity' => array('#ffffff', '#ffffff', '520'), 'Pink Steel' => array('#ffffff', '#ff00ff', '540'), 'Ice Crystal' => array('#ffffff', '#00ccff', '600'), 'Plated Steel' => array('#ffffff', '#363636', '700'), 'Red Steel' => array('#ffffff', '#ff3333', '700'), 'The Dark Knight' => array('#000000', '#736f6e', '800'), ); foreach ($styles as $value => $index) { echo ''.$value.'<input type="radio" value="'.$i.'" name="form[color]"><b><a style="color:'.$index[0].';text-shadow:'.$index[1].' 2px 1px 1px" href="u.php?id='.$pun_user['id'].'">'.$pun_user['username'].'</a></b> (<b>'.$index[2].'</b> FG)<br>'; } } else { echo '<label for="s'.$i.'"><input type="radio" value="'.$i.'" name="form[star]" disabled><b><a href="u.php?id='.$pun_user['id'].'">'.$pun_user['username'].'</a></b><br>'; } $i++; } echo "</td>"; } echo "</tr></table>"; Output:
-
Heres a massive updatE: $i=1; $selected=0; $uservalue=20; $numCols = 3; $numPerCol = ceil(20 / $numCols); echo "<table class=tuble><tr>"; for($col = 1; $col <= $numCols; $col++) { echo "<td>"; for($row = 0; $row < $numPerCol; $row++) { $resultRow = 20; if ($i<=$uservalue) { if ($i == $selected) { $checked = 'checked'; }else{ $checked = ''; } $styles = array( 'Blue Essense' => array('#2B8EFF', '#63CBFF', '50'), 'Pink Essence' => array('#FF08FF', '#E01DDA', '100'), 'Green Essence' => array('#39FF08', '#54FF7C', '200'), 'Black Essense' => array('#000000', '#000000', '300'), 'Pikachu' => array('#F4FF54', '#000000', '400'), 'Charmander' => array('#FF0303', '#000000', '500'), 'Ice Crystal' => array('#ffffff', '#00ccff', '600'), 'Plated Steel' => array('#ffffff', '#363636', '700'), ); foreach ($styles as $value => $index) { echo '<input type="radio" value="'.$i.'" name="form[color]"><b><a style="color:'.$index[0].';text-shadow:'.$index[1].' 2px 1px 1px" href="u.php?id='.$pun_user['id'].'">'.$pun_user['username'].'</a></b> (<b>'.$index[2].'</b> FG)<br>'; } } else { echo '<label for="s'.$i.'"><input type="radio" value="'.$i.'" name="form[star]" disabled><b><a href="u.php?id='.$pun_user['id'].'">'.$pun_user['username'].'</a></b><br>'; } $i++; } echo "</td>"; } echo "</tr></table>"; Only 1 problem, it's showing like 150 of them: How can I retain my column rows, but have it correspond with my arrays?
-
Oh ya i use that too! it's so lightweight! check my other topic, i got some more multi array stuff for ya lol
-
Beautiful, man Topic Solved Love preg match and regex
-
$i=1; $selected=0; $uservalue=20; $numCols = 3; $numPerCol = ceil(20 / $numCols); echo "<table class=tuble><tr>"; for($col = 1; $col <= $numCols; $col++) { echo "<td>"; for($row = 0; $row < $numPerCol; $row++) { $resultRow = 20; if ($i<=$uservalue) { if ($i == $selected) { $checked = 'checked'; }else{ $checked = ''; } $styles = array( 'Blue Essense' => array('#2B8EFF', '#63CBFF', '50 Forum Gold'), 'veggie' => array('carrot', 'collard', 'pea') ); echo '<input type="radio" value="'.$i.'" name="form[color]">Blue Essence <b><a style="color:#2B8EFF;text-shadow:#63CBFF 2px 1px 1px" href="u.php?id='.$pun_user['id'].'">'.$pun_user['username'].'</a></b><br>'; } else { echo '<label for="s'.$i.'"><input type="radio" value="'.$i.'" name="form[star]" disabled><b><a href="u.php?id='.$pun_user['id'].'">'.$pun_user['username'].'</a></b><br>'; } $i++; } echo "</td>"; } echo "</tr></table>"; Okay, see the $styles array? $styles = array( 'Blue Essense' => array('#2B8EFF', '#63CBFF', '50 Forum Gold'), 'veggie' => array('carrot', 'collard', 'pea') ); The first is hex code, background, and 2nd is #63CBFF (Front color) and the 3rd is how much it costs I need those arrays to echo out correspondent with my echo '<input type="radio" value="'.$i.'" name="form[color]">Blue Essense<b><a style="color:#2B8EFF;text-shadow:#63CBFF 2px 1px 1px" href="u.php?id='.$pun_user['id'].'">'.$pun_user['username'].'</a></b> (50 Forum Gold)<br>'; See how the style="color etc/etc" I need to grab the data from $styles to go into the correct spots, Is this feasable? Long story short, I need to explode those arrays out somehow, any idea?
-
Oh great idea is there a list of more? users can enter any hex amount, I want most most of them work, hmm I dont waant them to be limited. Your idea works great tho, cuz hackers can't do shit if doesn't check against the array lol epic
-
I am letting users select there color code option for text-shadow for there username I am storing them into a field called "color" HEX exaMPLE: FF6633,AA3633 First is the background color, 2nd is the foreground. (then i'll explode them) Is there a PHP function that let's me validate the input so it's HEX ONLY? I will be db escaping it and intval it too.
-
LOL yea I changed that, here is final result ty <3
-
Topic Solved!!! THANKS!
-
Lol, saw those Maybe Can it look more like my screenshot I had? I removed the break's but it's going side by side hmmmm
-
syntax error, unexpected '{' in C:\wamp\www\s.php on line 1544 1544 if (in_array($i, array('1', '11', '21', '31', '41', '51', '61')) { echo "<div class=\"column\">"; } is it those {'s? how it causing a error lol
-
I'll try that if I can't get this one to work $numCols = 6; $numPerCol = ceil(70 / $numCols); echo "<table><tr>"; for($col = 1; $col <= $numCols; $col++) { echo "<td><ul>"; for($row = 0; $row < $numPerCol; $row++) { $resultRow = 70; if ($i<=$uservalue) { echo $row; echo '<input type="radio" id="s1" value="$i" name="star"><img src=img/icons/'.$row.'.png><br>'; } else { echo '<input type="radio" id="s1" value="$i" name="star" disabled><img src=img/icons/'.$row.'.png><br>'; } } echo "</ul></td>"; } echo "</tr></table>"; Okay, I coded this but problem is: I need it to display 1 through 70 on all of them, any help? Dragon_SA i'll try yours if I cant get this to work, I also would need something to make the input radio box "selected" dependable on what they choose, it will be stored in the "stars" column any idea on that also?
-
code works great! <?php $uservalue=5; $i=1; while($i<=70) { if ($i<=$uservalue) { echo '<input type="radio" id="s1" value="$i" name="star"><img src=img/icons/'.$i.'.png><br>'; } else { echo '<input type="radio" id="s1" value="$i" name="star" disabled><img src=img/icons/'.$i.'.png><br>'; } $i++; } ?> Now I need help, how do I display them in 7columns? I wanna do 10 for each one, here is my current screenshot: Some are cut off, but yea
-
Okay, I did this awhile ago but I did not do it appropiately, I used basic HTML AND it took forever. I have 70 Icons, (They are all a Star icon). If my user has donated $$ to the site, he will get his field name "max_stars" incremented to the appropiate value, (1-70) to his account, so he can have access to any of the stars and selects them in his profile settings menu to be activated and shown on his account Profile. $i=1; while($i<=70) { echo "<input type="radio" id="s1" value="1" name="star">IMG TO STAR HERE"; $i++; } Okay, so I want to loop through all 70 icons, each icon is named 1-70.png and each one has to correspond to there correct #, so it shows all 70 and each image, 1.png, 2.png/etc, correct incrimination. I made the above code so far, but would like your help if you can help, I need to do all 70, but the radio boxes can only be enable to correspond to what the user's max_star field is in the table. So let's say user has max_stars set to 5. That means only 1-5.png stars will have the radio box enabled, so they can click it, but still showing the other 65 as DISABLED, base don there max_star db field. Then I would have to check if it's selected or not once they have updated there profile. If somone can get me going here it would be great (I have the code to update there profile/etc, I just need help on showing the data in the loop) if not I would have to do this with 70 stupid radio input boxes and use 70 if else statements, it's just so annoying, I want to take advantage of PHP's foreach/looping. .
-
o.o never though of that way also thanks man u always saving my ass i appreciate it haha
-
wow $ thx lo