Re: Re[2]: [PHP] File Upload

2002-12-14 Thread Paul Roberts
the legend starts here 
http://www.php.net/manual/sk/features.file-upload.php

"The _URL_ should point to a PHP file. The MAX_FILE_SIZE hidden field must precede the 
file input field and its value is the maximum filesize accepted. The value is in 
bytes." 

it also notes

"The MAX_FILE_SIZE is advisory to the browser. It is easy to circumvent this maximum. 
So don't count on it that the browser obeys your wish! The PHP-settings for 
maximum-size, however, cannot be fooled. "


Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, December 14, 2002 8:53 AM
Subject: Re: Re[2]: [PHP] File Upload


On Saturday 14 December 2002 16:40, Tom Rogers wrote:

> Just clutching at straws as there was no mention of which browser was being
> used and it may have been needed as this is a browser directive. I have
> never had trouble uploading files with or without that setting.

Ah, so in your case you're quoting an urban legend ;-)

I would really like to hear of a case where an upload fails *just because of* 
not putting in that hidden element. I've asked on the list before but never 
got any definite responses.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
You can't hold a man down without staying down with him.
-- Booker T. Washington
*/


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





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




Re: [PHP] File Upload

2002-12-14 Thread Paul Roberts
what version of php are you using?

- Original Message - 
From: "Miro Kralovic" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, December 14, 2002 3:52 AM
Subject: RE: [PHP] File Upload


Thanks Tom, but still no luck.. it seems like it doesn't recognize $testfile
variable at all in PHP script, even thought the globals are ON...



You are missing this bit:



--
regards,
Tom



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





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




[PHP] session life

2002-12-21 Thread Paul Roberts
Hi

I'm setting a session with
session_set_cookie_params (time()+648);
so the cookie should last 70 days+ but the data wasn't
returned.

from looking in the manual i see that session_cache_expire is used to set or print the 
current value of the expire. Its set in php.ini by default to 180 minutes. 

So it seems that the garbage collector will clean up the session file after 180 mins 
or 10800 seconds which is less then i was expecting after setting the cookie life.

do i need to set

session_set_cookie_params (time()+648);
session_cache_expire (648);

for the data to still be available if the user returns during the cookies life and is 
this on a per session basis.

Paul Roberts
[EMAIL PROTECTED]



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




Re: [PHP] Problem with comma in mail form

2002-12-26 Thread Paul Roberts
what mailserver are you using and how is it called in php.ini?
and what else is in the message causing the problem.

Best Wishes & Happy New Year

Paul Roberts
[EMAIL PROTECTED]


- Original Message - 
From: "Ben Edwards" <[EMAIL PROTECTED]>
To: "1LT John W. Holmes" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, December 26, 2002 4:36 PM
Subject: Re: [PHP] Problem with comma in mail form


Sorted it out with

 $message = ereg_replace("(\r\n|\n|\r)", "\n", trim( stripslashes( 
$message) ) );

trim and stripslashes not strictly speaking nessesery.  Not 100% sure what 
happened here but guess \r\n or \r was causing problems.

Ben

At 11:11 26/12/2002 -0500, 1LT John W. Holmes wrote:

> > I have actually discovered the problem is in fact that the message gets
> > truncated after a Carriage Return.
> >
> > The even wearder thing is that
> >$msg = ereg_replace( "\n", "NL", $msg );
> >
> > Douse put NL where the carriage return was but also seems to leave some
> > kind on new line character.
> >
> > So when I run $mgs through the function, do echo $msg, and look in the
> > source of the HTML $msg is still on a number of different lines,
>
>I'm still not sure why the message would be truncated, but try replacing
>\r\n instead of just \n. Windows uses \r\n, *nix uses \n and I think MAC
>uses \r.
>
>What are you using to view the message?
>
>---John Holmes...
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


* Ben Edwards  +44 (0)117 9400 636 *
* Critical Site Builderhttp://www.criticaldistribution.com *
* online collaborative web authoring content management system *
* Get alt news/views films online   http://www.cultureshop.org *
* i-Contact Progressive Video  http://www.videonetwork.org *
* Smashing the Corporate image   http://www.subvertise.org *
* Bristol Indymedia   http://bristol.indymedia.org *
* Bristol's radical news http://www.bristle.org.uk *
* PGP : F0CA 42B8 D56F 28AD 169B  49F3 3056 C6DB 8538 EEF8 *








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


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




Re: [PHP] e-mail

2002-12-26 Thread Paul Roberts
try this

mail($form['recipient'], $form['sublect'],$mailbody, "From:Web User 
<[EMAIL PROTECTED]'>");

Best Wishes & Happy New Year

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Anil Garg" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 26, 2002 7:06 PM
Subject: [PHP] e-mail


hi
i found a 'formmail' scripts from somewhere..
the problem isthe email which i get from this scripts has 'unprivilaged
user' in the 'from' field.

mail($form['recipient'], $form['sublect'],$mailbody, "From:Web User");

if i use this...in the from field..it says '[EMAIL PROTECTED]'

I just need the from field to show 'Web User' (instead of 'unprivilaged
user')
Can i do this!!
plz help

thanks and regards
anil


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





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




Re: [PHP] Multi-lingual Language Support in PHP

2002-12-30 Thread Paul Roberts
there's a nice article in this months (Feb. 2003!!!) PC world (UK) (www.pcw.co.uk) on 
this.

see www.nigelwhitfield.com for details.

Best Wishes & Happy New Year

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Michael J. Pawlowsky" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 30, 2002 4:53 PM
Subject: [PHP] Multi-lingual Language Support in PHP



Keywords: Multiple, Language, PHP, $HTTP_ACCEPT_LANGUAGE

I'm just shooting this one up here for the Archives.  

Since I could not find a built in PHP function to access the preferred languages on a 
user I came up with this.
The original version acted as a http server in that you needed to have a different 
file for evey language (ie. index.php.en, index.php.fr, index.php.de).

I find that's a complicated way to work since if you need to update code you will have 
to do it in several files.

I prefer simply 

if (phpLang_current == 'fr') {
print "Ceci est francais";
} else (
// default to english
print "This is english";
}

If it's a large block of text you can have seperate include text files as in.


if (phpLang_current == 'fr') {
include("mytext.fr");
} else (
// default to english
include("mytext.en");
}


So in case anyone else ever needs this... Here it is...


http://www.gnu.org/copyleft/gpl.html |
// +--+
// | Original release available on phpHeaven: |
// |http://www.phpheaven.net/rubrique7.html?var_recherche=phpLang |
// |  |
// | Authors:  Nicolas Hoizey <[EMAIL PROTECTED]> |
// |   Loïc Chapeaux <[EMAIL PROTECTED]> |
// +--+


// parameter to add in url
if(!defined('phpLang_urlParam'))
define('phpLang_urlParam', 'lang');

// path to image files
if(!defined('phpLang_images'))
define('phpLang_images', '/flags/');

// indicates if it should put a cookie
if(!defined('phpLang_useCookie'))
define('phpLang_useCookie', true);


// list of available languages, order it as you need
$phpLang_languages = array(
"en([-_][[:alpha:]]{2})?|english" => array('en', 'english'),
"fr([-_][[:alpha:]]{2})?|french" => array('fr', 'french'),
);



$HTTP_ACCEPT_LANGUAGE = getenv('HTTP_ACCEPT_LANGUAGE');
$HTTP_USER_AGENT = getenv('HTTP_USER_AGENT');


// language code detection
function phpLang_detectLanguage($str, $from)
{
$ext = '';
reset($GLOBALS['phpLang_languages']);
while($ext == '' && list($key, $name) = each($GLOBALS['phpLang_languages'])) {
if (($from == 1 && eregi("^".$key."$",$str)) || ($from == 2 && 
eregi("(\(|\[|;[[:space:]])".$key."(;|\]|\))",$str))) {
$ext = $name[0];
}
}

return $ext;
}


// finds the appropriate language file
if (isset($HTTP_GET_VARS[phpLang_urlParam])) {
// a language as been chosen by the user
define('phpLang_current', $HTTP_GET_VARS[phpLang_urlParam]);
}

if (!defined('phpLang_current') && phpLang_useCookie && 
isset($HTTP_COOKIE_VARS['phpLangCookie'])) {
// a language as been found in a cookie previously set
define('phpLang_current', $HTTP_COOKIE_VARS['phpLangCookie']);
}

if (!defined('phpLang_current') && isset($HTTP_ACCEPT_LANGUAGE) && 
trim($HTTP_ACCEPT_LANGUAGE) != '') {
// looks at the languages accepted by the browser
$accepted = explode(',', $HTTP_ACCEPT_LANGUAGE);
while(!defined('phpLang_current') && list($key, $name) = each($accepted)) {
$code = explode(';', $name);
$ext = phpLang_detectLanguage($code[0], 1);
if(file_exists(phpLang_localizedFileName($ext))) {
define('phpLang_current', $ext);
}
}
}

if (!defined('phpLang_current') && isset($HTTP_USER_AGENT) && trim($HTTP_USER_AGENT) 
!= '') {
// looks at the browser's identification
$ext = phpLang_detectLanguage($HTTP_USER_AGENT, 2);
define('phpLang_current', $ext);
}

if(!defined('phpLang_current')) {
// if no language yet found, chose the first existing in site's list
reset($phpLang_languages);
while(!defined('phpLang_current') && list($key, $name) = each($phpLang_languages)) {
define('phpLang_current', $name[0]);
}
}

// detection done, cookie update

if(defined('phpLang_current')) {
if(phpLang_useCookie) {
// set a cookie expiring in one year 

[PHP] error when conecting to mysql

2003-01-01 Thread Paul Roberts
Hi

my server started reporting an error when connecting to mysql

Warning: Can't connect to local MySQL server through socket 
'/var/lib/mysql/mysql.sock' (2) 
in /path/to/web//login.php on line 35 

it's happened a few times now and I'm wondering if it's me or a problem on the server 
(shared, I'm on a virtual host, Cobalt raq, apache )

any pointers to what might could cause the error.

Best Wishes & Happy New Year

Paul Roberts
[EMAIL PROTECTED]




Re: [PHP] mktime() and the format of the day number entry

2003-01-02 Thread Paul Roberts
same here win 2K apache php4.21

output

0,0,0,10,0,1998 => 90711
0,0,0,10,00,1998 => 90711
0,0,0,10,1,1998 => 907196400
0,0,0,10,01,1998 => 907196400
0,0,0,10,2,1998 => 907282800
0,0,0,10,02,1998 => 907282800
0,0,0,10,3,1998 => 907369200
0,0,0,10,03,1998 => 907369200
0,0,0,10,4,1998 => 907455600
0,0,0,10,04,1998 => 907455600
0,0,0,10,5,1998 => 907542000
0,0,0,10,05,1998 => 907542000
0,0,0,10,6,1998 => 907628400
0,0,0,10,06,1998 => 907628400
0,0,0,10,7,1998 => 907714800
0,0,0,10,07,1998 => 907714800
0,0,0,10,8,1998 => 907801200
0,0,0,10,08,1998 => 90711
0,0,0,10,9,1998 => 907887600
0,0,0,10,09,1998 => 90711

code
 $tmp";
$tmp = mktime(0,0,0,10,00,1998);
echo "0,0,0,10,00,1998 => $tmp";
$tmp = mktime(0,0,0,10,1,1998);
echo "0,0,0,10,1,1998 => $tmp";
$tmp = mktime(0,0,0,10,01,1998);
echo "0,0,0,10,01,1998 => $tmp";
$tmp = mktime(0,0,0,10,2,1998);
echo "0,0,0,10,2,1998 => $tmp";
$tmp = mktime(0,0,0,10,02,1998);
echo "0,0,0,10,02,1998 => $tmp";
$tmp = mktime(0,0,0,10,3,1998);
echo "0,0,0,10,3,1998 => $tmp";
$tmp = mktime(0,0,0,10,03,1998);
echo "0,0,0,10,03,1998 => $tmp";
$tmp = mktime(0,0,0,10,4,1998);
echo "0,0,0,10,4,1998 => $tmp";
$tmp = mktime(0,0,0,10,04,1998);
echo "0,0,0,10,04,1998 => $tmp";
$tmp = mktime(0,0,0,10,5,1998);
echo "0,0,0,10,5,1998 => $tmp";
$tmp = mktime(0,0,0,10,05,1998);
echo "0,0,0,10,05,1998 => $tmp";
$tmp = mktime(0,0,0,10,6,1998);
echo "0,0,0,10,6,1998 => $tmp";
$tmp = mktime(0,0,0,10,06,1998);
echo "0,0,0,10,06,1998 => $tmp";
$tmp = mktime(0,0,0,10,7,1998);
echo "0,0,0,10,7,1998 => $tmp";
$tmp = mktime(0,0,0,10,07,1998);
echo "0,0,0,10,07,1998 => $tmp";
$tmp = mktime(0,0,0,10,8,1998);
echo "0,0,0,10,8,1998 => $tmp";
$tmp = mktime(0,0,0,10,08,1998);
echo "0,0,0,10,08,1998 => $tmp";
$tmp = mktime(0,0,0,10,9,1998);
echo "0,0,0,10,9,1998 => $tmp";
$tmp = mktime(0,0,0,10,09,1998);
echo "0,0,0,10,09,1998 => $tmp";
?>


- Original Message - 
From: "Johnson, Kirk" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 02, 2003 8:50 PM
Subject: [PHP] mktime() and the format of the day number entry



OK, I am mktime() challenged. Can someone please explain these results to
me?

I have some test dates in October of 1998. For the days numbered 1-7,
mktime() does not care whether I have a leading zero on the day or not, I
get the same timestamp regardless, e.g., both a '7' and a '07' for the day
number give the same timestamp. However, for the days 8-9, I get different
timestamps for each if I use '8' versus '08' and '9' versus '09'. In these
latter two cases, mktime treats both '08' and '09' as '0', and it gives the
same timestamp as Oct 0 1998. What's up?

The code is below if you want to have a look.

Kirk

Kirk Johnson
[EMAIL PROTECTED]

"0, as a number, is just as important as any other number."

";
$tmp = mktime(0,0,0,10,00,1998);
echo "$tmp";
$tmp = mktime(0,0,0,10,1,1998);
echo "$tmp";
$tmp = mktime(0,0,0,10,01,1998);
echo "$tmp";
$tmp = mktime(0,0,0,10,2,1998);
echo "$tmp";
$tmp = mktime(0,0,0,10,02,1998);
echo "$tmp";
$tmp = mktime(0,0,0,10,3,1998);
echo "$tmp";
$tmp = mktime(0,0,0,10,03,1998);
echo "$tmp";
$tmp = mktime(0,0,0,10,4,1998);
echo "$tmp";
$tmp = mktime(0,0,0,10,04,1998);
echo "$tmp";
$tmp = mktime(0,0,0,10,5,1998);
echo "$tmp";
$tmp = mktime(0,0,0,10,05,1998);
echo "$tmp";
$tmp = mktime(0,0,0,10,6,1998);
echo "$tmp";
$tmp = mktime(0,0,0,10,06,1998);
echo "$tmp";
$tmp = mktime(0,0,0,10,7,1998);
echo "$tmp";
$tmp = mktime(0,0,0,10,07,1998);
echo "$tmp";
$tmp = mktime(0,0,0,10,8,1998);
echo "$tmp";
$tmp = mktime(0,0,0,10,08,1998);
echo "$tmp";
$tmp = mktime(0,0,0,10,9,1998);
echo "$tmp";
$tmp = mktime(0,0,0,10,09,1998);
echo "$tmp";
?>

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





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




Re: [PHP] Mass-mailing method

2003-01-03 Thread Paul Roberts
some times more than 100 bcc's are treated spam and dropped by the server, try it with 
a limit in the query.

Best Wishes & Happy New Year

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Cesar Aracena" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 03, 2003 6:19 AM
Subject: RE: [PHP] Mass-mailing method


I'm going to try changing that. I don't have access to my client's
server as I work remotely, so I can't view any logs... or can I? If
anyone else have something for me to try, start shooting...

Thanks,

Cesar L. Aracena
[EMAIL PROTECTED]
[EMAIL PROTECTED]
(0299) 156-356688
Neuquén (8300) Capital
Argentina


-Mensaje original-
De: Michael J. Pawlowsky [mailto:[EMAIL PROTECTED]] 
Enviado el: viernes, 03 de enero de 2003 3:15
Para: Cesar Aracena; [EMAIL PROTECTED]
Asunto: Re: [PHP] Mass-mailing method

Take a look at the sendmail.log for some clues...

But I had something weird were it worked fine for me at home Linux 8 PHP
4.2.2
and when I sent it up to the prod server I had to change the ."\r\n";
to ."\n";
Which technically is wrong.

Go figure!

But take a look at the sendmail log to begin with.

Mike

 

*** REPLY SEPARATOR  ***

On 03/01/2003 at 3:08 AM Cesar Aracena wrote:

>Hi all,
>
>I did a registration page for a customer, and now I'm trying to develop
>a way for him to send an e-mail once in a while to the people
registered
>with him. I did something (shown below) and everything seems to be ok,
>but the e-mail never reaches... Can someone find the problem or maybe
>point me to something already done to send multiple e-mails as BCC???
>
>Thanks in advance,
>
>$query = "SELECT * FROM mararegistro2 ORDER BY lname";
>$result = mysql_query($query) or die (mysql_errno());
>$num_rows = mysql_num_rows($result);
>
>for ($x=0; $x < $num_rows; $x++)
>{
>$row = mysql_fetch_array($result);
>$bcc .= $row[email]."; ";
>}
>
>$myname = "".$name.""; 
>$myemail = "".$email.""; 
>
>$contactemail = $bcc; 
>
>$message = "".$mes.""; 
>$subject = "".$subject.""; 
>
>$headers .= "MIME-Version: 1.0\r\n"; 
>$headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; 
>$headers .= "From: ".$myname." <".$myemail.">\r\n"; 
>$headers .= "Bcc: ".$contactemail."\r\n"; 
>$headers .= "Reply-To: ".$myname." <".$myemail.">\r\n"; 
>$headers .= "X-Priority: 1\r\n"; 
>$headers .= "X-MSMail-Priority: High\r\n"; 
>$headers .= "X-Mailer: Joyeria Mara"; 
>
>$mail = mail("", $subject, $message, $headers); 
>
>
>
>Cesar L. Aracena
>[EMAIL PROTECTED]
>[EMAIL PROTECTED]
>(0299) 156-356688
>Neuquén (8300) Capital
>Argentina
>
>
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php





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


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





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




[PHP] php stored in mysql

2003-01-09 Thread Paul Roberts
Hi

I want to store some discount codes in mysql, i was thinking of putting

$price = $price - ($price *.i);

in a mysql field that can be looked up via the coupon number

what's the best way to do this and return $price with the discount applied.

Thanks

Best Wishes & Happy New Year

Paul Roberts
[EMAIL PROTECTED]




Re: [PHP] php stored in mysql

2003-01-09 Thread Paul Roberts
I should have used

return($price = $price - ($price *.1)); in the db

and eval($str);

Best Wishes & Happy New Year

Paul Roberts
[EMAIL PROTECTED]


- Original Message - 
From: "Paul Roberts" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 09, 2003 10:29 PM
Subject: [PHP] php stored in mysql


Hi

I want to store some discount codes in mysql, i was thinking of putting

$price = $price - ($price *.i);

in a mysql field that can be looked up via the coupon number

what's the best way to do this and return $price with the discount applied.

Thanks

Best Wishes & Happy New Year

Paul Roberts
[EMAIL PROTECTED]




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




Re: [PHP] HTTP_REFERER work without a problem....

2003-01-15 Thread Paul Roberts
try looking at sessions, 

if they don't have a login session id send them to the login page otherwise they are 
logged in so let them see the page.

works for me

Best Wishes & Happy New Year

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Scott Fletcher" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 15, 2003 9:07 PM
Subject: Re: [PHP] HTTP_REFERER work without a problem


It's not a PHP bug.  Many PHP programmer tried to their best to use
HTTP_REFERER so they can keep track of which webpages on the current website
did the user last visited.  That way, they can keep out the unauthorized
access to the website without first logging in to the website.

Well, my company's website use both SSL and Session ID.  They are good for
starter but they aren't any secure if anyone can make a direct access
without logging in.  That's where I use HTTP_REFERER to see what last page
did he or she visited, if the last page being visited is outside of my
company's website then php moved the end user to the login page.  It is
pretty effective.

The common problem with the browsers is that they aren't compactible so
HTTP_REFERER don't alway work right and sometime return a blank if those
three are being used.  I had been observing it for a few years.  Those three
are  1) HierMenus, 2) location.replace('') and 3) location.href=''.  When
either one of these are in use, some browsers return with a blank in
HTTP_REFERER.

Cheers

"Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> --- Scott Fletcher <[EMAIL PROTECTED]> wrote:
> > Here's what I found so interesting
> >
> > This code, $_SERVER['HTTP_REFERER'] have worked without a
> > problem when I use the latest Mozilla build. It even work
> > with the HierMenus,
> location.replace('http://whatever.com'),
> > and location.href = http://whatever.com...
> >
> > This is a good news for PHP everywhere.
> >
> > Unfortunately, Internet Explorer still have this
> > bug...
>
> What bug is that?
>
> Is there a question here somewhere? I think I am having a
> hard time interpreting it.
>
> Chris



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





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




Re: [PHP] Converting accented characters or numeric equivalents to non-accented

2003-01-18 Thread Paul Roberts
another one for you

function removeaccents($string) {
   return strtr($string,
 "SOZsozY¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ",
 "SOZsozYYuAAACDNOOYsaaaconooyy");
}

Best Wishes & Happy New Year

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Ian M. Evans" <[EMAIL PROTECTED]>
To: "Ernest E Vogelsinger" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, January 18, 2003 6:41 PM
Subject: RE: [PHP] Converting accented characters or numeric equivalents to 
non-accented


Ernest E. Vogelsinger suggested:
>$chars_in = array('Á',''á','É','é');  // you get it
>$chars_out = array('A','a','E','e');  // this too
>preg_replace($chars_in, $chars_out, $string_to_parse);

I initially got a 'no ending delimiter' error but after adding /'s to the
$chars_in it was just what the doctor ordered.

I'm actually a little surprised that there isn't a built-in function, say,
strip_accent(). I'd assume a lot of people would need this at some time or
another.


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





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




Re: [PHP] MS Access

2003-01-28 Thread Paul Roberts
that means there's an error in your sql, 
what's the sql your using.
Best Wishes

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Johannes Schlueter" <[EMAIL PROTECTED]>
To: "Todd Barr" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, January 28, 2003 7:25 PM
Subject: Re: [PHP] MS Access


On Tuesday 28 January 2003 23:11, Todd Barr wrote:
> I have it connected, now I am getting the following error
>
> Warning: SQL error: , SQL state 0 in SQLConnect in c:\program
> files\apache group\apache\htdocs\test.php on line 7

What are you doing on line 7? What did you do on the lines 1-6? Sorry for the 
question, but my gem is broken...

johannes


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





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




Re: [PHP] move a record into a different table

2003-01-31 Thread Paul Roberts
so how about

With INSERT ... SELECT statement you can quickly insert many rows into a table from 
one or many tables.


INSERT INTO tblTemp2 (fldID) SELECT tblTemp1.fldOrder_ID FROM tblTemp1 WHERE
tblTemp1.fldOrder_ID > 100;

from the mysql manual

Best Wishes

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Kevin Stone" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 31, 2003 10:08 PM
Subject: Fw: [PHP] move a record into a different table


Sorry but as convenient as PHP and MySQL are there are some things you just
have to code for yourself.  In order to move data from one table to another
you will have to:

1) SELECT the desired fields from the first table
2) extract() them from the results pointer
3) INSERT them into the second table
4) DELETE the originals from the first table

If you need any help with any part of this feel free to ask.

-Kevin

Consider reposting this to the PHP-DB list for further help.

- Original Message -
From: "DC" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 31, 2003 2:29 PM
Subject: [PHP] move a record into a different table


> Hi all,
>
> I want to delete a record from my table 1, but would like all the data for
> that single record passed onto my (archive) table 2 at  the same time
> Sounds easy!!
>
> Any ideas??
>
> Thanks
>
> DC
>
>
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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





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




Re: [PHP] mail() vs sockets

2003-02-07 Thread Paul Roberts
just post once

- Original Message - 
From: "Jeff Busby" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 07, 2003 9:30 PM
Subject: [PHP] mail() vs sockets


Question regarding php's mail function.

I've created a targetted mail system for a client, that uses the mail() function to 
send the the customer list.  I find it's ok for a few hundred names, however the 
client has a list of over 1 and I know that would be way to taxing on the server, 
as some tests have shown.  I got the following function off the php.net site and I'm 
wondering if something like this will be significantly more efficient than using the 
mail function.

function sendmail($to='', $subject='', $message='', $headers='', $extra='') {
 
 $fd = popen("/usr/sbin/sendmail -t $extra", 'w');

 fputs($fd, "To: $to\n");
 fputs($fd, "Subject: $subject\n");
 fputs($fd, "X-Mailer: PHP4\n");
 
 if ($headers) {
  
   fputs($fd, "$headers\n");
 }
 
 fputs($fd, "\n");
 fputs($fd, $message);
 pclose($fd);
}

At this point using perl or another language is not an option.  Any advice or links 
would be appreciated.

Cheers,
Jeff.


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




Re: [PHP] Beginners question

2003-02-09 Thread Paul Roberts
use html  instead of \n 

or 

echo nl2br("This spans\nmultiple lines. The newlines will be\noutput as
well.");

Best Wishes

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Martin Purdy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, February 09, 2003 8:16 PM
Subject: Re: [PHP] Beginners question


How do you use the output on a webpage then?

Martin




"Leif K-Brooks" <[EMAIL PROTECTED]> skrev i en meddelelse
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> My guess is that the new lines are there, but since you're (most likely)
> outputting HTML, you don't see them.  Take at look at the br HTML tag.
>
> Martin Purdy wrote:
>
>  >Hi everybody
>  >
>  >I am totally new to PHP, and I have a problem with the Print statement.
>  >When I send a newline using "\n" nothing happens.
>  >
>  >I cannot get any linebreaks into my code.
>  >
>  >The following line is copied from the PHP Manual, and is sopposed to
> give me
>  >the text split into 3 lines, but they come out as one line.
>  >
>  >echo "This spans\nmultiple lines. The newlines will be\noutput as
>  >well.";
>  >
>  >Can someone please tell me what I am doing wrong?
>  >
>  >Martin Purdy
>  >
>  >
>  >
>  >
>  >
>
> --
> The above message is encrypted with double rot13 encoding.  Any
> unauthorized attempt to decrypt it will be prosecuted to the full extent
> of the law.
>
>
>
>



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





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




Re: [PHP] RSS

2003-03-13 Thread Paul Roberts
this months free sample article in PHP Architect - A monthly magazine for PHP 
Professionals.  http://www.phparch.com/


- Original Message - 
From: "Sebi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 13, 2003 11:47 AM
Subject: [PHP] RSS



Hi,
Does some one know where I can find a RSS parser exmple?

Tnx


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





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



Re: [PHP] Decode email

2002-08-04 Thread Paul Roberts

the imap function will do this.

http://za2.php.net/manual/en/ref.imap.php


Paul Roberts
http://www.paul-roberts.com
[EMAIL PROTECTED]

- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 04, 2002 1:06 AM
Subject: [PHP] Decode email


> Hi
> 
> Anyone know a good email decoder (function or class) that can split the
> any email to subject, from, to , body and attachments ?
> 
> 
> Thank You
> 
>___
> http://www.SaudiABM.com
>  ___
> About Islam :
> http://home2.swipnet.se/~w-20479/Audio.htm
> http://sultan.org
>   ___
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 


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




Re: [PHP] Re: Bulk Email [solution found!]

2002-08-16 Thread Paul Roberts

i tried it using the 5th parameter with -odd and the mail got qued but i also need to 
set [EMAIL PROTECTED] (so i get those bounces) but i got <[EMAIL PROTECTED] -odd> for the 
return path in the email. 

i then tried it with the -odd first and it qued the mail but didn't set the return 
path, i also want to set it so it only returns the headers using -Rhdrs so need to set 
3 options when sendmail is called.

can you set multiple options with the 5th parameter? i would have thought it would 
append the stuff in the 5th to the sendmail path set in php.ini but it doesn't seem to 
work that way.

i can do this fine by using popen() and adding the parameters to the path so i can't 
see why it doesn't play with the mail function.

Paul Roberts
http://www.paul-roberts.com
[EMAIL PROTECTED]




- Original Message - 
From: "Manuel Lemos" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 17, 2002 2:36 AM
Subject: [PHP] Re: Bulk Email [solution found!]


> Hello,
> 
> On 08/16/2002 05:37 PM, Daren Cotter wrote:
> > First, a recap of my problem:
> > 
> > I need to send personalized emails to my member list
> > on a daily basis. I use PHP to query the MySQL
> > database, and loop through the results using the
> > mail() function. Problem: very slow, browser/php times
> > out, etc.
> > 
> > Solution:
> > 
> > First, I configure sendmail to use "queueonly" as the
> > DeliveryMethod (see sendmail.cf) instead of
> > "background". Then, when my PHP script runs, mailings
> > simply get queued instead of actually delivered. This
> > is a x10 speed increase. My script queues
> > approximately 1,000 mailings per minute (a x10 speed
> > increase). Then, I modified the
> > /etc/rc.d/init.d/sendmail script to process the queue
> > every 5 minutes, instead of the default one hour. This
> > insures that the mailings actually get sent soon after
> > they're queued, and you won't have to wait for
> > important emails to come through.
> 
> As I mentioned before this solution is set for disaster as you grow into 
> larger number of recipients. The problem is that queuing separate 
> messages for each recipient will fill up your disk. But that is not all. 
> The eventual message bounces that you will get will only aggravate your 
> problem. If you can live without personalization, don't think twice, 
> forget it. If you have doubts, think again.
> 
> 
> 
> > The problem with the above solution used to be this:
> > certain emails generated from my site (welcome emails,
> > password lookup emails, etc) need to be sent
> > IMMEDIATELY, and cannot wait in the queue for 5
> > minutes. The solution for this: not using the built-in
> > mail() command in PHP. I created my own mail script
> > (by modifying something someone else already did)
> > which opens a socket directly with the mail server.
> > Code is below.
> > 
> > // Sends the email directly to the mail server using
> > SMTP. This is done
> > // so sendmail can be setup using the queue method on
> > the server, and
> > // confirmation emails, etc, can be sent immediately
> > to the member.
> > function smtp_mail($to, $from_name, $from_email,
> > $reply_to_email, $subject, $body) {
> > $smtp = fsockopen("your_mail_server_here", 25);
> 
> I am not sure that sending to the local mailer queue via SMTP would be 
> any better than using sendmail itself to put the message there. Anyway, 
> I am afraid that the message will still wait for sendmail to process it
> 
> 
> > if ($smtp == 0)
> > return 0;
> > fputs($smtp,"helo
> > machines_host_and_domain_name_here\r\n");
> > $line = fgets($smtp, 1024);
> > fputs($smtp,"mail from: $from_email\r\n");
> > $line = fgets($smtp, 1024);
> > fputs($smtp,"rcpt to: $to\r\n");
> > $line = fgets($smtp, 1024);
> > fputs($smtp,"data\r\n");
> > $line = fgets($smtp, 1024);
> > fputs($smtp,"From: $from_name <$from_email>\r\n");
> > fputs($smtp,"Reply-To: $reply_to_email\r\n");
> > fputs($smtp,"To: $to\r\n");
> > fputs($smtp,"Subject: $subject\r\n");
> > fputs($smtp,"\r\n");
> > fputs($smtp,"$body\r\n");
> > fputs($smtp,".\r\n");
> > $line = fgets($smtp, 1024);
> > fputs($smtp, "QUIT\r\n");
> > fclose($smtp);
> > return 1;
> > }
> 
> I am afraid this code needs a lot of work or else it will choke on some 
> servers due to multi-line responses, maybe not on the actual sendmail 
> version and configuration you are using, but definetely on some SMTP 
> servers.
> 
> 
> -- 
> 
> Regards,
> Manuel Lemos
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 



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




Re: [PHP] Re: Bulk Email [solution found!]

2002-08-17 Thread Paul Roberts

Okay i found a bug report on this
http://bugs.php.net/bug.php?id=15509

Apparently it was changed to only allow one parameter for security reasons.


Paul Roberts
http://www.paul-roberts.com
[EMAIL PROTECTED]



- Original Message - 
From: "Manuel Lemos" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 17, 2002 1:37 PM
Subject: Re: [PHP] Re: Bulk Email [solution found!]


> Hello,
> 
> On 08/17/2002 03:52 AM, Paul Roberts wrote:
> > i tried it using the 5th parameter with -odd and the mail got qued but i also need 
>to set [EMAIL PROTECTED] (so i get those bounces) but i got <[EMAIL PROTECTED] -odd> for 
>the return path in the email. 
> > 
> > i then tried it with the -odd first and it qued the mail but didn't set the return 
>path, i also want to set it so it only returns the headers using -Rhdrs so need to 
>set 3 options when sendmail is called.
> > 
> > can you set multiple options with the 5th parameter? i would have thought it would 
>append the stuff in the 5th to the sendmail path set in php.ini but it doesn't seem 
>to work that way.
> > 
> > i can do this fine by using popen() and adding the parameters to the path so i 
>can't see why it doesn't play with the mail function.
> 
> That is because PHP encloses what you pass between quotes, so that is 
> take as just a single argument, so it can't be used to pass more than 
> one argument.
> 
> -- 
> 
> Regards,
> Manuel Lemos
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 


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




Re: Re[4]: [PHP] Pulling data out of browser address bar

2002-08-25 Thread Paul Roberts

try $REQUEST_URI
The URI which was given in order to access this page; for instance, '/index.html'. 

Paul Roberts
http://www.paul-roberts.com
[EMAIL PROTECTED]

- Original Message - 
From: <[EMAIL PROTECTED]>
To: "php-general" <[EMAIL PROTECTED]>
Sent: Friday, August 23, 2002 10:54 PM
Subject: Re[4]: [PHP] Pulling data out of browser address bar


> This is close to what I want but I don't what to redirect them I just
> want to get what is in the URL so I can but it in a variable to use on
> the web page. I have a lot of domain names all pointing to one domain
> and I want to be able to put "WELCOME TO TheDomannamethaytypedin.com" at the top of
> the page depending on what domain they typed into the URL. They will
> not be coming from another page they will most likely be typing the
> URL in
> 
> Friday, August 23, 2002, 2:22:21 PM, you wrote:
> 
> 
> SJNHBe> This probably isn't doing what you want but it will illustrate how to get
> SJNHBe> the location.
> 
> SJNHBe> 
> SJNHBe> <!--
> SJNHBe> function checklocation(goodurl) {
> SJNHBe> if (self.window.location != goodurl) {
> SJNHBe> self.window.location = goodurl;
> SJNHBe> }
> 
> SJNHBe> }
> -->>
> SJNHBe> 
> 
> SJNHBe> Bascially you call checklocation with the url they should be at, if they
> SJNHBe> aren't at that url it will redirect them to their URL.
> 
> SJNHBe> I use this script by placing and onLoad event in the  tag, an example
> SJNHBe> is  SJNHBe> onLoad="checklocation('http://www.yoursite.com/login.php')">
> 
> 
> SJNHBe> I created this script because some people were only going to yoursite.com
> SJNHBe> instead of www.yoursite.com, this caused sessions not to work because the
> SJNHBe> browser was not sending the cookies with the request because the cookies
> SJNHBe> were for www.yoursite.com.
> 
> SJNHBe> Jason 
> SJNHBe> -Original Message-
> SJNHBe> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
> SJNHBe> Sent: Friday, August 23, 2002 3:24 PM
> SJNHBe> To: php-general
> SJNHBe> Subject: Re[2]: [PHP] Pulling data out of browser address bar
> 
> SJNHBe> Hello Kevin,
> SJNHBe> I  don't what to know where that came from I what to know what is in
> SJNHBe> the Address bar of the browser. They might not be coming from anywhere
> SJNHBe> they might have just typed the url in. I will look at doing it with
> SJNHBe> Javascript
> 
> SJNHBe> Friday, August 23, 2002, 1:21:10 PM, you wrote:
> 
> 
> KS>> You can do it with Javascript but there's no need.  $HTTP_REFERER is
> SJNHBe> what
> KS>> you want.  It'll tell you where your users are coming from.  So you'll
> SJNHBe> know
> KS>> if they have been redirected from one your other domains.
> KS>> -Kevin
> 
> KS>> - Original Message -
> KS>> From: <[EMAIL PROTECTED]>
> KS>> To: "php-general" <[EMAIL PROTECTED]>
> KS>> Sent: Friday, August 23, 2002 2:19 PM
> KS>> Subject: [PHP] Pulling data out of browser address bar
> 
> 
> >>> Is there any way to tell what was typed in the browser to get to the
> >>> web page.
> >>> What I have is domain names that forward to a main domain and I
> >>> want to know what they typed in the browser to get to the main domain.
> >>>  The way it is forwarded the browser retains what ever was typed
> >>> in the address bar. How can I pull what was typed into the address bar
> >>> this info into the web page.
> >>>
> >>>
> >>>
> >>> --
> >>> Best regards,
> >>>  rdkurth  mailto:[EMAIL PROTECTED]
> >>>
> >>>
> >>> --
> >>> PHP General Mailing List (http://www.php.net/)
> >>> To unsubscribe, visit: http://www.php.net/unsub.php
> >>>
> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> Best regards,
>  rdkurthmailto:[EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 


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




Re: [PHP] Ridding myself of HTML tags

2002-08-31 Thread Paul Roberts

have a look at peg_replace in the man, you could also get your users to save as 
filtered html which get rid of some of it, there's also a MS tool "Microsoft Office 
HTML Filter 2" that will clean it some more, it says it's for word 2000 but it works 
fine for word 2002/XP.

but your best option is to use preg_replace to swap out all the "smart tags" etc.
Paul Roberts
http://www.paul-roberts.com
[EMAIL PROTECTED]



- Original Message - 
From: "DL Neil" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, August 31, 2002 12:02 AM
Subject: Re: [PHP] Ridding myself of HTML tags


> Liam,
> If you were to stristr()/remove everything up to and including the 
> tag, would that take care of things?
> =dn
> 
> 
> > I've got a lil problem with HTML tags. Here's the description.
> >
> > My site accepts HTML files by upload. A lot of these files are written in
> MS
> > Word and then saved as HTML files from that. MS Word likes to put a bunch
> of
> > garbage at the beginning of the file. Now, when users upload their HTML
> > files, my script goes and striptags all of the unnecessary junk in there
> > except it can't rid all this junk (HTML, XML, CSS, JavaScript) at the
> > beginning of the HTML file. Some of these tags span multiple lines, and my
> > script goes through line-by-line, so it won't identify these as tags. Is
> > there a simpler fashion? I don't need the junk about style sheeting and
> > stuff, because I have a style sheet that will take care of styling the
> files
> > the way they should be. I don't want the extra tags, even though they're
> > invisible to users when they web-view, because these are e-mailable files
> > (for HTML mail, it's fine; for text mail, I need to strip it down and
> that's
> > the problem).
> >
> > =
> > Just in case, I've included the HTML code below:
> >
> >
> >  > xmlns:w="urn:schemas-microsoft-com:office:word"
> > xmlns="http://www.w3.org/TR/REC-html40";>
> >
> > 
> > 
> > 
> > 
> > 
> > 
> > Test test test
> > 
> > 
> > <!--
> >  /* Style Definitions */
> >  p.MsoNormal, li.MsoNormal, div.MsoNormal
> > {mso-style-parent:"";
> > margin:0cm;
> > margin-bottom:.0001pt;
> > mso-pagination:widow-orphan;
> > font-size:12.0pt;
> > font-family:"Times New Roman";
> > mso-fareast-font-family:"Times New Roman";}
> > span.SpellE
> > {mso-style-name:"";
> > mso-spl-e:yes;}
> > @page Section1
> > {size:612.0pt 792.0pt;
> > margin:72.0pt 90.0pt 72.0pt 90.0pt;
> > mso-header-margin:35.4pt;
> > mso-footer-margin:35.4pt;
> > mso-paper-source:0;}
> > div.Section1
> > {page:Section1;}
> > -->
> > 
> > 
> > 
> >
> > 
> >
> > 
> >
> > Test test  > class=SpellE>test
> >
> >  > class=SpellE>Fdjfkasdjfkla
> >
> >  > class=SpellE> > style='mso-bidi-font-weight:normal'>Fdjkslafjdklaf
> >
> >  
> >
> >  > class=SpellE>Fdasfdfasffasdfdaadfdfs
> >
> >  > class=SpellE>Dfsdfs
> >
> > Hi
> >
> >  
> >
> >  > style='mso-tab-count:3'>  > class=SpellE>Jfdklas
> >
> >  
> >
> > 
> >
> > 
> >
> > 
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 


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




Re: [PHP] Upload Progress

2002-09-09 Thread Paul Roberts

why not just get creative, pop up a window on submit with an animated gif of a dot 
moving back and forth or similar and an uploading message and then close it when the 
page reloads.

most of these things on have nothing to do with progress of what's really happening in 
my experience.

Paul Roberts
http://www.paul-roberts.com
[EMAIL PROTECTED]

- Original Message - 
From: "David Buerer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 09, 2002 7:20 PM
Subject: RE: [PHP] Upload Progress


Ya' know guys i'm sitting here thinking about this problem because I have
the same problem on one of my sites.  A bunch of inpatient stupid users whom
are click happy when they get impatient. Event a 100K upload can take to
long!

I don't like the ASP idea.  It's really not a good solution.  I'm almost
wondering if a JAVA solution which can do FTP directly or maybe a direct
socket connection/transfer with Macromedia Flash would work. Both of these
ways you could better monitor what's going on at the packet level and
therefore giving a lot of control over something like a progress bar.  Who
knows.  It's got to be something other than PHP though because PHP is after
all only a server side language.

-Original Message-
From: Jed Verity [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 09, 2002 11:08 AM
To: Jay Blanchard; [EMAIL PROTECTED]
Subject: Re: [PHP] Upload Progress


You're right about it costing more money. But we had one server handling a
bunch of uploads, most of them over 25 MB, and 99% being instigated by very
impatient, not very technical, people. People who kept canceling and
canceling, despite our directions, because they thought it was stuck or
frozen or taking too long. It was worth $150 for us to buy the ASP component
(I think we used ABCUpload, maybe?). The development time required for a
creative PHP solution -- and one that might not have worked as well -- would
have been dramatically more expensive than the almost out-of-the-box
solution with ASP's components. (And much of the site was already written in
ASP.)

Other than that, you'll get know argument from me about ASP vs. PHP. I'm
head over heels for PHP and, in any context other than the one stated above
(and maybe one or two others), I would choose to use God Blessed PHP over
anything else.

Cheers!
Jed

P.S. I knew I'd get some fighters with that comment. Haven't learned my
lesson yet... ;-)

On the threshold of genius, Jay Blanchard wrote:

> [snip]
> There really isn't a great solution for this, that I know of. It's one of
> the few things that makes an argument for ASP over PHP, as far as I'm
> concerned (if you have the luxury of choosing). Below is what I did once
to
> try to get around the problem. It worked *okay*.
> [/snip]
> 
> How does this argue for ASP over PHP? I don't see how. File upload on PHP
is
> built in and therefore free. ASP file upload mechs cost more money. And,
> having used ASP for a while, and having looked for this feature, no upload
> progress bar exists there either. And PHP is a language, where ASP is a
> service ... please do not confuse the two. If you want to argue VBScript
vs.
> PHP , well ,come on ... let's go. :^] PHP can beat VBScript with one
> curly-brace tied behind its back.
> 
> I mentioned a while back, when this came up before (see the archives) that
> this could probably be done with an IFRAME in the upload dialog box. Now I
> haven't given this much thought, but maybe it could be done. The largest
> problem that I see is the communication back and forth between client and
> server. The server would have to know the original size of the file at the
> point the upload is started, then it would be checked for original_size
> minus bits_uploaded, flush the reults to the IFRAME drawing a GD graph,
and
> continue to do this as it went on.
> 
> Another method is to start the upload with a non-progressive animation
that
> quits when is_upload_file() returns true.
> 
> Jay
> 
> 


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




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




Re: [PHP] Upload Progress

2002-09-09 Thread Paul Roberts

your problem is nothing seems to happen when they click the submit button, you can use 
JavaScript to prevent re-submission, change the text on the submit button or you could 
even pop up a window on submit with an animated gif of a dot moving back and forth or 
similar and an uploading message and then close it when the page reloads.

Just a few ideas.

Paul Roberts
http://www.paul-roberts.com
[EMAIL PROTECTED]

- Original Message - 
From: "David Buerer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 09, 2002 7:20 PM
Subject: RE: [PHP] Upload Progress


Ya' know guys i'm sitting here thinking about this problem because I have
the same problem on one of my sites.  A bunch of inpatient stupid users whom
are click happy when they get impatient. Event a 100K upload can take to
long!

I don't like the ASP idea.  It's really not a good solution.  I'm almost
wondering if a JAVA solution which can do FTP directly or maybe a direct
socket connection/transfer with Macromedia Flash would work. Both of these
ways you could better monitor what's going on at the packet level and
therefore giving a lot of control over something like a progress bar.  Who
knows.  It's got to be something other than PHP though because PHP is after
all only a server side language.

-Original Message-
From: Jed Verity [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 09, 2002 11:08 AM
To: Jay Blanchard; [EMAIL PROTECTED]
Subject: Re: [PHP] Upload Progress


You're right about it costing more money. But we had one server handling a
bunch of uploads, most of them over 25 MB, and 99% being instigated by very
impatient, not very technical, people. People who kept canceling and
canceling, despite our directions, because they thought it was stuck or
frozen or taking too long. It was worth $150 for us to buy the ASP component
(I think we used ABCUpload, maybe?). The development time required for a
creative PHP solution -- and one that might not have worked as well -- would
have been dramatically more expensive than the almost out-of-the-box
solution with ASP's components. (And much of the site was already written in
ASP.)

Other than that, you'll get know argument from me about ASP vs. PHP. I'm
head over heels for PHP and, in any context other than the one stated above
(and maybe one or two others), I would choose to use God Blessed PHP over
anything else.

Cheers!
Jed

P.S. I knew I'd get some fighters with that comment. Haven't learned my
lesson yet... ;-)

On the threshold of genius, Jay Blanchard wrote:

> [snip]
> There really isn't a great solution for this, that I know of. It's one of
> the few things that makes an argument for ASP over PHP, as far as I'm
> concerned (if you have the luxury of choosing). Below is what I did once
to
> try to get around the problem. It worked *okay*.
> [/snip]
> 
> How does this argue for ASP over PHP? I don't see how. File upload on PHP
is
> built in and therefore free. ASP file upload mechs cost more money. And,
> having used ASP for a while, and having looked for this feature, no upload
> progress bar exists there either. And PHP is a language, where ASP is a
> service ... please do not confuse the two. If you want to argue VBScript
vs.
> PHP , well ,come on ... let's go. :^] PHP can beat VBScript with one
> curly-brace tied behind its back.
> 
> I mentioned a while back, when this came up before (see the archives) that
> this could probably be done with an IFRAME in the upload dialog box. Now I
> haven't given this much thought, but maybe it could be done. The largest
> problem that I see is the communication back and forth between client and
> server. The server would have to know the original size of the file at the
> point the upload is started, then it would be checked for original_size
> minus bits_uploaded, flush the reults to the IFRAME drawing a GD graph,
and
> continue to do this as it went on.
> 
> Another method is to start the upload with a non-progressive animation
that
> quits when is_upload_file() returns true.
> 
> Jay
> 
> 


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





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




Re: [PHP] Best Practice

2002-09-21 Thread Paul Roberts

just use css to define separate styles for each media
e.g.

<!--
// screen style
-->


<!--
// print style
-->


then the print style will be applied when the user clicks print.

Paul Roberts
http://www.paul-roberts.com
[EMAIL PROTECTED]


- Original Message - 
From: "Ashley M. Kirchner" <[EMAIL PROTECTED]>
To: "PHP-General List" <[EMAIL PROTECTED]>
Sent: Saturday, September 21, 2002 7:51 PM
Subject: [PHP] Best Practice



I'm working on converting several static (price) pages on our site into dynamic 
pages, with the data stored in an MySQL database and PHP to pull the data out, with 
CSS to build the page and present it.  At the same time, I would also like to have a 
'printer friendly' link on each page that visitors can click on and get the same page 
re-rendered for easy printing.  What's the best way to get the data converted from one 
form to another?  Should I be querying the database again to get the same data to 
reformat?  Should I store the data in sessions and reformat based on the CSS?  I would 
think having to query twice for the same thing would be a degradation in performance, 
right?  So what's the best practice?

--
H | "Life is the art of drawing without an eraser." - John Gardner
  +
  Ashley M. Kirchner <mailto:[EMAIL PROTECTED]>   .   303.442.6410 x130
  Director of Internet Operations / SysAdmin. 800.441.3873 x130
  Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave, #6
  http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.




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





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




Re: [PHP] Owner

2002-09-26 Thread Paul Roberts

the list as replies asking you to confirm your email before allowing the post, this 
was brought in to stop people spamming the lists.

so to post you need a subscribed email or a confirmed email.

Paul Roberts

- Original Message - 
From: "Justin French" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, September 26, 2002 1:22 PM
Subject: Re: [PHP] Owner


Why can't you post to the newsgroup with [EMAIL PROTECTED]

(not that i've tried)

Justin


on 26/09/02 4:38 PM, John Taylor-Johnston ([EMAIL PROTECTED])
wrote:

> Justin,
> 
>> Best advice is to post strictly to the newsgroup with a dud email address,
> 
> Unfortunately, that doesn't work. I had a hotmail address, but not acceptable.
> Someone did not put it on the "accepted' list. Someone back there needs to
> accept that address to allow that poster to post when using
> news://news.php.net/php.general. Been through that. That's what I want to do
> now. Who is he? I would like to work something out with him.
> 
>> filter out anything to that address which doesn't have [PHP] in the subject
> 
> I've been filtering :)
> 
>> Using 'nospam' in your address' prolly doesn't help as much as it used to,
> 
> True, But I could work around that too, when I talk with the chap in charge :)
> 
>> Fun huh?
> 
> Giggle loads :p
> 
> Thanks,
> John
> 
> 


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





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




Re: [PHP] php mail()

2002-10-14 Thread Paul Roberts

The additional_parameters parameter can be used to pass an additional parameter to the 
program configured to use when sending mail using the sendmail_path configuration 
setting. For example, this can be used to set the envelope sender address when using 
sendmail. You may need to add the user that your web server runs as to your sendmail 
configuration to prevent a 'X-Warning' header from being added to the message when you 
set the envelope sender using this method. 

Example 375. Sending mail with extra headers and setting an additional command line 
parameter.
mail("[EMAIL PROTECTED]", "the subject", $message,
"From: webmaster@$SERVER_NAME", -fwebmaster@$SERVER_NAME);

from http://us.php.net/manual/en/function.mail.php


Paul Roberts
http://www.paul-roberts.com
[EMAIL PROTECTED]


- Original Message - 
From: "Brad Dameron" <[EMAIL PROTECTED]>
To: "'PHP'" <[EMAIL PROTECTED]>
Sent: Monday, October 14, 2002 8:44 PM
Subject: RE: [PHP] php mail()


Hey do you guys know how to correct this problem with sending email?

A custumer uses mail() to send the email and it isn't deliverable. So the
message bounces. But since the local sendmail sent the email it thus bounces
to root's mailbox instead of say the replyto address. Anyone know how to
correct it so that it sends the bounces to the person sending it? This is on
a virtual host machine with hundreds of domains.

Thank you,

---
Brad Dameron Network Account Executive
TSCNet Inc.  www.tscnet.com
Silverdale, WA. 1-888-8TSCNET



> -Original Message-
> From: John W. Holmes [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 14, 2002 12:17 PM
> To: 'Rodrigo Peres'; 'PHP'
> Subject: RE: [PHP] php mail()
>
>
> > Hi list,
> >
> > I trying to send mail using PHP's mail() function without success. My
> > email
> > is rejected because it goes with apache@localhost. I've tried
> everything
> > put
> > a diferent from in header etc.
> >
> > Does anyone have a clue
> >
> > My system is a RedHAT 7, PHP4.2.3, sendmail
> >
> > thank's n advance
>
> Probably need to set a FROM header in your mail
>
> $header = "FROM: [EMAIL PROTECTED]";
>
> mail($to,$subject,$body,$header);
>
> Or there is a setting in php.ini that sets this, too. Maybe try that, if
> you can.
>
> ---John Holmes...
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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





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




Re: [PHP] Help with form

2002-11-09 Thread Paul Roberts
why don't you submit it to a php script (instead of using the mailto ) and get mail() 
to email it to you, you could also process it and save the info somewhere.


Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Karl James" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, November 09, 2002 12:44 AM
Subject: [PHP] Help with form


http://www.ultimatefootballleague.com/Create_Account.htm
 
Im Trying to create this form so that this will give you access to login
Team action page
Where you can do the add/drops Trades and submit starters..
 
SO what im trying to do on this form  is have the results mailed to me
in my in box and be able to view
All the user imported on the form in my email body that I rec, but when
I test this code out.
It only provides a postdata.att
With nonthing in the email body.
 
Any help with this would be greatly appreciated.
 
Can some one do a view source and help me out.
Please forgive my ignorance if I did something wrong 
As im starting from the beginning and trying to learn forms and php
together
 
Thanks for your understanding.
 
Sincerely
Karl James "The_Saint" irc tag



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




Re: [PHP] get pwd on windows

2002-06-11 Thread Paul Roberts

just use php to do it

getcwd()

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Shane Wright" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 11, 2002 6:45 PM
Subject: [PHP] get pwd on windows


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi

Ok, I need to write this little script to run on a Windows box (don't ask...), 
but I'm getting completely shafted by the inconsistent use of long filenames.

I need to get the current directory, but it must have long filenames and not 
be chopped to xxx~1 or anything.   $SCRIPT_FILENAME is not set, there is no 
pwd utility, nothing is set in the environment and realpath('./') returns 
cropped firectory names.

Is there a way to do this or am I condemned to bang my head against a wall and 
swear some more?

Cheers

- -- 
Shane
http://www.shanewright.co.uk/
Public key: http://www.shanewright.co.uk/files/public_key.asc
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9Bjcw5DXg6dCMBrQRAjjbAJ4iz2jRJ5rMzkV7Md5GHpTd3YcX1wCfZb6B
44Qwj0u6jdfNpGtf+LTEX+w=
=HgUp
-END PGP SIGNATURE-


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





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




Re: [PHP] bulk mail()

2002-06-12 Thread Paul Roberts

I find a few bad addresses can slow mail() down, i write to a log file if mail returns 
true or to a bad mail file if false, try the bad emails later and then take them off 
the list if still bad. you can increase your time out with set_time_limit(), i'd also 
send when the server isn't too busy.

bcc is faster but will usually end up getting binned as Spam as they are not addressed 
to the recipient and fail junk mail filters as used by hotmail.

if 1 of your 100 emails is bad the whole lot can be rejected by the server and not 
sent.

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Niklas Lampén" <[EMAIL PROTECTED]>
To: "Php-General" <[EMAIL PROTECTED]>
Sent: Wednesday, June 12, 2002 1:08 PM
Subject: RE: [PHP] bulk mail()


One solution could be this:

You only need on page for this:

1) create an array of recipients

2) get value from array like array[$pos];

3) send mail to this receiver

4) now some javascript, unless ofcourse if $pos is bigger than
count($array): location.href = "http://blah.com/foo.php?pos=


And keep some log on sending. Even simple text file will do, if you are
sending mails in some known order. Log file is very handy if cpu
crashes, or something else happens.


Niklas


-Original Message-
From: Justin French [mailto:[EMAIL PROTECTED]] 
Sent: 12. kesäkuuta 2002 14:45
To: php
Subject: [PHP] bulk mail()


Hi all,

I've got a mailing on a website, with email address' / names / etc in a
MySQL table.

I think there's around 120 on it at the moment.

I've been noticing a growing lag on the sending of mail though... I've
got a script which takes a message from a form, then runs a while loop
through the rows of the mailing_list table, replacing a special string
with the subscribers name, and sending using the mail() command.

However, this time, the script actually failed, with a "failure when
attempting to access blah.com/foo.php" (the sending script).  I have no
idea if SOME people got the email, or what, and have no idea how to
check.

So, I make the assumption that as the mailing list has grown, the script
time has slowed... now it's too big (or the server was too busy) to
process all the emails before the script timed out.


If I didn't want to personalise the emails, I'm sure the script would
run a lot quicker with every address in the Bcc header, but since we
personalise each email, I can't see any option other than using mail()
200 times...  and it's only going to get a lot worse as we climb to
1000+.

So, what options do I have?

Break the mailing list up into batches of 40 or so?  How would I
implement something like this?


Any advice / concepts / ideas welcome!


Justin French

Creative Director
http://Indent.com.au



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

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

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





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




Re: [PHP] any reason why mail() returns a false value?

2002-06-22 Thread Paul Roberts

Worked fine for me, what it your sendmail setting.

I'm on win2k php 4.2.1 and i send via my isp's smtp server.

If I'm offline i get an error
Warning: Failed to Connect in c:\my documents\\temp\php\hs~temp.php on line 9

Now, hopefully your message has been sent.The return value of mail() is 0.


when online i get

Now, hopefully your message has been sent.The return value of mail() is 1.


Paul Roberts
[EMAIL PROTECTED]


- Original Message - 
From: "Erik Price" <[EMAIL PROTECTED]>
To: "Lazor, Ed" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, June 21, 2002 6:30 PM
Subject: Re: [PHP] any reason why mail() returns a false value?


Ed, thanks for taking a look at this:

[eprice@media eprice]$ less public_html/testmail.php


 a mail Test




Now, hopefully your message has been sent.";
 print "The return value of mail() is " . (int)$return . 
".\n";


?>







The results I get are:

Now, hopefully your message has been sent.The return value of mail() is 
0.

My path_to_sendmail is confirmed to be correct, and again, I have tested 
sendmail -- it works fine from the command line.  It's executable by all 
users, so my Apache user shouldn't have a hard time executing it.  
There's just no explanation!  I've even pointed my path_to_sendmail to 
an executable shell script that prints a confirmation message if it is 
executed, and the mail() function has the exact same effect if I do this.


Gratefully,


Erik




On Friday, June 21, 2002, at 12:56  PM, Lazor, Ed wrote:

> Please send code generating the problem.
>
>> -Original Message-
>> my sendmail problem is still present -- every time I try to call the
>> "mail()" function, even with the simplest of arguments (the
>> first three
>> required arguments, all three of them simple string literals:
>> mail('[EMAIL PROTECTED]', 'SubjectString', 'BodyText')), it fails.
>>
>> No email is sent, the return value of the function, when cast to
>> integer, is zero, and I have thoroughly tested that sendmail
>> works just
>> fine.  It is a RedHat 7.2 server, if that matters (though I
>> don't think
>> it does).  I have done all of my compiling as root, and
>> /usr/sbin/sendmail was definitely in my PATH.
>
> *
> ***
> This message is intended for the sole use of the individual and entity 
> to
> whom it is addressed, and may contain information that is privileged,
> confidential and exempt from disclosure under applicable law.  If you 
> are
> not the intended addressee, nor authorized to receive for the intended
> addressee, you are hereby notified that you may not use, copy, disclose 
> or
> distribute to anyone the message or any information contained in the
> message.  If you have received this message in error, please immediately
> advise the sender by reply email and delete the message.  Thank you very
> much.
>
>







Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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





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




Re: [PHP] Formatting phone numbers

2002-06-23 Thread Paul Roberts

preg_replace will do it.

$returnValue = preg_replace("/(\d{3})(\d{3})(\d{4})/","($1)$2-$3",$returnValue);

(\d{3})(\d{3})(\d{4}) = $0 or \\0 we aren't using this match

we are using the subpatterns in brackets
(\d{3}) =$1 or \\1 matches 3 numbers
(\d{3}) =$2 or \\2 matches 3 numbers
(\d{4}) =$3 or \\3 matches 4 numbers

which we use to make the replacement
($1)$2-$3

http://za2.php.net/manual/en/function.preg-replace.php

so that's the phone number, I'll leave the cc to you.

Paul Roberts
[EMAIL PROTECTED]


 


Phone Number: 


- Original Message - 
From: "Corinne Shea" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, June 23, 2002 8:06 PM
Subject: [PHP] Formatting phone numbers


Hi,

I'd like to write a function that will take a string of characters and 
output it in a phone number format (xxx)xxx- and one for credit 
cards ---. What I have below will currently remove 
non-numeric characters from the string, but I'm not sure how to do the 
rest of the formatting. Any help would be appreciated.

By the way, any recommendations for good php tutorials for beginners?

Thanks,
Corinne








 


Phone Number: 





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






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




Re: [PHP] preg_replace pains

2002-06-27 Thread Paul Roberts

try

$str = preg_replace("|\[details\].*?\[/details\]|si","", $str);

drop the i if you want it case sensitive.

Paul


"Richard Davey" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all,
> 
> I've been having a wonderful night trying to solve this one, but I'm going
> to throw in the towel and see if anyone else can shed some light on it. The
> scenerio is quite simple, I'm parsing some form input from a user and
> looking for the following:
> 
> [details]...[/details]




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




Re: [PHP] need to change $ char in string

2002-06-29 Thread Paul Roberts

works for me on win2k
- Original Message - 
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, June 29, 2002 6:43 PM
Subject: Re: [PHP] need to change $ char in string


On Sunday 30 June 2002 01:24, Beverly Steiner wrote:

> Thanx for your suggestion but I tried it and it didn't work.  I'm not sure
> if it matters, but this running on NT.

Not sure whether NT has anything to do with it but it works for me :-) 

If you can't get the following code to work then you might want to check 
whether it is a known bug (http://bugs.php.net).



But as someone has pointed out, you should be using single-quotes to prevent 
unwanted/unexpected variable expansion:

$new_string = preg_replace('/\$/', '%', $test_string);

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
All great discoveries are made by mistake.
-- Young
*/


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





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




Re: [PHP] parsing of SSI scripts.

2002-07-03 Thread Paul Roberts


>> I think I misunderstood your question. You have a Perl script that 
>> returns HTML and SSI and you want that string, returned to PHP, to be 
>> parsed by Apache, so the SSI is evaluated, right?

you can do this with apache 2  but not apache 1

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Sandman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 03, 2002 9:11 PM
Subject: Re: [PHP] parsing of SSI scripts.


In article 
<[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Ed Lazor) wrote:

>> I think I misunderstood your question. You have a Perl script that 
>> returns HTML and SSI and you want that string, returned to PHP, to be 
>> parsed by Apache, so the SSI is evaluated, right?

> It seems that PHP is much more powerful and would completely replace the 
> need for SSI.

PHP more powerful than Perl?? I disagree violently of course. And since 
this is a -HUGE- perlscript which is pretty advanced, having to re-code it 
in PHP just because PHP can't have it parsed the way I want to seems like a 
drag.

-- 
Sandman[.net]

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





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




Re: [PHP] help with eval problems...

2002-07-06 Thread Paul Roberts

On Fri, 5 Jul 2002, Kelly Meeks wrote:
> If I had this information stored in a database field, 
> ">
> 
> how could I assign it to a variable and output it?

  
you have to ?> first to leave php mode so you can do 

$content_output = "logo.gig";
$code = "";
eval("?>$code"); 

 which will echo the outut

or catch it with output buffering

$content_output = "logo.gig";
$code = "";
 ob_start(); 
eval("?>$code"); 
$evaled_code = ob_get_contents(); 
    ob_end_clean(); 

I have used arrays in evals before you have to watch the quotes.

Paul Roberts
[EMAIL PROTECTED]



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




Re: [PHP] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

2002-07-09 Thread Paul Roberts

i usually click no to the read receipts i get, maybe I'll make an exception in this 
case.
- Original Message - 
From: "Daniel Negron/KBE" <[EMAIL PROTECTED]>
To: "Erik Hegreberg" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, July 09, 2002 8:28 PM
Subject: Re: [PHP] 
%%%))



Is this retaliation ?

**DAN**




|+>
||  "Erik |
||  Hegreberg"|
||  |
|||
||  07/09/02 03:27|
||  PM|
|||
|+>
  
>--|
  |
  |
  |  To: <[EMAIL PROTECTED]>   
  |
  |  cc:   
  |
  |  Subject: [PHP]
  |
  |   
%%%|
  |   ))   
  |
  
>--|




TT





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





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




Re: [PHP] Printer margins

2002-07-17 Thread Paul Roberts

have a look at the @page spec in the css docs at w3c.org

I use this for A4 paper, you can set the margins as well:

@page{
  size : "21.0cm 29.7cm ";
 }

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Martin Towell" <[EMAIL PROTECTED]>
To: "'Manuel'" <[EMAIL PROTECTED]>; "PHP General" <[EMAIL PROTECTED]>
Sent: Wednesday, July 17, 2002 1:57 AM
Subject: RE: [PHP] Printer margins


You can't change this type of setting on a client's browser
The only way you'd be able to do this is to tell the user that the page
prints best when margins are set to 0.25"

-Original Message-
From: Manuel [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 17, 2002 10:52 AM
To: PHP General
Subject: [PHP] Printer margins


I'm creating an HTML file that will be printed by my website users. I've
notices that most browser have the default print margins set to 0.75". Is
there any way to change the print margins to 0.25"?


-
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes

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





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




Re: [PHP] Sending out mass mail without having timeout problems ..

2001-12-27 Thread Paul Roberts

can this be set in the php file or htaccess with

sendmail_path ="pathtosendmail/sendmail -oi -t -odq";


Paul Roberts
[EMAIL PROTECTED]


- Original Message -
From: "Peter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 27, 2001 6:02 PM
Subject: Re: [PHP] Sending out mass mail without having timeout problems ..


> > > >Subject:  [PHP] Sending out mass mail without having timeout problems
> ..
>
> Hi,
>
> Too much trouble to write who wrote what when. Someone suggested using an
> alias but that's not always doable.
>
> I had an app that read from a live rdbms and sent out emails. I sent each
> email to sendmail and waited fo it to send the email before going on to
the
> next one. My cohort determined that this was way, way too slow. He did
some
> research and added some new parameters to sendmail so that the email was
put
> in a queue and so the script ran MUCH faster.  I believe these were the
> parameters. You should look them up on the sendmail site:
>
> sendmail -oi -t -odq
>
> Hope this helps.
>
> Peter
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] is_uploaded_file

2001-12-28 Thread Paul Roberts

I'm on PHP/4.0.2

i'm getting 
Fatal error: Call to undefined function: is_uploaded_file() 

how can i emulate the function 

will also nag my host but...


Paul Roberts
[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] is_uploaded_file

2001-12-28 Thread Paul Roberts

no it's move_uploaded_file and it's 4.03 or greater as well.

i'm using empty() as i just want to see if i uploaded a file or not


Paul Roberts
[EMAIL PROTECTED]

- Original Message -
From: "Andrey Hristov" <[EMAIL PROTECTED]>
To: "Paul Roberts" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, December 28, 2001 12:48 PM
Subject: Re: [PHP] is_uploaded_file


> Read the docs about copy_uploaded_file() (this is the function with some
more docs, as I remember).
>
>
> HTH
>
> Andrey Hristov
> - Original Message -
> From: "Paul Roberts" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, December 28, 2001 2:41 PM
> Subject: [PHP] is_uploaded_file
>
>
> > I'm on PHP/4.0.2
> >
> > i'm getting
> > Fatal error: Call to undefined function: is_uploaded_file()
> >
> > how can i emulate the function
> >
> > will also nag my host but...
> >
> >
> > Paul Roberts
> > [EMAIL PROTECTED]
> > 
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] is_uploaded_file

2001-12-28 Thread Paul Roberts

yep it all works on my dev server but the host only has 4.02 installed these
functions are php 4.03+


- Original Message -
From: "Andrey Hristov" <[EMAIL PROTECTED]>
To: "Paul Roberts" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, December 28, 2001 3:26 PM
Subject: Re: [PHP] is_uploaded_file


> From : http://www.php.net/manual/en/features.file-upload.php
>  /* Userland test for uploaded file. */
> function is_uploaded_file($filename) {
> if (!$tmp_file = get_cfg_var('upload_tmp_dir')) {
> $tmp_file = dirname(tempnam('', ''));
> }
> $tmp_file .= '/' . basename($filename);
> /* User might have trailing slash in php.ini... */
> return (ereg_replace('/+', '/', $tmp_file) == $filename);
> } if (is_uploaded_file($userfile)) {
> copy($userfile, "/place/to/put/uploaded/file");
> } else {
> echo "Possible file upload attack: filename '$userfile'.";
> }
> ?>
>
> HTH
>
> Regards,
> Andrey Hristov
>
> - Original Message -
> From: "Paul Roberts" <[EMAIL PROTECTED]>
> To: "Andrey Hristov" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Friday, December 28, 2001 5:13 PM
> Subject: Re: [PHP] is_uploaded_file
>
>
> > no it's move_uploaded_file and it's 4.03 or greater as well.
> >
> > i'm using empty() as i just want to see if i uploaded a file or not
> >
> >
> > Paul Roberts
> > [EMAIL PROTECTED]
> > 
> > - Original Message -
> > From: "Andrey Hristov" <[EMAIL PROTECTED]>
> > To: "Paul Roberts" <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Friday, December 28, 2001 12:48 PM
> > Subject: Re: [PHP] is_uploaded_file
> >
> >
> > > Read the docs about copy_uploaded_file() (this is the function with
some
> > more docs, as I remember).
> > >
> > >
> > > HTH
> > >
> > > Andrey Hristov
> > > - Original Message -
> > > From: "Paul Roberts" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Friday, December 28, 2001 2:41 PM
> > > Subject: [PHP] is_uploaded_file
> > >
> > >
> > > > I'm on PHP/4.0.2
> > > >
> > > > i'm getting
> > > > Fatal error: Call to undefined function: is_uploaded_file()
> > > >
> > > > how can i emulate the function
> > > >
> > > > will also nag my host but...
> > > >
> > > >
> > > > Paul Roberts
> > > > [EMAIL PROTECTED]
> > > > 
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> > > >
> > > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> > >
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] connect MS Access

2002-01-02 Thread Paul Roberts

yes you can connect via ODBC.
- Original Message - 
From: "Matt Friedman" <[EMAIL PROTECTED]>
To: "'gendeng'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, January 02, 2002 3:32 AM
Subject: RE: [PHP] connect MS Access


Please do not send html emails to this list. 

Send only plain text emails.

Matt Friedman


-Original Message-
From: gendeng [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday January 1, 2002 8:23 PM
To: [EMAIL PROTECTED]
Subject: [PHP] connect MS Access

halo... i want to know about connect to database. can php (for windows)
connect to MS Access.

Mpu Strees





IncrediMail - Email has finally evolved - Click Here



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] multiple replaces...

2002-01-12 Thread Paul Roberts

have a look at eval()

Paul Roberts
[EMAIL PROTECTED]

From: "Lauri Vain" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, January 12, 2002 11:44 AM
Subject: [PHP] multiple replaces...


Hello there,

I have about 30 markers in the text which need to be replaced with the value
of a variable or an array.

Common sense comes up with
eregi_replace("!one!","blah",eregi_replace("!heh!",'foobar',eregi_replace("b
lah","ho-ho-ho",text)));

The list above could go on and on... I'm sure there are better ways to
replace many markers or spans of text with something else. A loop? Something
even more easier and better?

Thanks,
Lauri
--
Tharapita Creations
[dynamic web applications]
[EMAIL PROTECTED]
Mobile: +372 53 410 610



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] encrypting passwords, how to decrypt?

2002-01-17 Thread Paul Roberts

a nice starter on encryption
http://www.onlamp.com/pub/a/php/2001/07/26/encrypt.html?page=1

Paul Roberts
[EMAIL PROTECTED]


"Hawk" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Ok, even if I don't need encryption I thought I might go ahead and try to
> learn it, and as I said in the previous post I managed to get it working
> everywhere but on the login script
> first I have a form that sends username and password to login.php, in that
> file I have something like this
> 
>  $the host user pswd and db vars
> mysql_connect($host, $user, $pswd);




Re: [PHP] WinNT extensions

2002-01-25 Thread Paul Roberts

Don't you pay them for the very difficult stuff!


Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Malcolm" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 25, 2002 11:04 AM
Subject: [PHP] WinNT extensions


> Hi all
> 
> I am building a simple web based mail app. I tried to contact my mail server
> using imap_open() but all I got was this:
> 
> Fatal error: Call to undefined function: imap_open() in d:\... on line
> 15
> 
> I got in touch with my provider who replied:
> 
> IMAP support was not compiled into the
> Windows version of PHP.  Unfortunately,
> compiling it by hand is very difficult.
> It requires having Microsoft Visual C++, along
> with a bunch of other tools.  So...it looks like
> you'll need to use another method to view mail.
> Sorry for the bad news.
> 
> I thought imap functionality was in a dll which can be loaded dynamically:
>   dl("php_imap.dll");
>   imap_open("a","u","p");
> 
> Can anyone please enlighten me? Is it built in? They use PHP 4.1.1.
> 
> Malcolm
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 
> 




Re: [PHP] set_time_limit() in a loop

2002-01-26 Thread Paul Roberts

what are you doing a while on

if while never ends and you reset the time out each loop and use
ignore_user_abort(true), it will still be going 13 hours latter.

maybe if you send the full code so we can look at it.

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Matthew Delmarter" <[EMAIL PROTECTED]>
To: "Martin Towell" <[EMAIL PROTECTED]>
Cc: "PHP Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, January 25, 2002 12:55 AM
Subject: RE: [PHP] set_time_limit() in a loop


> I should also mention that the loop is sending mail using mail().
> 
> Is it possible that this is the problem somehow?
> 
> -Original Message-
> From: Martin Towell [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 25, 2002 1:16 PM
> To: 'Matthew Delmarter'; PHP Mailing List
> Subject: RE: [PHP] set_time_limit() in a loop
> 
> your first thought was correct - it sets it to 1800, it's NOT
> accumulative.
> 
> it would have something to do with  ignore_user_abort(true); and also
> is your while loop's exit check working?
> 
> Martin
> 
> 
> -Original Message-
> 
> Just wondering about set_time_limit() in a loop.
> 
> The current code looks something like this:
> 
>   ignore_user_abort(true);
>  set_time_limit(1800);
>  while:
> do stuff;
> set_time_limit(1800);
>  endwhile;
> ?>
> 
> Does this reset the timeout to 1800 seconds every time it loops? Or
> does it accumulate so that the timeout has 1800 seconds added to it
> every time?
> 
> The reason I ask is that my ISP informs me that the script is still
> running 13 hours later! Or is this related to the ignore_user_abort?
> 
> Regards,
> Matthew Delmarter
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 
> 




Re: [PHP] secure form handling

2002-02-08 Thread Paul Roberts

I think you mean that you want to display the total as text but have the total on the 
form hidden so they can't edit it (and give themselves a discount), you can  use a 
hidden form field, sessions or cookies.




Paul Roberts
[EMAIL PROTECTED]


- Original Message - 
From: "wm" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 07, 2002 1:36 AM
Subject: [PHP] secure form handling


> hi,
> 
> i'm fairly new to this.
> 
> what i want to do is use a form so the user can specify a few different
> choices
> of things they want to buy. maybe a few radio buttons with dollar
> amounts and
> then possibly a couple of quantity fields for items.
> 
> this can then be passed to a script and total added up etc. and the user
> 
> can input
> their billing data. what i don't want is for the user to be able to see
> the amount of
> the transaction in the source code in a hidden field.
> 
> how do i hide this data while still passing it to the credit card script
> 
> along with all
> the other info?
> 
> thanks.
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 



Re: [PHP] Modifying a record works but not in actual database?

2002-02-09 Thread Paul Roberts

try using

// set up query 
$sql = "UPDATE thistable
SET FNAME = \"$esc_fname\", LNAME = \"$esc_lname\", EMAIL
= \"$esc_email\", WEB = \"$esc_web\"
WHERE ID = \"$id\"
";

variables aren't expanded inside ' so you need to use "


Paul Roberts
[EMAIL PROTECTED]


- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 09, 2002 4:47 PM
Subject: [PHP] Modifying a record works but not in actual database?


> I'm trying to set up a "modify record" page, and after testing and triple-checking
> the syntax and form, and even running the query in the phpMyAdmin interface
> to make sure the query is correct.
> 
> This is just a snippet of what I've done:
> 
>  
> // open connection
> include ("connectdatabase.inc");
> 
> // format names to protects the O'Haras etc.
> $esc_fname = addslashes($fname);
> $esc_lname = addslashes($lname);
> $esc_email = addslashes($email);
> $esc_web = addslashes($web);
> 
> // set up query 
> $sql = 'UPDATE thistable
> SET FNAME = "$esc_fname", LNAME = "$esc_lname", EMAIL
> = "$esc_email", WEB = "$esc_web"
> WHERE ID = "$id"';
> 
> // perform query
> $sql_result = mysql_query($sql);
> if (!$sql_result) {
>echo "Can't execute $sql " . mysql_error();
>exit;
> }
> 
> // close connection
> mysql_close($connection);
> ?>
> 
> The problem? On the PHP front (my "mofidy record" page) says it's performed
> without a problem. However, if I were to do a "view all records" - I
> can see that none of the changes has actually been made to the database.
> 
> Adding a record is not a problem; nor is deleting a record.
> 
> Can someone point me into the right direction as to what I might be doing
> wrong?
> 
> Thanks!
> 
> Laurie Landry
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 




[PHP] preg_replace problem.

2002-02-17 Thread Paul Roberts

where am i going wrong

i used 
$mail = preg_replace("/]*?>/i","\n\n$0", $mail,-1);
and
$mail = preg_replace("/]*?>/i","\n\n\\1", $mail,-1);

but i get $0 or \1 inserted, but only on the linux server
not on my win 2000 dev machine!

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Anas Mughal" <[EMAIL PROTECTED]>
To: "Michael Sims" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, February 17, 2002 8:12 AM
Subject: Re: [PHP] Could this be a configuration directive?


> Thank you very much...
> 
> This worked:
> 
>   $message = ${$this->func_name($string)};
> 
> 
> and, this worked: (I am going to stick with this)
> 
>   $message = ${$this->func_name}($string);
> 
> 
> However, this did NOT work:
> 
> $message = ${$this}->func_name($string);
> 
> 
> Lesson learned: I need to enclose the function name
> variable in curly braces.
> 
> Thanks.
> 
> 
> 
> --- Michael Sims <[EMAIL PROTECTED]> wrote:
> > At 11:22 PM 2/16/2002 -0800, Anas Mughal wrote:
> > >I get a parse error using my CGI version of PHP on
> > the
> > >following line:
> > >
> > >$message = $$this->func_name($string);
> > >
> > >However, the same above line works fine with my
> > ISP's
> > >CGI version of PHP.
> > 
> > That is strange.  Just for kicks, try using curly
> > braces to make the 
> > statement less ambiguous.  Is the variable part just
> > the object name, or is 
> > it the entire method?  See if it works like this:
> > 
> > $message = ${$this}->func_name($string);
> > 
> > or like this:
> > 
> > $message = ${$this->func_name($string)};
> > 
> > Depending on which one you mean.
> > 
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> 
> 
> =
> Anas Mughal
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> Tel: 973-249-6665
> 
> __
> Do You Yahoo!?
> Yahoo! Sports - Coverage of the 2002 Olympic Games
> http://sports.yahoo.com
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 



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




[PHP] monitoring banwith used by a script

2002-02-20 Thread Paul Roberts


is there a way to monitor bandwidth use of a script

any ideas welcome.


Paul Roberts
[EMAIL PROTECTED]



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




Re: [PHP] Nasty DoS in PHP

2002-04-18 Thread Paul Roberts

Also win2k and apache(cgi)  
i got an internal server error, due to the malformed header, CPU usage peaked at 100% 
and then dropped off.

So i changed the code to the loop below and max execution time came up but CPU usage 
didn't drop straight off, so i had closer look, php exits after 30 seconds but the CPU 
usage continues in ie and apache and the page keeps loading, so i think that's down to 
output buffering . interestingly i had no trouble loading phpmyadmin and running a 
query while this was happening, it was just a little slower..

";
   }
 ?>

So if you want to crash your server with an infinite loop there's plenty of ways to do 
it. 
Paul Roberts
[EMAIL PROTECTED]



- Original Message - 
From: "Jason Soza" <[EMAIL PROTECTED]>
To: "Jason Murray" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, April 18, 2002 7:29 AM
Subject: RE: [PHP] Nasty DoS in PHP


> Very odd indeed. Well, here's my setup:
> Windoze2K
> PHP 4.1.2
> Apache 1.3.something
> Accessing it via IE 6.0, although this should not have any bearing on
> anything
> 
> I'd be interested in knowing your versions and the versions of the first guy
> that posted about this. Maybe he has the same setup as me, or close enough,
> but both of us are different from you. My browser just kept loading and
> loading like all was well, while task manager was skipping all over the
> place and I had to wait 5 - 10 seconds after I moved my mouse for the cursor
> to move. I timed the script, and after 30 secs, it was still going (although
> I stopped it soon thereafter to keep from having to reboot). So I reset
> php.ini's execution time limit down to 5 seconds and ran it twice more, and
> both times it went well past 5 seconds.
> 
> Of course, none of this bothers me as I won't be putting while(0>1) {
> header("A") } into any of my scripts, nor was I ever planning on it! :)
> 
> -Original Message-
> From: Jason Murray [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 17, 2002 10:13 PM
> To: 'Jason Soza'; [EMAIL PROTECTED]
> Subject: RE: [PHP] Nasty DoS in PHP
> 
> 
> > Mine produced the same error message as yours, Jason, but the memory
> > and CPU usage continued until I hit the 'stop' button on the browser.
> > It seemed to have overridden both time and memory limits, as it had
> > racked up 320 megs of my RAM by the time I stopped it.
> 
> It certainly didn't do that here, but it could be a difference between
> RAM, PHP and Apache versions (simple paranoia ;)) that causes it.
> 
> PHP clearly sent the error *to my browser* and the browser stopped loading
> immediately (thus, the "fatal" error was indeed fatal, and PHP terminated
> at that time).
> 
> J
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 




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




Re: [PHP] Directory System Splitter

2002-04-27 Thread Paul Roberts

search zend.com for breadcrumbs

- Original Message - 
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, April 27, 2002 2:01 PM
Subject: Re: [PHP] Directory System Splitter


> On Saturday 27 April 2002 20:34, Randum Ian wrote:
> 
> [snip]
> 
> > For example:
> >
> > http://www.danceportal.co.uk/diary/2002/may/
> >
> > has this in the panel:
> >
> > Home / Diary / 2002 / May /   <-- These are links back down the system of
> > directories.
> >
> > http://www.danceportal.co.uk/charts/randumian/mon-22-apr-2002.php
> >
> > has this:
> >
> > Home / Charts / Randum Ian / Monday, April 22, 2002
> >
> > Is it possible to automate this in a template so that it can work out where
> > it is and create the correct links?
> 
> Yes.
> 
> 
>http://homepages.tesco.net/~J.deBoynePollard/FGA/questions-with-yes-or-no-answers.html
> 
> 
> Presumably you want to know *how* to do it?
> 
> Use phpinfo() to see what predefined vars you can use to get your document 
> path. Then probably use explode() to get the individual components of the 
> path.
> 
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> 
> /*
> Are we not men?
> */
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 


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




Re: [PHP] PHP editing environment

2002-05-03 Thread Paul Roberts

install a webserver (apache?) on your machine and then set up server mappings in 
homesite so when you switch to browse in homesite your code is parsed.

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Pag" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 03, 2002 12:58 PM
Subject: [PHP] PHP editing environment


> 
> Hi, i am new to the list and i am quite impressed with whats going on over 
> here. Anyway, just have a small question.
> Have been coding php for a while now but i still havent found a stable 
> (easy and not time consuming) way of working in PHP, i mean, i use 
> homesite5 to code and when i want to test the php i upload the scripts and 
> test them on the site. This process is a bit time consuming, so i installed 
> php on my winXP, but even like that i can only test small things using php 
> master editor.
> Anyone know how i can make my work more efficient? Like install MySQL and 
> PHP and get everything working normally when i preview the code in internet 
> explorer, that would be perfect, is it possible? How do you guys and girls 
> work with php, what editors and/or tools you use?
> Thanks.
> 
> Pag
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 



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




Re: [PHP] Formatting Information in header? Gridlines in Excel

2002-05-06 Thread Paul Roberts

strange i just worked this out over the weekend.

I'm going to be use it to email data that will be inserted 
into an excel sheet you just tell it the html file is a xls file 
in the mime headers and it opens the file up in excel, 
no problem and no messing with csv files, comas,
xml support and all that.

ie
Content-Type: application/vnd.ms-excel;
 name="test.xls" 
Content-Transfer-Encoding: base64
Content-Disposition: attachment; 
 filename="test.xls";

if it's excel 2002 (xp) you can use styles and edit the doc properties.
have a look for  or 
in the file. If it's 97 then you need the border=1 in the table though.

have fun.

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Jay Blanchard" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 06, 2002 3:25 PM
Subject: RE: [PHP] Formatting Information in header? Gridlines in Excel


> [snip]
> This is intriguing me, are you opening up excel in a browser window or just
> printing out html tables?? I am confused.
> [/snip]
> 
> I am using PHP to query a database and create an HTML table based on the
> information in the database (in this case it it a large crosstab query).
> This is set up to open Excel in a broswer window (inline) and display the
> data in a worksheet. All normal Excel functions can be performed on the
> worksheet without changing the data in the database. These worksheets then
> can be saved to the user's local disk. They can always run the original
> query again by requesting the worksheet/page again.
> 
> Link pointed to php page that will send to browser  href="test.php/test.xls"> Stupid IE trick, the .xls file does not 'exist',
> but will fake out Excel to open the .php 'page' in a worksheet. Also, make
> sure to include header information listed in previous e-mail at the top of
> the PHP page.
> 
> The steps are;
> 1. Create a PHP file with the header info
> 2. Do a PHP request to the database.
> 3. Use the results to create an HTML table within the PHP
> 4. Open this table in a spreadsheet
> 
> HTH!
> 
> Jay Blanchard
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 



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




Re: [PHP] Variable won't work in function, even when I global it?

2002-05-19 Thread Paul Roberts

try

eval("?>$footertext");

also take the code out of the function and try it, you may need to global some more 
variables.

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Leif K-Brooks" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 20, 2002 6:23 AM
Subject: [PHP] Variable won't work in function, even when I global it?


>   On my website, I open my header (and footer) file with fileopen and 
> then eval() it.  I know I should include them, but I knew nothing about 
> php when I did this.  Anyway, I'm working on "groups" for my website. 
>  They will be a kind of club.  At the top of every group page, I include 
> a group function file.  Among those functions is one that checks if the 
> user trying to go to the group is a member of it.  If not, it gives them 
> an error message and exits.  It is also supposed to eval() the footer 
> before exiting.  My code is as follows:
> 
> function checkmember(){
> global $groupid;
> global $userinfo;
> global $footertext;
> if($groupid != $userinfo['groupid']){
> print "Error: you're not a member of this group.";
> eval($footertext);
> exit;
> }
> return;
> }
> 
> 
> The thing is, it doesn't seem to eval() the footer.  I've even tried 
> getting $footertext out of the $GLOBALS array.  I have also tried 
> printing $footertext to make sure it wasn't a problem with evel(). 
>  Nothing has worked.  When I did isset() on $GLOBALS['footertext'], it 
> worked however.  Thanks to anybody who can help.
> 
> 


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




Re: [PHP] PHP script

2002-05-25 Thread Paul Roberts

how about using the FTP functions that php has, look it up in the man, i haven't used 
it.
Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Chris Hewitt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, May 25, 2002 3:33 PM
Subject: Re: [PHP] PHP script


> Ryan,
> 
> I may be missing something as I have not been monitoring this thread, 
> but why not use ftp? It allows the file transfer and chmod. Perhaps its 
> not available on the server that you need it to be, but its the normal 
> way of putting web pages onto a server.
> 
> HTH
> Chris
> 
> SP wrote:
> 
> >I'm not an expert but that doesn't sound like it's
> >possible.  I mean if you could upload files and
> >chmod them on a remote server you would have some
> >serious security issues.  The only thing I can
> >think of is you could upload files to your remote
> >datebase.
> >
> >
> >
> >-Original Message-
> >From: r [mailto:[EMAIL PROTECTED]]
> >Sent: May 25, 2002 7:00 AM
> >To: [EMAIL PROTECTED]
> >Subject: [PHP] PHP script
> >
> >
> > Hi Guys,
> >
> > I need a PHP script that will allow me to
> >upload/download chmod files etc
> >on
> > a remote server...
> > I know there are loads of these scripts out there
> >but being a newbie to PHP
> > I really dont know which one is good...
> > can you recomend any? coming from Java I love PHP
> >so would appreciate if
> >you
> > would recomend only a php script and not
> >perl,servlet,asp etc.
> > Another problem is my webserver is something like
> > /wtn/cgi-bin/www/
> >
> > all cgi scripts will have to be put in the
> >cgi-bin directory of course but
> > must be called like this
> >mysite.com/cgibin/script.pl
> >
> > the php script should allow me access to this
> >directory too!
> >
> > ANY ideas or recomendations will be deeply
> >appreciated esp from John
> >Holmes,
> > Jason Wong, Miguel Cruz coz you guys are really
> >brainy and have helped me
> >in
> > the past so I know your advise is supurb.
> > I would tip my hat to you, but dont wear
> >one...;-)
> >
> > Cheers,
> > -Ryan A.
> >
> >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit:
> >http://www.php.net/unsub.php
> >
> >
> >
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 


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




Re: [PHP] unable to load dynamic library etc. etc.

2002-02-21 Thread Paul Roberts

I deleted everything in the php dir and reinstalled it all.

- Original Message - 
From: "Hunter, Ray" <[EMAIL PROTECTED]>
To: "'Jeremy Reed'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, February 21, 2002 4:32 PM
Subject: RE: [PHP] unable to load dynamic library etc. etc.


> Place all the dlls in the same directory as the php.exe file and in your
> php.ini file have the extension_dir = .\ (windows).
> 
> This works for me great...
> 
> Ray Hunter
> Firmware Engineer
> 
> ENTERASYS NETWORKS
> 
> 
> -Original Message-
> From: Jeremy Reed [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, February 21, 2002 9:30 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] unable to load dynamic library etc. etc.
> 
> 
> I keep getting this error message and cannot figure out why.  The
> extension_dir is set correctly in the php.ini, I have put the .dlls into
> every conceivable directory I can think of and nothing seems to work.
> 
> Anybody else had and fixed this problem?
> 
> Thanks,
> 
> Jeremy
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




[PHP] fork?

2002-02-23 Thread Paul Roberts

how do i do two things at the same time, i'm thinking of the equivalent of fork in perl


Paul Roberts
[EMAIL PROTECTED]



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




[PHP] ignore_user_abort

2002-03-03 Thread Paul Roberts

hi 

I have a host with ignore_user_abort turned off in php ini.

the man says
int ignore_user_abort ( [int setting])

so far i have tried 1 and true for the int setting but nothing changed, it still 
aborted.

I want it so the script finishes even the browser conection is lost.

anyone know what i should use for int setting

the man is not clear on this.

Paul Roberts
[EMAIL PROTECTED]



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




Re: [PHP] Evaluating code

2002-03-06 Thread Paul Roberts

You can do 
eval("?>$fp");
this will echo the evaluated $fp data. as you exit php mode before the eval,
so any php in the file needs to be in  tags

you can also catch it with output buffering if you need to.

Paul Roberts
[EMAIL PROTECTED]


- Original Message - 
From: "Ernesto" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 06, 2002 8:55 PM
Subject: [PHP] Evaluating code


> 
> Hi,
> 
> I have code stored on a server which I retrieve via fsockopen() and put it 
> into a variable (It's like if it were on a database).
> Now, I want to eval that code, but eval() won't work because it has HTML 
> and PHP mixed, with  and everything.
> 
> I know I can eval this code saving it to a file and then including it, but 
> I want to know if there's a better way.
> As I'm going to do this all the time, I prefer not to create temporary 
> files (so I don't slow down everything).
> 
> Any ideas?
> 
> Thanks in advance,
> Ernesto
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 


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




Re: [PHP] Rasmus, O'Reilly, "Programming PHP"

2002-03-07 Thread Paul Roberts


Amazon have it listed as folows.

http://www.amazon.com/exec/obidos/ASIN/1565926102/qid=1015539436/sr=2-3/ref=sr_2_3/104-7882944-0058305

List Price: $39.95
Our Price: $27.96
You Save: $11.99 (30%)

This item will be published in March 2002. You may order it now and we will ship it to 
you when it arrives. 

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Erik Price" <[EMAIL PROTECTED]>
To: "DL Neil" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, March 07, 2002 8:53 PM
Subject: Re: [PHP] Rasmus, O'Reilly, "Programming PHP"


> 
> On Thursday, March 7, 2002, at 06:05  AM, DL Neil wrote:
> 
> > Rasmus/others,
> >
> > O'Reilly are advertising the imminent release (Mar 2002) of "Programming
> > PHP" (http://www.oreilly.com/catalog/progphp/desc.html).
> > Is that still going ahead?
> > (I'll submit an advanced purchase order...)
> >
> 
> Hmmm... on the one hand, it's an O'Reilly book, and their books tend to 
> shine pretty brightly (though I'm extremely fond of two of my New Riders 
> books, "MySQL" by Paul DuBois and "Python Web Programming" by Steve 
> Holden, very well-written and well-made books).  But on the other hand, 
> the writeup at O'Reilly that you link to doesn't really entice me -- it 
> seems to offer the same topics as most other non-introductory PHP titles 
> out there.
> 
> I'd probably pick it up regardless, if only to demonstrate to O'Reilly 
> that there's a demand for more books on PHP.  To date, their PHP 
> selection is pathetic.
> 
> David, did you hear anything more about this?
> 
> 
> 
> 
> Erik
> 
> 
> 
> 
> 
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 


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




[PHP] cron with php as apache module

2002-03-22 Thread Paul Roberts

I want to run a php script via a crontab, (i can set up the crontab etc).

this is a Linux server and php is installed as an apache module, is there any way to 
run the php script via cron.

 the build details are 

  Configure Command './configure' '--with-apxs=/usr/sbin/apxs' '--with-mysql' 
'--enable-track-vars' '--enable-versioning' '--enable-bcmath' 



Paul Roberts
[EMAIL PROTECTED]




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




Re: [PHP] cron with php as apache module

2002-03-22 Thread Paul Roberts

ok
for lynx, at the command prompt i get
bash: lynx: command not found

I've also looked in all the obvious places for php but can't find it.

the server is a cobalt raq 3 and i have a virtual host account so i can't recompile 
php.

maybe I'll rewrite it in Perl.

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Analysis & Solutions" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Friday, March 22, 2002 7:26 PM
Subject: Re: [PHP] cron with php as apache module


> Even if you can't get, or don't want to bother getting, PHP as a
> standalone CGI type program, you can still execute via crontab.  Make a
> web page that you want to have run, then put something along the lines
> of:
> 
>lynx http://localhost/scriptname.php
> 
> as the command in the crontab file.  Do note, you'll likely need to take
> steps to protect the script from being run by people you don't want
> touching it.  You could use SSL, cookies and REMOTE_ADDR, among other
> things to accomplish that.
> 
> --Dan
> 
> -- 
> PHP scripts that make your job easier
>   http://www.analysisandsolutions.com/code/
>  SQL Solution  |  Layout Solution  |  Form Solution
>  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 


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




Re: [PHP] cron with php as apache module

2002-03-22 Thread Paul Roberts

 wget http://your.server.address/phpscript.php

did the trick

thanks

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Bruce S. Garlock" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 22, 2002 8:55 PM
Subject: Re: [PHP] cron with php as apache module


> Are you specifying the full path in the crontab?  If the raq 3 does not have lynx, 
>you might
> be able to use wget.  I'm not too familiar with wget, you may want to read the 
>manpage.
> Here's how I run PHP scripts from cron, when PHP is compiled as a DSO:
> 
> 0 8 * * * TERM=xterm; export TERM; /usr/bin/lynx -source
> "http://your.server.address/phpscript.php"; 1>/dev/null 2>&1
> 
> You can leave off the stdin and stdout redirects if you want an email that the 
>script was
> run.
> 
> HTH..
> 
> - Bruce
> 
> 
> 
> Paul Roberts wrote:
> 
> > ok
> > for lynx, at the command prompt i get
> > bash: lynx: command not found
> >
> > I've also looked in all the obvious places for php but can't find it.
> >
> > the server is a cobalt raq 3 and i have a virtual host account so i can't 
>recompile php.
> >
> > maybe I'll rewrite it in Perl.
> >
> > Paul Roberts
> > [EMAIL PROTECTED]
> > 
> > - Original Message -
> > From: "Analysis & Solutions" <[EMAIL PROTECTED]>
> > To: "PHP List" <[EMAIL PROTECTED]>
> > Sent: Friday, March 22, 2002 7:26 PM
> > Subject: Re: [PHP] cron with php as apache module
> >
> > > Even if you can't get, or don't want to bother getting, PHP as a
> > > standalone CGI type program, you can still execute via crontab.  Make a
> > > web page that you want to have run, then put something along the lines
> > > of:
> > >
> > >lynx http://localhost/scriptname.php
> > >
> > > as the command in the crontab file.  Do note, you'll likely need to take
> > > steps to protect the script from being run by people you don't want
> > > touching it.  You could use SSL, cookies and REMOTE_ADDR, among other
> > > things to accomplish that.
> > >
> > > --Dan
> > >
> > > --
> > > PHP scripts that make your job easier
> > >   http://www.analysisandsolutions.com/code/
> > >  SQL Solution  |  Layout Solution  |  Form Solution
> > >  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> > >
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 


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




Re: [PHP] Assigning unique form names...

2002-04-08 Thread Paul Roberts

the html is wrong, option doesn't have an attribute of name, select has the name, 
option has the value.

try it like this, the result will be in $files


";
 while ($file_name = readdir($dir)) {
  if (($file_name != ".") && ($file_name !="..")) {
  $file_list .= "$file_name";
  }
 }
 $file_list .= "";
 closedir($dir);
 ?>

- Original Message - 
From: "Erik Price" <[EMAIL PROTECTED]>
To: "Jas" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, April 08, 2002 6:45 PM
Subject: Re: [PHP] Assigning unique form names...


> I understand what you're saying.  You like the convenience of having the 
> entire thing kept in a neat variable called $file_list, which you can 
> add to your page in any place that you like, but you need a unique name 
> for each  input tag so that on the "receiving" PHP script, you 
> can access the contents of each time that you use $file_list.
> 
> Unfortunately, I can't think of a good way for you to make these input 
> names unique.  The best thing I can suggest is that you turn this into a 
> function/subroutine, and pass the string you wish to use as a unique 
> name to the function as its argument (and you can make this a reuaseable 
> function by also passing the $dir_name as an argument, and the target of 
> the form tag).  Like this:
> 
> // $dir_name = name of directory to list
> // $form_target_page = name of page to receive this form's input
> // $input_name = unique name for this  input
> function file_list($dir_name, $form_target_page, $input_name)
> {
>if (!$dir = opendir($dir_name)) {
>  return "Could not open directory $dir_name";
>} else {
>  $file_start = "
> \n";
> 
>  while ($file_name = readdir($dir)) {
>if ($file_name != '.' && $file_name != '..') {
>  $file_list .= " value=\"$file_name\">$file_name\n";
>}
>  }
>  closedir($dir);
> 
>  $file_finish = "
>   value=\"select\">
>\n";
> 
>  // this function prints the form as its return value
>  return $file_start . $file_list . $file_finish;
>}
> }
> 
> 
> On Monday, April 8, 2002, at 12:58  PM, Jas wrote:
> 
> > Here is what I need some information about, the script below opens a
> > directory on the server, reads the files and places them into select 
> > boxes
> > within a form, now I have this echoed multiple times on the page like
> > so... Now I have tried to assign a form name 
> > based
> > on the $file_name varibable but because the $file_name variable is 
> > created
> > after the form has been created I cannot assign a unique form name each 
> > time
> > I call .  If someone could point out another 
> > way to
> > do this or point out a good function for this I would greatly 
> > appreciate it.
> >  > $dir_name = "/path/to/images/directory/";
> > $dir = opendir($dir_name);
> > $file_list .= "
> > ";
> >  while ($file_name = readdir($dir)) {
> >   if (($file_name != ".") && ($file_name !="..")) {
> >   $file_list .= " > NAME=\"$file_name\">$file_name";
> >   }
> >  }
> >  $file_list .= " > VALUE=\"select\">";
> >  closedir($dir);
> > ?>
> > Thanks in advance,
> > Jas
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> 
> 
> 
> 
> 
> 
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 


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




[PHP] special charicters in form output

2002-04-13 Thread Paul Roberts

when i enter sZZsçe in to a form it's changed to sŹZşçę I didn't code 
it to change it to html special characters, is php doing this?

Paul Roberts
[EMAIL PROTECTED]





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




[PHP] globals in functions

2002-04-13 Thread Paul Roberts

Is there a quick way to set all variables as global so that they are avalible to a 
function, i'm doing an eval inside, so i need all the submitted variables to be 
avalible, or do i have to decalre them individualy.

Paul Roberts
[EMAIL PROTECTED]





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




Re: [PHP] special charicters in form output

2002-04-13 Thread Paul Roberts

it's METHOD=POST already, I'm trying to find out why a Polish address was changed!
Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Cal Evans" <[EMAIL PROTECTED]>
To: "Paul Roberts" <[EMAIL PROTECTED]>; "php" <[EMAIL PROTECTED]>
Sent: Saturday, April 13, 2002 6:37 PM
Subject: RE: [PHP] special charicters in form output


> If you are using METHOD=GET, your browser is probably doing it. Try
> METHOD=POST
> 
> =C=
> 
> *
> * Cal Evans
> * Journeyman Programmer
> * Techno-Mage
> * http://www.calevans.com
> *
> 
> 
> -Original Message-
> From: Paul Roberts [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, April 13, 2002 12:14 PM
> To: php
> Subject: [PHP] special charicters in form output
> 
> 
> when i enter sZZsçe in to a form it's changed to sŹZşçę I
> didn't code it to change it to html special characters, is php doing this?
> 
> Paul Roberts
> [EMAIL PROTECTED]
> 
> 
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 


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




[PHP] odbc with access on win2k

2001-11-20 Thread Paul Roberts

I just installed win2k to dual boot with 98 while I change over os's, I have
a script that connects to an access 97 DB via odbc_connect, it works fine
under win 98 but gives an error that it can't connect on win2000.(error
follows)

any ideas what I'm doing wrong, I have set up user and file dsn on the odbc
applet.

Warning: SQL error: [Microsoft][ODBC Driver Manager] Data source name not
found and no default driver specified, SQL state IM002 in SQLConnect in
c:\my documents\\links\hs~links.php on line 48

thanks in advance.


Paul Roberts
[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] eval on a form

2001-12-09 Thread Paul Roberts

Hi

I'm trying to pre-fill a form ( the data is passed via sessions or from
another script).

i have some check boxes on the form that i would like checked if the
variable is present.

any ideas


Paul Roberts
[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Sending out mass mail without having timeout problems ..

2001-12-13 Thread Paul Roberts

the way I handle this is to send a response to the browser before sending
any mail you can then close the browser window and the script will carry on
while you do something else. I get the script to send me an email when its
finished 2-3 hours later. (I have around 6000 newsletters that are sent out)

Paul Roberts
[EMAIL PROTECTED]

- Original Message -
To: "bain" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, December 11, 2001 8:39 AM
Subject:  [PHP] Sending out mass mail without having timeout problems ..




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Sending out mass mail without having timeout problems ..

2001-12-14 Thread Paul Roberts

how do I do that on a virtual server? (Linux+apache, I'm just a user not
admin)
the con is that I can't afford the phone bill, I'm on a dial up (56K).


Paul Roberts
[EMAIL PROTECTED]

- Original Message -
From: "jimtronic" <[EMAIL PROTECTED]>
To: "Paul Roberts" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, December 13, 2001 9:13 PM
Subject: Re: [PHP] Sending out mass mail without having timeout problems ..


>
> Wouldn't it be easier (better) to create a sendmail alias include
> file that has all the addresses in it and let sendmail or majordomo
> or qmail or whatever handle it?
>
> I'm not knocking your method as much as I'm looking for the pros and
> cons of the different methods.
>
> jim
>
> >the way I handle this is to send a response to the browser before sending
> >any mail you can then close the browser window and the script will carry
on
> >while you do something else. I get the script to send me an email when
its
> >finished 2-3 hours later. (I have around 6000 newsletters that are sent
out)
> >
> >Paul Roberts
> >[EMAIL PROTECTED]
> >
> >- Original Message -
> >To: "bain" <[EMAIL PROTECTED]>
> >Cc: <[EMAIL PROTECTED]>
> >Sent: Tuesday, December 11, 2001 8:39 AM
> >Subject:  [PHP] Sending out mass mail without having timeout problems ..
> >
> >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
> --
> Jim Musil
> -
> Multimedia Programmer
> Nettmedia
> -
> 212-629-0004
> [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] `T_VARIABLE' or `'$''

2001-08-24 Thread Paul Roberts

I'm using preg_replace and getting the following error

parse error, expecting `T_VARIABLE' or `'$''

anyone know where I can find out abut them, I did a search of the manual but
nothing came up.

Paul Roberts

[EMAIL PROTECTED]
+



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]





Re: [PHP] php's future

2001-09-02 Thread Paul Roberts

me too and as the max execution time is 30 secs and there's no code to
override it.
- Original Message -
From: "nick" <[EMAIL PROTECTED]>
To: "'nick'" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, September 02, 2001 1:56 PM
Subject: RE: [PHP] php's future


| Haha I tried its code and it only takes 1~2 secs to run it .
|
| Wellgod damn lies
|
| -Original Message-
| From: nick [mailto:[EMAIL PROTECTED]]
| Sent: Sunday, September 02, 2001 8:38 PM
| To: 'Faisal Nasim'; [EMAIL PROTECTED]
| Subject: RE: [PHP] php's future
|
| It's Chinese .
|
| I translated it maybe u cannot understand bcoz my English is not
| good
|
| First: jsp test for loop see below
|
| 
| 
| <%
| int i=0;
| int j=0;
| int k=0;
| for(i=0;i<2;i++){
| for(j=0;j<2;j++){
|
| }
| }
| %>
| 
| 
|
| 4 secs taken
|
| Next : php test for loop see below (he didn't mention if it is php3
| or php4)
| 
|
| 84 secs taken ++"
|
| Third : Asp for loop test
| <%
| response.write now
| response.write "
| "
| for i=0 to 2000
| for j=0 to 2000
| next
| next
| response.write now
| %>
|
| 64 secs taken
|
| Last one : Asp+ for loop test
|
| <%
| Dim intStart,intStop As DateTime
| Dim timeUse As TimeSpan
| dim Sum,i,j as int32
| intStart = DateTime.Now
| for i=1 to 2
| for j=1 to 2
| Sum=Sum + i
| next
| next
| intStop = DateTime.Now
| timeUse = intStop.Subtract(intStart)
| Response.Write (TimeSpan.ToString(timeUse))
| %>
|
| 3.6 secs taken
|
| if u can read Chinese u can go
| http://www.webappcabaret.com/jsptw/doc/test-report.htm for more
| infomation.
|
| It's a website which teach jsp at all
|
|
| -Original Message-
| From: Faisal Nasim [mailto:[EMAIL PROTECTED]]
| Sent: Sunday, September 02, 2001 7:54 PM
| To: nick
| Subject: Re: [PHP] php's future
|
| Where did you see that?
|
| Faisal
|
| At 04:28 PM 9/2/2001, you wrote:
| >Hi all in the list :
| >I read an news that said jsp/asp.net is better than php..
| >
| >They made a test that asp/php/jsp/asp.net using "for loops",
| >
| >Jsp from 1 to 2 takes only 4 secs
| >Asp from 1 to 2000 (not 2) takes 72 secs
| >Php from 1 to 2000 (not 2) takes 68 secs
| >Asp.Net from 1 to 2 takes only 3.5~3.8 secs...
| >
| >So is it time to learn jsp/asp+ instead of learning php ..???
| >I am so confused ~
| >I have been learning php for a while and now it said jsp/asp+ is better
| >than it.@@
|
|
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]