php-general Digest 25 Jun 2008 14:00:34 -0000 Issue 5533

Topics (messages 275915 through 275938):

Re: Monitor a WP website
        275915 by: Boyd, Todd M.
        275916 by: Daniel Brown
        275917 by: tedd
        275918 by: Ryan S
        275919 by: Boyd, Todd M.
        275920 by: Daniel Brown
        275921 by: Ryan S
        275922 by: Ryan S
        275923 by: Boyd, Todd M.
        275931 by: tedd
        275933 by: Boyd, Todd M.

Re: Include Problem
        275924 by: Wei, Alice J.
        275925 by: Boyd, Todd M.
        275926 by: Wei, Alice J.
        275927 by: Boyd, Todd M.
        275928 by: Wei, Alice J.
        275929 by: Boyd, Todd M.
        275930 by: Shawn McKenzie

ImageTTFText leaves Black in letters
        275932 by: Stephen Pynenburg
        275934 by: Boyd, Todd M.
        275937 by: Stephen Pynenburg

exec() Error
        275935 by: Wei, Alice J.
        275936 by: Shawn McKenzie

Problem with IE 6.0
        275938 by: juanmanuel.vilela.ags-alpama.com

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
> -----Original Message-----
> From: Ryan S [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 24, 2008 2:23 PM
> To: Stut
> Cc: Eric Butera; php php
> Subject: Re: [PHP] Monitor a WP website
> 
> >Got an example? I've never seen a WP site with RSS feeds disabled.
> 
> Hey Stut,
> 
> Actually, dont have an example.. :o) but i have seen this question of
> how to disable wordpress rss frequently  come up on many forums ( a
> quick google search with "wordpress disable rss" gives up quite a few
> results) so wanted a solution to these sites as well... however
> marginal they might be.

Sounds like that is going to involve a lot of messy tag parsing with
cURL.


Todd Boyd
Web Programmer




--- End Message ---
--- Begin Message ---
On Tue, Jun 24, 2008 at 3:21 PM, Boyd, Todd M. <[EMAIL PROTECTED]> wrote:
>
> I'm afraid to click on a site with the url "ballz.info" while I'm at
> work. :D Any other WP feed examples?

    Heh.  I checked it out, and it's a celebrity gossip website.  In
fact, in the third picture down, Paris Hilton looks like Cyndi Lauper.

-- 
</Daniel P. Brown>
Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
$59.99/mo. with no contract!
Dedicated servers, VPS, and hosting from $2.50/mo.

--- End Message ---
--- Begin Message ---
At 3:20 PM -0400 6/24/08, Daniel Brown wrote:
On Tue, Jun 24, 2008 at 2:46 PM, tedd <[EMAIL PROTECTED]> wrote:

 Now, if you want to do this on your own, then it should be simple enough to
 use get_file_contents and put the file through a md5() function (or use
 md5_file) and store the result in a dB.

 Then cron a check every so often to see if the hash has changed. If it has,
 then email you notice, rehash the site and store it in the dB.

    Tedd,

    As usual, a good idea.  However, with the abundance of blogs and
the like containing Google AdWords or similar --- or even accepting
comments, changing the time of day, holding a random image, et cetera
--- the page content will change frequently.

Okay, then get_file_contents(), parse between the tags that would contain the stuff you want to monitor, hash, store that, and do what I said.


    You'd get more emails than this list got when my PostTrack system
went haywire.

Egads, not that!?!

I had bits all over my desktop -- it looked like an ant farm.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
<snippy>
If it's RSS, I think it's going to be XML regardless of the language
they're using to assemble it (Perl, PHP, ASP, etc.). I might be wrong,
but I thought that's part of what made it RSS.

I'm afraid to click on a site with the url "ballz.info" while I'm at
work. :D Any other WP feed examples?
</snippy>

LOL, no worries, all links that i sent are work safe... although if someone saw 
you open that their opinion of you might be lowered as its a celeb site and 
presently has super dumbo Paris H on the first page...

Pretty much the same is this one (again work safe)
http://www.ballzbollywood.com/feed/

A client runs both of these...

Cheers!
R



      

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Ryan S [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 24, 2008 2:34 PM
> To: Boyd, Todd M.
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Monitor a WP website
> 
> <snippy>
> If it's RSS, I think it's going to be XML regardless of the language
> they're using to assemble it (Perl, PHP, ASP, etc.). I might be wrong,
> but I thought that's part of what made it RSS.
> 
> I'm afraid to click on a site with the url "ballz.info" while I'm at
> work. :D Any other WP feed examples?
> </snippy>
> 
> LOL, no worries, all links that i sent are work safe... although if
> someone saw you open that their opinion of you might be lowered as its
> a celeb site and presently has super dumbo Paris H on the first
page...
> 
> Pretty much the same is this one (again work safe)
> http://www.ballzbollywood.com/feed/
> 
> A client runs both of these...

Ryan,

That feed is indeed XML.

However, as you said, some sites *MAY* have that option turned off. (For
what reason, I have no idea.) I would suggest doing what tedd was
talking about--grab the entire file contents, and figure out the
structure of WP sites to determine where the "articles" are at in the
tag structure, and parse the info inside those tags.


Todd Boyd
Web Programmer




--- End Message ---
--- Begin Message ---
On Tue, Jun 24, 2008 at 3:29 PM, tedd <[EMAIL PROTECTED]> wrote:
>
> Okay, then get_file_contents(), parse between the tags that would contain
> the stuff you want to monitor, hash, store that, and do what I said.

    Even if you did use the *file_get_contents()* method you mentioned
(;-P), how would you know between which tags you should parse?  Each
installation of Wordpress will likely be different, so the HTML source
will differ vastly.

    I'm not shooting holes in your logic.  I'm prodding you to get
that big brain of yours working to churn out an answer that I'm sure
is in there.

-- 
</Daniel P. Brown>
Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
$59.99/mo. with no contract!
Dedicated servers, VPS, and hosting from $2.50/mo.

--- End Message ---
--- Begin Message ---
<cut>
Okay, then get_file_contents(), parse between the tags that would 
contain the stuff you want to monitor, hash, store that, and do what 
I said.
</cut>

So far yours has been the best solution Tedd, thanks!

Cheers!
R
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


      

--- End Message ---
--- Begin Message ---
<chip>
Ryan,

That feed is indeed XML.
</chip>


Ooookay! I think i see where my confusion was coming in.... opening the 
"http://www.ballzbollywood.com/feed/"; in FF3 automatically parses it in a 
way... as does it in IE7... but opera is giving me the "raw" feed and it makes 
sense again.
(Am on win vista home premium)

Cheers!
R



      

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Ryan S [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 24, 2008 2:58 PM
> To: Boyd, Todd M.
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Monitor a WP website
> 
> <chip>
> Ryan,
> 
> That feed is indeed XML.
> </chip>
> 
> 
> Ooookay! I think i see where my confusion was coming in.... opening
the
> "http://www.ballzbollywood.com/feed/"; in FF3 automatically parses it
in
> a way... as does it in IE7... but opera is giving me the "raw" feed
and
> it makes sense again.
> (Am on win vista home premium)

Correct. You are either seeing an XSL Transformation or your web browser
is formatting the RSS feed for you (probably determining it as RSS based
on namespaces, etc.).


Todd Boyd
Web Programmer




--- End Message ---
--- Begin Message ---
At 3:50 PM -0400 6/24/08, Daniel Brown wrote:
On Tue, Jun 24, 2008 at 3:29 PM, tedd <[EMAIL PROTECTED]> wrote:

 Okay, then get_file_contents(), parse between the tags that would contain
 the stuff you want to monitor, hash, store that, and do what I said.

    Even if you did use the *file_get_contents()* method you mentioned
(;-P), how would you know between which tags you should parse?  Each
installation of Wordpress will likely be different, so the HTML source
will differ vastly.

    I'm not shooting holes in your logic.  I'm prodding you to get
that big brain of yours working to churn out an answer that I'm sure
is in there.


If I was actually confronted with the specifics of the problem, then I could figure it out.

If it were me, I would look at the site I was trying to scrub and figure out where the comments I'm interested in keeping tabs on are being kept -- like in between the <div id="comments"> tag and then parse on that.

Considering that every site is different, I would also record the "tab of interest", as well as the url and hash for scrubbing in the dB.

Of course, any of those data could change -- BUT -- the method would still send out an email in that event and from there you would have to re-consider what you want to do.

It's not rocket science -- but occasionally my solutions leave craters.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: tedd [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 24, 2008 4:22 PM
> To: php php
> Subject: Re: [PHP] Monitor a WP website

---8<--- big snip

> It's not rocket science -- but occasionally my solutions leave
craters.

Haha! Yes! I'm going to use this (with your permission, of course).


Todd Boyd
Web Programmer




--- End Message ---
--- Begin Message ---
________________________________________
From: Boyd, Todd M. [EMAIL PROTECTED]
Sent: Tuesday, June 24, 2008 2:53 PM
To: [EMAIL PROTECTED]; Wei, Alice J.
Subject: RE: [PHP] Include Problem

>
> > If you are trying to include() a remote file via HTTP, the remote
> > server
> > will (most likely) translate the PHP code into the output that it
> would
> > produce if you were to visit the script with a web browser. It
> appears
> > you are trying to grab a PHP file from a remote server and execute
it
> > as
> > code, which won't work--at least not under normal circumstances.
>
> Alice,
>
> If the two Windows machines are on the same network, you can try to
use
> Windows' file sharing to do the job for you. For instance,
>
> include('\\servername\dirname\filename.php');

*cough* ... I meant to double up on those backslashes. I'm not sure if
PHP supports forward-slash file/dir specifications in Windows, but to
double them all up would look like this:

Include("\\\\servername\\dirname\\filename.php");

> Using HTTP from Windows to Windows would yield the same results as
> using
> HTTP from Linux to Windows. You could host the files on a server that
> does not parse PHP, and so they would be transmitted as plain text...
> but then you get into issues of disclosing their contents to parties
> you
> would rather leave in the dark (read: hackers).
>
> You might consider using FTP, SCP, or another behind-the-scenes file
> transfer agent to accomplish what it is you're trying to do. I believe
> PHP already has several functions for use with FTP.

Sorry, I don't think I am intending on passing any file to whatever server.

All I need to do is to have my script be able to execute another program that 
can allow my  PHP script to pass the variables, so this may be using anything 
from PHP, Perl to C. I have seen in the PHP manual that there is this command 
called exec().

Is it possible that I could use something like exec($someurl) to execute the 
script? I tried doing this in PHP, but it tells me this:

arning: exec() [function.exec]: Unable to fork 
[http://www.mysite.com/calculate.php] in C:\Inetpub\wwwroot\read.php on line 31

Is there some way I can fix this error somehow? Or, is this not possible either?

Thanks for your help

Alice


Todd Boyd
Web Programmer

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Wei, Alice J. [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 24, 2008 3:11 PM
> To: Boyd, Todd M.; [EMAIL PROTECTED]
> Subject: RE: [PHP] Include Problem
> 
> ________________________________________
> From: Boyd, Todd M. [EMAIL PROTECTED]
> Sent: Tuesday, June 24, 2008 2:53 PM
> To: [EMAIL PROTECTED]; Wei, Alice J.
> Subject: RE: [PHP] Include Problem
> 
> >
> > > If you are trying to include() a remote file via HTTP, the remote
> > > server
> > > will (most likely) translate the PHP code into the output that it
> > would
> > > produce if you were to visit the script with a web browser. It
> > appears
> > > you are trying to grab a PHP file from a remote server and execute
> it
> > > as
> > > code, which won't work--at least not under normal circumstances.
> >
> > Alice,
> >
> > If the two Windows machines are on the same network, you can try to
> use
> > Windows' file sharing to do the job for you. For instance,
> >
> > include('\\servername\dirname\filename.php');
> 
> *cough* ... I meant to double up on those backslashes. I'm not sure if
> PHP supports forward-slash file/dir specifications in Windows, but to
> double them all up would look like this:
> 
> Include("\\\\servername\\dirname\\filename.php");
> 
> > Using HTTP from Windows to Windows would yield the same results as
> > using
> > HTTP from Linux to Windows. You could host the files on a server
that
> > does not parse PHP, and so they would be transmitted as plain
text...
> > but then you get into issues of disclosing their contents to parties
> > you
> > would rather leave in the dark (read: hackers).
> >
> > You might consider using FTP, SCP, or another behind-the-scenes file
> > transfer agent to accomplish what it is you're trying to do. I
> believe
> > PHP already has several functions for use with FTP.
> 
> Sorry, I don't think I am intending on passing any file to whatever
> server.
> 
> All I need to do is to have my script be able to execute another
> program that can allow my  PHP script to pass the variables, so this
> may be using anything from PHP, Perl to C. I have seen in the PHP
> manual that there is this command called exec().
> 
> Is it possible that I could use something like exec($someurl) to
> execute the script? I tried doing this in PHP, but it tells me this:
> 
> arning: exec() [function.exec]: Unable to fork
> [http://www.mysite.com/calculate.php] in C:\Inetpub\wwwroot\read.php
on
> line 31
> 
> Is there some way I can fix this error somehow? Or, is this not
> possible either?

Alice,

If you simply need to execute a remote PHP script and pass variables,
you could do it behind-the-scenes with cURL or AJAX, and pass the
variables in the url (i.e.,
http://www.mysite.com/script.php?param=value). cURL is capable of
retrieving the page (read: the results of the executed script), which
can then be parsed by your local script.

I actually did something like this where I scraped the World of Warcraft
Armory (ok, groan. No, seriously, let it out). I grabbed their XML
pages, parsed the info, and then pushed this info to a script on a
remote site of mine. I had to do this because the remote site I was
working with did not have cURL installed (nor could I install it myself
due to access restrictions). The remote script would return "OK" or
"FAIL", and my script would expect one of these values and react
accordingly.

Is this a little bit more on target? I can supply you with source code
if you would like.

You could also use AJAX to populate an IFRAME with the results of a
remote PHP script, and then parse those values using a hidden form
submission, perhaps. Just some ideas.

HTH,


Todd Boyd
Web Programmer




--- End Message ---
--- Begin Message ---
Alice,

If you simply need to execute a remote PHP script and pass variables,
you could do it behind-the-scenes with cURL or AJAX, and pass the
variables in the url (i.e.,
http://www.mysite.com/script.php?param=value). cURL is capable of
retrieving the page (read: the results of the executed script), which
can then be parsed by your local script.

I actually did something like this where I scraped the World of Warcraft
Armory (ok, groan. No, seriously, let it out). I grabbed their XML
pages, parsed the info, and then pushed this info to a script on a
remote site of mine. I had to do this because the remote site I was
working with did not have cURL installed (nor could I install it myself
due to access restrictions). The remote script would return "OK" or
"FAIL", and my script would expect one of these values and react
accordingly.

Is this a little bit more on target? I can supply you with source code
if you would like.

You could also use AJAX to populate an IFRAME with the results of a
remote PHP script, and then parse those values using a hidden form
submission, perhaps. Just some ideas.

     I think that the variables passed to will be used by that code to do 
perform some operations on another remote machine, (according to what I got 
from my client, he calls this behind the scenes to avoid users screw up the 
front end, and he is thinking of using C,  Perl or Python), which is why I am 
hoping that I can produce one single script, and have it execute some script 
without the user pushing any button. I don't think I plan on "scraping" 
websites. However, if you are suggesting that it is easier to do in Ajax to do 
what I am intending to do here, I would love to check it out and forget about 
PHP (hopefully not).

       Most of the documentation I have been seeing on exec() seems to be 
executing UNIX commands at http://us2.php.net/manual/en/function.exec.php. One 
main issue, which I am not sure if it is entirely relevant, is that I am using 
PHP on Windows with my current script, (the one to execute things from), while 
the script that would be executed is located on a Linux machine. Would this be 
an issue when I am doing this with what I am trying to do here?

 Thanks in advance.

Alice

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Wei, Alice J. [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 24, 2008 3:51 PM
> To: Boyd, Todd M.; [EMAIL PROTECTED]
> Subject: RE: [PHP] Include Problem
> 
> Alice,
> 
> If you simply need to execute a remote PHP script and pass variables,
> you could do it behind-the-scenes with cURL or AJAX, and pass the
> variables in the url (i.e.,
> http://www.mysite.com/script.php?param=value). cURL is capable of
> retrieving the page (read: the results of the executed script), which
> can then be parsed by your local script.
> 
> I actually did something like this where I scraped the World of
> Warcraft
> Armory (ok, groan. No, seriously, let it out). I grabbed their XML
> pages, parsed the info, and then pushed this info to a script on a
> remote site of mine. I had to do this because the remote site I was
> working with did not have cURL installed (nor could I install it
myself
> due to access restrictions). The remote script would return "OK" or
> "FAIL", and my script would expect one of these values and react
> accordingly.
> 
> Is this a little bit more on target? I can supply you with source code
> if you would like.
> 
> You could also use AJAX to populate an IFRAME with the results of a
> remote PHP script, and then parse those values using a hidden form
> submission, perhaps. Just some ideas.
>
> ---
> 
>      I think that the variables passed to will be used by that code to
> do perform some operations on another remote machine, (according to
> what I got from my client, he calls this behind the scenes to avoid
> users screw up the front end, and he is thinking of using C,  Perl or
> Python), which is why I am hoping that I can produce one single
script,
> and have it execute some script without the user pushing any button. I
> don't think I plan on "scraping" websites. However, if you are
> suggesting that it is easier to do in Ajax to do what I am intending
to
> do here, I would love to check it out and forget about PHP (hopefully
> not).
> 
>        Most of the documentation I have been seeing on exec() seems to
> be executing UNIX commands at
> http://us2.php.net/manual/en/function.exec.php. One main issue, which
I
> am not sure if it is entirely relevant, is that I am using PHP on
> Windows with my current script, (the one to execute things from),
while
> the script that would be executed is located on a Linux machine. Would
> this be an issue when I am doing this with what I am trying to do
here?

Alice,

exec() will execute Windows commands, as well. However, I'm not sure I
understand the reason for separating your script into two files--the
remote and the local scripts.

I will assume you are gathering data in your script (local), shipping
this off to a script on the client's machine (remote), and passing a
program (C/Python/Whatever) values you gathered using your script
(local).

Under this assumption, I would gather the data via
form/extraction/upload/whatever, and use cURL (a PHP library) to "visit"
the remote script, passing values either via GET or POST. The remote
script would then parse these values and send them to the appropriate
exec() command.

Am I off base?


Todd Boyd
Web Programmer




--- End Message ---
--- Begin Message ---
======================================================
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
[EMAIL PROTECTED]
________________________________________
From: Boyd, Todd M. [EMAIL PROTECTED]
Sent: Tuesday, June 24, 2008 4:55 PM
To: Wei, Alice J.; [EMAIL PROTECTED]
Subject: RE: [PHP] Include Problem

> -----Original Message-----
> From: Wei, Alice J. [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 24, 2008 3:51 PM
> To: Boyd, Todd M.; [EMAIL PROTECTED]
> Subject: RE: [PHP] Include Problem
>
> Alice,
>
> If you simply need to execute a remote PHP script and pass variables,
> you could do it behind-the-scenes with cURL or AJAX, and pass the
> variables in the url (i.e.,
> http://www.mysite.com/script.php?param=value). cURL is capable of
> retrieving the page (read: the results of the executed script), which
> can then be parsed by your local script.
>
> I actually did something like this where I scraped the World of
> Warcraft
> Armory (ok, groan. No, seriously, let it out). I grabbed their XML
> pages, parsed the info, and then pushed this info to a script on a
> remote site of mine. I had to do this because the remote site I was
> working with did not have cURL installed (nor could I install it
myself
> due to access restrictions). The remote script would return "OK" or
> "FAIL", and my script would expect one of these values and react
> accordingly.
>
> Is this a little bit more on target? I can supply you with source code
> if you would like.
>
> You could also use AJAX to populate an IFRAME with the results of a
> remote PHP script, and then parse those values using a hidden form
> submission, perhaps. Just some ideas.
>
> ---
>
>      I think that the variables passed to will be used by that code to
> do perform some operations on another remote machine, (according to
> what I got from my client, he calls this behind the scenes to avoid
> users screw up the front end, and he is thinking of using C,  Perl or
> Python), which is why I am hoping that I can produce one single
script,
> and have it execute some script without the user pushing any button. I
> don't think I plan on "scraping" websites. However, if you are
> suggesting that it is easier to do in Ajax to do what I am intending
to
> do here, I would love to check it out and forget about PHP (hopefully
> not).
>
>        Most of the documentation I have been seeing on exec() seems to
> be executing UNIX commands at
> http://us2.php.net/manual/en/function.exec.php. One main issue, which
I
> am not sure if it is entirely relevant, is that I am using PHP on
> Windows with my current script, (the one to execute things from),
while
> the script that would be executed is located on a Linux machine. Would
> this be an issue when I am doing this with what I am trying to do
here?

Alice,

exec() will execute Windows commands, as well. However, I'm not sure I
understand the reason for separating your script into two files--the
remote and the local scripts.

   To answer your question, I am separating these because the script that will 
be placed on the remoate server is filled with dense calculation operations, 
and putting these on the same server as the one I am writing and running from 
the local machine would possibly take up too much resources of the local 
server, and thus this only interacts with the local server I am working with 
and not with the client machine.

I will assume you are gathering data in your script (local), shipping
this off to a script on the client's machine (remote), and passing a
program (C/Python/Whatever) values you gathered using your script
(local).

     That would be correect, although I am not passing this to a client as I 
mentioned previously, and therefore everything would be ideally executed 
directly without any person to invoke the script.

Under this assumption, I would gather the data via
form/extraction/upload/whatever, and use cURL (a PHP library) to "visit"
the remote script, passing values either via GET or POST. The remote
script would then parse these values and send them to the appropriate
exec() command.

       That sounds like something I have to do, but the question is, if I don't 
have anyone pushing any button to invoke the script, how would it execute 
without using GET or POST before it uses exec()?

Hope this makes a little more sense now.

Alice

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Wei, Alice J. [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 24, 2008 4:07 PM
> To: Boyd, Todd M.; [EMAIL PROTECTED]
> Subject: RE: [PHP] Include Problem

---8<--- snip

> >      I think that the variables passed to will be used by that code
> to
> > do perform some operations on another remote machine, (according to
> > what I got from my client, he calls this behind the scenes to avoid
> > users screw up the front end, and he is thinking of using C,  Perl
or
> > Python), which is why I am hoping that I can produce one single
> script,
> > and have it execute some script without the user pushing any button.
> I
> > don't think I plan on "scraping" websites. However, if you are
> > suggesting that it is easier to do in Ajax to do what I am intending
> to
> > do here, I would love to check it out and forget about PHP
(hopefully
> > not).
> >
> >        Most of the documentation I have been seeing on exec() seems
> to
> > be executing UNIX commands at
> > http://us2.php.net/manual/en/function.exec.php. One main issue,
which
> I
> > am not sure if it is entirely relevant, is that I am using PHP on
> > Windows with my current script, (the one to execute things from),
> while
> > the script that would be executed is located on a Linux machine.
> Would
> > this be an issue when I am doing this with what I am trying to do
> here?
> 
> Alice,
> 
> exec() will execute Windows commands, as well. However, I'm not sure I
> understand the reason for separating your script into two files--the
> remote and the local scripts.
> 
>    To answer your question, I am separating these because the script
> that will be placed on the remoate server is filled with dense
> calculation operations, and putting these on the same server as the
one
> I am writing and running from the local machine would possibly take up
> too much resources of the local server, and thus this only interacts
> with the local server I am working with and not with the client
> machine.
> 
> I will assume you are gathering data in your script (local), shipping
> this off to a script on the client's machine (remote), and passing a
> program (C/Python/Whatever) values you gathered using your script
> (local).
>
> ---
>
>      That would be correect, although I am not passing this to a
client
> as I mentioned previously, and therefore everything would be ideally
> executed directly without any person to invoke the script.
> 
> Under this assumption, I would gather the data via
> form/extraction/upload/whatever, and use cURL (a PHP library) to
> "visit"
> the remote script, passing values either via GET or POST. The remote
> script would then parse these values and send them to the appropriate
> exec() command.
> 
>        That sounds like something I have to do, but the question is,
if
> I don't have anyone pushing any button to invoke the script, how would
> it execute without using GET or POST before it uses exec()?
> 
> Hope this makes a little more sense now.

Alice,

I'm not sure I follow you. Are you speaking of the local script or the
remote script as far as automation? The local script is executed when a
user requests it. The remote script will be executed when your local
script uses cURL to "visit" it. No users pressing buttons involved to my
knowledge.

Unless... is it a form? I'm a bit lost now. I'm not "Midwestern tourist
in Malaysia" lost, but I'm definitely a bit confused.


Todd Boyd
Web Programmer




--- End Message ---
--- Begin Message ---
Shaun wrote:
Hi,

I am having problems with an include statement, i am using the following
statement in an effort to include a footer file on my page:

include("/cms/templates/footer.php");

However I get the following error:

Warning: main(/cms/templates/footer.php): failed to open stream: No such
file or directory in /home/m/y/mysite/public_html/cms/news/index.php on line
38

Warning: main(/cms/templates/footer.php): failed to open stream: No such
file or directory in /home/m/y/mysite/public_html/cms/news/index.php on line
38

Warning: main(): Failed opening '/cms/templates/footer.php' for inclusion
(include_path='.:/lib/php') in
/home/m/y/mysite/public_html/cms/news/index.php on line 38

The file is definitely there, the script just doesn't seem to be picking it
up, has anyone else had this problem?

What is the very first file that loads?

Is it actually: /home/m/y/mysite/public_html/cms/news/index.php

Or maybe something higher up like: /home/m/y/mysite/public_html/cms/index.php that then includes the file above.

In the first case, this will work if the file is there:
include(dirname(dirname(__FILE__)).'/templates/footer.php');

In the second case, this:
include('templates/footer.php');

-Shawn

--- End Message ---
--- Begin Message ---
Hi all,
I'm using imagettftext, and my script works perfectly, except that on these
TTF fonts that I'm using, in any letter with a hole in the middle (letters
like a, R, O) the hole is coloured black, not transparent. Is this a PHP
thing, or do I need to edit my fonts somehow?

Thanks,
Stephen

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Stephen Pynenburg [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 24, 2008 4:27 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] ImageTTFText leaves Black in letters
> 
> Hi all,
> I'm using imagettftext, and my script works perfectly, except that on
> these
> TTF fonts that I'm using, in any letter with a hole in the middle
> (letters
> like a, R, O) the hole is coloured black, not transparent. Is this a
> PHP
> thing, or do I need to edit my fonts somehow?

Stephen,

Please include the source in question--most specifically, the section
where ImageTTFText is invoked.


Todd Boyd
Web Programmer




--- End Message ---
--- Begin Message ---
Thanks for the response. Here's the relevant bit:
  $fontcolour = imagecolorallocatefromhex($i,$tcolor);
  $font2colour = imagecolorallocatefromhex($i, $t2color);
  $bg = imagecolorallocatefromhex($i,$bcolor);

  if($bcolor == '#000000') $bg = imagecolorallocate($i, 0, 0, 0);
  if($tcolor == '#000000') $fontcolour = imagecolorallocate($i, 1, 0, 0);
  if($t2color== '#000000') $font2colour = imagecolorallocate($i, 1, 0, 0);

if($_GET['fontFileName'] == "") {$fontfile = "arial.ttf";} else {$fontfile =
$_GET['fontFileName'];}
//echo "fonts/$fontfile";
$box = imagettfbbox(40, 0, "fonts/".$fontfile, $_GET['text']);
$ax = ceil((500 - $box[2]) / 2);
$ay = ceil((170 - $box[3]) / 2);
$box2 = imagettfbbox(20, 0, "fonts/arial.ttf", $_GET['text2']);
$bx = ceil((500 - $box2[2]) / 2);
$by = ceil((170 - $box2[3]) / 2) + 50;
//image, size, angle, x, y, color, font, text
imagettftext($i, 40, 0, $ax, $ay, $fontcolour, "fonts/".$fontfile,
$_GET['text']);
imagettftext($i, 20, 0, $bx, $by, $font2colour, "fonts/arial.ttf",
$_GET['text2']);
imagefill($i, 0, 0, $bg);
imagepng($i);

Thanks,
Stephen

On Tue, Jun 24, 2008 at 5:32 PM, Boyd, Todd M. <[EMAIL PROTECTED]> wrote:

> > -----Original Message-----
> > From: Stephen Pynenburg [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, June 24, 2008 4:27 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] ImageTTFText leaves Black in letters
> >
> > Hi all,
> > I'm using imagettftext, and my script works perfectly, except that on
> > these
> > TTF fonts that I'm using, in any letter with a hole in the middle
> > (letters
> > like a, R, O) the hole is coloured black, not transparent. Is this a
> > PHP
> > thing, or do I need to edit my fonts somehow?
>
> Stephen,
>
> Please include the source in question--most specifically, the section
> where ImageTTFText is invoked.
>
>
> Todd Boyd
> Web Programmer
>
>
>
>

--- End Message ---
--- Begin Message ---
Hi,

        I have got a task from my client asking me to build something that 
allows the variables in the PHP file passed to another PHP file or a file in a 
different computer language to perform some operations on another remote 
machine. According to my client, he calls this behind the scenes to avoid users 
screw up the front end, and I am hoping that I can produce one single script, 
and have it execute some script without the user pushing any button. Has anyone 
tried using exec() successfully in PHP to execute files from PHP or other 
programming languages? For example, C, Python, or Perl.

    I have tried this by putting in

      exec("http://www.mysite.com/calculate.php";);

   This is the error I got:

     Warning: exec() [function.exec]: Unable to fork 
[http://www.mysite.com/calculate.php] in C:\Inetpub\wwwroot\read.php on line 31

   I have checked my permissions, and I have set it to 755.
   Does anyone know how I might be able to correct this error?

Thanks in advance.

Alice
======================================================
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Wei, Alice J. wrote:
Hi,

        I have got a task from my client asking me to build something that 
allows the variables in the PHP file passed to another PHP file or a file in a 
different computer language to perform some operations on another remote 
machine. According to my client, he calls this behind the scenes to avoid users 
screw up the front end, and I am hoping that I can produce one single script, 
and have it execute some script without the user pushing any button. Has anyone 
tried using exec() successfully in PHP to execute files from PHP or other 
programming languages? For example, C, Python, or Perl.

    I have tried this by putting in

      exec("http://www.mysite.com/calculate.php";);

   This is the error I got:

     Warning: exec() [function.exec]: Unable to fork 
[http://www.mysite.com/calculate.php] in C:\Inetpub\wwwroot\read.php on line 31

   I have checked my permissions, and I have set it to 755.
   Does anyone know how I might be able to correct this error?

Thanks in advance.

Alice
======================================================
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
[EMAIL PROTECTED]

Well, whatever OS you use, try typing that at the command line and see if it works. That's what exec does in effect.

Linux:
$ http://www.mysite.com/calculate.php

Windows:
C:\> http://www.mysite.com/calculate.php

-Shawn

--- End Message ---
--- Begin Message ---
Hello and thanks in advance,

I have a problem with the cache in Internet Explorer version 6.0

When I put these lines in the page

header ("Expires: Mon, 1 Jan 1997 01:00:00 GMT");
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header ("Cache-Control: no-cache, must-revalidate");
header ("Pragma: no-cache");

Internet explorer stills make the cache to the page, is there any solution to these problem and how is it?

Thanks and regards


--- End Message ---

Reply via email to