Results 1 to 9 of 9

Thread: exec

  1. #1

    Thread Starter
    Banned ThaRubby's Avatar
    Join Date
    Apr 2005
    Location
    127.0.0.1
    Posts
    356

    Resolved exec

    Is there some reason why:
    <?
    echo exec('whois google.com');
    ?>
    Turns up nothing?
    Last edited by ThaRubby; Jun 22nd, 2005 at 06:48 PM.

  2. #2
    Fanatic Member ALL's Avatar
    Join Date
    Jul 2004
    Location
    192.168.1.1
    Posts
    711

    Re: exec

    because 'whois' is not a program that can be executed in the command prompt

    look at this link:
    http://us2.php.net/manual/en/function.exec.php
    Please support one of my projects?
    TKForums.com

    Web Forum
    JavaScript Wiki
    ________________________
    If somone helps you, please rate their post, by clicking the to rate their post

  3. #3

    Thread Starter
    Banned ThaRubby's Avatar
    Join Date
    Apr 2005
    Location
    127.0.0.1
    Posts
    356

    Re: exec

    I dont use command prompt i use linux, and it is a command. And when i googled php exec that is the link I found already

  4. #4
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: exec

    Firstly what output are you expecting? Secondly, what output are you getting? - Remember that the exec function returns only the last line from stdout. If you want the whole lot then you need to use the passthru() function.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  5. #5

    Thread Starter
    Banned ThaRubby's Avatar
    Join Date
    Apr 2005
    Location
    127.0.0.1
    Posts
    356

    Re: exec

    Well when i type whois google.com in terminal I get:
    tharub3x@Force:~$ whois google.com

    Whois Server Version 1.3

    Domain names in the .com and .net domains can now be registered
    with many different competing registrars. Go to http://www.internic.net
    for detailed information.

    Server Name: GOOGLE.COM.ZZZZ.DNSW.COM
    IP Address: 69.93.107.106
    Registrar: TUCOWS INC.
    Whois Server: whois.opensrs.net
    Referral URL: http://domainhelp.tucows.com



    Server Name: GOOGLE.COM.VN
    Registrar: ONLINENIC, INC.
    Whois Server: whois.OnlineNIC.com
    Referral URL: http://www.OnlineNIC.com



    Server Name: GOOGLE.COM.SUCKS.FIND.CRACKZ.WITH.SEARCH.GULLI.COM
    IP Address: 80.190.192.24
    Registrar: KEY-SYSTEMS GMBH
    Whois Server: whois.rrpproxy.net
    Referral URL: http://www.key-systems.net



    Server Name: GOOGLE.COM.IS.NOT.HOSTED.BY.ACTIVEDOMAINDNS.NET
    IP Address: 217.148.161.5
    Registrar: ENOM, INC.
    Whois Server: whois.enom.com
    Referral URL: http://www.enom.com



    Server Name: GOOGLE.COM.IS.APPROVED.BY.NUMEA.COM
    IP Address: 213.228.0.43
    Registrar: GANDI
    Whois Server: whois.gandi.net
    Referral URL: http://www.gandi.net



    Server Name: GOOGLE.COM.HAS.LESS.FREE.PORN.IN.ITS.SEARCH.ENGINE.THAN.SECZY.COM
    IP Address: 209.187.114.130
    Registrar: INNERWISE, INC. D/B/A ITSYOURDOMAIN.COM
    Whois Server: whois.itsyourdomain.com
    Referral URL: http://www.itsyourdomain.com



    Server Name: GOOGLE.COM.AU
    Registrar: PRIMUS TELCO PTY LTD DBA PRIMUSDOMAIN/PLANETDOMAIN
    Whois Server: whois.planetdomain.com
    Referral URL: http://www.planetdomain.com



    Domain Name: GOOGLE.COM
    Registrar: ALLDOMAINS.COM INC.
    Whois Server: whois.alldomains.com
    Referral URL: http://www.alldomains.com
    Name Server: NS2.GOOGLE.COM
    Name Server: NS1.GOOGLE.COM
    Name Server: NS3.GOOGLE.COM
    Name Server: NS4.GOOGLE.COM
    Status: REGISTRAR-LOCK
    Updated Date: 03-oct-2002
    Creation Date: 15-sep-1997
    Expiration Date: 14-sep-2011


    >>> Last update of whois database: Wed, 22 Jun 2005 09:26:44 EDT <<<

    NOTICE: The expiration date displayed in this record is the date the
    registrar's sponsorship of the domain name registration in the registry is
    currently set to expire. This date does not necessarily reflect the expiration
    date of the domain name registrant's agreement with the sponsoring
    registrar. Users may consult the sponsoring registrar's Whois database to
    view the registrar's reported date of expiration for this registration.

    TERMS OF USE: You are not authorized to access or query our Whois
    database through the use of electronic processes that are high-volume and
    automated except as reasonably necessary to register domain names or
    modify existing registrations; the Data in VeriSign Global Registry
    Services' ("VeriSign") Whois database is provided by VeriSign for
    information purposes only, and to assist persons in obtaining information
    about or related to a domain name registration record. VeriSign does not
    guarantee its accuracy. By submitting a Whois query, you agree to abide
    by the following terms of use: You agree that you may use this Data only
    for lawful purposes and that under no circumstances will you use this Data
    to: (1) allow, enable, or otherwise support the transmission of mass
    unsolicited, commercial advertising or solicitations via e-mail, telephone,
    or facsimile; or (2) enable high volume, automated, electronic processes
    that apply to VeriSign (or its computer systems). The compilation,
    repackaging, dissemination or other use of this Data is expressly
    prohibited without the prior written consent of VeriSign. You agree not to
    use electronic processes that are automated and high-volume to access or
    query the Whois database except as reasonably necessary to register
    domain names or modify existing registrations. VeriSign reserves the right
    to restrict your access to the Whois database in its sole discretion to ensure
    operational stability. VeriSign may restrict or terminate your access to the
    Whois database for failure to abide by these terms of use. VeriSign
    reserves the right to modify these terms at any time.

    The Registry database contains ONLY .COM, .NET, .EDU domains and
    Registrars.
    MarkMonitor.com - The Leader in Corporate Domain Management
    ----------------------------------------------------------
    For Global Domain Consolidation, Research & Intelligence,
    and Enterprise DNS, go to: www.markmonitor.com
    ----------------------------------------------------------

    The Data in MarkMonitor.com's WHOIS database is provided by MarkMonitor.com
    for information purposes, and to assist persons in obtaining information
    about or related to a domain name registration record. MarkMonitor.com
    does not guarantee its accuracy. By submitting a WHOIS query, you agree
    that you will use this Data only for lawful purposes and that, under no
    circumstances will you use this Data to: (1) allow, enable, or otherwise
    support the transmission of mass unsolicited, commercial advertising or
    solicitations via e-mail (spam); or (2) enable high volume, automated,
    electronic processes that apply to MarkMonitor.com (or its systems).
    MarkMonitor.com reserves the right to modify these terms at any time.
    By submitting this query, you agree to abide by this policy.

    Registrant:
    Google Inc.
    (DOM-258879)
    2400 E. Bayshore Pkwy Mountain View
    CA
    94043 US

    Domain Name: google.com

    Registrar Name: Alldomains.com
    Registrar Whois: whois.alldomains.com
    Registrar Homepage: http://www.alldomains.com

    Administrative Contact:
    DNS Admin
    (NIC-1340142)
    Google Inc.
    2400 E. Bayshore Pkwy Mountain View
    CA
    94043 US
    [removed] +1.6503300100 Fax- +1.6506181499
    Technical Contact, Zone Contact:
    DNS Admin
    (NIC-1340144)
    Google Inc.
    2400 E. Bayshore Pkwy Mountain View
    CA
    94043 US
    [removed] +1.6503300100 Fax- +1.6506181499

    Created on..............: 1997-Sep-15.
    Expires on..............: 2011-Sep-14.
    Record last updated on..: 2003-Apr-07 10:42:46.

    Domain servers in listed order:

    NS3.GOOGLE.COM
    NS4.GOOGLE.COM
    NS1.GOOGLE.COM
    NS2.GOOGLE.COM

    MarkMonitor.com - The Leader in Corporate Domain Management
    ----------------------------------------------------------
    For Global Domain Consolidation, Research & Intelligence,
    and Enterprise DNS, go to: www.MarkMonitor.com
    ----------------------------------------------------------

    tharub3x@Force:~$





    Im getting no output on the php page. Can you explain the passthru() function.
    Last edited by visualAd; Jun 22nd, 2005 at 05:25 PM. Reason: email addresses

  6. #6
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: exec

    Its the same as exec, except that the commands output is sent directly to PHP's output buffer. exec only returns the last line of output which, in your case happens to be a blank line.
    Last edited by visualAd; Jun 22nd, 2005 at 05:11 PM.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  7. #7

    Thread Starter
    Banned ThaRubby's Avatar
    Join Date
    Apr 2005
    Location
    127.0.0.1
    Posts
    356

    Re: exec

    Ok so...
    echo passthru('cat /proc/cpuinfo');
    Works but I get the data like this:
    processor : 0 vendor_id : AuthenticAMD cpu family : 6 model : 10 model name : AMD Athlon(tm) stepping : 0 cpu MHz : 2260.262 cache size : 512 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse pni syscall mmxext 3dnowext 3dnow bogomips : 4472.83

    When it should be like this:
    tharub3x@Force:~$ cat /proc/cpuinfo
    processor : 0
    vendor_id : AuthenticAMD
    cpu family : 6
    model : 10
    model name : AMD Athlon(tm)
    stepping : 0
    cpu MHz : 2260.262
    cache size : 512 KB
    fdiv_bug : no
    hlt_bug : no
    f00f_bug : no
    coma_bug : no
    fpu : yes
    fpu_exception : yes
    cpuid level : 1
    wp : yes
    flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse pni syscall mmxext 3dnowext 3dnow
    bogomips : 4472.83

    tharub3x@Force:~$

  8. #8
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: exec

    Thats becuase there are no HTML tags in the output. You can force the browser to display it as plain text though by sending a header:
    PHP Code:
    header('Content-Type: text/plain'); 
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  9. #9

    Thread Starter
    Banned ThaRubby's Avatar
    Join Date
    Apr 2005
    Location
    127.0.0.1
    Posts
    356

    Re: exec

    Ok got it, sorry im such a noob ;x

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width