[PHP] Autoflush

2005-01-31 Thread Wudi
Can PHP attain autoflush?
(See attachments.)

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

Re: [PHP] upload file size limit

2005-01-31 Thread Wudi
Run phpinfo() to see the Configuration File (php.ini) Path.

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



Re: [PHP] Autoflush

2005-01-31 Thread Wudi
Sorry, I still don't know how to attain it.
Could you give a sample?

PS: See http://wudicgi.spymac.net/pt/pt_autoflush.gif

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



Re: [PHP] Reg Exp.

2004-08-18 Thread Wudi
On Wed, 18 Aug 2004 10:42:54 +0200
Jay [EMAIL PROTECTED] wrote:

 Hi!
 
 Why can? i get this code to work:
 $html = $_POST[htmlIn];
 
 $patterns[0] = /strike/;
 $patterns[1] = //strike/;
 $patterns[2] = /align=\left\/;
 
 $replacements[0] = del;
 $replacements[1] = /del;
 $replacements[2] =  style=\text-align:left;\;
 
 $xhtml = preg_replace($patterns, $replacements, $html);


$patterns[1] = /\/strike/;

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



Re: [PHP] Write text on imge...AND save it to disk..

2004-08-04 Thread Wudi
On Wed, 4 Aug 2004 19:36:40 -0700 (PDT)
PHP Gen [EMAIL PROTECTED] wrote:

 Hi,
 
 Have very little of idea of the GD functions (and dont
 ahve imagemagik) so am having problems
 
 1. I need to read all the images from a dir and write
 something on it at the bottom right side of the
 picture
 
 2.save this image in a diff folder keeping the
 originals as is.
 
 I have worked out the logic to fetch the imgs from the
 folder into an array but the rest is beyond me...
 
 
 I HAVE gotten a good class that does a lot but...it
 does not save the image, it outputs it to the browser
 (class below) can anybody help me save the file to a
 folder on my disk please?
 
 I have gone to http://se.php.net/image, 
 searched the archives,
 http://www.hotscripts.com/PHP/Tips_and_Tutorials/Image_Manipulation/
 and google...but am as confused as ever...maybe
 because its 5am ;-) and been working whole day.
 
 Solutions or URLs are most welcome, thanks in advance.
 -Mag

http://www.php.net/manual/en/function.imagepng.php

bool imagepng ( resource image [, string filename])

The imagepng() outputs a GD image stream (image) in PNG format to standard output 
(usually the browser) or, if a filename is given by the filename it outputs the image 
to the file. 

Think this.

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



Re: [PHP] regex help needed

2004-08-01 Thread Wudi
On Sun, 1 Aug 2004 10:38:06 -0700 (PDT)
Kathleen Ballard [EMAIL PROTECTED] wrote:

 Sorry,
 Here is the code I am using to match the h* tags:
 
 h([1-9]){1}.*/h([1-9]){1}
 
 I have removed all the NL and CR chars from the string
 I am matching to make things easier.  Also, I have run
 tidy on the code so the tags are all uniform.
 
 The above string seems to match the tag well now, but
 I still need to remove the br tags from the tag
 contents (.*).
 
 The strings I will be matching are html formatted
 text.  Sample h* tags with content are below:
 
 h4Ex-Secretary Mickey Mouse br /Loses Mass.
 Primary/h4
 
 h4Ex-Secretary Mickey Mouse br /Loses Mass.
 Primary br / Wins New Jersey/h4
 
 h4Ex-Secretary Reich Loses Mass. Primary/h4
 
 Again, any help is appreciated.
 Kathleen

Simple:

while (preg_match(/(h\d)(.*)(br \/)(.*)(\/h\d)/is, $str)) {
$str = preg_replace(/(h\d)(.*)(br \/)(.*)(\/h\d)/is,
$1$2$4$5, $str);
}
$str = preg_replace(/(h\d)(.*)(\/h\d)/is, $2, $str);


Recommended:

$str = preg_replace(/(h\d)([^]*)()(.*)(\/h\d)/eis, remove_br('$4'), $str);
function remove_br($str){
return preg_replace(/(br)([^]*)()/i, , $str);
}

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



Re: [PHP] How to get all links from a webpage?

2004-07-26 Thread Wudi
On Mon, 26 Jul 2004 11:44:04 +0800
Jason Wong [EMAIL PROTECTED] wrote:

 On Monday 26 July 2004 10:05, Wudi wrote:
 
  Thank you. I have found a method to get links. But it's slow.
  The script replaced the links, marked it.
  And then foreach() all texts were marked.
  But the blank space always make troubles.
 
 As you haven't posted any code nor described the problem in any detail I can 
 only take a wild guess that you want to take a look at urlencode(), 
 rawurlencode().

I read perlre just now, it's very long and very complex.
Now, I can use the following script to parse link tags:
$html = preg_replace(/(A )([^]+)()([^]+)(\/A)/e, 
\$this-ParseTagA(\$2\, \$4\), $html);
It works well and fast.
I use %20 and %3D replace   and = to remove the problem about
blank space and equal sign.
--
Comment: English is not my first language.
Wudi [EMAIL PROTECTED]

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



Re: [PHP] How to get all links from a webpage?

2004-07-25 Thread Wudi
On Mon, 26 Jul 2004 02:03:56 +0800
Jason Wong [EMAIL PROTECTED] wrote:

 On Sunday 25 July 2004 13:14, Wudi wrote:
 
 I repeat:
 
   Hmmm it needs to be able to *find* the links before it can replace them.
   Just borrow the code that finds the links.
 
 The get links part, the bit which you're interested in, is the regex. So 
 just plug the regex into ereg() or for this application eregi() may be more 
 useful.

Thank you. I have found a method to get links. But it's slow.
The script replaced the links, marked it.
And then foreach() all texts were marked.
But the blank space always make troubles.
Now I'm looking for another way to do it.

BTW, what does regex mean?
--
Comment: English is not my first language.
Wudi [EMAIL PROTECTED]

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



Re: [PHP] How to get all links from a webpage?

2004-07-24 Thread Wudi
Hm, Perl is OK. Could you send that program to me?
I have searched the class in phpclasses.org, but not found.
The classes I searched only can replace the link, can't get links.


On Sat, 24 Jul 2004 12:36:25 +0600
raditha dissanayake [EMAIL PROTECTED] wrote:

 
 Wudi wrote:
 
 How can I get all links from a webpage?
   
 
 You need to parse the HTML of the web page first there may be several 
 classes already available taht does it for you. The best I have seen 
 though is not in PHP but in perl.
 
 
 
 -- 
 Raditha Dissanayake.
 
 http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
 Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
 Graphical User Inteface. Just 128 KB | with progress bar.
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

--
Comment: English is not my first language.
Wudi [EMAIL PROTECTED]

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



Re: [PHP] How to get all links from a webpage?

2004-07-24 Thread Wudi
This script can replace links:
$text = ereg_replace([[:alpha:]]+://[^[:space:]]+[[:alnum:]/], a 
href=\\\0\\\0/a, $text);
But it cannot get the links.

On Sun, 25 Jul 2004 09:18:28 +0800
Jason Wong [EMAIL PROTECTED] wrote:

 On Saturday 24 July 2004 16:08, Wudi wrote:
  Hm, Perl is OK. Could you send that program to me?
  I have searched the class in phpclasses.org, but not found.
  The classes I searched only can replace the link, can't get links.
 
 Hmmm it needs to be able to *find* the links before it can replace them. Just 
 borrow the code that finds the links.
 
 -- 
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 Calling you stupid is an insult to stupid people!
   -- Wanda, A Fish Called Wanda
 */
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

--
Comment: English is not my first language.
Wudi [EMAIL PROTECTED]

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



[PHP] How to get all links from a webpage?

2004-07-23 Thread Wudi
How can I get all links from a webpage?
For example the HTML sources is:
a href=../page2.htmPage 2/a
img src=http://www.host.com/path/logo.png;
And I want to get:
print_r($links)
Array
(
[Page 2] = ../page2.htm
)

print_r($images)
Array
(
[0] = http://www.host.com/path/logo.png
)
How to achieve?
--
Comment: English is not my first language.
Wudi [EMAIL PROTECTED]

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



[PHP] sendmail_from not set in php.ini or custom From: header missing

2004-07-16 Thread Wudi
Script:
?php
mail('[EMAIL PROTECTED]', 'Subject', 'Message', From: [EMAIL PROTECTED]);
?

Result:
Warning: mail() [function.mail]: sendmail_from not set in php.ini or custom From: 
header missing in D:\ApacheData\htdocs\downloader\mail.php on line 2

Why does the mail() not work?
How can I send a e-mail without SMTP?

Comment: English is not my first language.
Wudi [EMAIL PROTECTED]

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



Re: [PHP] Want to save png to file

2004-07-07 Thread Wudi
int imagepng ( resource image [, string filename])


On Tue, 6 Jul 2004 13:48:44 +0200
Victor Sp?g Arthursson [EMAIL PROTECTED] wrote:

 Hi!
 
 Creating a transparent png using GD and PHP is (almost) no problem, but 
 it's impossible to save? 
 No matter what I try, the saved image wont remember that it's 
 transparent. I suspect the reason it works on the fly is because I 
 manually set the header to image/png, but if I try so save the stream 
 to a file, the transparency disappears? 
 Please please please somebody help!
 
 Sincerely
 
 Victor
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


Comment: English is not my first language.
Wudi [EMAIL PROTECTED]

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



Re: [PHP] php.ini mail settings

2004-07-03 Thread Wudi
It's impossible. If you olny want to set the mail sender, you can write mail
head From: [EMAIL PROTECTED] to get the same result.
But using SMTP Class is better.

On Fri, 02 Jul 2004 23:44:48 +0100
Olly [EMAIL PROTECTED] wrote:

 [mail function]
 ; For Win32 only.
 SMTP = smtp.mail.yahoo.co.uk ; for Win32 only
 sendmail_from= [EMAIL PROTECTED] ; for Win32 only
 
 ; For Win32 only.
 ;sendmail_from = [EMAIL PROTECTED]
 
 
 is there anyway to set a password for the mail function in php.ini
 
 thanks
 
 -- 
 Olly
 
 Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


Comment: English is not my first language.
Wudi [EMAIL PROTECTED]

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



Re: [PHP] PHP Bug ?

2004-07-03 Thread Wudi
It works on Apache/2.0.49 (Win32) PHP/4.3.7.
It wrote the following to test it:

?php
$country_symbol = array( 'AU' = 5 );
$country_list = array( 5 = 'Australia' );
$temp = $country_list[$country_symbol['AU']];
echo '$country_list[$country_symbol[\'AU\']] = 
$country_list['.$country_symbol['AU'].'] = ' . $temp . 'br';

$country_symbol = array( 'AU' = 'a' );
$country_list = array( 'a' = 'Australia' );
$temp = $country_list[$country_symbol['AU']];
echo '$country_list[$country_symbol[\'AU\']] = 
$country_list['.$country_symbol['AU'].'] = ' . $temp . 'br';

$country_symbol = array( 'AU' = '%' );
$country_list = array( '%' = 'Australia' );
$temp = $country_list[$country_symbol['AU']];
echo '$country_list[$country_symbol[\'AU\']] = 
$country_list['.$country_symbol['AU'].'] = ' . $temp . 'br';
?

The output was:

$country_list[$country_symbol['AU']] = $country_list[5] = Australia
$country_list[$country_symbol['AU']] = $country_list[a] = Australia
$country_list[$country_symbol['AU']] = $country_list[%] = Australia


On Fri, 2 Jul 2004 14:01:18 +1000
adwinwijaya [EMAIL PROTECTED] wrote:

 Hi...
 
 I found a bug (may be)
 I tried to do like this:
 
 $temp = $country_list[$country_symbol['AU']] ;
 this didnt work, so I have to change to :
 
 $symbol = $country_symbol['AU'];
 $temp = $country_list[$symbol] ;
 
 is this PHP bug ?
 
 -- 
 Best regards,
  adwinwijaya  mailto:[EMAIL PROTECTED]
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


Comment: English is not my first language.
Wudi [EMAIL PROTECTED]

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



Re: [PHP] help ???

2004-07-03 Thread Wudi
If you have a bad habit of writing program codes, it may don't work on
the strict config. You'd better change the bad habit.
But if you don't want to do that, you can modify php.ini to fit you.


On Fri, 2 Jul 2004 23:46:38 +0700
Dannis Yang [EMAIL PROTECTED] wrote:

 Dear:
 I wonder why my website runs smooth in PHP 4.1.1 but it does not in 4.3.7. 
  Dannis


Comment: English is not my first language.
Wudi [EMAIL PROTECTED]

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