Полезные скрипты

Discussion in 'PHP' started by SMiX, 2 Nov 2006.

  1. Sko_fake

    Sko_fake New Member

    Joined:
    10 Nov 2011
    Messages:
    2
    Likes Received:
    0
    Reputations:
    0
    А ты что не видишь?
    Написано же - "Парсер url'ов l2top.ru"
     
  2. sadist_ua

    sadist_ua Banned

    Joined:
    21 Jul 2010
    Messages:
    0
    Likes Received:
    0
    Reputations:
    0
    Привет всем, ищу скрипт для вывода картинки в страничке которая берётся из картинок гугла по заданому ключу.Поделитесь пожалуйста в пм.
     
  3. AppS

    AppS Member

    Joined:
    8 Aug 2009
    Messages:
    249
    Likes Received:
    25
    Reputations:
    6
    Народ нет ни у кого скриптика который проверял файлы на удалных серверах
    такого вида:

    С добавлением и удалением?
    Заранее Спасибо!;)
     
  4. Katsuro

    Katsuro Member

    Joined:
    26 May 2009
    Messages:
    42
    Likes Received:
    16
    Reputations:
    0
    Нужен скрипт парсинга контента с соц сетей, с последующим постингом в phpbb3 (форумные движки). Может у кого завалялись подобные скрипты?
     
  5. GAiN

    GAiN Elder - Старейшина

    Joined:
    2 Apr 2011
    Messages:
    2,550
    Likes Received:
    172
    Reputations:
    99
    Этот скрипт перенаправляет на ту страниц. адрес которой указан в нём.
    Например: поставишь его на главной странице и укажешь адрес форума, то главной стр. не увидишь, открываться будет форум.
    Ставить в head.

    PHP:
    <script
    if (
    parent.length<|| parent.location.toString().indexOf()==-1
    window.location="адрес страницы" 
    </script>
    <script language="JavaScript">  
      window.location.href = "адрес страницы" 
    </script>
     
  6. GAiN

    GAiN Elder - Старейшина

    Joined:
    2 Apr 2011
    Messages:
    2,550
    Likes Received:
    172
    Reputations:
    99
    Чётные и нечётные недели

    чётный нечётный день
    PHP:
    <script type="text/javascript">
    myDate = new Date();
    rdate myDate.getDate();
    rday myDate.getDay();
    myDate.setDate(1);

    if(!
    rday)
    k=6; else k=rday-1;
    if(!
    myDate.getDay())
    l=6; else l=myDate.getDay()-1;

    if(
    rdate<8-l){
    ponedelnik 8-l;
    if(
    ponedelnik/== Math.floor(ponedelnik/2))
    chet 0; else chet 1;
    } else {
    ponedelnik rdate k;
    if(
    ponedelnik/== Math.floor(ponedelnik/2))
    chet 1; else chet 0
    if(
    chet==1){document.write('Четная')} else {document.write('Нечетная')}; 
    }
    </script>
     
  7. Real1

    Real1 Banned

    Joined:
    28 Dec 2011
    Messages:
    2
    Likes Received:
    0
    Reputations:
    0
    :confused: Хотя одно и тоже...
    Хм, какой-то простенький md5 брут

    PHP код:
    <?
    function pass_dict ($hash)
    {
    //вычисляем начальное время, необходимое для расчета общего времени выполнения скрипта
    $start_time = microtime();
    $start_array = explode(" ",$start_time);
    $start_time = $start_array[1] + $start_array[0];

    //открываем файл словаря из стандартного дистрибутива линукса
    $f = fopen("linux.words","r") or die("ошибка");
    while (!feof($f))
    {
    $str = strtolower(fgets($f));
    //удаляем лишние пробелы и символы конца строки
    $str = trim($str);
    $strmd5 = md5($str);
    if ($strmd5 == $hash)
    $pass = $str;

    if (isset($pass))
    {
    echo "password = ".$pass;
    $end_time = microtime();
    $end_array = explode(" ",$end_time);
    $end_time = $end_array[1] + $end_array[0];
    $time = $end_time - $start_time;
    echo "<br><center>Найдено за $time секунд!</center>";
    fclose($f);
    return;
    }
    }

    $end_time = microtime();
    $end_array = explode(" ",$end_time);
    $end_time = $end_array[1] + $end_array[0];
    $time = $end_time - $start_time;
    echo "<br><center>Не найдено за $time секунд!</center>";
    fclose($f);
    return;
    }
    pass_dict("e206a54e97690cce50cc872dd70ee896");
    ?>
     
  8. SHiNiGaMi

    SHiNiGaMi Banned

    Joined:
    3 Jan 2010
    Messages:
    382
    Likes Received:
    55
    Reputations:
    15
    php-функция для определения физического положения хоста через сервис geoiptool.com
    PHP:
    <?php
    //$ip - IP-адрес
    //$CRLF - разделитель между заголовками. В windows \r\n, в Mac \n\r и т.д.
    //возвращает массив вида:
    //IP
    //страна
    //буквенный код страны
    //регион
    //город
    //почтовый индекс
    //телефонный код страны
    //геогр. долгота
    //геогр. ширина
    function geoIp($ip$CRLF)
    {
        
    $fh fsockopen('www.geoiptool.com'80$errno$errstr10);

        if(!
    $fh)
            return 
    false;
        
        
    fputs($fh"GET /en/?IP=".$ip." HTTP/1.1".$CRLF.
                    
    "Host: www.geoiptool.com".$CRLF.$CRLF);

        for(
    $i=0;$i<10;$i++)
            
    fgets($fh128);
        
        
    $answer fread($fh99999);
        
    $answer .= fread($fh99999);

        
    $ip_info = Array();
        
    preg_match('#IP Address:</span></td>\s+<td align="left" class="arial_bold">(.+?)</td>#i'$answer$matches);
        
    $ip_info[0] = $matches[1] ? $matches[1] : null;

        
    preg_match('#Country:</span></td>\s+<td align="left" class="arial_bold"><a href="http://en.wikipedia.org/wiki/[^"]*" target="_blank">(.+?)</a>#i'$answer$matches);
        
    $ip_info[1] = $matches[1] ? $matches[1] : null;

        
    preg_match('#Country code:</span></td>\s+<td align="left" class="arial_bold">(.+?)</td>#i'$answer$matches);
        
    $ip_info[2] = $matches[1] ? $matches[1] : null;

        
    preg_match('#Region:</span></td>\s+<td align="left" class="arial_bold"><a href="http://en.wikipedia.org/wiki/[^"]*" target="_blank">(.+?)</a></td>#i'$answer$matches);
        
    $ip_info[3] = $matches[1] ? $matches[1] : null;

        
    preg_match('#City:</span></td>\s+<td align="left" class="arial_bold">(.+?)</td>#i'$answer$matches);
        
    $ip_info[4] = $matches[1] ? $matches[1] : null;

        
    preg_match('#Postal code:</span></td>\s+<td align="left" class="arial_bold">(\d+?)</td>#i'$answer$matches);
        
    $ip_info[5] = $matches[1] ? $matches[1] : null;

        
    preg_match('#Calling code:</span></td>\s+<td align="left" class="arial_bold"><a href="http://en.wikipedia.org/wiki/Area_code\#[^"]*">(.+?)</a></td>#i'$answer$matches);
        
    $ip_info[6] = $matches[1] ? $matches[1] : null;

        
    preg_match('#Longitude:</span></td>\s+<td align="left" class="arial_bold">(.+?)</td>#i'$answer$matches);
        
    $ip_info[7] = $matches[1] ? $matches[1] : null;

        
    preg_match('#Latitude:</span></td>\s+<td align="left" class="arial_bold">(.+?)</td>#i'$answer$matches);
        
    $ip_info[8] = $matches[1] ? $matches[1] : null;
        
        return 
    $ip_info;
    }
    ?>
     
  9. luckyhacker

    luckyhacker New Member

    Joined:
    12 Jan 2012
    Messages:
    1
    Likes Received:
    0
    Reputations:
    0
    Здравствуйте. Мне нужен скрипт для рассылки html писем на email.
    Заранее благодарен.
     
    #1109 luckyhacker, 12 Jan 2012
    Last edited: 13 Jan 2012
  10. AppS

    AppS Member

    Joined:
    8 Aug 2009
    Messages:
    249
    Likes Received:
    25
    Reputations:
    6
    luckyhacker

    файл index.html:

    файл send.php:

     
  11. losserr

    losserr New Member

    Joined:
    14 Jan 2012
    Messages:
    5
    Likes Received:
    0
    Reputations:
    0
    Ребят, накатайте кому не трудно:

    Имеется файл sourse.txt с парой: юин;пароль (валид/невалид)
    Имеется файл good.txt с парой: юин;пароль2 (валид)
    Необходимо: чтобы из файла sourse.txt удалились строки, в которых есть такой же UIN, какой и в файле good.txt, и создался файл sourse2.txt
    Т.е. sourse2.txt = sourse.txt-good.txt (по UINу, пароли в этих файлах разные)
     
  12. SergioBlog

    SergioBlog New Member

    Joined:
    21 Jan 2011
    Messages:
    10
    Likes Received:
    2
    Reputations:
    0
    Посоветуйте скрипт для работы с microsoft sql server плз
     
  13. shell_c0de

    shell_c0de Hack All World

    Joined:
    7 Jul 2009
    Messages:
    1,164
    Likes Received:
    617
    Reputations:
    690
    https://rdot.org/forum/showthread.php?t=1142
     
    _________________________
    1 person likes this.
  14. lukmus

    lukmus Elder - Старейшина

    Joined:
    18 Nov 2009
    Messages:
    400
    Likes Received:
    118
    Reputations:
    23
    загрузка изображения в ВК

    Есть у кого-нибудь кому не жалко рабочий скрипт на любом языке (желательнее на php или ruby) загрузки аватара и/или изображений в альбом в ВК.
    Интересует сама тема со всякими хэшами и прочей защитой ВК.
     
  15. Nikit

    Nikit New Member

    Joined:
    19 Jan 2012
    Messages:
    21
    Likes Received:
    3
    Reputations:
    0
    lukmus: http://www.google.ru/search?q=умный%20аватар%20вконтакте
    P.S. Там будет и авторизация, и загрузка аватара.
     
  16. nordx

    nordx New Member

    Joined:
    19 Sep 2011
    Messages:
    7
    Likes Received:
    0
    Reputations:
    0
    есть у кого скрипт простенького самодельного файлового обменника, просьба выложить. заранее благодарен.
     
  17. Nikit

    Nikit New Member

    Joined:
    19 Jan 2012
    Messages:
    21
    Likes Received:
    3
    Reputations:
    0
    nordx, Вот инструкция: http://php.su/phphttp/?uploads
    А скоро я тут выложу файл-хостинг, который будет всё в zip-архивы пихать. И каптча будет :3
     
    #1117 Nikit, 21 Jan 2012
    Last edited: 21 Jan 2012
  18. GAiN

    GAiN Elder - Старейшина

    Joined:
    2 Apr 2011
    Messages:
    2,550
    Likes Received:
    172
    Reputations:
    99
    перенаправление по экрану

    PHP:
    <script>
    if(
    screen.width 1024)
        
    document.location.href "http://mobile.mysite.ru";
    </script>
     
  19. GAiN

    GAiN Elder - Старейшина

    Joined:
    2 Apr 2011
    Messages:
    2,550
    Likes Received:
    172
    Reputations:
    99
    Отключение правой кнопки на flash роликах

    PHP:
    <script type="text/javascript" src="http://sitename/js/rightClick.js"></script>
    <script type="text/javascript" src="http://sitename/js/swfobject.js"></script>
    <body onload="RightClick.init();">
    <script type="text/javascript">
    so.addParam("quality", "high");
    so.addParam("name", "customRightClick");
    so.addParam("id", "customRightClick");
    so.addParam("AllowScriptAccess", "always");
    so.addParam("wmode", "opaque");
    so.addParam("menu", "false");
    so.write("flashcontent");
    </script>
    это скрипт Отключения правой кнопки на флеш роликах
    Работает на safari и chrome

    содержимое rightClick.js
    PHP:
    var RightClick = {
     
    /**
      *  Constructor
      */ 
     
    init: function () {
      
    this.FlashObjectID "customRightClick";
      
    this.FlashContainerID "flashcontent";
      
    this.Cache this.FlashObjectID;
      if(
    window.addEventListener){
        
    window.addEventListener("mousedown"this.onGeckoMouse(), true);
      } else {
       
    document.getElementById(this.FlashContainerID).onmouseup = function() { document.getElementById(RightClick.FlashContainerID).releaseCapture(); }
       
    document.oncontextmenu = function(){ if(window.event.srcElement.id == RightClick.FlashObjectID) { return false; } else { RightClick.Cache "nan"; }}
       
    document.getElementById(this.FlashContainerID).onmousedown RightClick.onIEMouse;
      }
     },
     
    /**
      * GECKO / WEBKIT event overkill
      * @param {Object} eventObject
      */
     
    killEvents: function(eventObject) {
      if(
    eventObject) {
       if (
    eventObject.stopPropagationeventObject.stopPropagation();
       if (
    eventObject.preventDefaulteventObject.preventDefault();
       if (
    eventObject.preventCaptureeventObject.preventCapture();
          if (
    eventObject.preventBubbleeventObject.preventBubble();
      }
     },
     
    /**
      * GECKO / WEBKIT call right click
      * @param {Object} ev
      */
     
    onGeckoMouse: function(ev) {
        return function(
    ev) {
         if (
    ev.button != 0) {
       
    RightClick.killEvents(ev);
       if(
    ev.target.id == RightClick.FlashObjectID && RightClick.Cache == RightClick.FlashObjectID) {
           
    RightClick.call();
       }
       
    RightClick.Cache ev.target.id;
      }
       }
     },
     
    /**
      * IE call right click
      * @param {Object} ev
      */
     
    onIEMouse: function() {
        if (
    event.button 1) {
       if(
    window.event.srcElement.id == RightClick.FlashObjectID && RightClick.Cache == RightClick.FlashObjectID) {
        
    RightClick.call(); 
       }
       
    document.getElementById(RightClick.FlashContainerID).setCapture();
       if(
    window.event.srcElement.id)
       
    RightClick.Cache window.event.srcElement.id;
      }
     },
     
    /**
      * Main call to Flash External Interface
      */
     
    call: function() {
      
    document.getElementById(this.FlashObjectID).rightClick();
     }
     
    }
    содержимое swfobject.js
    PHP:
    if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
     
  20. GAiN

    GAiN Elder - Старейшина

    Joined:
    2 Apr 2011
    Messages:
    2,550
    Likes Received:
    172
    Reputations:
    99
    открыть 2 окна по нажатию на ссылку

    PHP:
    <script>
    function 
    open_windows()
    {
        
    window.open('http://google.com');
        
    window.open ('http://rambler.ru');
    }
    </script>
    <a href="http://yandex.ru" onclick="open_windows();">yandex.ru</a>