FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » php exec http url
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: php exec http url [message #185193 is a reply to message #185190] Fri, 07 March 2014 20:33 Go to previous messageGo to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma:
Senior Member
On 07/03/14 15:36, Thomas 'PointedEars' Lahn wrote:
> The Natural Philosopher wrote:
> ^^^^^^^^^^^^^^^^^^^^^^^
> Please fix.
>
>> On 07/03/14 14:09, Thomas 'PointedEars' Lahn wrote:
>>> bishop2001 wrote:
>>>> from machine1:
>>>> <?php
>>>> $ch = curl_init();
>>>> curl_setopt($ch, CURLOPT_URL, "http://machine2/script.sh");
>>>> curl_setopt($ch, CURLOPT_HEADER, 0);
>>>> curl_exec($ch);
>>>> curl_close($ch);
>>>> ?>
>>>
>>> Even if a Web server would serve that resource, it would not execute it
>>> by default, IOW by default you would receive only the source code of the
>>> shell script, not its output.
>>
>> The way to do this is to set php up on the remote server to have a web
>> page run that script.
>>
>> e.g. on the machine2 that runs a script have a php file that does this
>>
>> echo (exec('script.sh'));
>>
>> and then on machine1 simply use curl to point not at the script, but at
>> the URL of the php file that actually runs that script.
>
> That is not the only way.
>
> Your From header field still violates RFC 5536, and several other
> conventions and rules.
>
> Learn to quote.
>
>
> PointedEars
>

Fuck off noddy

--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Experienced Web designer required
Next Topic: When a random file is not found then what?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Nov 25 00:06:56 GMT 2024

Total time taken to generate the page: 0.03625 seconds