Jump to content

karimali831

Members
  • Posts

    436
  • Joined

  • Last visited

Everything posted by karimali831

  1. I have hundreds with off site URLs with many of the links no longer exist so it looks really messy when I specifying an img tag with invalid source.
  2. I do both methods for flexibility. Are you saying I should enforce uploads to server only? This I am not sure about...
  3. Hello! It took a while to find out why one of my pages is slow.. it is because of getimagesize() when users link their avatar to a URL and the URL no longer exist, I use getimagesize() function. Is there something else I can to check for a file existent? It must be for any website. Thanks!
  4. I am trying to open a link without page load using top location. This code opens link but in parent window: new Ajax.Updater('ULLIST_0', webRoot + '?site=standings&ladderID=<?php echo $_GET[ladderID].'&start='.$i; ?>', { This code opens in top window but there is page load so it's no good: new Ajax.Updater('ULLIST_0', top.location = '?site=standings&ladderID=<?php echo $_GET[ladderID].'&start='.$i; ?>', { how do I get top window without page load?
  5. that is spot on!! thank you soo much ok, I thought I wouldn't mention about the 3 bars but now that you mention it and that I'm getting this close, I'll explain... now if there are 1-20 participants, there should only be 1 bar, in that case I can set the style height of the bar to 555px which is the full height. 21 to 40 participants will show 2 bars therefore 555 / 2 = 277.5 px for bar 1 and bar 2 only. 41 to 60 participants will show 3 bars therefore 555 / 3 = 185 pixels for bar 1, 2 and 3 (this is what it is set to now as you can see) 61 to 80 participants will show 4 bars therefore 555 / 4 = 138.75 and so on... I use this to check out how many are registered: $result = safe_query("SELECT count(*) as number FROM ".PREFIX."cup_clans WHERE ladID='".$laddID."' && checkin='1' && credit!='0'"); $ap=mysql_fetch_array($result); I'll try give this a go myself.. again thank you very much for your help!
  6. Thanks alot for the help! I am understanding this a bit now but still having trouble determining what bar is active, I have put it together: $start = (!isset($_GET['start']) ? 1 : $_GET['start']); for($i = 1; $i <= 501; $i += 20){ $active = ''; // for now, we'll set the active variable to nothing. if($i == $start){ $active = 'active'; $rank = $i; $limit_by = 'LIMIT ' . ($i - 1) . ',' . ($i + 19); } $from = $i - 1; $to = $i + 19; // Now you can construct each DIV $bars = '<div id="from_' . $from . '" class="rPosButton ' . $active . '" style="height: 185px;" onclick="getNextParticipants(this);this.blur();" onmouseover="Tip( get_value(\'' . $i . ' - ' . $to . '\'), TEXTALIGN, \'justify\', ABOVE,\'true\', TEXTALIGN, \'justify\', PADDING,10, TEXTALIGN, \'justify\', OPACITY,90, TEXTALIGN, \'justify\', FIX,[300,450], TEXTALIGN, \'justify\', DELAY,1, TEXTALIGN, \'justify\' );" onmouseout="UnTip();"> </div> <div id="from_' . $from . '" class="rPosButton ' . $active . '" style="height: 185px;" onclick="getNextParticipants(this);this.blur();" onmouseover="Tip( get_value(\'' . $i . ' - ' . $to . '\'), TEXTALIGN, \'justify\', ABOVE,\'true\', TEXTALIGN, \'justify\', PADDING,10, TEXTALIGN, \'justify\', OPACITY,90, TEXTALIGN, \'justify\', FIX,[300,450], TEXTALIGN, \'justify\', DELAY,1, TEXTALIGN, \'justify\' );" onmouseout="UnTip();"> </div> <div id="from_' . $from . '" class="rPosButton ' . $active . '" style="height: 185px;" onclick="getNextParticipants(this);this.blur();" onmouseover="Tip( get_value(\'' . $i . ' - ' . $to . '\'), TEXTALIGN, \'justify\', ABOVE,\'true\', TEXTALIGN, \'justify\', PADDING,10, TEXTALIGN, \'justify\', OPACITY,90, TEXTALIGN, \'justify\', FIX,[300,450], TEXTALIGN, \'justify\', DELAY,1, TEXTALIGN, \'justify\' );" onmouseout="UnTip();"> </div>'; break; } Now $active is set to all bars active.. ? http://team-x1.co.uk/league/popup.php?site=standings&ladderID=24
  7. Thanks for the for loop, worked fine but I'm having problems how to determine $active and will explain why I did it like that.. If you have a look at http://team-x1.co.uk/league/popup.php?site=standings&ladderID=24 you will see three grey bars to the right: <div id="RSCROLLBAR" class="PosButtons" style="position:absolute;top:0px;right:0px;height:555px;width:15px;"> <div id="from_0" class="rPosButton '.$active_1_20.'" style="height: 185px;" onclick="getNextParticipants(this);this.blur();" onmouseover="Tip( get_value(\'1 - 20\'), TEXTALIGN, \'justify\', ABOVE,\'true\', TEXTALIGN, \'justify\', PADDING,10, TEXTALIGN, \'justify\', OPACITY,90, TEXTALIGN, \'justify\', FIX,[300,450], TEXTALIGN, \'justify\', DELAY,1, TEXTALIGN, \'justify\' );" onmouseout="UnTip();"> </div> <div id="from_20" class="rPosButton '.$active_21_40.'" style="height: 185px;" onclick="getNextParticipants_21_40(this);this.blur();" onmouseover="Tip( get_value(\'21 - 40\'), TEXTALIGN, \'justify\', ABOVE,\'true\', TEXTALIGN, \'justify\', PADDING,10, TEXTALIGN, \'justify\', OPACITY,90, TEXTALIGN, \'justify\', FIX,[300,450], TEXTALIGN, \'justify\', DELAY,1, TEXTALIGN, \'justify\' );" onmouseout="UnTip();"> </div> <div id="from_40" class="rPosButton '.$active_41_60.'" style="height: 185px;" onclick="getNextParticipants_41_60(this);this.blur();" onmouseover="Tip( get_value(\'41 - 60\'), TEXTALIGN, \'justify\', ABOVE,\'true\', TEXTALIGN, \'justify\', PADDING,10, TEXTALIGN, \'justify\', OPACITY,90, TEXTALIGN, \'justify\', FIX,[300,450], TEXTALIGN, \'justify\', DELAY,1, TEXTALIGN, \'justify\' );" onmouseout="UnTip();"> </div> </div> It should show green bar which is "active" if I'm on that specified page. So if $active_21_40 is set to "active", it will show green bar instead of grey. I am having difficulty explaining, sorry.
  8. Hello! I am going to end up ending with many If-Else statements so I'm hoping someone can change this into a for loop for me, I will learn this way too if(empty($_GET['start'])) { $active_1_20 = 'active'; $limit_by = 'LIMIT 0,20'; $rank = 1; } elseif($_GET['start']==21) { $active_21_40 = 'active'; $limit_by = 'LIMIT 20,40'; $rank = 21; } elseif($_GET['start']==41) { $active_41_60 = 'active'; $limit_by = 'LIMIT 40,60'; $rank = 41; } elseif($_GET['start']==61) { $active_61_80 = 'active'; $limit_by = 'LIMIT 60,80'; $rank = 61; } You can see the obvious pattern, next one will be elseif($_GET['start']==81) and I want it to end to elseif($_GET['start']==501) Much appreciated anyone! Thanks.
  9. Please help someone, have I missed something?
  10. I'm really sorry if this is off the question but have noticed this is what I no longer require.. ok, this <div> tag: <div id="from_0" class="rPosButton '.$active_1_20.'" style="height: 184px;" onclick="getNextParticipants(this);this.blur();" onmouseover="Tip( get_value(\'1 - 20\'), TEXTALIGN, \'justify\', ABOVE,\'true\', TEXTALIGN, \'justify\', PADDING,10, TEXTALIGN, \'justify\', OPACITY,90, TEXTALIGN, \'justify\', FIX,[300,450], TEXTALIGN, \'justify\', DELAY,1, TEXTALIGN, \'justify\' );" onmouseout="UnTip();"> will trigger the onclick event: function getNextParticipants(button){ from = $(button).id.split('_')[1]; $('ULLIST_0').innerHTML = $('Loader').innerHTML; $$('.PosButtons').each(function(f){ $(f).select('.active').each(function(e){ e.removeClassName('active'); }); }); $(button).addClassName('active'); var listname = 'ranking'; if(friends){ var listname = 'friends'; } new Ajax.Updater('ULLIST_0', webRoot + '?site=standings&ladderID=<?php echo $_GET[ladderID]; ?>', { method: 'post', parameters: { listname: listname }, onComplete: function(transport){ //var bnts = $('RSCROLLBAR').childElements(); bnts = get_visible_elements($('RSCROLLBAR').childElements()); for(i=0; i < bnts.length; i++){ if(bnts[i].id==button.id){ if(i==0){ $('ladders_button_up').addClassName('previous_button_disabled'); if(bnts.length > 1){ $('ladders_button_down').removeClassName('next_button_disabled'); }else{ $('ladders_button_down').addClassName('next_button_disabled'); } }else if(i==(bnts.length-1)){ $('ladders_button_up').removeClassName('previous_button_disabled'); $('ladders_button_down').addClassName('next_button_disabled'); }else{ $('ladders_button_up').removeClassName('previous_button_disabled'); $('ladders_button_down').removeClassName('next_button_disabled'); } } } markMyPosition(); prepareTooltips(); ptt_init(); } }); } in PARENT target, I want it to open in top target. So I tried... new Ajax.Updater('ULLIST_0', top.location = '?site=standings&ladderID=<?php echo $_GET[ladderID]; ?>', { but this will open the page on pageload, without "top.location =" it opens page without pageload but opens in parent instead of top target. I would really appreciate if someone can help me with this... thank you!
  11. Hello! With this code, it opens in parent target and want to be able to open in top target. new Ajax.Updater('ULLIST_0', webRoot + '?site=standings&ladderID=<?php echo $_GET[ladderID]."&start=21"; ?>', { This is no good because I do not want to use location: new Ajax.Updater('ULLIST_0', top.location = '?site=standings&ladderID=<?php echo $_GET[ladderID]."&start=41"; ?>', { Need to somehow use webRoot, top location. help please with this.
  12. For example with this: onclick="getNextParticipants(this);this.blur();" Can I use if statement to check if user has clicked on the event?
  13. Sorry I mean: onClick="location.href="?site=cup_matches&match=69&laddID=21" I got it $match_link = matchlink($dm['matchID'],$ac=0,$tg=0,$redirect=1); $matchlink = "onclick=\"location.href='index.php".$match_link."';\""; <div class="rankingrow" style="height:28px;background-color:$bg_color" $matchlink> thanks anyway for help!
  14. this is what I see: <div class="rankingrow" style="height:28px;background-color:#4B4B4B" onClick="javascript:location.href=""?site=cup_matches&match=69&laddID=21" ">
  15. I keep trying but still not working $matchlink = "onClick=\"javascript:location.href=\"".$match_link."\""; anyone please?
  16. no? I don't think I need function to call onclick. never did this before.
  17. tried this already and nope, it doesn't do no page load when I click.
  18. Hi! I need help with passing php variable in onclick, can someone please correct code below? Right now the location.href is showing $match_link variable in address bar, it's not reading it. $matchlink = 'onclick="location.href=\'$match_link\';"'; I then echo HTML template... <div class="rankingrow" style="height:28px;background-color:$bg_color" $matchlink> thanks for help.
  19. :D didn't know I could php in js, thank you now working.
  20. Hello! With this code: new Ajax.Updater('ULLIST_0', top.location = '?site=standings1&ladderID=24&start=21', { I want to be able to use ladderID=$_GET['ladderID'] like in PHP, can I do this with js? also can't I use variable e.g. top.location = $variable, which will suit me much better. thanks for help!
  21. This is the safe_query() function: $_mysql_querys = array(); function safe_query($query="") { global $_mysql_querys; if(stristr(str_replace(' ', '', $query), "unionselect")===FALSE AND stristr(str_replace(' ', '', $query), "union(select")===FALSE){ $_mysql_querys[] = $query; if(empty($query)) return false; if(DEBUG == "OFF") $result = mysql_query($query) or die('Query failed!'); else { $result = mysql_query($query) or die('Query failed: ' .'<li>errorno='.mysql_errno() .'<li>error='.mysql_error() .'<li>query='.$query); } return $result; } else die(); } Does it escape $cupID? If not a lot of work needs to be done as I have coded many things like this. Thanks
  22. I'm confused, can this result in css/sql injection? if(isset($_GET['action'])){ if($_GET['action'] == 'details'){ $cupID = $_GET['cupID']; $ergebnis = safe_query("SELECT gameaccID, name, start, ende, typ, game, `desc`, status, checkin, maxclan, gewinn1, gewinn2, gewinn3 FROM ".PREFIX."cups WHERE ID = '".$cupID."'"); $ds=mysql_fetch_array($ergebnis); ... Some german fellow was explaining, translate to English briefly: "$ CupID is not escaped. NEN here I could just "; DROP TABLE` cups `Paste and your table is no longer available eez. Or I could inject javascript, your current session read out, accept it and act as an admin ... " I am trying to understand what he means by this... is this query vulnerable to an injection and why/how?
  23. Forgot to say thanks alot, works great
  24. Hi, I'm having trouble generating random string with 8 characters, when I refresh I sometimes get 6 characters and sometimes 8. "-" not included as character. Wrong: 6JW-F7W Correct: (should always generate random like this) DVMF-F36V I know I'm trying to achieve this in wrong methods but it's the only way I know. Hope someone can help. function getReference() { $length = 8; $characters = "0123456789abcdefghijklmnopqrstuvwxyz"; for ($p = 0; $p < $length; $p++) { $string .= $characters[mt_rand(0, strlen($characters))]; } return strtoupper(substr($string, 0, -$length/2)."-".substr($string, $length/2-1, -1)); }
  25. thank you works fine.
×
×
  • 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.