php-general Digest 8 Apr 2009 15:58:20 -0000 Issue 6056

2009-04-08 Thread php-general-digest-help
php-general Digest 8 Apr 2009 15:58:20 - Issue 6056 Topics (messages 291201 through 291225): how to get the filesize of an online document? 291201 by: Sebastian Muszytowski 291202 by: Gevorg Harutyunyan 291206 by: Sebastian Muszytowski Re: Best Practices for Hiding

[PHP] how to get the filesize of an online document?

2009-04-08 Thread Sebastian Muszytowski
Hello everyone, i have a little problem. I want to get the filesize of an online document (for example an rss or atom feed). I tried the filesize() function, but this doesn't work. I also search for options with cUrl but i didn't found any solution. Hope you can give me some hints or code

Re: [PHP] how to get the filesize of an online document?

2009-04-08 Thread Gevorg Harutyunyan
Hi, You must get content-length http header value, but sometimes header is not set and you don't have any chance to get size. For more info see *get_headers* function description. On Wed, Apr 8, 2009 at 12:31 PM, Sebastian Muszytowski s.muszytow...@googlemail.com wrote: Hello everyone, i

Re: [PHP] Best Practices for Hiding Errors

2009-04-08 Thread George Langley
Thanks for all the info, everyone! Seems like the @ trick is nice for individual lines, but turning off/on every time may be bit much on a complicated page. The ini_set('display_errors', false); also has a hit, as it turns back on after the entire script has run, but seems the easier way

[PHP] Larger fonts...

2009-04-08 Thread Peter Ford
Patrick, The reason you think the fonts are too small is that you have (un)zoomed the screen at some point. The proportions of the centre white panel to the side bars is wrong. Measuring your screenshots, and assuming you had a full-screen browser window at 1680x1050 resolution (what your monitor

Re: [PHP] Larger fonts...

2009-04-08 Thread Peter Ford
Tom, You're right - I tried to catch it before it went, but just too late! To the list - please ignore the message Tom refers to - it's not too commercially sensitive, at least. I probably need more coffee before fielding bug reports in the morning. Cheers Pete Tom Chubb wrote: Pete,

[PHP] extracting text - regex

2009-04-08 Thread Merlin Morgenstern
Hello, I am trying read text out of a text that is inbetween two divs. Somehow this should be possible with regex, I just can't figure out how. Example: div id=test bla blub /div I would like to extract the text bla blub out of this example. Has anybody an idea on how to do that? Is there

Re: [PHP] extracting text - regex

2009-04-08 Thread Per Jessen
Merlin Morgenstern wrote: Hello, I am trying read text out of a text that is inbetween two divs. Somehow this should be possible with regex, I just can't figure out how. Example: div id=test bla blub /div I would like to extract the text bla blub out of this example. This

Re: [PHP] how to get the filesize of an online document?

2009-04-08 Thread Sebastian Muszytowski
Hi, thanks for the hint, but how can i get the size when the header isn't specified? is there the possibility to count the bits and bytes when i get the file? Sebastian Gevorg Harutyunyan schrieb: Hi, You must get content-length http header value, but sometimes header is not set and you

Re: [PHP] extracting text - regex

2009-04-08 Thread George Larson
I'm what you might consider rather green, myself. I certainly wouldn't use this code for production but if you're just debugging or something then how about something like this: ?php $handle = @fopen('page.htm', 'r'); if ($handle) { while (!feof($handle)) { $eos =

[PHP] Am I being hacked?

2009-04-08 Thread julian haffegee
I set up a simple form to save comments on my webpage, and after just one day of going live, i'm getting weird comments up like this declare @q varchar(8000) select @q = 0x57414954464F522044454C4159202730303A30303A313027 exec(@q) I don't recognise this code - is this an attempt to do

Re: [PHP] extracting text - regex

2009-04-08 Thread George Larson
On Wed, Apr 8, 2009 at 9:13 AM, George Larson george.g.lar...@gmail.comwrote: I'm what you might consider rather green, myself. I certainly wouldn't use this code for production but if you're just debugging or something then how about something like this: ?php $handle =

Re: [PHP] Am I being hacked?

2009-04-08 Thread Richard Heyes
I set up a simple form to save comments on my webpage, and after just one day of going live, i'm getting weird comments up like this declare @q varchar(8000) select @q = 0x57414954464F522044454C4159202730303A30303A313027 exec(@q) I don't recognise this code - is this an attempt to do

Re: [PHP] Am I being hacked?

2009-04-08 Thread Andrew Ballard
On Wed, Apr 8, 2009 at 9:23 AM, Richard Heyes rich...@php.net wrote: I set up a simple form to save comments on my webpage, and after just one day of going live, i'm getting weird comments up like this declare @q varchar(8000) select @q = 0x57414954464F522044454C4159202730303A30303A313027

RE: [PHP] Am I being hacked?

2009-04-08 Thread Bob McConnell
On Behalf Of Richard Heyes I set up a simple form to save comments on my webpage, and after just one day of going live, i'm getting weird comments up like this declare @q varchar(8000) select @q = 0x57414954464F522044454C4159202730303A30303A313027 exec(@q) I don't recognise this code - is

[PHP] integrating perl and PHP problem

2009-04-08 Thread Moses
Hi Everyone, I have a perl program which I would like to display its results in PHP. I have read PHP book and the solution is to convert the perl program which is not easy. I have tried a simple example but it is not working. The perl script is #! /usr/bin/perl -w print hello world and the Php

Re: [PHP] integrating perl and PHP problem

2009-04-08 Thread Thijs Lensselink
Moses wrote: Hi Everyone, I have a perl program which I would like to display its results in PHP. I have read PHP book and the solution is to convert the perl program which is not easy. I have tried a simple example but it is not working. The perl script is #! /usr/bin/perl -w print

Re: [PHP] Am I being hacked?

2009-04-08 Thread 9el
On Wed, Apr 8, 2009 at 8:04 PM, Bob McConnell r...@cbord.com wrote: On Behalf Of Richard Heyes I set up a simple form to save comments on my webpage, and after just one day of going live, i'm getting weird comments up like this declare @q varchar(8000) select @q =

Re: [PHP] Am I being hacked?

2009-04-08 Thread Yannick Mortier
2009/4/8 9el le...@phpxperts.net: On Wed, Apr 8, 2009 at 8:04 PM, Bob McConnell r...@cbord.com wrote: On Behalf Of Richard Heyes I set up a simple form to save comments on my webpage, and after just one day of going live, i'm getting weird comments up like this declare @q varchar(8000)

Re: [PHP] extracting text - regex

2009-04-08 Thread Merlin Morgenstern
George Larson wrote: On Wed, Apr 8, 2009 at 9:13 AM, George Larson george.g.lar...@gmail.comwrote: I'm what you might consider rather green, myself. I certainly wouldn't use this code for production but if you're just debugging or something then how about something like this: ?php

[PHP] opening utf-8 files - chinese mb characters

2009-04-08 Thread Merlin Morgenstern
Hello everybody, I am having some trouble with utf-8 encoding. The html file containes chinese characters and looks ok, when opened in a browser. Now I want to extract some text from the file. In order to do this I do: $handle = fopen($file, r); $contents = fread($handle, filesize($file));

[PHP] Re: opening utf-8 files - chinese mb characters

2009-04-08 Thread Merlin Morgenstern
Merlin Morgenstern wrote: Hello everybody, I am having some trouble with utf-8 encoding. The html file containes chinese characters and looks ok, when opened in a browser. Now I want to extract some text from the file. In order to do this I do: $handle = fopen($file, r); $contents =

Re: [PHP] opening utf-8 files - chinese mb characters

2009-04-08 Thread Per Jessen
Merlin Morgenstern wrote: Hello everybody, I am having some trouble with utf-8 encoding. The html file containes chinese characters and looks ok, when opened in a browser. Now I want to extract some text from the file. In order to do this I do: $handle = fopen($file, r); $contents =

Re: [PHP] Am I being hacked?

2009-04-08 Thread Andrew Ballard
On Wed, Apr 8, 2009 at 10:04 AM, Bob McConnell r...@cbord.com wrote: On Behalf Of Richard Heyes I set up a simple form to save comments on my webpage, and after just one day of going live, i'm getting weird comments up like this declare @q varchar(8000) select @q =

RE: [PHP] Am I being hacked?

2009-04-08 Thread Warren Vail
Looks like an attempt to get your SQL server to execute a command, Microsoft SQL server will do that(among others), and if not properly set up can do it with root access. If you don't properly escape and store this comment in a database, it could execute (called SQL injection, no?). Warren Vail

Re: [PHP] Am I being hacked?

2009-04-08 Thread Michael A. Peters
Andrew Ballard wrote: You don't need a disassembler; I already said what that string is intended to do. If it is allowed to run on Microsoft's SQL Server, the hex value is implicitly converted to the string WAITFOR DELAY '00:00:10', which is then executed. It doesn't require semi-colons, as

Re: [PHP] opening utf-8 files - chinese mb characters

2009-04-08 Thread Merlin Morgenstern
Per Jessen wrote: Merlin Morgenstern wrote: Hello everybody, I am having some trouble with utf-8 encoding. The html file containes chinese characters and looks ok, when opened in a browser. Now I want to extract some text from the file. In order to do this I do: $handle = fopen($file, r);

[PHP] How can I echo a javascript var in an email subject line? Possible?

2009-04-08 Thread Terion Miller
I have a php form, that uses a javascript word counter to make sure submissions are a certain number of words, I have now been tasked with taking that word count and having it pass in the email that gets sent when someone submits a form ..in the subject line. Here is the code I'm using so far. Is

Re: [PHP] Am I being hacked?

2009-04-08 Thread Andrew Ballard
On Wed, Apr 8, 2009 at 12:05 PM, Michael A. Peters mpet...@mac.com wrote: Andrew Ballard wrote: You don't need a disassembler; I already said what that string is intended to do. If it is allowed to run on Microsoft's SQL Server, the hex value is implicitly converted to the string WAITFOR

Re: [PHP] How can I echo a javascript var in an email subject line? Possible?

2009-04-08 Thread Michael A. Peters
Terion Miller wrote: I have a php form, that uses a javascript word counter to make sure submissions are a certain number of words, I have now been tasked with taking that word count and having it pass in the email that gets sent when someone submits a form ..in the subject line. Here is the

Re: [PHP] opening utf-8 files - chinese mb characters

2009-04-08 Thread Andrew Ballard
On Wed, Apr 8, 2009 at 11:38 AM, Per Jessen p...@computer.org wrote: Merlin Morgenstern wrote: Hello everybody, I am having some trouble with utf-8 encoding. The html file containes chinese characters and looks ok, when opened in a browser. Now I want to extract some text from the file. In

Re: [PHP] opening utf-8 files - chinese mb characters

2009-04-08 Thread Merlin Morgenstern
Andrew Ballard wrote: On Wed, Apr 8, 2009 at 11:38 AM, Per Jessen p...@computer.org wrote: Merlin Morgenstern wrote: Hello everybody, I am having some trouble with utf-8 encoding. The html file containes chinese characters and looks ok, when opened in a browser. Now I want to extract some

Re: [PHP] opening utf-8 files - chinese mb characters

2009-04-08 Thread Paul Gregg
In mail.php.general, Merlin Morgenstern merli...@fastmail.fm wrote: Hello everybody, I am having some trouble with utf-8 encoding. The html file containes chinese characters and looks ok, when opened in a browser. Now I want to extract some text from the file. In order to do this I do:

Re: [PHP] How can I echo a javascript var in an email subject line? Possible?

2009-04-08 Thread Terion Miller
javascript is client side. php is server side. To use something client side in a server side script, the web page has to send it to the server from the client. The best way to do what you want to do is probably to do the work count server side, but if you really want to use what javascript

Re: [PHP] opening utf-8 files - chinese mb characters

2009-04-08 Thread Merlin Morgenstern
Paul Gregg wrote: In mail.php.general, Merlin Morgenstern merli...@fastmail.fm wrote: Hello everybody, I am having some trouble with utf-8 encoding. The html file containes chinese characters and looks ok, when opened in a browser. Now I want to extract some text from the file. In order

[PHP] stream_set_timeout issue with ssl connection

2009-04-08 Thread Sebastian Muszytowski
Hello everyone, i have an issue with stream_set_timeout and ssl. I've written a php irc newsbot and my code looks like this: [...] while (!feof($con['socket'])) { stream_set_timeout($con['socket'], $CONFIG['qtime']); [...] I need this timeout because i

Re: [PHP] opening utf-8 files - chinese mb characters

2009-04-08 Thread Merlin Morgenstern
Merlin Morgenstern wrote: Paul Gregg wrote: In mail.php.general, Merlin Morgenstern merli...@fastmail.fm wrote: Hello everybody, I am having some trouble with utf-8 encoding. The html file containes chinese characters and looks ok, when opened in a browser. Now I want to extract some

Re: [PHP] How can I echo a javascript var in an email subject line? Possible?

2009-04-08 Thread Michael A. Peters
Terion Miller wrote: javascript is client side. php is server side. To use something client side in a server side script, the web page has to send it to the server from the client. The best way to do what you want to do is probably to do the work count server side, but

Re: [PHP] PHP LDAP over SSL problems (SOLVED)

2009-04-08 Thread Keith Lawson
On Fri, Apr 3, 2009 at 10:16 AM, in message 49d5e20c.8302.00a...@sjhc.london.on.ca, Keith Lawson keith.law...@sjhc.london.on.ca wrote: On Thu, Apr 2, 2009 at 5:51 PM, in message 49d53344.7040...@gmail.com, Chris dmag...@gmail.com wrote: Keith Lawson wrote: Hello, I have been

Re: [PHP] How can I echo a javascript var in an email subject line? Possible?

2009-04-08 Thread Terion Miller
On Wed, Apr 8, 2009 at 12:50 PM, Michael A. Peters mpet...@mac.com wrote: Terion Miller wrote: javascript is client side. php is server side. To use something client side in a server side script, the web page has to send it to the server from the client. The best way to

Re: [PHP] PHP module ignores ldap.conf (SOLVED)

2009-04-08 Thread Keith Lawson
On Mon, Apr 6, 2009 at 7:02 PM, in message 49da8a1b.5070...@gmail.com, Chris dmag...@gmail.com wrote: Keith Lawson wrote: Hello, I'm trying to connect to and LDAP server using PHP over SSL. I compiled Openldap from source, installed it and then compiled PHP against that install. I

Re: [PHP] How can I echo a javascript var in an email subject line? Possible?

2009-04-08 Thread Michael A. Peters
Terion Miller wrote: On Wed, Apr 8, 2009 at 12:50 PM, Michael A. Peters mpet...@mac.com mailto:mpet...@mac.com wrote: Terion Miller wrote: javascript is client side. php is server side. To use something client side in a server side script, the web

[PHP] problems with loaded extensions

2009-04-08 Thread Andres Gonzalez
Hi, I have got an extension loaded in all three of my php config files (in cli, in cgi, and in apache2 directories). The functions in the extension are all accessible when running test scripts from the command line, like: php init.php for example, in the init.php file I have calls to

[PHP] Re: problems with loaded extensions

2009-04-08 Thread Shawn McKenzie
Andres Gonzalez wrote: Hi, I have got an extension loaded in all three of my php config files (in cli, in cgi, and in apache2 directories). The functions in the extension are all accessible when running test scripts from the command line, like: php init.php for example, in the

[PHP] About Login on PHP

2009-04-08 Thread Alejandro Esteban Galvez
Hi!, I am making a system in php for linux. This system take a control of my LDAP server, and login for the LDAP server too. How I can do that the login expires past two minutes, when the user part of the system, and when the user close your Internet Explorer??? Bye

Re: [PHP] difficult select problem

2009-04-08 Thread PJ
Hi Jim, Sorry I could not gat back to you on your suggestion. I've been under the weather for a couple of days but am almost over it. Your suggestion does not work... yet. I'll insert comments questions below... Jim Lucas wrote: PJ wrote: I've searched the web, the tutorials, etc. with no luck

Re: [PHP] difficult select problem

2009-04-08 Thread Jan G.B.
2009/4/7 Bastien Koert phps...@gmail.com: On Tue, Apr 7, 2009 at 1:10 PM, Michael A. Peters mpet...@mac.com wrote: PJ wrote: Bob McConnell wrote: From: PJ First, let me thank you all for responding and offering suggestions. I appreciate it and I am learning things. However, it looks

Re: [PHP] Re: problems with loaded extensions

2009-04-08 Thread Edgar da Silva (Fly2k)
Did you check the apache error log? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How can I echo a javascript var in an email subject line? Possible? (Yes!)

2009-04-08 Thread Raymond Irving
For me its very easy to pass php values to the client: echo _var($value,'name'); But the best part is taking control of what your client sees from the server-side: C('#info')-show(); // now you see it ... C('#info')-hide(); // now you don't! Take control and start building powerful web apps

[PHP] PHP and Send Mail

2009-04-08 Thread Alejandro Esteban Galvez
Hi!, I am making a web system and i need known how send a mail using PHP Bye --- Alejandro Esteban Galvez Administrador de Red IPICHMC Rimed, Radio-Aficionado CL2AEG Linux User #472120 - http://i18n.counter.li.org/ Correo:

Re: [PHP] PHP and Send Mail

2009-04-08 Thread Jason Pruim
Alejandro Esteban Galvez wrote: Hi!, I am making a web system and i need known how send a mail using PHP Bye HTTP://www.php.net/mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP and Send Mail

2009-04-08 Thread Chris
Alejandro Esteban Galvez wrote: Hi!, I am making a web system and i need known how send a mail using PHP http://www.php.net/manual/en/function.mail.php -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] difficult select problem

2009-04-08 Thread Jim Lucas
PJ wrote: Hi Jim, Sorry I could not gat back to you on your suggestion. I've been under the weather for a couple of days but am almost over it. Your suggestion does not work... yet. I'll insert comments questions below... Jim Lucas wrote: PJ wrote: I've searched the web, the tutorials, etc.

Re: [PHP] PHP and Send Mail

2009-04-08 Thread Phpster
And not one RTFM? Bastien Sent from my iPod On Apr 8, 2009, at 20:58, Chris dmag...@gmail.com wrote: Alejandro Esteban Galvez wrote: Hi!, I am making a web system and i need known how send a mail using PHP http://www.php.net/manual/en/function.mail.php -- Postgresql php tutorials

[PHP] Re: PHP and Send Mail

2009-04-08 Thread Shawn McKenzie
Alejandro Esteban Galvez wrote: Hi!, I am making a web system and i need known how send a mail using PHP Bye --- Alejandro Esteban Galvez Administrador de Red IPICHMC Rimed, Radio-Aficionado CL2AEG Linux User #472120 -

[PHP] How about a saveXHTML for the DOM?

2009-04-08 Thread Raymond Irving
Hello, I'm thinking that it's about time a saveXHTML() method be added to the DOM objects. XHTML is supported by all major browsers and libxml2 so I can't see why we should be stuck with saveHTML() and saveXML(). While it's true that some developers are using saveXML(), it does not always

Re: [PHP] How about a saveXHTML for the DOM?

2009-04-08 Thread Michael Shadle
i think it should also be fully utf-8 capable. saveHTML is not for me right now, and i have to run some preg_replace to remove the html etc chunks, and the output is not utf-8, even though the input is. i got a workaround using html_decode_entities() or something like that but i haven't ran it to

Re: [PHP] difficult select problem

2009-04-08 Thread Jim Lucas
PJ wrote: Gentlemen, First, let me thank you all for responding and offering suggestions. I appreciate it and I am learning things. How about telling us/me what it did or did not do for you? However, it looks like my message is not getting across: The problem is not to retrieve only the

Re: [PHP] How about a saveXHTML for the DOM?

2009-04-08 Thread Michael A. Peters
Raymond Irving wrote: Hello, I'm thinking that it's about time a saveXHTML() method be added to the DOM objects. Not necessary. saveXML() already does what is needed to provide valid xhtml output. See the php source of http://www.clfsrpm.net/xss/dom_script_test.phps to see how one can

Re: [PHP] How about a saveXHTML for the DOM?

2009-04-08 Thread Michael A. Peters
Michael Shadle wrote: i think it should also be fully utf-8 capable. saveHTML is not for me right now, and i have to run some preg_replace to remove the html etc chunks, and the output is not utf-8, even though the input is. i got a workaround using html_decode_entities() or something like that

Re: [PHP] How about a saveXHTML for the DOM?

2009-04-08 Thread Michael Shadle
On Wed, Apr 8, 2009 at 8:58 PM, Michael A. Peters mpet...@mac.com wrote: Yes it should - I believe php 6 is suppose to be much better at native UTF8. At least according to some blog I read somewhere (IE don't believe me without reservation, it's third hand knowledge at best) afaik you're

[PHP] convert video files to FLV

2009-04-08 Thread Gevorg Harutyunyan
Hi, I need to convert video files to FLV using php. The only solution that I found is to use ffmpeg, but because I am using shared hosting I am not allowed to install it on server. Do you know any other ways to convert any video file types to flv using PHP. Thanks for help! Best Regards,

Re: [PHP] convert video files to FLV

2009-04-08 Thread Adrian
Don't waste CPU power of shared servers for video recoding. If you need that, get a dedicated server without other customers who would probably be affected by you using lots of cpu power. Besides that, if you cannot install own (compiled) software on it, you'd have to use a pure php solution

Re: [PHP] convert video files to FLV

2009-04-08 Thread Michael Shadle
On Wed, Apr 8, 2009 at 10:30 PM, Gevorg Harutyunyan gevorg...@gmail.com wrote: Hi, I need to convert video files to FLV using php. The only solution that I found is to use ffmpeg, but because I am using shared hosting I am not allowed to install it on server. Do you know any other ways to

[PHP] codeigniter 'secure, non-secure content' pop up message in IE7

2009-04-08 Thread 9el
-- Forwarded message -- From: Sabrina Akter lizzeel...@gmail.com Date: Thu, Apr 9, 2009 at 1:12 AM Subject: codeigniter 'secure, non-secure content' pop up message in IE7 To: phpexpe...@yahoogroups.com Hello Experts, I badly need your help. My developed site's some pages are

Re: [PHP] Re: PHP and Send Mail

2009-04-08 Thread 9el
On Thu, Apr 9, 2009 at 7:19 AM, Shawn McKenzie nos...@mckenzies.net wrote: Alejandro Esteban Galvez wrote: Hi!, I am making a web system and i need known how send a mail using PHP Hi, Use PHPmailer or PEAR:mail() And I'm Lenin Bye :) www.twitter.com/nine_L -- PHP General Mailing List

Re: [PHP] convert video files to FLV

2009-04-08 Thread Michael Shadle
On Wed, Apr 8, 2009 at 10:33 PM, Adrian adr...@planetcoding.net wrote: Don't waste CPU power of shared servers for video recoding. If you need that, get a dedicated server without other customers who would probably be affected by you using lots of cpu power. Besides that, if you cannot

Re: [PHP] convert video files to FLV

2009-04-08 Thread Gevorg Harutyunyan
Thanks guys, but as I understood that extension also requires ffmpeg on server, correct me if I am wrong. So anyway I need ffmpeg on server. Some day, when I will have dedicated server I will use ffmpeg for sure, but now I need other solution. On Thu, Apr 9, 2009 at 10:33 AM, Adrian

Re: [PHP] convert video files to FLV

2009-04-08 Thread Michael Shadle
there's some third party encoding services out there, and if you host with softlayer, they have media transcoding services they offer for their hosting customers (not sure the cost, but it's pay for what you use) On Wed, Apr 8, 2009 at 10:45 PM, Gevorg Harutyunyan gevorg...@gmail.com wrote:

Re: [PHP] codeigniter 'secure, non-secure content' pop up message in IE7

2009-04-08 Thread Chris
Hello Experts, I badly need your help. My developed site's some pages are HTTPS, and other parts are HTTP. When I try to access the HTTPS page in IE it comes up with secure non-secure content warning. I search on google to find out the solution. but almost every site suggest to change the IE