php-general Digest 16 Oct 2012 00:16:49 -0000 Issue 8008
Topics (messages 319456 through 319467):
Re: SNMP via PHP
319456 by: Bastien
319457 by: Lester Caine
319458 by: Jonathan Sundquist
319459 by: Jonathan Sundquist
319460 by: Lester Caine
Re: Beneficial site spamming framework
319461 by: Daniel Brown
319466 by: Ashley Sheridan
Serving an image
319462 by: Rick Dwyer
319463 by: viper
Re: Is it possible to click download button,and run 2 tasks downloading a file
and show number of downloads(ajax)simultaneously?
319464 by: Negin Nickparsa
319465 by: Negin Nickparsa
foreach
319467 by: David McGlone
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
Bastien Koert
On 2012-10-15, at 7:09 AM, Lester Caine <les...@lsces.co.uk> wrote:
> OK I've spent the last two hours going through pages of crap generated by
> google, and that includes google crap created by searches on sites like
> http://www.phpbuilder.com - cause mainly of cause by php pages on sites
> supporting other languages :(
> Certainly it seems that PHP is preferred even to website java and ruby ...
>
> I had some problems over the weekend with the network here and decided it was
> time to get some monitoring in place locally. cacti simply loaded up and I
> have working system, but now I'm having trouble getting SNMP sorted on the
> target machines. So I started looking for an editor to handle the MIB data
> and keep hitting one dead end after another.
>
> I'm sure there must be something out there using php-snmp for a browser?
>
> --
> Lester Caine - G8HFL
> -----------------------------
> Contact - http://lsces.co.uk/wiki/?page=contact
> L.S.Caine Electronic Services - http://lsces.co.uk
> EnquirySolve - http://enquirysolve.com/
> Model Engineers Digital Workshop - http://medw.co.uk
> Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
Xenoss is a python solution with tons of monitoring capability. It's well worth
a look
Bastien
--- End Message ---
--- Begin Message ---
Bastien wrote:
Xenoss is a python solution with tons of monitoring capability. It's well worth
a look
If I wanted to move to python then I would not be asking here ;)
I have enough of python on Hg and what I'm looking for here is PHP code that I
can massage to do what I need ...
I'm still working my way around this. cacti provides a nice monitoring layer and
is PHP, but is not helping to set up SNMP on the client machines, so I'm looking
for something that can help edit MIB files and also check the SNMP link to
remote machines ...
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
--- End Message ---
--- Begin Message ---
There appears to be quite a few examples,
https://www.google.com/search?q=php+snmp+example<https://www.google.com/search?q=php+snmp+example&aq=0&oq=php+snmp+&sugexp=chrome,mod=0&sourceid=chrome&ie=UTF-8>,
and tutorials,
https://www.google.com/search?q=php+snmp+example<https://www.google.com/search?q=php+snmp+example&aq=0&oq=php+snmp>,
on google.
On Mon, Oct 15, 2012 at 7:25 AM, Lester Caine <les...@lsces.co.uk> wrote:
> Bastien wrote:
>
>> Xenoss is a python solution with tons of monitoring capability. It's well
>> worth a look
>>
>
> If I wanted to move to python then I would not be asking here ;)
> I have enough of python on Hg and what I'm looking for here is PHP code
> that I can massage to do what I need ...
>
> I'm still working my way around this. cacti provides a nice monitoring
> layer and is PHP, but is not helping to set up SNMP on the client machines,
> so I'm looking for something that can help edit MIB files and also check
> the SNMP link to remote machines ...
>
>
> --
> Lester Caine - G8HFL
> -----------------------------
> Contact -
> http://lsces.co.uk/wiki/?page=**contact<http://lsces.co.uk/wiki/?page=contact>
> L.S.Caine Electronic Services - http://lsces.co.uk
> EnquirySolve - http://enquirysolve.com/
> Model Engineers Digital Workshop - http://medw.co.uk
> Rainbow Digital Media -
> http://rainbowdigitalmedia.co.**uk<http://rainbowdigitalmedia.co.uk>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
There appears to be quite a few examples,
https://www.google.com/search?q=php+snmp+example<https://www.google.com/search?q=php+snmp+example&aq=0&oq=php+snmp+&sugexp=chrome,mod=0&sourceid=chrome&ie=UTF-8>,
and tutorials,
https://www.google.com/search?q=php+snmp+example<https://www.google.com/search?q=php+snmp+example&aq=0&oq=php+snmp>,
on google.
On Mon, Oct 15, 2012 at 7:25 AM, Lester Caine <les...@lsces.co.uk> wrote:
> Bastien wrote:
>
>> Xenoss is a python solution with tons of monitoring capability. It's well
>> worth a look
>>
>
> If I wanted to move to python then I would not be asking here ;)
> I have enough of python on Hg and what I'm looking for here is PHP code
> that I can massage to do what I need ...
>
> I'm still working my way around this. cacti provides a nice monitoring
> layer and is PHP, but is not helping to set up SNMP on the client machines,
> so I'm looking for something that can help edit MIB files and also check
> the SNMP link to remote machines ...
>
>
> --
> Lester Caine - G8HFL
> -----------------------------
> Contact -
> http://lsces.co.uk/wiki/?page=**contact<http://lsces.co.uk/wiki/?page=contact>
> L.S.Caine Electronic Services - http://lsces.co.uk
> EnquirySolve - http://enquirysolve.com/
> Model Engineers Digital Workshop - http://medw.co.uk
> Rainbow Digital Media -
> http://rainbowdigitalmedia.co.**uk<http://rainbowdigitalmedia.co.uk>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Jonathan Sundquist wrote:
There appears to be quite a few examples,
https://www.google.com/search?q=php+snmp+example
<https://www.google.com/search?q=php+snmp+example&aq=0&oq=php+snmp+&sugexp=chrome,mod=0&sourceid=chrome&ie=UTF-8>,
and tutorials, https://www.google.com/search?q=php+snmp+example
<https://www.google.com/search?q=php+snmp+example&aq=0&oq=php+snmp>, on google.
Care to point out something there which is ACTUALLY usable?
Many of the 'php examples' only have a connection to php because they are on
.php hosted pages ... But it's not examples I'm looking for but something like
http://sourceforge.net/projects/php-netanalyzer/ which is still coming up on
many searches but not even available just to play with :(
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
--- End Message ---
--- Begin Message ---
On Sat, Oct 13, 2012 at 5:10 PM, Ashley Sheridan
<a...@ashleysheridan.co.uk> wrote:
>
> It was only your replies coming through so often, so I doubt its my end.
> Also, the newsgroup is the same thing as the mailing list I believe, in this
> instance.
Hmm.... I only got each reply once as well, so I'm not entirely
convinced it's an issue with Maciek's setup. Ash, you don't happen to
have any misfiring forwarders or multiple addresses subscribed, do
you?
--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/
--- End Message ---
--- Begin Message ---
Daniel Brown <danbr...@php.net> wrote:
>On Sat, Oct 13, 2012 at 5:10 PM, Ashley Sheridan
><a...@ashleysheridan.co.uk> wrote:
>>
>> It was only your replies coming through so often, so I doubt its my
>end. Also, the newsgroup is the same thing as the mailing list I
>believe, in this instance.
>
> Hmm.... I only got each reply once as well, so I'm not entirely
>convinced it's an issue with Maciek's setup. Ash, you don't happen to
>have any misfiring forwarders or multiple addresses subscribed, do
>you?
Nope, it was just that one email I received 5 times. Guess it was a hiccup
somewhere along the lines...
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
--- End Message ---
--- Begin Message ---
Hello all.
I am sending an email with a logo at the top of the email. The source of the
image for the logo is:
http://myurl.com/image.php?id=5
Image.php then calls a function that simply returns the following:
$image='<img src="http://myurl.com/images/logo.jpg" />';
return $image;
Calling the page directly via the URL http://myurl.com/image.php?id=5 works
fine.
But when the email is opened, I get the broken link/image icon even though I
can see in my source that the URL which works when loaded into a browser.
What needs to be done to serve that image to a email client when it is opened?
Thanks,
--Rick
--- End Message ---
--- Begin Message ---
On Mon, Oct 15, 2012 at 5:48 PM, Rick Dwyer <rpdw...@earthlink.net> wrote:
> I am sending an email with a logo at the top of the email. The source of the
> image for the logo is:
>
> http://myurl.com/image.php?id=5
>
> Image.php then calls a function that simply returns the following:
>
>
>
> $image='<img src="http://myurl.com/images/logo.jpg" />';
> return $image;
>
>
>
> Calling the page directly via the URL http://myurl.com/image.php?id=5 works
> fine.
> But when the email is opened, I get the broken link/image icon even though I
> can see in my source that the URL which works when loaded into a browser.
>
> What needs to be done to serve that image to a email client when it is opened?
in image.php you should return an image/xxx file and not an HTML tag.
try something like this:
image.php:
$im = imagecreatefrompng("test.png");
header('Content-Type: image/png');
imagepng($im);
imagedestroy($im);
then in your email you can put:
<img src="http://myurl.com/image.php?id=5" />
--
+ http://vipertechnology.dyndns.org
() ascii ribbon campaign - against html e-mail
/\ www.asciiribbon.org - against proprietary attachments
+ http://vipertechnology.dyndns.org/cotnact/
--- End Message ---
--- Begin Message ---
Thanks Tedd,
ajax works fine now,when submiting a button it will show the number and it
doesn't have any problem
$(function() {
$(".button").click(function(){
var id=$(this).attr('id');
var dataString = 'id='+ id ;
$.ajax({
type: "POST",
url: "download_number.php",
data: dataString,
cache: false,
success: function(html)
{
$("#div_"+id).html(html);
} });
}
button:
<input type = "button" value="Download" class="button" id="<?php echo $id;
?>" >
div:
<div id="div_<?php echo $id; ?>" ><?php echo $downloadcount;?></div>
by the way* I totally will refuse this approach* because,although the ajax
is working,but I can't do anything for click to download the related file
because when I go to my php page I can't redirect it to a page for download
and besides echo the output to be written in div element,so that,the best
solution is just redirect to a page and download the file in first place.
after submiting write a $_POST['submit'] and just store the download
count,update the table and if user refreshed the page,can see the number of
downloads,*as sure there isn't anything better than this.*
Marco suggested me iframe,reloading it,like a manual ajax but I think it
has much of troubles.
by the way thanks for all helps.
--- End Message ---
--- Begin Message ---
oh my bad:)! there is a cool solution,I forgot the blank page!:) yep!
solved:)
window.open('download.php', '_blank' );
now I can count up,and download:)
$(".button").click(function(){
var id=$(this).attr('id');
var dataString = 'id='+ id ;
$.ajax({
type: "POST",
url: "download_number.php",
data: dataString,
cache: false,
success: function(html)
{
$("#div_"+id).html(html);
} });
window.open('download.php', '_blank' );
});
so cool!!:)
On Mon, Oct 15, 2012 at 7:42 PM, Negin Nickparsa <nickpa...@gmail.com>wrote:
> Thanks Tedd,
>
> ajax works fine now,when submiting a button it will show the number and it
> doesn't have any problem
>
>
> $(function() {
>
> $(".button").click(function(){
> var id=$(this).attr('id');
> var dataString = 'id='+ id ;
> $.ajax({
> type: "POST",
> url: "download_number.php",
> data: dataString,
> cache: false,
> success: function(html)
> {
> $("#div_"+id).html(html);
> } });
> }
>
> button:
>
> <input type = "button" value="Download" class="button" id="<?php echo $id;
> ?>" >
>
> div:
>
> <div id="div_<?php echo $id; ?>" ><?php echo $downloadcount;?></div>
>
>
>
> by the way* I totally will refuse this approach* because,although the
> ajax is working,but I can't do anything for click to download the related
> file because when I go to my php page I can't redirect it to a page for
> download and besides echo the output to be written in div element,so
> that,the best solution is just redirect to a page and download the file in
> first place. after submiting write a $_POST['submit'] and just store the
> download count,update the table and if user refreshed the page,can see the
> number of downloads,*as sure there isn't anything better than this.*
>
> Marco suggested me iframe,reloading it,like a manual ajax but I think it
> has much of troubles.
>
> by the way thanks for all helps.
>
>
>
>
--- End Message ---
--- Begin Message ---
I've been sitting here playing around with foreach() and I'm wondering why I
am getting these results. here's what I've been fooling around with. the code
has no perticular meaning, but I noticed if the script fails, I get the
sentence "Too expensive I'm going home LOL" 6 times because there are 6 words
in the sentence. I also have a database that looks like this:
product_id product price
1 Milk 2.59
2 bread 1.05
And when $row is equal to 0 the output I get is
1 1 Milk Milk 2.59 2.59 Which is printed to the screen according to how many
rows are in the db I belive.
So my question is why this behavior? I was expecting something like a while
loop.
--
David M.
--- End Message ---