[PHP] PHP preg_replace_callback with unicode

2012-03-30 Thread Jimmy Chen
I wrote a simple script below to simulate my problem.
Both my string and pattern contain unicode characters.

Basically, if I run it from command line (php -f test.php), it prints
match as expected.

But if I run it through web server (apache, http://localhost/test.php), it
prints no match.

I am using PHP 5.3.
I am sure both use the same php.ini.

Any idea why it behaves differently?
How do I make it work through web server?


Thanks
-

?php
function myCallback($matches) {
return $matches[0]; //do nothing, test only
}

$value = 'aaa äää';
$pattern = '/(\bäää)/u';

$value = preg_replace_callback($pattern, 'myCallback', $value, -1, $count);
if ($count  0) {
echo match;
} else {
echo 'no match';
}
?



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



[PHP] PHP Error logging

2011-01-17 Thread Jimmy Stewpot
Hello,

I currently have a strange issue where we are seeing 'random errors' being 
displayed to end users. What I find most interesting is that in the php.ini 
file we have the following error settings.

error_reporting  =  E_ALL  ~E_NOTICE
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
track_errors = Off

I thought that if we had dislay_errors = Off then end users should never see 
errors displayed on the web page. However at apparently random times we do 
still see errors being reported, its not consistent at all. To give a better 
idea of the problem we have 8 web servers, they all run an identical copy of 
the site which is stored on a common netapp nfs filer. At apparently random 
times we see that 1 out of 8 servers will reported strange errors like 'use of 
undefined constant' or 'Undefined variable'. What's most strange about these 
errors is that if the code was faulty wouldn't we expect to see the errors on 
all web servers? and secondly wouldn't we expect to see the errors constantly 
rather than at apparently random intervals?

The php.ini files have a modify time of mid 2010 and yet this problem has only 
started in the last few weeks. Has anyone else experienced similar problems in 
the past and if so what was the root cause? 

Regards,

Jimmy

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



[PHP] Apache and PHP segfaults on Redhat EL5

2011-01-06 Thread Jimmy Stewpot
Hello,

I have been working over the last few months to try and get to the bottom of 
why our apache processes are regularly being killed with a Sig 11 (Segmentation 
Fault). Here are the messages in the kern.log

httpd[22309]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[21819]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[19168]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[21597]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[22871]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[22090]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[21970]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[22315]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[21808]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[21801]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[20469]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[23509]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[21967]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[21814]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[24017]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[21605]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[24329]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[23573]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[24328]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[22301]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[24636]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[25028]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[22869]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6
httpd[25030]: segfault at 7fffd01b4ffc rip 2b1f935c064c rsp 
7fffd01b4f90 error 6


We literally have thousands of those, I have tracked it down as far as being 
caused by mod_php in apache (Redhat 5 update 5). However when I enabled 
coredump's in apache I don't get anything. I can however get a dump if I send a 
manual sig 11 to the process. Which brings me to my questions.

Is there a method or way that I can enable a 'debug' mode in php which would 
help me track down and identify the root cause of these problems?
If anyone has any suggestions on what I can do to try and get further down the 
track to enlightenment I would be really appreciated.

Regards,

Jimmy. 

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



[PHP] SEE MY LATE JANGO JIMMY(Snr) BUSINESS CARD,I SEND MY PICTURES WHEN I HEAR FROM YOU.

2008-04-28 Thread Acct.yussuf Jimmy


Dear,

I am yussuf Jimmy,from Togo Republique.I will be very glad if you do assist me 
to download the sum of ( USD$15.8Million)into your bank account. I got your 
contact through a Global Network and i decided to communicate with you in a 
good manner.

I will compensat you for effort after the tarnsfer is done

email is:[EMAIL PROTECTED]

Thanks
Acct.yussuf




---

Afficher mes photos !

Je vous invite à regarder le(s) album(s) photos suivant(s) :

album 28/04/08

Comment afficher les photos :

http://www1.snapfish.fr/getimageforshare/p=118281209411671735/l=365045867/s=221172724/t=ALB/g=128984847/otsc=SYE/otsi=SALB

1) Consultez le lien ci-dessous pour accéder à Snapfish.

Photos de Acct.yussuf
Si le lien ci-dessus ne fonctionne pas, sélectionnez le lien ci-dessous à 
l'aide du curseur.  Ensuite, copiez-le et collez-le dans la barre d'adresse de 
votre navigateur et appuyez sur la touche « Entrée » ou « Retour » de votre 
clavier.

http://www1.snapfish.fr/share/p=199281209411671420/l=365045656/g=128984847/cobrandOid=1015/otsc=SYE/otsi=SALB

2) Entrez votre nom et votre adresse e-mail puis choisissez un mot de passe.. 
Cela permet d'assurer la confidentialité de vos photos et définit votre compte 
personnel protégé par un mot de passe sur Snapfish.
3) Si vous créez votre compte personnel Snapfish, vous pouvez commander des 
tirages ou des agrandissements de vos photos au tarif compétitif de 0,09 euro; 
l'unité. Il suffit de cliquer sur « Commander des tirages » pendant que vous 
visionnez les photos pour passer une commande.
4) Vous pouvez aussi commencer par partager mes photos en ligne. C'est une 
excellente façon de rester en contact avec ses proches.










[PHP] FastCGI and --enable-force-cgi-redirect

2006-03-29 Thread Jimmy Scott
Hi all,

While testing with PHP 5.0.4 (old, but should be good enough for testing
purposes), I noticed that --enable-force-cgi-redirect did not do his job,
and several people responded to the documentation that it is not
supported anymore, however, if I look at the archives it is still very
well supported on first sight.

Is there anyone that can comment on this? I think the provided
mod_rewrite workaround is a bit of ... ya know. In the current
situation, the script starting the PHP interpreter, is interpreted
itself, and thus displaying it's source (or part of it).

It scares me to put this (with or without that workaround) in a
production area without knowing *WHAT* support on it is still being
done, to be honest, it scares me this very moment.

The system I'm testing on FreeBSD 6.0-RELEASE.

Please CC me as I'm not subscribed to the list.

Kind regards,
Jimmy Scott

-- 
People usually get what's coming to them ... unless it's been mailed.

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



[PHP] Problem with arrays

2005-06-24 Thread Jimmy jimmy hoo
Hi,
 
I have 2 arrays:
 
Array ( 
   [0] = Array (
[0] = 28 
[1] = Music
  ) 

[1] = Array ( 
 [0] = 5 
 [1] = Books 
  ) 
 
   )
 
 
and 
 
Array ( 
   [0] = aaa
   [1] = bbb
   )
 
I want to join this two array and the result must be loke this: 
 
Array ( 
   [0] = Array (
[0] = 28 
[1] = Music
[2] = aaa
  ) 

[1] = Array ( 
 [0] = 5 
 [1] = Books
 [2] = bbb 
  ) 
 
   )
 
 
Thanks in advance for your help

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



[PHP] E-Commerce II

2004-02-13 Thread Jimmy
Wow, thanks for the help guys. Appreciate it.

Here's 2 other Q that popped into my head while researching...

1. I looked at Yahoo! and bCentral, they both charge monthly fees for using
their E-Commerce Tools. Why? I thought it should be a one time thing? Or are
they not providing code, just letting us use the code via Explorer and
Frontpage?

2. If I were to look for a website hoster, any recommendations?

Thanks!

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



[PHP] E-Commerce

2004-02-12 Thread Jimmy
Hi all. Is PHP a suitable language for building an online shop? Where would
I go to find out more info on this? Thanks in advance!

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



Re: [PHP] Empty Reference to an Object

2004-01-13 Thread Jimmy Lantz
At 16:14 2004-01-13, you wrote:
Hello Sebastian,

Tuesday, January 13, 2004, 3:09:39 PM, you wrote:

SO I cannot believe that there is no way of making an object parameter
SO optional.
function ($parameter1, $parameter2 = NULL)
{
 // etc
}
If passed to your function, $parameter2 will be your object (or
string or whatever you wanted), if not passed in it'll be null.
this might work this is an ugly solution from the top of my head, not tested:
?php
$myObject = (ifYour object exists)? $yourObject : new stdClass;
foo(blaha,$myObject);
function foo($para1,$param2){
if(get_class($param2) =='stdClass') $param2 = NULL; // get_class 
might return stdclass not sure
}
?
/ Jimmy
--
Best regards,
 Richardmailto:[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] PHP logo question

2004-01-12 Thread Jimmy Lantz
Hi coders,
I've sent several mails to [EMAIL PROTECTED] regarding the limitations / rights 
to use the PHP logo.
But I havent recieved any reply, does anyone know who answers that email? 
If so please send him/her an heads up to check his/hers inbox.

Now you might think that I've been sending several mails within a few days 
and now cries for help...
Thats no the case, I sent my first mail the 18th december and a copy of 
that mail was resent at the 8th of january 2004.
Or if someone knows if that guy has a lot on his plate just send me an mail 
to let me know if he usually replies within the month or two months.

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


Re: [PHP] PHP vs. jsp, advice please

2003-06-10 Thread Jimmy Brake
hi!

i run some really big apps (crms/email/shopping
carts/directories/forums/etc) that make use of persistance type data but
NEARLY all of it is just put in and removed from the DB - just all kinds
of little/big functions that need to maintain some data or state(s) of
some data - my system averages 20 queries per second - thousands and
thousands and thousands of simple queries - the only persistance is with
mysql connections

just my two cents


On Tue, 2003-06-10 at 17:51, Jean-Christian Imbeault wrote:
 Cpt John W. Holmes wrote:
  Agree 100%. Don't assume that just because you use JSP, or any other
  language, your program is going to instantly scale well and be easy to
  maintain. You can write crappy, inefficient code in any language. You can
  also write good programs in most any language if you put the proper planning
  into it before hand.
 
 Ok, I've got answers concerning the learning curve and maintainability 
 and some pros and cons that I have found very useful.
 
 Now the one last point that I would like to really find out about is 
 persistence. I keep hearing that you can get *true* persistence with 
 jsp/servlets/beans/whatever. I'm still trying to find out more details 
 on this as I can't see how you can get that since HTML is stateless and 
 whatever the backend is it all eventually turns into an HTML connection ...
 
 Sessions in PHP are nice but as everyone knows they don't allow for true 
 persistence. And if you want to have your objects persist over a 
 session, that's even more work (and in my short programming career I 
 have not yet found a case where persisting a PHP object across a session 
 was worth the trouble/overhead).
 
 Can anyone offer an opinion on this? Is persistence with jsp that much 
 easier compared to PHP? And if true persistence is possible is it all 
 it's cracked up to be?
 
 I've often dreamed of being able to have true persistence but if I had 
 it maybe I wouldn't find it all that useful once I'd had a go with it.
 
 Thanks,
 
 Jean-Christian Imbeault
-- 
Jimmy Brake [EMAIL PROTECTED]


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



Re: [PHP] native vs. phplib sessions

2003-04-04 Thread Jimmy Brake
homegrown 


make a rand value for the cookie -- stick that rand value in a db with
the actual user account info ... then we pull the real account info
using the random value from their cookie -- simple, efficient and pretty
dang secure -- also the system is load balance friendly

On Fri, 2003-04-04 at 12:26, Dennis Gearon wrote:
 How many people are using native vs. phplib sessions, vs. their own/homegrown 
 sessions?
 
 The archives show a LOT of problems with native sessions.
-- 
Jimmy Brake [EMAIL PROTECTED]


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



[PHP] cookies with internet explorer on macs

2003-03-31 Thread Jimmy Brake
Hi!

The cookies i set for people using Internet Explorer on mac (OS X or mac
os 8-9) are not staying alive as long as I would like(12hours) they only
last for a few hours or sometimes even a few minutes, the time on the
end users computers are set correctly. IE on windows is fine and Mozilla
and other browsers on linux are fine. 

This is what I use to set the cookie.  

$rand = md5(uniqid(rand()));
setcookie(sessid, $rand, time()+43200, /);

Any ideas? 

Thanks!

Jimmy


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



Re: [PHP] cookies with internet explorer on macs

2003-03-31 Thread Jimmy Brake
thanks ... lots of my customers use entourage ... 

On Mon, 2003-03-31 at 20:53, Lowell Allen wrote:
  From: Jimmy Brake [EMAIL PROTECTED]
  
  The cookies i set for people using Internet Explorer on mac (OS X or mac
  os 8-9) are not staying alive as long as I would like(12hours) they only
  last for a few hours or sometimes even a few minutes, the time on the
  end users computers are set correctly. IE on windows is fine and Mozilla
  and other browsers on linux are fine.
  
  This is what I use to set the cookie.
  
  $rand = md5(uniqid(rand()));
  setcookie(sessid, $rand, time()+43200, /);
  
  Any ideas? 
 
 A designer I work with was having problems with his sessions sometimes
 expiring after a few minutes. He uses OS X/Internet Explorer/Entourage. He
 determined that whenever he checks his email with Entourage, his session
 cookie is no longer recognized. He got Microsoft support to duplicate and
 acknowledge the problem. I use Mac OS 9/Internet Explorer/Outlook Express --
 no problem.
 
 --
 Lowell Allen
-- 
Jimmy Brake [EMAIL PROTECTED]


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



Re: [PHP] 2 databases

2003-03-19 Thread Jimmy Brake
yes -- i connect to oracle and mysql simultaneously .. 

On Wed, 2003-03-19 at 15:21, Iwan van Kanten wrote:
 Is it possible to connect to 2 different databases??
 2 different dtabase typs I mean
 postgresql and Mysql
 
 


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



Re: [PHP] Weird slowdown using complex functions in a loop

2003-03-12 Thread Jimmy Brake
where are you storing the information that you are cleaning once it is
cleaned?

are you appending it to a variable in the script?

On Wed, 2003-03-12 at 00:26, pgcd wrote:
 Hi,
 I'm trying to write a script to do some basic XML validation - nothing
 fancy, basically I just close open tags and check the arguments.
 The script runs fine, except that, when I use it in a loop (I need to
 validate roughly 200.000 posts), it gets progressively slower - like, the
 first ten calls to the function need around 0.01 seconds, next ten take
 0.03, then it's 0.1 and so on.
 I've tried disabling parts of the code, I've tried profiling with dbg, I've
 tried manually optimizing: nothing. I managed to reduce the slowdown a bit,
 but it's still there, and very evident (as soon as I reach around a hundred
 posts, a single function call takes as long as 10 seconds).
 
 It may be interesting to note that I had to recode it from scratch: I wrote
 a class to do the same processing, and *that* ate memory like crazy, ending
 up with nearly 2 GB of used memory (according to XP taskman).
 
 If anybody has come across a similar problem, I'd love to know what did they
 do to solve it, but a suggestion on how to pinpoint the cause of the
 slowdown would be great as well.
 
 Uh, yes: I'm using PHP 4.2.2 and Apache 1.3.24 on an XP machine (but I've
 tried using PHP 4.3.0 and Apache 2, with the same results).
 
 pgcd
 
 
 


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



Re: [PHP] fopen and file dump to a databace...

2003-03-09 Thread Jimmy Brake
hi mark!

i import data all the dang time and this is what i use (more or less)

?

$file = file(sompath/somefile.csv);


for($a=1;$acount($file);$a++)
{
$d = csv_parse($file[$a],,);
$first_name = make_safe($d[0]);
$last_name = make_safe($d[1]);
$company_name = make_safe($d[2]);
$address_1_1 = make_safe($d[3]);
$address_1_2 = make_safe($d[4]);
$city = make_safe($d[5]);
$state = make_safe($d[6]);
$zipcode = make_safe($d[7]);
$country = make_safe($d[8]);
$start_date = make_safe($d[9]);

$query = some insert sql;
$db-Insert($query); // i use a class for my mysql connections
}


function csv_parse($data, $separator)
{
$quote = '';
$values = array();
$toggle = 0;
$len = strlen($data);
$count = 1;
for ($i = 0; $i  $len; $i++)
{
$tmp = substr ($data, $i, 1);
if (strcmp($tmp, $quote) == 0)
{
$toggle = $toggle ^ 1;
}
$value = $value . $tmp;
if (strcmp($tmp, $separator) == 0)
{
if (! $toggle)
{
# End of word
$value = ereg_replace(,$, , $value);
$value = ereg_replace(^\, ,
$value);
$value = ereg_replace(\$, ,
$value);
$value = ereg_replace(\+, \,
$value);
$num_of_elems = count($values);
$values[$num_of_elems] = $value;
$value = ;
}
}
}
$value = ereg_replace(^\, , $value);
$value = ereg_replace(\$, , $value);
$value = ereg_replace(\+, \, $value);
$num_of_elems = count($values);
$values[$num_of_elems] = $value;
return ($values);
}

function make_safe($text)
{
$text = preg_replace(/(\cM)/,  , $text);
$text = preg_replace(/(\c])/,  , $text);
$text = str_replace(\r\n,  , $text);
$text = str_replace(\x0B,  , $text);
$text = str_replace('',  , $text);
$text = explode(\n, $text);
$text = implode( , $text);
$text = addslashes(trim($text));
return($text);
}



On Sun, 2003-03-09 at 18:02, Mark Tehara wrote:
 HI, I'm looking to take the data from a CSV file, then upload it into a
 mysql databace.
 
 I figure i will need the following.
 
 To count the number of lines ... and cut up each line in its veriables then
 entering it into the databace.
 
 I have:
 
 $file = fopen(pricelist-snippet.csv,r);
 $buffer = fread($file,1);
 echo $buffer;
 
 This dumps the data to the screen ...
 
 where would i start to making cutting this data up by the line?
 
 / Mark
 
 


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



[PHP] syntax question

2003-03-06 Thread Jimmy
I'm looking through some existing code for a project I'm working on, but
I keep running into this syntax that I really don't understand. Here's
an example:

$a=strpos($a,'-')?explode('-',$a,2):array($a);

What do the ? and the : do here?  I'm seeing this sort of thing all over
and just have no idea what ? : do. Thanks. 



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



Re: [PHP] crontab

2003-03-04 Thread Jimmy Brake
i think one of us misunderstood your posting ... 

my suggestion was simply to put a php script in your crontab to be run
whenever you set it to go .. if you are writing a php script to update
crontab for you as Liam understood your message it is not a good idea (
actually it's a really bad idea :) )

but running a php script versus a bash or perl or whatever
script/program is no more a concern than those ( always have security in
mind )


On Tue, 2003-03-04 at 13:07, John Taylor-Johnston wrote:
 Cal, Liam, Jimmy,
 Thanks. If this is a serious security hazard, could you show me some code that is 
 more secure? I am the root. Mind you I've never worked with crontab before. I want 
 to run /var/www/backup_mysql.php I suppose I should start by putting it somewhere 
 not publicly accessible?
 
 Thanks,
 John
 
 Liam Gibbs wrote:
 
   Can I run a php script in crontab?
   Do I echo or print?
   Anyone doing it?
 
  This is a serious security hazard. However, what you could do is have a PHP
  page set cron settings (such as name of file, location, frequency, and
  importance), then have another cron job (running at a decent frequency) do
  the organization. However, this is still a security flaw, as hackers can
  just take a look at your cron jobs and get in and run their own in place of
  yours. Probably no more a flaw than normal, though, as if a hacker can get
  in to replace your cron job, they can get in and run any number of things
  anyway. Make sure to hard code your cron jobs, as having a downloadable page
  is a bigger security hazard. You don't want the PHP page to do this itself,
  because it will have to run as root.
 
  I did this one time, and if I'm allowed some time to get my page up, I can
  e-mail you some instructions. What you'll need is a PHP page, a txt file
  (for the settings) and a cron job that will read the file and do the
  necessary steps to arrange the cron jobs itself.
-- 
Jimmy Brake [EMAIL PROTECTED]


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



[PHP] I have a problem with MsSQL

2003-02-17 Thread Jimmy Huaman
Hi.

My problem is the characters in spanish:

example:

Construcción (Data of MsSQL Server)
  
Result in web with PHP:
Construcci¢n  

Thanks you.




Prompyme a su servicio

-
Prompyme a su servicio.
El Estado su mejor cliente, visite la página de 
  información de Compras del Estado

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




[PHP] vni - unicode

2003-02-17 Thread Jimmy Brake
Hi!

I was wondering if anyone has vni - unicode conversion script.

Thanks Jimmy


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




[PHP] mac os 9 - file upload problems

2003-02-10 Thread Jimmy Brake
Hi,

I have a file upload page that accepts file uploads from pretty much
every browser and os EXCEPT any browser on mac os 9.  I have no idea
why, any of you ever have problems with file uploads on mac os 9? How
did you solve the issue.

  
-- 
Jimmy Brake [EMAIL PROTECTED]


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




RE: [PHP] Flow diagrams.-- Resending

2002-12-31 Thread Jimmy Brake
On Mon, 2002-12-30 at 06:59, Sridhar Moparthy wrote:
 Hi Jimmy,
 
 Thank You for the your reply. Here is the example.
 
 If
 1. Jobs 'B' and 'C' starts immediately after Completion of job'A'
 2. Job 'D' starts after completion of both Jobs 'B' and 'C'.
 3. Job 'E' starts after completion of job 'C'
 4. ...
 

job = object

What makes the jobs different -- should the images for different jobs be
different images? Do the connecting lines need to represent objects
bouncing around inside a computer, a network or the real world? Do the
objects transition between the real world - inside a computer and
through networks?

I just need to get a grasp.

Do the connecting lines always connect to the same place or are they
places on an object can connecting lines have bends? If they bend can
they cross other lines or pass through objects they are not related to?
(lots of other questions like this)

Can you show me data from your db(change the names if security is an
issue).

Also some general descriptions or what each job is would be great.

Such as is it a function or an object or class or is this data bouncing
between servers and respective processes. And things that you are
looking for in the image.

H if the layout is always the same then the graphic class can be
quite simple but if the layout changes it could make things much more
complex.

 The I would like to see the following image.
 
 
 [image]
 
  
 If you can not see the image, Please see the attached file. 
  
 Thank you.
 Sridhar.
 
 
 
 
 
 -Original Message-
 From: Jimmy Brake [mailto:[EMAIL PROTECTED]]
 Sent: Friday, December 27, 2002 4:23 PM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Flow diagrams.-- Resending
 
 
 can you give us some examples of the data ..
 
 the example I would like to see is: based on this information this is
 what should be displayed
 
 
 
 On Fri, 2002-12-27 at 11:48, Sridhar Moparthy wrote:
  Hi Every one,
 
  I have information about some processes in the database that tells
 different
  process dependencies. I need to display that information as a
 process flow
  diagram. Do you know how to prepare and display process flow
 diagrams
  dynamically. Do you know anything like JPGraph or Java script or
 java applet
  that can do this? If so Please help me.
 
  I am using PHP 4.xx and IIS on Win NT platform. Please help me if
 you know
  how to do.
 
  Thank You,
  Sridhar Moparthy
 
 
-- 
Jimmy Brake [EMAIL PROTECTED]


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




[PHP] uploading + downloading Large files ...

2002-12-27 Thread Jimmy Brake
Hi!

My users need to upload and download large files (100 + megs). Right now
I only allow 100k to be uploaded. Will I need to do anything to
php/apache to make sure things continue to be reliable? 

My google search only found threads with bad endings and they had much
smaller files. Should i just make em use ftp or scp? The problem with
using one of those protocols is that it makes it difficult for the users
to link the files to the proper account/relation/incident and anything
that is a problem for users is usually a problem for me. 

Thanks!

Jimmy 


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




Re: [PHP] Flow diagrams.-- Resending

2002-12-27 Thread Jimmy Brake
can you give us some examples of the data ...

the example I would like to see is: based on this information this is
what should be displayed



On Fri, 2002-12-27 at 11:48, Sridhar Moparthy wrote:
 Hi Every one,
 
 I have information about some processes in the database that tells different
 process dependencies. I need to display that information as a process flow
 diagram. Do you know how to prepare and display process flow diagrams
 dynamically. Do you know anything like JPGraph or Java script or java applet
 that can do this? If so Please help me.
 
 I am using PHP 4.xx and IIS on Win NT platform. Please help me if you know
 how to do.
 
 Thank You,
 Sridhar Moparthy



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




Re: [PHP] monster form and compression?

2002-12-27 Thread Jimmy Brake
IE has some bugs when you have big forms when using []  

test with mozilla or netscape

if thats the case -- then errr well umm use what works

On Fri, 2002-12-27 at 12:50, Jeff D. Hamann wrote:
 I have a monster form (really a funky grid - hey the client is always right)
 that does not display entirely each time the form is displayed. Some times,
 quite repeatably, the bottom half of the form's select boxes will be blank
 (not good). Is there a way to compress the web page before it gets sent, or
 any method to ensure the page will display correctly?
 
 Jeff.
 
 --
 Jeff D. Hamann
 Hamann, Donald  Associates, Inc.
 PO Box 1421
 Corvallis, Oregon USA 97339-1421
 Bus. 541-753-7333
 Cell. 541-740-5988
 [EMAIL PROTECTED]
 www.hamanndonald.com
 



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




Re: [PHP] Flow diagrams.

2002-12-26 Thread Jimmy Brake
to my knowledge there is nothing in php that does that

good luck

On Thu, 2002-12-26 at 11:17, Sridhar Moparthy wrote:
 Hi Every one,
 
 Do you know how to prepare and display process flow diagrams dynamically
 based on some data from database. I have information about some processes in
 the database that tells different process dependencies. I need to display
 that information as a process flow diagram.
 
 I am using PHP 4.xx and IIS on Win NT platform. Please help me if you know
 how to do.
 
 
 Thank You,
 Sridhar Moparthy


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




[PHP] a good imap library?

2002-12-11 Thread Jimmy Brake
Hi!

I am looking for a good imap library ..

That will let me:

login
logout
list folders
list contents of a folder
retrieve email 
retrieve just headers
retrieve the attachement of an email
get the number of messages in a mailbox
set server side filters
etc 

I have been digging around squirrel mail but I am not to happy with what I am seeing  
-- looks very mature but I would prefer something that is OO.

Thanks in advance,

Jimmy


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




Re: [PHP] update query based on array

2002-12-09 Thread Jimmy Brake
not real sure of the setup of the form but if you have mutiple groups of
items to be updated then you should make the rank an array -- rank[pid#]

you should make all the items -- that are related part of the same group
-- by using [] 

On Mon, 2002-12-09 at 15:06, Jason Dulberg wrote:
 I am displaying a list of data (from an sql query) and some of the fields in
 that list are editable through a form. If the user chooses to edit one or
 more of the rows of data, they must click on a checkbox to add that row to
 an update array. The problem is that when I read that array to pass to an
 UPDATE sql statement, it only passes the last entry of the array.
 
 Here's an example of the data being passed:
 13 - 4 - UPDATE ranking SET category='Prep School', rank='30' WHERE pid=4
 14 - 169 - UPDATE ranking SET category='Prep School', rank='30' WHERE
 pid=169
 15 - 166 - UPDATE ranking SET category='Prep School', rank='30' WHERE
 pid=166
 
 The above is created based on the following html code:
 //the last row
 input type=text name=category value=Prep School
 input type=text name=rank value=30 size=4
 input type=checkbox name=rankid[15] value=166
 
 So as you can see, its only reading the last row and assigning its values to
 the data above as well.
 
 Here's what I'm using for the sql query:
 
 while(list($key,$val)=each($rankid)) {
$upd=mysql_query(UPDATE ranking SET category='$category', rank='$rank'
 WHERE pid=$val);
 }
 
 If anyone has any suggestions for fixing this problem, please let me know :)
 THanks
 
 
 __
 Jason Dulberg
 Extreme MTB
 http://extreme.nas.net
-- 
Jimmy Brake [EMAIL PROTECTED]


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




Re: [PHP] Re: Looking for good ZIP Code / Latitude / Longitude table

2002-10-30 Thread Jimmy Brake
how much does the service cost?

or am misunderstanding the class?

why do you have to enter a password?


On Wed, 2002-10-30 at 11:31, Manuel Lemos wrote:
 Hello,
 
 On 10/30/2002 04:03 PM, Michael Zornek wrote:
  I've written a nice php/mysql site that let's you search for hospitals and
  community colleges by zip code. The search is built upon some math that
  figures out distances by a zip's lat and lon cords.
  
  My problem is that my current ZIP table (bout 42,000 rows) seems to be
  flawed. There are a ton of zip codes round california that have all the same
  lat and lons. There are other dups as well. So I'm looking for some new
  data.
  
  Does anyone know a good source for this type of info?
 
 This class may be used to figure the coordinates of a location given the 
 IP address of a computer (the user computer):
 
 http://www.phpclasses.org/netgeoclass
 
 
 -- 
 
 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] Cleaning pasted Word text

2002-10-29 Thread Jimmy Brake
for file maker pro (windows/mac) -- word (windows/mac) 

function make_safe($text)
{
$text = preg_replace(/(\cM)/,  , $text);
$text = preg_replace(/(\c])/,  , $text);
$text = str_replace(\r\n,  , $text);
$text = str_replace(\x0B,  , $text);
$text = str_replace('',  , $text);
$text = explode(\n, $text);
$text = implode( , $text);
$text = addslashes(trim($text));
return($text);
}

function make_safe2($text)
{
$text = str_replace(\r\n, \n, $text);
$text = preg_replace(/(\cM)/, \n, $text);
$text = preg_replace(/(\c])/, \n, $text);
$text = str_replace(\x0B, \n, $text);
$text = addslashes($text);
return($text);
}

cannot remember I why put in two functions ... but anyhow have fun you
will probably not the the implode / explode either



On Tue, 2002-10-29 at 16:39, Daniel Guerrier wrote:
 Paste into notepad, the copy the text from notepad. 
 Notepad should remove the high ASCII text.
 --- Brent Baisley [EMAIL PROTECTED] wrote:
  I think you have posted before and probably didn't
  get an answer. I'm 
  not going to give you an answer (because I don't
  have one), but perhaps 
  I can point you in the right direction.
  Look at http://www.w3.org/TR/REC-html40/charset.html
  and see if that 
  helps you. Below is a paragraph I pulled from it.
  
  The document character set, however, does not
  suffice to allow user 
  agents to correctly interpret HTML documents as they
  are typically 
  exchanged -- encoded as a sequence of bytes in a
  file or during a 
  network transmission. User agents must also know the
  specific character 
  encoding that was used to transform the document
  character stream into a 
  byte stream.
  
  
  On Tuesday, October 29, 2002, at 02:20 PM, a.h.s.
  boy wrote:
  
   I'm working on a PHP-based CMS that allows users
  to post lengthy  
   article texts by submitting through a form. The
  short version of my  
   quandary is this: How can I create a conversion
  routine that reliably  
   substitutes HTML-acceptable output for high-ASCII
  characters pasted  
   into the form (from a variety of operating
  systems)?
  
  --
  Brent Baisley
  Systems Architect
  Landover Associates, Inc.
  Search  Advisory Services for Advanced Technology
  Environments
  p: 212.759.6400/800.759.0577
  
  
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 
 __
 Do you Yahoo!?
 HotJobs - Search new jobs daily now
 http://hotjobs.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] What causes this?

2002-10-28 Thread Jimmy Brake
Hi,

I am getting this error randomly, just stops and starts.



Error: Unable to select database: crm :Commands out of sync; You can't
run this command now

 './configure' '--with-oracle=/opt/oracle/product/8.1.6/'
'--with-oci8=/opt/oracle/product/8.1.6/' '--enable-sigchild'
'--enable-track-vars' '--enable-wddx' '--with-mysql'
'--with-jpeg-dir=../jpeg-6b/' '--with-t1lib=../t1lib-1.3.1'
'--enable-wddx' '--with-apache=../apache_1.3.27'
'--with-mysql=/usr/local/mysql/'

The site ran fine till the upgrade  any ideas how I can get rid of
this or should I just rollback the update?

Jimmy


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




[PHP] Reading header information

2002-08-29 Thread jimmy

What I'd like to do is get some of the information found when you do a 
telent on port 80 like this below..

telnet www.hostname.com 80
Trying www.hostname.com...
Connected to.www.hostname.com
Escape character is '^]'.
HEAD / HTTP/1.0

HTTP/1.1 200 OK
Date: Thu, 29 Aug 2002 17:00:09 GMT
Server: Apache/1.3.26 (Darwin) PHP/4.2.2
Connection: close
Content-Type: text/html

Really what I'm trying to find is the server message (404, 200, etc.) on 
a remote server from this line... 

HTTP/1.1 200 OK

Is there anyway to access this through php?

thanks,
jimmy

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




[PHP] missing function? array_change_key_case()

2002-07-17 Thread Jimmy Brake

Hi!

When I run this command ...

$foo = array_change_key_case($foo, CASE_UPPER);

I get this error ..

Call to undefined function:  array_change_key_case() in /index.php on
line 181

Yet the function (should) exist:

http://www.php.net/manual/en/function.array-change-key-case.php

I am running 4.x any ideas?

Jimmy


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




RE: [PHP] missing function? array_change_key_case()

2002-07-17 Thread Jimmy Brake

yep thats it ... 

On Wed, 2002-07-17 at 18:02, John Holmes wrote:
 Works fine for me on 4.2.1
 
 You have to have at least 4.2.0, do you?
 
 ---John Holmes...
 
  -Original Message-
  From: Jimmy Brake [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, July 17, 2002 8:53 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] missing function? array_change_key_case()
  
  Hi!
  
  When I run this command ...
  
  $foo = array_change_key_case($foo, CASE_UPPER);
  
  I get this error ..
  
  Call to undefined function:  array_change_key_case() in /index.php on
  line 181
  
  Yet the function (should) exist:
  
  http://www.php.net/manual/en/function.array-change-key-case.php
  
  I am running 4.x any ideas?
  
  Jimmy
  
  
  --
  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] ^k ? -- how do I match that?

2002-07-15 Thread Jimmy Brake

Hi!

I keep getting that evil little character ... ^k  from mac users (pre X)
and I need to remove it. Does anyone know how to remove?

This site has that character as a vertical tab. This character is what
is used in MS Excel when people hit return inside a cell. If they copy
and paste that into a form its ok, but when I export that data to a csv
it gets ugly.

http://www.robelle.com/smugbook/ascii.html

Thanks in advance!

Jimmy


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




[PHP] A problem in mysql_fetch_array

2002-07-08 Thread Jimmy Lam

I have insert some text with space to mysql DB with varchar()

When I use mysql_fetch_array function to retrieve the data from DB . I found only the 
first session text can be shown . It means if any space there . It will split like 
session by session. for example. my DB have a text Hello World , It can retrieve 
only HELLO by using mysql_fetch_array . 

could anyone help me  ? thanks ..





[PHP] I would like to ask about Photo Upload in mysql and reteive problem .

2002-07-05 Thread Jimmy Lam

Dear all , 

I am a new bie here and I would like to know more about coding in upload photo 
file by client side and store in mysql database. also , how can I show the photo in 
the HTML CODING embeded and get the image directly from the database ? thanks . could 
you mind provide some code to let me reference. ?? I am doing my project. I need this 
information in urgent. Please friendly give me advice here . thanks 

Jimmy 



[PHP] STDIN/STDOUT in PHP

2002-06-09 Thread Jimmy Lantz

I've been looking for a way to work with stdin/stdout for a mod_rewrite's 
rewritemap.

There's a working example in Perl, (just returning the input)

#!/usr/bin/perl
$| = 1;
while (STDIN) {
   print $_;
}

I've been trying to achieve this with fopen() read and write the 
php://stdin  php://stdout .

#!/usr/local/bin/php -q
?php
$fp = fopen(php://stdin, r);
while (($buf = fgets($fp)) != false) {
 $input .= $buf;
}
fclose($fp);
$fp = fopen(php://stdout, w);
 fputs($fp, $input\n);
fclose($fp);
?


But no success.
In the apache man they say
Avoid one common mistake: never do buffered I/O on stdout! This will cause 
a deadloop!
Hence the ``$|=1'' in the above example

Could sommone give  some pointers how I could achieve the perl script above 
in php?

TIA
Jim.


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




[PHP] (Unlink(file) == rm file) ? (ignore this mail):(explain diffs);

2002-05-28 Thread Jimmy Lantz

Hi,

(Unlink(file) == rm file) ? (ignore this mail):(explain diffs);

Does PHP unlink function handle deletion of files equally as the rm 
command on the system in my case FreeBSD.
Or does it involve caching/handling files in any different way?
/ Jim


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




[PHP] Mcrypt: Blowfish or Twofish or no fish? Part 2

2002-05-22 Thread Jimmy Lantz

Thanx for the suggestions!
Someone mentioned that I could use MD5 and then encrypt the hash,
how would I ever decrypt that? Is'nt MD5 a 1-way thing only?

Another question?
Should I go for bigger keylength or bigger blocksize or both? What makes 
for the best encryption?

/ Jim

(and before someone suggest that I read the book Applied cryptography it's 
already orderd and on it's way :-) )


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




RE: [PHP] Mcrypt: Blowfish or Twofish or no fish? part 3

2002-05-22 Thread Jimmy Lantz



I believe that twofish has been successfully broken, so use blowfish
instead. Typically, for encrypting files you will use an algorithm like
blowfish in cbc mode (as opposed to ebc mode) but I don't know if Mcrypt
supports this. Also, when creating the hash of the file, it is probably best
to use SHA-1 instead of MD5, as there appears to be some concern with MD5
over it's compression function.
HTH
JH

It helps :)
I have been looking into Blowfish with cbc mode :)
If I use SHA-1 it's still no way to dehash it during decryption of the file,
so I fail to see the use of Hashing in fileencryption.
Could someone enlighten me?
/ Jim


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




[PHP] Mcrypt: Blowfish or Twofish or no fish?

2002-05-21 Thread Jimmy Lantz

Hi,
started playing with Mcrypt and just wanted to ask which encryption method 
makes the stronger encryption?
(I can supply the necesary keylength).
Should I go for MCRYPT_BLOWFISH or MCRYPT_TWOFISH? Or no fish at all :)

So what do I need it for? I'm going to use it encrypting files, sizes 
varies between some 100 k's and 4-5 mb's.
/ Jim

Paranoia + A system w/o users = Safe system :) 


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




[PHP] Sane path? Avoiding people climbing in directory structure ../../

2002-05-20 Thread Jimmy Lantz

Hi,
I'm planning on using userinput as a part of path to read (horrific I know :)
So to make this userinput a bit more secure I'm thinking to use
$path = escapeshellarg($path);
$path = str_replace(../,,$path);

I'm thinking to use a basedir in a constant something like 
/usr/home/userdir  (this also being set in php.ini)
then add the userinput and then append that to the constant and then use 
opendir() on it.
I want to avoid people putting in nice little strings like ../../../etc/

Any other pointers?
/ Jim

Security is a state of mind not a sales arguement!

*** Secret behind flying=
Throw yourself at the ground and miss :-) 


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




[PHP] [PHP 4.2.0] HTTP PUT method $_FILES ?

2002-05-10 Thread Jimmy Lantz

Hi,
I'm trying to get the PUT method working on a Apache server running PHP as
module.
Theese are the steps I've taken so far:

- I see in my apache logs that I've got PUT requests  PUT /path/filename.html
HTTP/1.1 OK
- I've added Script PUT /put.php , And checked so that the requests are beeing
transfered to this function. OK
- I've tried to get the ENV VARS but none show more than the PATH_TRANSLATED
(and it's beeing set) OK
- Checked the vars $PHP_UPLOADED_FILE_NAME and $PHP_PUT_FILENAME But neither
are being set to any tmpfile NOT OK!
- Checked $HTTP_RAW_POST_DATA , not set either.

Would'nt it be better to have the PUT valuables in the superglobal $_FILES ?
Or at least in a $HTTP_PUT_FILE var.

If someone could direct me to where I can fine the temporary file, I would be
much obliged!

Theres bugs referring to this as an non working function is this so?
- Bug #10383 Receiving an HTTP PUT, rather than sending one 
- Bug #14298 PUT absent $PHP_PUT_FILENAME $PHP_UPLOADED_FILE_NAME 

I propose a solution like the following:

$HTTP_PUT_FILE['request_uri']
Path of the proposed upload like /mytest/filename.htm

$HTTP_PUT_FILE['path_translated']
The full path of the proposed upload like
/usr/home/foo/bar/public_html/mytest/filename.htm

$HTTP_PUT_FILE['size']
The size, in bytes, of the uploaded file. 

$HTTP_PUT_FILE['tmp_name']
Temp name something like /tmp/hfdhjfufd8733

My only bad is that I cant program in C otherwise I would have been there
doing it already.

/ Jimmy


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




[PHP] Re: [[PHP] php problem]

2002-05-10 Thread Jimmy Lantz

johnny1b1g [EMAIL PROTECTED] wrote:
?

Well I guess I could try to help you if you elaborate your question a bit
further.
/ Jimmy
Start with RTFM :-)

-- 
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 MSSQL...

2002-04-29 Thread Jimmy

Anyone have any experience resetting the result cursor when using ODBC to
access MSSQL (2000)?

TIA

-josh



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




[PHP] [PHP 4.2.0] Benchmarking file uploads?

2002-04-24 Thread Jimmy Lantz

Hi,
I'm looking into the new version of PHP it says in the changelog
Highly improved performance with file uploads 
Has there been any benchmarking done on this?
/ Jimmy
  


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




[PHP] php printer functions...

2002-04-18 Thread Jimmy

I'm running PHP 4.1.1 on a Win2K box.  If I understand the manual correctly,
the printer functions have been integrated into PHP as of v4.0.4.  However,
when I try to call any of the printer functions, nothing works.

Any ideas or suggestions?

TIA

-josh



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




[PHP] Resume/recover uploads in PHP 4.2 ? WAS: RE: upload forms, how much was uploaded before upload fails..

2002-03-25 Thread Jimmy Lantz

Hi
following up on the text below...
Will there then be possible to recover uploads in 4.2?
Maybe even  resuming uploads? (wishfull thinking) ?
Cheers
Jimmy

Rasmus Lerdorf wrote:
Re: [PHP] upload forms, how much was uploaded before upload fails..
You'll probably need PHP 4.2 for uploads that big to work well. Before
4.2 uploads were buffered in ram, so no, you have no way to recover a
broken upload.

On Sun, 24 Mar 2002, Gerhard Hoogterp wrote:
  Hello all,
 
  I'm still having problems uploading BIG files (15MB and more) Is there a 
way
  to find howmuch data was uploaded before the connection was broken?
 
  For some weird reason no browser has a half decent user feedback if it come
  to upload forms.
 
  Gerhard


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




[PHP] mimeexplode counterpart in php?

2002-03-25 Thread Jimmy Lantz

Hi!
I wonder if there's such a thing as a counterpart in PHP for MimeExplode in 
PERL?
MimeExplode takes a email and splits the attachments and text so that you 
can save it automatically to a certain dir
by using .forward files.
Or something alike to it in PHP. I've been looking at IMAP functions but 
dont see how it would be possible to do the same thing.
Cheers
Jimmy


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




[PHP] Appropriate headers for Forcing download on IE/Mac and open with stuffit?

2002-03-18 Thread Jimmy Lantz

Hi,
I know it has been discussed before but I havent seen any working solutions.

My problem is that I need to force a dowload for Mac users / IE
and preferably also automatically let them open the file with stuffit expander.
(it works with files downloaded from a webpage/apache without PHP)
So there must be a way to replicate this behaviour in PHP, right?

I've tried endless combinations of orders for the headers and removing 
parts of them. What I've ended up using is the following:

header(Content-type: application/octet-stream\n);
header(Content-disposition: attachment; filename=\$filename\\n);
header(Content-transfer-encoding: binary\n);
header(Content-length:  . $filesize . \n);

But it doesnt result in the desired behaviour though.
Any Ideas?
Cheers
Jimmy

And yes I've RTFM more than twice!

Btw, I use PHP 4.12 as an Apache module on FreeBSD.


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




[PHP] readfile or fopen? (Passing file to user...)

2002-03-12 Thread Jimmy Lantz

Hi,
I wonder if there's a better way (more effective, less resource consuming ) 
to pass a file to a user than the ones I put below.
This might be quite large files more than 100 mb. Mind this might be all 
kind of files (binary and others) and must preserve the files state.

//Sending approriate headers
//snip
--Is this better, 
faster less consuming
$fd=fopen($completeFilePath,'r');
fpassthru($fd);
exit;

than this? Seems 
like it, or is there yet another, faster, better way?
$data = readfile($completeFilePath);
$i=0;
while ($data[$i] != ){
echo $data[$i];
$i++;
}
exit;

TIA
/ Jimmy


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




[PHP] strange behaviour of mysql_pconnect()

2002-01-22 Thread Jimmy

Hi list,

I do a small test on mysql_connect() and mysql_pconnect(),
and discover a strange behaviour.

?
$cid1 = mysql_pconnect($host,$user,$pass) or die(cant connect1);
$cid2 = mysql_pconnect($host,$user,$pass) or die(cant connect2);
echo $cid1, $cid2;
?

the output if using mysql_connect():
Resource id #1
Resource id #1
(both resource id are the same, as expected)

the output if using mysql_pconnect():
Resource id #1
Resource id #2
(both resource id are different)

at first I though pconnect() will create 2 different connection
because the printed resource id is different.

But after doing some test (by looking at the mysql processlist) i can
conclude that those two link_identifier are actually the same
(only one link, but with two different id)

the question is, why pconnect() print different resource id,
whereas connect() print the same one?

--
Jimmy

You can't quicken the growing of a plant by pulling the leaves



-- 
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] strange behaviour of mysql_pconnect()

2002-01-22 Thread Jimmy

Hi Shane,

 Actually, I'd be interested to know why the same connection is used for two
 connections to the same database?
 I'm guessing people could fall over this trying to do, say, unbuffered
 queries through one to fetch a huge result set, and normal queries through 
 another to make changes

nope...
as i've said before, this is only a testing script, not a real one.

I come across this testing when discussing about how many
same persistent connection can be opened to mysql.
I believe there will always be exactly only one same connection
(same connection = same host and same username), regardless of
using connect() or pconnect().

but then someone make a small testing, by doing 2 same pconnect()
and printing the returned link_identifier, which surprisingly return 2
different id.

--
Jimmy

There is no greater waste as a waste of time



-- 
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] Error notification and pretty error page

2002-01-21 Thread Jimmy

Hi Dan,

 How can i include error notification, like if an MySQL error occurs,
 to notify me of the offending page and what the error was, while
 having the page die quietly or nicely, like an message saying that
 the webmaster will be notified please continue?

you can make a generic function to be called when such error occured.
the fucntion will print a nice/default error msg to user and you can
log detail information regarding the error into logfile or DB,
or even send out a notification email to you.

function fatal_error($msg, $file, $line) {
  //$msg : the to be logged
  //$file: name of file which trigger the error
  //$line: line number which trigger the error
}

the usage:

include('lib which contain fatal_error()');
@mysql_query or fatal_error (mysql_error(), __FILE__, __LINE__);

__FILE__ and __LINE__ are php predefined constant to indicate current
file and line number which is being parsed/executed.

you always have to pass this __FILE__ and __LINE__ because PHP dont
have the ability to backtrack from which file/line a function is
called :(

and dont forget to add @ sign in front of the PHP's function,
to surpress the error msg generated by PHP.

--
Jimmy

There is no greater waste as a waste of time



-- 
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] Best way to get the remote IP address?

2002-01-21 Thread Jimmy

 either $HTTP_SERVER_VARS['REMOTE_ADDR'] or simply $REMOTE_ADDR (if you use
 $REMOTE_ADDR in functions make sure you do a global on it first) - I
 personally use $REMOTE_ADDR, but you should read the docs for details...

using $REMOTE_ADDR directly is fine as long as the
register_global setting is off.

otherwise, it's wiser to use getenv('REMOTE_ADDR') instead of
$REMOTE_ADDR directly.

--
Jimmy

Failure doesn't mean you'll never make it. It just means it may take longer.


-- 
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] Lazy evaluation?

2002-01-16 Thread Jimmy

Hi Alexander,

 Does PHP support lazy evaluation? Meaning that if:

Yes, it does.

--
Jimmy

Got a dictionary?  I want to know the meaning of life.


-- 
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] StripSlashes() quotes in text boxes

2002-01-16 Thread Jimmy

Hi Robert,

 administrator to edit the item description. When displayed in a text box the
 description just shows 17.
 The only solution I can find is to swap the quote marks for quot;
 when storing the item initially

you can use htmlspecialchars() function to convet all the html chars.
The issue is, when do you convert it, either when you want to display
them on browser, or when user INSERT/UPDATE.

I think it's better to convert it only when displaying to the browser.
so in the DB, the data is still stored as it is, because you might
want to display the data somewhere else other than browser, for
example email or printing.

--
Jimmy

All work and no pay makes a housewife.


-- 
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] Time calculation after UNIX

2002-01-16 Thread Jimmy

Hi Olav,

 I have a database that is supposed to last more than 30 years
 Could someone advice me how to calculate (add and subtract) time in a maner
 that willl be correct after 2030 when Unix Time stop working?

if you are using MySQL, then use datetime or date column type.
they can support date range from '1000-01-01' to '-12-31'.

and for calculation, you can use MySQL function:
ADDDATE() or SUBDATE()

--
Jimmy

Bigamy is having one spouse too many.  Monogamy is the same.



-- 
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] Lazy evaluation?

2002-01-16 Thread Jimmy

 For or statements it does, but not  or xor.

Are you sure only or which do lazy evaluation?
as far as i remember, the last time I use  operator it do
lazy evaluation.
And if you look at the online manual, some users also confirmed
that PHP implement lazy evaluation for logical operator.
http://www.php.net/manual/en/language.operators.logical.php

 I don't know about you, but I wouldn't want lazy evaluation on
 a conditional statement involving and.

Would you share the reason with us why you dont want lazy
evaluation in AND?

 if i have a statement like
  if (($a == 'a')  ($b == 'b')) blahblahblah();
 and, $a != 'a'.
 why should php even look at the value for $b while evaluating this line?

i believe PHP implement lazy evaluation, so it won't evaluate $b=='b'

--
Jimmy

Success only comes before work in the dictionary.



-- 
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] mysql_insert_id?

2002-01-16 Thread Jimmy

Hi Martin,

 2 because the (function argument) controlling feature is the
 connection, it is not possible for another concurrent user to
 'steal' your ID or influence the ID returned to you - it's all

 Ok, assume you are correct, but what if you are using persistent 
 connections (ie pconnet)?

don't worry, persistent connection is per-child-process basis,
so concurrent users will use different connection to DB.

the only problem i can think of might occur with pconnect is,
last_insert_id() will return you the last inserted ID from
previous 'session', not current 'session'.
to prevent this, you should call last_insert_id() only when
your INSERT query executed succesfully.


--
Jimmy

Right thinking leads to right living



-- 
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] WDDX...

2002-01-16 Thread Jimmy

Hi Tony,

 I'm doing a website which I want to be easily updated so I made it using
 wddx, now I wonder how fast or slow it is?
 How many people can connect to my website without seeing any slowdowns?
 Anyone knows?

I use WDDX in my project to exchange data between application
(which is what WDDX mainly for).
In average, in all my script there will be one call to
wddx_serialize_vars() function, and everything seems to be ok to
me...there's no significant slow down.
though, still we can not conclude that WDDX is fast/slow,
since my app is not so WDDX-intensive.

btw, it's interesting that you can use WDDX to help you update your
website easily. would you mind sharing with us how?

Thanks

--
Jimmy

The past is present in the future



-- 
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] Help !! Mail Function Problem (Newbie)

2002-01-16 Thread Jimmy

Hi Simos,

 mail([EMAIL PROTECTED], Subject, Line 1\nLine 2\nLine 3);

  thewall sendmail[4513]: g0H10I604513: from=apache, size=0, class=0,
 nrcpts=0, relay=apache@localhost

I am not sendmail expert, so i am just guessing.
the nrcpts=0 in your log message might be stands for number of
recipients, and it is showing 0.

So maybe you should pass the email address in proper string
(enclose it inside quote), like this:

mail([EMAIL PROTECTED], Subject, Line 1\nLine 2\nLine 3);

--
Jimmy

The past is present in the future



-- 
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] mysql_insert_id?

2002-01-16 Thread Jimmy

Hi DL,

 the only problem i can think of might occur with pconnect is,
 last_insert_id() will return you the last inserted ID from
 previous 'session', not current 'session'.
 to prevent this, you should call last_insert_id() only when
 your INSERT query executed succesfully.

 =Of course a right-living boy like me, cannot conceive of why one would
 look up LAST_INSERT other than immediately after the INSERT/UPDATE command...

calling last_insert_id() after INSERT is the number one rule
of course :)
What i mean was, what if the INSERT query fail, but the script still
execute the last_insert_id() function?
Most probably the returned value would be wrong, because it will
return the last_insert_id of previous INSERT query (from previous
'session')

 =What I have noted is that the PHP manual
 (http://www.php.net/manual/en/function.mysql-insert-id.php) works
 slightly differently (and possibly more simply), as well as
 emphasising the immediately after relationship between this call
 and the preceding INSERT.

I might be wrong, but i think PHP's mysql_insert_id() must be using
MySQL's API function call.
Meaning, it will return whatever value MySQL return.
Or in other word, mysql_insert_id() and last_insert_id() will return
the same result.

I have look thru the manual link above, and i think the phrase
immediately after in the manual is more to advise the user to do
mysql_insert_id() immediately after the INSERT query,
because last_insert_id value might get overwritten by the newest one.

the immediately after phares in the manual doesn't mean that PHP's
mysql_insert_id() function is somehow tied to the previous/last
INSERT query, so that if the INSERT fails then mysql_insert_id()
will intelegently return the correct value.

just my 1 cent

--
Jimmy

The average woman would rather have beauty than brains, because the average man can 
see better than he can think.



-- 
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] mysql_insert_id?

2002-01-16 Thread Jimmy

Hi mike,

 last_insert_id() will return you the last inserted ID from
 previous 'session', not current 'session'.
 to prevent this, you should call last_insert_id() only when
 your INSERT query executed succesfully.

 Most probably the returned value would be wrong, because it will
 return the last_insert_id of previous INSERT query (from previous
 'session')

 but of course, you'd have checked that the result id returned a valid result
 and not an error in this case and never looked for the last_insert_id,

Exactly.
That's why in the first posting (read the first paragraph above),
I told him to exec last_insert_id() or mysql_insert_id() ONLY when
the insert query is SUCCESSFUL.

--
Jimmy

When you lose, don't lose the lesson.



-- 
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] mysql_insert_id?

2002-01-16 Thread Jimmy

Hi DL,

 =session is not the correct word/its use is potentially confusing
 (perhaps that's why it's in quotes?) - persistence refers to the
 continuing connection between PHP and MySQL.

yup, you're right.
session is not the correct word, but i can't find the
correct/easy word to subtitute session, so i just use session
but put it inside quotes :)

 However it is also possible that in order to save time the LAST_ID
 information is built into the resultset coming back from the INSERT -
 thus when mysql_insert_id() is called PHP would not need to go back
 to MySQL/last_insert_id().

yes, what you said could be true also.

Well, there's only one way to be sure how mysql_insert_id() works...read
the source code of PHP :) but unfortunately I dont have the source code,
and even if I do, I won't read it, because I am lousy at reading someone's
code...:)

nice discussion, Neil :)

--
Jimmy

Buy Land. They've stopped making 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]




Re: [PHP] Content

2002-01-15 Thread Jimmy

Hi Daniel,

 variables, but as part of the Content of the HTTP request. Here is a sample:

 POST
 
/~rafael/sms_mail/cliente.dcs.php?NotificationProtocolVersion=1.0.0.0ApplicationName=NPlexApplicationVersion=6.0.037RequestType=NewMsgRequestTime=01/15/2002%2014:08:23ServerType=email[EMAIL PROTECTED]MessageType=email[EMAIL PROTECTED]%3ESubject=TST26MessageReceivedTime=01/15/2002%2014:08:23
 
 HTTP/1.0

in your php script, try to echo the passed param directly as variable,
for example $NotificationProtocolVersion or $ApplicationName
if it show the correct value, then you're lucky.

otherwise, you have to parse the HTTP request.
parse_str($QUERY_STRING);
// after this you will have the $NotificationProtocolVersion variable

--
Jimmy

A woman is like your shadow; follow her, she flies; fly from her, she follows.



-- 
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] Content

2002-01-15 Thread Jimmy

Hi Martin,

 I dunno how to do that from the top of my head, but imo Daniels server
 is broken since POST variables are sent in the body, but that is 
 clearly no POST request at all. In this case PHP has no way of parsing 
 the broken request. Or am I wrong here?

nope.
in POST request, all the variable will be in the body/content part,
so it is correct.

--
Jimmy

To Jazz or not to jazz. That's the question.  -William Saxpeare-



-- 
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] Including a REMOTE FILE using include (php function)

2002-01-15 Thread Jimmy

Hi louie,

 Im trying this little example of mine, Im trying to include
 a file from a remote webserver but could not possibly get
 it to work..

could be because the url fopen wrapper is disabled.
check the value of this setting in your php.ini file:
allow_url_fopen

--
Jimmy

Love your country, but never trust its government.



-- 
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] help using ereg_replace()

2002-01-14 Thread Jimmy

Hi Erik,

 $phone is a 10-digit string.
 I would like the output to be
 $phone = (555) 555-;

you don't need regex to do that.
just insert add ( to the beginning of $phone,
add )  to the 4th position,
and - to the 4th position from behind,
using substr_replace() function.

anyway if you insist on using regex:
preg_replace(/(\d{3})(\d{3})(\d{4})/, (\\1) \\2-\\3, $arr);

--
Jimmy

Everything loses its value when overly used, including love.



-- 
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] unable to copy and chmod

2002-01-14 Thread Jimmy

Hi Edgard,

 I'm trying to copy a file and chmod it to make it writable, but after I copy
 it using PHP I can't even chmod in ftp !

since you upload it using PHP, most likely the owner of the file is
nobody.nobody, that's why you can't chmod thru ftp. (unless you login
to ftp as nobody ;))

 I can't change the file owner too.

only root can chown

You need root access to fix your problem...or re-upload your file using
ftp, not php.

--
Jimmy

A diplomat is man who always remembers a woman's birthday but never her age.


-- 
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] Piping data into a select box

2002-01-12 Thread Jimmy

Hi Dean,

 Does anyone know how to give a select pulldown box a default value
 from a PHP variable?

?
function generate_option_list ($key_value,$set) {
// This function will return option list and set the selected attribute
// $key_value : the associative array which contain the key and the value for each 
option
// $set : the value to be selected by deafult
//
// Usage: for example we want to have a dropdown list of month, and set February as 
selected
//
//   $key_value=array(01=January,02=February,...);
//   $option_list=generate_option_list($key_value,02);
//   //$option_list now contain text option value='01'January/option
//   //  option value='02' selectedFebruary/option
//
// NOTE: This will only create the OPTION tag, without the SELECT tag
//

  while ( list($key,$value) = each($key_value) ) {
if ($key==$set) {$var.=option value='$key' selected$value/option;}
else {$var.=option value='$key'$value/option;}
  }
  return $var;
}

?

--
Jimmy

Leave loved ones with loving words, it may be the last time you see them



-- 
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] preg_replace help

2002-01-11 Thread Jimmy

Hi Gaylen,

 Please visit my web site at a
 href=http://www.mysite.comwww.mysite.com/a. You will be glad you did!

assumming all link start with www and all word which start
with www must be a link:

$repLink = preg_replace(/ (www[^ ]*) /i,
a href='http://\\1'\\1/a,
$myLink);

--
Jimmy

People are like clouds, all unique.



-- 
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] weird fopen problem

2002-01-10 Thread Jimmy

Hi Jon,

 Warning: fopen(/home/jon/pgpfiles/sgsdgsdg,w) - Permission denied in
 /home/ethiorg/public_html/test.php on line 2
 the directory /home/jon/pgpfiles has mode 777 and is owned by nobody and
 group is nobody. Apache runs under user nobody.

looks like you try to open a file outside the allowed direcory tree.
check your open_basedir setting in php.ini config file.

--
Jimmy

Politics SUCKS !!


-- 
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] Test if picture exists then load.

2002-01-10 Thread Jimmy

 Would that be fopen()?  or something else?  I'm still new to PHP so any
 feedback would be very appreciated.

 Use file_exists() to check whether a file exists.

file_exists() function is quite slow.
in your case, better do fopen() to check if the file exist,
because you gonna do fopen() anyway if the file exist.
if fopen() return error, then you can assume the file does not exist.
dont forget to add @ in front of the function name, to surpress err
msg.

if ($f = @fopen($image)) {
  // file exist, read the content, then echo to browser
}
else {
  // file does not exist, open default image
}

--
Jimmy

Bigamy is having one spouse too many.  Monogamy is the same.



-- 
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] Object Copying

2002-01-10 Thread Jimmy

Hi Ken,

 As we all know, this copies an object in PHP:
   $obj2 = $obj1
 Preferable a way to fix PHP not to copy the object, but the reference.

this will do want you want:
$obj2 = $obj1;

--
Jimmy

Always keep a cool head and a warm heart


-- 
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] ereg

2002-01-10 Thread Jimmy

Hi Kunal,

 ereg(!--start--(.*)!--stop--, $lineofhtml, $output);

ereg(!--start--([^!--stop--]*)!--stop--, $lineofhtml, $output);

--
Jimmy

It's not what you have in your life that counts, but who you have in your life


-- 
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] inserting a file into MSSQL

2002-01-09 Thread Jimmy

Hi Peter,

 Does anyone have a link to a good reference on how to insert a binary file
 (zip file) into MSSQL?

why do you want to store binary file in DB?
It's more efficient to store the file in filesystem, and in DB only
store the path of the file.
Unless you really have a good reason and left with no option
other than store the file in DB.

--
Jimmy

Brigands will demand your money or your life, but a woman will demand both.



-- 
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] Interesting Problem

2002-01-09 Thread Jimmy

Hi Yoed,

 mysql_query(SELECT Id, Dep_Date, Return_DateFROM X,Y WHERE Dep_Date LIKE
 '%$SelectDate%' OR Return_Date LIKE '%$SelectDate%' ORDER BY Dep_Date);
 Will give you a ton of errors, and I'm not very fimilar with JOIN and SQL
 and how that works. My idea was to create two querys, but the results in

from your table definition i didn't see any relation between those two
tables, so most probably it doesnt make sense to make a join
operation.
just do it in 2 query, one for each table.

--
Jimmy

When you have a hammer, you tend to treat everything as if it were a nail.


-- 
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] Supplied argument is not a valid MySQL result resource

2002-01-08 Thread Jimmy

Hi Dan,

 $parent_sql = SELECT * FROM categories ORDER BY sort_order ASC;
 $parent_result = mysql_query($parent_sql);

change the line to this one and run it again to see the error:
$parent_result = mysql_query($parent_sql) or die(mysql_error());

--
Jimmy

Brain off-line, please wait.



-- 
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] strip from html to closing body tag

2002-01-07 Thread Jimmy

Hi WB,


 Hi i need to strip out the html up  to the body tag.
 preg_replace( /html(.*)body(.*) ,   , $body );

try this:
preg_replace( /html[^body]*body[^]*/ ,   , $body );


--
Jimmy

Your mind is like parachute. It works best when it is open.


-- 
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] HOWTO USE : htmlspecialchars

2002-01-07 Thread Jimmy

Hi louie,


 ?php htmlspecialchars($info); ?

htmlspecialchars() do not change the passed variable.
it will _return_ the result.
so you have to do like this:
$info = htmlspecialchars($info);

please read the manual before asking to the list.
it's clearly stated there, and there's even an example
on how to use this function.

--
Jimmy

Leave loved ones with loving words, it may be the last time you see them



-- 
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] take links from url

2002-01-07 Thread Jimmy

Hi Alawi,

 I want to take string between table/table tags in put it
 in variable 

preg_match (|table([^/table]*)/table|i, $str, $match);

$match[1] will contain the string between table/table

--
Jimmy

Fate shuffles the cards and we play with them



-- 
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] Running php in background?

2002-01-07 Thread Jimmy

Hi James,

 Ideally,  I  would like to run the job in the background anyway. Can
 that be done?

read this: http://www.php.net/manual/en/function.exec.php
and search for 'background' keyword.

--
Jimmy

Brigands will demand your money or your life, but a woman will demand both.



-- 
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] How to read/write form/into certain place in a text file

2002-01-06 Thread Jimmy

Hi Leon,

 For example,read form letter 5 to 10 in line 4 ,and after some procedure
 ,write into the same place.

if the file is not too big, you can use file() function which will
return an array containing the content of the file per line.
combine this with substr() to read from specific column.
to write use substr_replace().

if the file is big, then doing file() is not advised, you should read
the file as stream. read the following functions:
fopen(), fclose(), fseek(), fread(), fwrite().

   Another question is that if a user has opened the file to read and write ,
 what will happen if another one will open and write the same file?

php doesnt handle file locking automatically, so i think it would
depend on the OS. if you want to handle file locking, read about flock().

--
Jimmy

God is greater than your greatest problem


-- 
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] no reply-to header?

2002-01-06 Thread Jimmy

Hi All,

I just realize there's no reply-to header in this mailing list.
No wonder I never receive my own email when I reply to any mail here.
Does it purposely set this way? Or is this a glitch?

--
Jimmy

Mistakes show us what we need to learn.


-- 
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] no reply-to header?

2002-01-06 Thread Jimmy

Hi Martin,

 I thought that if there's no reply-to, then email clients will use the
 from as the reply to ??

yes, correct, but the from is the address of the original sender,
so when someone hit reply, the email will goes to the original sender
only, not to this mailing list.

--
Jimmy

Be engaged at least six months before you get married


-- 
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] Mysql Curdate problem

2002-01-02 Thread Jimmy

Hi Andras,

 $aresult=mysql_query(select * from orders WHERE (a3 = CURDATE()-$datec)
 ,$db);

what's the value of $datec? integer 7 or 14?
if so then try to change it to this: interval 7 days

--
Jimmy

Love deeply and passionately. You might get hurt but it's the only way to live life 
completely.


-- 
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] Supplied argument is not a valid PostgreSQL result resource

2001-12-26 Thread Jimmy

Hi James,

 I've been getting the following error:
 Warning: Supplied argument is not a valid PostgreSQL
 result resource in dbasefunctions.php on line 87

that's because your SQL query return nothing, but you
try to fetch a row.

--
Jimmy

Live for Love, for without Love you don't live.


-- 
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] MySQL to Excel with mutiple sheets

2001-11-29 Thread jimmy elab

Matthew Loff wrote:
 
 http://www.wotsit.org/search.asp?page=49s=ALLFILES
  http://homepage.tinet.ie/~jmcnamara/perl/WriteExcel.html

This guy really has loads of remarkable links, or have you?!
Got any more?

-- 
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] MySQL to Excel with mutiple sheets

2001-11-29 Thread jimmy elab

David Robley wrote:
 
 s/require it be done/want to do it

Count me in. 
Starting somewhere in December. An RTF module will be first, though!

I'll post.

-- 
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] MySQL to Excel with mutiple sheets

2001-11-29 Thread jimmy elab

Jason Murray wrote:
 
 I stand by my original statement. After someone requires PHP to
 output a multi-sheet Excel file, the code to do it will then
 be out there. :)

Ah, this is a nice cryptic answer! 
I need it -more or less- ;-)

Why? 
This is why: http://nijb.nl/planning.php (It will open a flat excel
sheet, or so you might think) Oh, in case you should worry, the file is
PHP generated and guaranteed macro free.

There's the first requirement fullfilled.

So what more needs to be done,
and where is 'out there?'

-- 
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] Re: PHP4 sessions and Netscape 4.75/Mac

2001-11-19 Thread jimmy elab

 Dennis Moore wrote:
  
 Any ideas or clues?
 

Turn on cookies

-- 
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] Re: alzheimers and confused

2001-11-17 Thread jimmy elab

de Morgan and Boole, not Alzheimer nor Confusius

!(A OR B) = (!A) AND (!B)

-- 
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] Parse POST-Data myself

2001-11-16 Thread jimmy elab

Andrew Forgue wrote:
 
 By putting brackets after the variable name [] in a form element
 
 input type=text name=text[]
 input type=text name=text[]
 input type=text name=text[]

BLAAACH!!! Please add an index variable, as fields that you don't need
wil NOT be posted, so when you have several fields for one single
dataset, you might end up with the wrong set of indexes.

Adding them now, you'll never regret. 
Forget them now and you will regret it later...

  for ($i= 1; $i= 3; $i++) {
  ?
 input type=text name=text[?php echo $il ?]
  ?php
  }

-- 
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] Parse POST-Data myself

2001-11-16 Thread jimmy elab

Jimmy Elab wrote:
  input type=text name=text[?php echo $il ?]

When your not positioned straigth at your keyboard a ';' may
occasionally turn into an 'l'...

-- 
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] for loop problem?

2001-11-13 Thread jimmy elab

Tyler Longren wrote:
 
 Here's something interesting though.  There's an id field that's set to
 AUTO_INCREMENT.  

Yep, and that's one thing I've been looking at. See, I find it strange
that you need an KEY idpass (id, passcode(245)) when the ID is
quaranteed to be unique in itself.

Funny... Would not explain why you get more, I'd rather expect you to
get fewer entries.

Anyway. Try this: Drop the passcode VARCHAR and make it fixed CHAR(10).
It seems like MySQL can't keep up with the speed of your inserts, and
varchar is obnoxiously slow.

-- 
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] Re: Frames and Sessions

2001-11-13 Thread jimmy elab

Michael Hall wrote:
 can't figure out how I'm going to maintain a session across the three
 seperate HTML files in the frameset.

You don't! PHP and your browser will do it for you. It doesn't matter
whether you're in frames or not. All that matters is the cookie that is
automagically generated by the session manager and is sent to the server
on each request.

You only need a call to session_start() in each file that relies on the
session variables, and a session.register('varname') for each var once
you've decided you want it being saved accross pages.

-- 
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] Looking for security annoucements

2001-11-09 Thread Jimmy

I'm running phpBB not phpNuke and I'm subcribed to Buftraq, hope the otehrs
are more helpful for me...

Jimmy




-- 
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]




  1   2   >