Jump to content

karthikeyan_coder

Members
  • Posts

    201
  • Joined

  • Last visited

    Never

Posts posted by karthikeyan_coder

  1. Hello,

     

    I have this text.

    $string = "blab blab some useless html tags here

    <strong>Downloads:</strong> 1,826

    </p> and some other ";

     

    I need to get number of downloads only.

     

    I have no guess about this. how to fetch the data the resides between "Downloads:</strong>" and </p>

     

    Note: that page may have too many "Downloads" words and </strong> tags. so "Downloads:</strong>" would be a best initial needle for fetching..

     

    Help me please.

  2. Hello,

     

    I am trying to show youtube/metacafe & so vids in some other page. I need to make all video size fixed.

     

    $string = '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/shJ436747sE"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/shJ436747sE" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>';

     

    I need width value = 400 & height = 325.

     

    I am tying this hardly in last couple of hours.. But no success yet!.. please help me..

     

    I need result string with "width="400" " and "height=325"

     

  3. Hello,

              Someone may already familiar with this error.

    Notice: Use of undefined constant MCRYPT_BLOWFISH - assumed 'MCRYPT_BLOWFISH'.

     

    PHP details:

    PHP Version 5.2.3

     

    Configure Command './configure' '--build=i686-redhat-linux-gnu' '--host=i686-redhat-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-kerberos' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--without-mime-magic' '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml' '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--without-odbc' '--disable-dom' '--disable-dba' '--without-unixODBC' '--disable-pdo' '--disable-xmlreader' '--disable-xmlwriter' '--disable-json'

     

    additional .ini files parsed /etc/php.d/dom.ini, /etc/php.d/gd.ini, /etc/php.d/imap.ini, /etc/php.d/json.ini, /etc/php.d/ldap.ini, /etc/php.d/mbstring.ini, /etc/php.d/mcrypt.ini, /etc/php.d/mysql.ini, /etc/php.d/mysqli.ini, /etc/php.d/ncurses.ini, /etc/php.d/odbc.ini, /etc/php.d/pdo.ini, /etc/php.d/pdo_mysql.ini, /etc/php.d/pdo_odbc.ini, /etc/php.d/pdo_pgsql.ini, /etc/php.d/pdo_sqlite.ini, /etc/php.d/pgsql.ini, /etc/php.d/snmp.ini, /etc/php.d/xmlreader.ini, /etc/php.d/xmlrpc.ini, /etc/php.d/xmlwriter.ini, /etc/php.d/xsl.ini, /etc/php.d/zend.ini, /etc/php.d/zip.ini

     

    We installed

    libmcrypt-2.5.7-1.2,

    mcrypt-2.6.4-3 and

    php-mcrypt-4.3.9-3.2.1

    today.. But still getting the same error.

     

    any help?

  4. I need to get urls from this page..

    http://crappytools.com/pingurls/list.asp

    i am using my own function to get urls. tell me how is it.. If you have any idea/suggestion then plz let me know.

    <?php
    function line_stripper($url,$checker,$filter)
    {
    $file = file_get_contents($url);
    $string = explode("\n",$file);
    $j=0;
    for($i=1;$i<=count($string); $i++)
    {
    $res=1;
    $res = strpos($string[$i],$checker);
    if($res === 0)
    {
        $short = strpos($string[$i],$filter);
        if($short == "" )
        {
            $list[$j] = $string[$i];
            $j++;
        }
    }
    }
    return $list;
    }
    $result = line_stripper("http://crappytools.com/pingurls/list.asp","http","fails");
    print_r($result);
    ?>

    $checker= "http" As we need urls alone then

    $filter=We dont need failed urls. So we filter from result urls.

  5. I have a string like below.

     

    $string = "Inner peace, which is peace of mind, is not the sole possession of yogis and hermits. You too can enjoy it without becoming a yogi or a hermit.

     

    Click here to read the article."

     

    I have to replace "Click here blablab" with "";

     

    But we cannt guess the words followed by "Click here"

     

    so i need to replace a sub string which starts with "Click here or click here" and ends with ". or !"

     

    thanks in advance :)

  6. Thanks for the help with regex.

     

    I got above Header informations ONLY FROM "live http headers" plugin for firefox.

     

    My only one question is.. How can i get Header information like this from google.com page?

     

    #1: I need to get these information from google.com/blablab

    #2: Store it in a $PHP_Variable then do "String Findings" using Reg Ex

     

    You friends helping for #2.. I need your support for #1 :)

  7. https://www.google.com/accounts/LoginAuth?service=blogger

     

    POST /accounts/LoginAuth?service=blogger HTTP/1.1

    Host: www.google.com

    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3

    Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5

    Accept-Language: en-us,en;q=0.5

    Accept-Encoding: gzip,deflate

    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

    Keep-Alive: 300

    Connection: keep-alive

    Referer: https://www.google.com/accounts/Login?service=blogger&naui=8&skipvpage=true&alwf=true

    Cookie: __utmz=173272373.1178976993.22.5.utmccn=(referral)|utmcsr=freakitude.com|utmcct=/2007/02/08/gmail-open-for-all/|utmcmd=referral; __utma=173272373.1617290277.1173753241.1179329475.1179808574.29; GoogleAccountsLocale_session=en; __utma=173272373.1617290277.1173753241.1179808574.1180096851.30; __utmz=173272373.1180062305.29.6.utmccn=(referral)|utmcsr=72.249.25.177|utmcct=/~albaybi/new/|utmcmd=referral; __utmb=173272373; __utmc=173272373; rememberme=true; PREF=ID=cc03b169fb414456:FF=4:TB=2:LD=en:NR=10:TM=1172328518:LM=1177868161:DV=AA:GM=1:S=8V2P_LBiblPSVDDz; adsenseReferralSourceId=; adsenseReferralClickId=; WebmastersLocale=en; adsenseReferralSubId=

    Content-Type: application/x-www-form-urlencoded

    Content-Length: 105

    service=blogger&naui=8&skipvpage=true&alwf=true&Email=ednremeterqg&Passwd=e028bc&rmShown=1&signIn=Sign+in

    HTTP/1.x 302 Moved Temporarily

    Content-Type: text/html; charset=UTF-8

    Set-Cookie: rememberme=false;Domain=.google.com;Path=/;Expires=Mon, 22-May-2017 12:45:49 GMT

    Set-Cookie: SID=DQAAAGwAAACyNQrtVn4FOI0Da5WdH3aQfbGocYAnTlpKZTJPp5LyTAWLJRirIrbl4UnHt6kSLCLr6C5tvKBa4Fnxj9Vfis6YvH93sijKjAWZH0ZAiFU4iqNP6dpWWLMo1G2MdpNuIVfnYyg7L5iwzcnhCRduXi6_;Domain=.google.com;Path=/

    Set-Cookie: LSID=EXPIRED;Domain=.google.com;Path=/;Expires=Mon, 01-Jan-1990 00:00:00 GMT

    Set-Cookie: LSID=EXPIRED;Path=/;Expires=Mon, 01-Jan-1990 00:00:00 GMT

    Set-Cookie: LSID=EXPIRED;Domain=www.google.com;Path=/accounts;Expires=Mon, 01-Jan-1990 00:00:00 GMT

    Set-Cookie: LSID=DQAAAG8AAADj279ak7iMxiwz0DhWSiHUGRpN_Nmbr6eT1PJJAKoNmdPk7rkOIpo3z4Dvz4pHrWJmZO79Oa18V42X2JQeN-mAaCcdVVtDY7-IjpHrrMv39e2UdNipyI46pJC3HmnUpsBRD4_hv4rWZkquIl_E-5Rf;Path=/accounts;Secure

    Location: https://www.google.com/accounts/CheckCookie?service=blogger&chtml=LoginDoneHtml&skipvpage=true&naui=8

    Cache-Control: private

    Transfer-Encoding: chunked

    Content-Encoding: gzip

    Date: Fri, 25 May 2007 12:45:49 GMT

    Server: GFE/1.3

    ----------------------------------------------------------

    https://www.google.com/accounts/CheckCookie?service=blogger&chtml=LoginDoneHtml&skipvpage=true&naui=8

     

    GET /accounts/CheckCookie?service=blogger&chtml=LoginDoneHtml&skipvpage=true&naui=8 HTTP/1.1

    Host: www.google.com

    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3

    Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5

    Accept-Language: en-us,en;q=0.5

    Accept-Encoding: gzip,deflate

    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

    Keep-Alive: 300

    Connection: keep-alive

    Referer: https://www.google.com/accounts/Login?service=blogger&naui=8&skipvpage=true&alwf=true

    Cookie: __utmz=173272373.1178976993.22.5.utmccn=(referral)|utmcsr=freakitude.com|utmcct=/2007/02/08/gmail-open-for-all/|utmcmd=referral; __utma=173272373.1617290277.1173753241.1179329475.1179808574.29; GoogleAccountsLocale_session=en; __utma=173272373.1617290277.1173753241.1179808574.1180096851.30; __utmz=173272373.1180062305.29.6.utmccn=(referral)|utmcsr=72.249.25.177|utmcct=/~albaybi/new/|utmcmd=referral; __utmb=173272373; __utmc=173272373; LSID=DQAAAG8AAADj279ak7iMxiwz0DhWSiHUGRpN_Nmbr6eT1PJJAKoNmdPk7rkOIpo3z4Dvz4pHrWJmZO79Oa18V42X2JQeN-mAaCcdVVtDY7-IjpHrrMv39e2UdNipyI46pJC3HmnUpsBRD4_hv4rWZkquIl_E-5Rf; rememberme=false; PREF=ID=cc03b169fb414456:FF=4:TB=2:LD=en:NR=10:TM=1172328518:LM=1177868161:DV=AA:GM=1:S=8V2P_LBiblPSVDDz; adsenseReferralSourceId=; adsenseReferralClickId=; WebmastersLocale=en; adsenseReferralSubId=; SID=DQAAAGwAAACyNQrtVn4FOI0Da5WdH3aQfbGocYAnTlpKZTJPp5LyTAWLJRirIrbl4UnHt6kSLCLr6C5tvKBa4Fnxj9Vfis6YvH93sijKjAWZH0ZAiFU4iqNP6dpWWLMo1G2MdpNuIVfnYyg7L5iwzcnhCRduXi6_

     

    HTTP/1.x 200 OK

    Content-Type: text/html; charset=UTF-8

    Cache-Control: no-cache

    Pragma: no-cache

    Transfer-Encoding: chunked

    Content-Encoding: gzip

    Date: Fri, 25 May 2007 12:45:50 GMT

    Server: GFE/1.3

    ----------------------------------------------------------

  8. Hello,

              I am trying to get a browser cookie(not a text file cookie) value of a remote website.

     

    I've installed "Live HTTP headers" plugin for firefox, to trace all header information.

     

    I am using pfsockopen(); for reading a remote website...

     

    In header.. Two kinds of cookie values are there.

    1. Set-Cookie:

    &

    2. Cookie:

     

    I need Cookie value alone.

     

    Any help would be really appreciated.

     

  9. Hello,

            First of all great thanks to all PHPFreaks... Coz i am getting some new ideas from this forum always...

     

    Lets go to the problem...

     

    if you type "https://www.google.com/accounts/NewAccount?service=mail" in address bar... google will automatically redirects itself to some page similar like..

     

    https://www.google.com/accounts/NewAccount?service=mail&t=ddac592b-4825b1e3-d59eb27e4391e89e55bd&continue=http%3A%2F%2Fmail.google.com%2Fmail%2Fe-11-105c945b390a9d18f9cb58c765347318-021b3aca0aa65adf42d2c538e2d9ad4ed1b81d85&type=2

     

    Here is the new values "t" and "continue" google

     

    We know "https://www.google.com/accounts/NewAccount?service=mail" only.. we cannt guess the "t" and "continue" values fully anyway...

     

    Lets say i have a function to read the urls...

    getSocket();

     

    $host = "www.google.com";

    $url = "/accounts/NewAccount?service=mail";

    $responce=getSocket($host,$url,"GET",443);

    die($responce);

     

    the result is... i am redirected to some "https://google.com/NewAccount?service=mail&t=blablab&continue=blab";

    My browser url also above...

     

    My need is...

     

    $host = "www.google.com";

    $url = "/accounts/NewAccount?service=mail";

    $responce=getSocket($host,$url,"GET",443);

    ////////////////////////////////////////////////////

    //                                                    /////

    // do some operations with $responce //////

    ///////////////////////////////////////////////////

    // And get "t" and "continue" values... /////

    // I mean... I want to know that.. what is the redirection url after calling //

    ///accounts/NewAccount?service=mail//////

    //////////////////////////////////////////////////

     

    Many sites are doing like google.. i want to know what is the technology behind that..

    and how can we guess the redirection url after calling a specific page....

     

    Note: the function getSocket is having pfsockopen() function as a core.

     

    Regards,

    Karthi Keyan.

  10. I have 334,164 rows in a table. I guess it will be increased to 7-8 digits soon.

     

    I have some db operations.

     

    I need to take 120,200 random rows from that table. so i use...

    $num = rand(120,200);

    $query = "SELECT * FROM `links` ORDER BY RAND() LIMIT 1,$num";

     

    &

     

    I will delete some rows based on some range...

    Lets say..

    ID ------ LINK

    1  -------  href=http://subdomain.domainname.ext/somepage-asdf.ext>keyword</a>

    5000  -------  href=http://subdomain2.domainname.ext/somepage-dafsdf.ext>keyword</a>

    60000  ------- href=http://subdomain3.domainname.ext/somepage-ewrw.ext>keyword</a>

    60001  ------- href=http://subdomain.domainname2.ext/somepage-gfvf.ext>keyword</a>

    300300  ------- href=http://subdomain.domainname3.ext/somepage-gfvf.ext>keyword</a>

     

    I have to delete all the rows which contains $delete_this_domain

     

    $delete_this_domain may be "domainname.ext" , "domainname2.ext"

    Just main domain part...

    I may have to delete 60000 rows in a query.. is MySQL can work smoothly? and please tell me a better query for deleting those rows.

     

     

     

  11. a program that generates a list of 10,000 numbers in random order each time it is run. Each number in the list must be unique and be between 1 and 10,000

     

    thanks.

  12. Hello,

          I am parsing a rss. While parsing i am getting some  images inside the description. Actually i dont want it. so i try to remove <img tags.

     

    $desc = "this is the sample image <img src='image.jpg'> have a look on it";

     

    I need $desc like "this is the sample image <!-- <image src='image.jpg'> --> have a look on it"

     

    any help?

  13. Hello,

            I am having a table with a timestamp field.

    id::  inserteddate

    1 :: 2007-01-19 21:22:23  11 weeks

    2 :: 2007-01-23 21:22:23  10 weeks

    3 :: 2007-01-29 21:22:23  9 weeks

    4 :: 2007-02-19 21:22:23  7 weeks

    5 :: 2007-02-26 21:22:23  6 weeks

    6 :: 2007-03-03 21:22:23  5 weeks

    7 :: 2007-03-19 21:22:23  3 weeks

     

    if i want to select rows started before 6 weeks...

    then the result should be

    5 :: 2007-02-26 21:22:23  6 weeks

    6 :: 2007-03-03 21:22:23  5 weeks

    7 :: 2007-03-19 21:22:23  3 weeks

     

    if i want to select rows started before 9 weeks then

    result should be

    3 :: 2007-01-29 21:22:23  9 weeks

    4 :: 2007-02-19 21:22:23  7 weeks

    5 :: 2007-02-26 21:22:23  6 weeks

    6 :: 2007-03-03 21:22:23  5 weeks

    7 :: 2007-03-19 21:22:23  3 weeks

     

    any help?

     

     

     

×
×
  • 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.