[PHP] proxy

2007-01-21 Thread wwww
Hi list,

I am trying to create a link checker that would look for broken URLs
with help of the following code"

$handle = @fopen("http://www.circle.am";, "r");
if ($handle):
print "OK";
else:
print "Error";
endif;

The problem is that I want to check if the links are accessible under
certain proxy, so is there any way to tell the script to open the URL
under a proxy?

Thank you in advance.

Ed

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



Re[2]: [PHP] proxy

2007-01-21 Thread wwww
Thank you Roman and Jochem,

I'll try both.

Best regards,
Ed

Sunday, January 21, 2007, 6:27:44 PM, you wrote:

> # [EMAIL PROTECTED] / 2007-01-21 17:29:56 +0300:
>> I am trying to create a link checker that would look for broken URLs
>> with help of the following code"
>> 
>> $handle = @fopen("http://www.circle.am";, "r");
>> if ($handle):
>> print "OK";
>> else:
>> print "Error";
>> endif;
>> 
>> The problem is that I want to check if the links are accessible under
>> certain proxy, so is there any way to tell the script to open the URL
>> under a proxy?

> Several, start by googling for connect.c

> -- 
> How many Vietnam vets does it take to screw in a light bulb?
> You don't know, man.  You don't KNOW.
> Cause you weren't THERE. http://bash.org/?255991


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



Re: [PHP] preg_replace();

2007-02-02 Thread wwww
I am not a very experienced programmer, but I think that "str_replace"
can be used in this case:
$new_string=str_replace('|', '_', $old_string)

then use the same function to replace spaces.

Ed

Friday, February 2, 2007, 9:30:37 PM, you wrote:

> Hi all,

> I want replace the "|" (pipe) and the " " (space) chars where are
> between " (double-quotes)  by an underscore "_" with the
> preg_replace(); funtction.

> Can someone help me to find the correct regex.

> Thanks in advance

> Seb



-- 
Best regards,
 mailto:[EMAIL PROTECTED]

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



Re[2]: [PHP] preg_replace();

2007-02-02 Thread wwww
I have tasted the code and it worked fine (if I got you right):

$old_string="lazy \"|\" dog";
$new_string=str_replace('"|"', '_', $old_string);
print $new_string;

I got "lazy_dog"

Ed

Friday, February 2, 2007, 10:01:14 PM, you wrote:

> Thanks,

> but I think that I must use preg_replace because the condition is: replace
> the chars (pipe or space) when they are between "

> ie :  src=file:///h|/hjcjdgh dlkgj/dgjk.jpg"  to 
> src=file:///h_/hjcjdgh_dlkgj/dgjk.jpg"

> Seb





> - Original Message - 
> From: <[EMAIL PROTECTED]>
> To: "Sébastien WENSKE" <[EMAIL PROTECTED]>
> Cc: 
> Sent: Friday, February 02, 2007 8:38 PM
> Subject: Re: [PHP] preg_replace();


> I am not a very experienced programmer, but I think that "str_replace"
> can be used in this case:
> $new_string=str_replace('|', '_', $old_string)

> then use the same function to replace spaces.

> Ed

> Friday, February 2, 2007, 9:30:37 PM, you wrote:

>> Hi all,

>> I want replace the "|" (pipe) and the " " (space) chars where are
>> between " (double-quotes)  by an underscore "_" with the
>> preg_replace(); funtction.

>> Can someone help me to find the correct regex.

>> Thanks in advance

>> Seb

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



Re[4]: [PHP] preg_replace();

2007-02-02 Thread wwww
Try this one:

$old_string="lazy \"some chars|some chars\" dog";
$new_string=str_replace('|', '_', $old_string);
print $new_string;

Ed

Friday, February 2, 2007, 10:39:59 PM, you wrote:

> ok, but :

> $old_string="lazy \"some chars|some chars\" dog";
> $new_string=str_replace('"|"', '_', $old_string);

> don't work

> sorry for my bad english, i'm french.

> - Original Message - 
> From: <[EMAIL PROTECTED]>
> To: "Sébastien WENSKE" <[EMAIL PROTECTED]>
> Sent: Friday, February 02, 2007 9:22 PM
> Subject: Re[2]: [PHP] preg_replace();


> I have tasted the code and it worked fine (if I got you right):

> $old_string="lazy \"|\" dog";
> $new_string=str_replace('"|"', '_', $old_string);
> print $new_string;

> I got "lazy_dog"

> Ed

> Friday, February 2, 2007, 10:01:14 PM, you wrote:

>> Thanks,

>> but I think that I must use preg_replace because the condition is: replace
>> the chars (pipe or space) when they are between "

>> ie :  src=file:///h|/hjcjdgh dlkgj/dgjk.jpg"  to
>> src=file:///h_/hjcjdgh_dlkgj/dgjk.jpg"

>> Seb





>> - Original Message - 
>> From: <[EMAIL PROTECTED]>
>> To: "Sébastien WENSKE" <[EMAIL PROTECTED]>
>> Cc: 
>> Sent: Friday, February 02, 2007 8:38 PM
>> Subject: Re: [PHP] preg_replace();


>> I am not a very experienced programmer, but I think that "str_replace"
>> can be used in this case:
>> $new_string=str_replace('|', '_', $old_string)

>> then use the same function to replace spaces.

>> Ed

>> Friday, February 2, 2007, 9:30:37 PM, you wrote:

>>> Hi all,

>>> I want replace the "|" (pipe) and the " " (space) chars where are
>>> between " (double-quotes)  by an underscore "_" with the
>>> preg_replace(); funtction.

>>> Can someone help me to find the correct regex.

>>> Thanks in advance

>>> Seb

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



Re: [PHP] Pop up window in PHP code

2007-02-03 Thread wwww
Try this:


function poptastic(url)
{

newwindow=window.open(url,'name','height=490,width=900,left=150,top=175');
if (window.focus) {newwindow.focus()}
}

click here";
?>

Ed


> I am trying to open a Java script pop up widow from within the php code. Not
> able to get it done, the error I think is in the use of "" '' .. I mean
> double and/or single quote. Do not know how to place those. Please advice.
> The code is below:

> echo "
> 
> $shopname 
> $category 
> $subcategory 
> $level 
>  javascript:poptastic( Details 
> ";
> $i++;

> The Javascript code is:

> 
> var newwindow;
> function poptastic(url)
> {
>
> newwindow=window.open(url,'name','height=490,width=900,left=150,top=175');
> if (window.focus) {newwindow.focus()}
> }
> 

> The javascript code works perfect with other pages and within HTML, its just
> that the PHP is not supporting the quotes and double quotes. I have even
> tried &rsquo &rdquo and all.

> Thanks in advance
> -- 
> View this message in context:
> http://www.nabble.com/Pop-up-window-in-PHP-code-tf3167481.html#a8786668
> Sent from the PHP - General mailing list archive at Nabble.com.




-- 
Best regards,
 mailto:[EMAIL PROTECTED]

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



Re: [PHP] Pop up window in PHP code

2007-02-03 Thread wwww
Sorry, if already posted, just did not get any confirmation, wanted to
make sure the e-mail has been sent.

Try this:


function poptastic(url)
{

newwindow=window.open(url,'name','height=490,width=900,left=150,top=175');
if (window.focus) {newwindow.focus()}
}

click here";
?>

Ed


> I am trying to open a Java script pop up widow from within the php code. Not
> able to get it done, the error I think is in the use of "" '' .. I mean
> double and/or single quote. Do not know how to place those. Please advice.
> The code is below:

> echo "
> 
> $shopname 
> $category 
> $subcategory 
> $level 
>  javascript:poptastic( Details 
> ";
> $i++;

> The Javascript code is:

> 
> var newwindow;
> function poptastic(url)
> {
>
> newwindow=window.open(url,'name','height=490,width=900,left=150,top=175');
> if (window.focus) {newwindow.focus()}
> }
> 

> The javascript code works perfect with other pages and within HTML, its just
> that the PHP is not supporting the quotes and double quotes. I have even
> tried &rsquo &rdquo and all.

> Thanks in advance
> -- 
> View this message in context:
> http://www.nabble.com/Pop-up-window-in-PHP-code-tf3167481.html#a8786668
> Sent from the PHP - General mailing list archive at Nabble.com.




-- 
Best regards,
 mailto:[EMAIL PROTECTED]

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