Re: [PHP] PHP bug tracker, it is freely available

2004-08-15 Thread Jean-Christian Imbeault
Christian Stocker wrote:
http://cvs.php.net/php-bugs-web/
Thanks!
Now, is there any installation documentation? ;) Can't seem to find any 
under php-bugs-web.

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


[PHP] PHP bug tracker, it is freely available

2004-08-13 Thread Jean-Christian Imbeault
I absolutely love the PHP bug tracker and was wondering if it freely
available software or software internal to php.net only?

I've looked around but can't find a link to it anywhere.

-- 
Jean-Christian Imbeault
Assistant Manager
Technology Department
_
Mizuho Securities Co, Ltd.
Tel: (03) 5208-2932 (direct)

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



[PHP] SID set or unset?

2003-09-09 Thread Jean-Christian IMbeault
Is the PHP constant SID always defined? I have found conflicting answer 
in the documentation. One page of the docs says it is always defined 
while another says it is defined only if the right cookie hasn't been 
passed to the server.

Also how can I check if the SID is set or not?

I have tried the following but get an error:

?php
if (isset(SID)) {}
?
Parse error: parse error, expecting `T_VARIABLE' or `'$''
Thanks,

Jean-Christian Imbeault

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


Re: [PHP] Foring a file download *and* page reload

2003-09-01 Thread Jean-Christian IMbeault
Marek Kilimajer wrote:
 
 But because explorer does not support multipart/mixed and it is still 
 the major browser (thought not for long ;), do it this way. Output 
 header('Refresh: 0; url=download.zip'); first and then load the html 
 page with new data blocks.

Sorry if the solution is obvious but I can't understand what you mean by
using a refresh header. Where and when should I use the header? Can you
give a short example?

Thanks,

Jean-Christian Imbeault

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



[PHP] Foring a file download *and* page reload

2003-08-29 Thread Jean-Christian IMbeault
I've asked about this before but could not get a working solution.

I have a database. Users put data in the DB :) I have a page with a list 
of accessible data block. Each block has a button next to it.

When a user click a button what I would like is:

- I extract the data block from the DB
- I send the data to the browser as a file download so the user can save 
the data block to disk. (i.e. a save-file-as dialog comes up)
- I mark the data block as inaccessible
- I reload the page and present a new list. The data block the user as 
just selected is no longer in the list.

I have figure out how to force a file download using:

header(Content-disposition: attachment; filename=aFile);
header(Content-type: application);
The problem I have is that I need a way of send the user back to list 
page so I can regenerate a new listing. I can't use header(Location) 
because I've already started an output stream (the download).

Some suggested using this header:

header(Content-Type: multipart/mixed; boundary=\-Boundary-12399\);

But I could quite get it to work. The example code I have been trying to 
get to work make Netscape open a save-as dialog three times and on IE 6 
just prints everything in the browser window. This is the code:

(suggested by Marek Kilimajer)
?
header(Content-Type: multipart/mixed; boundary=\-Boundary-12399\);
print ---Boundary-12399\r\n;
print Content-Type: text/html\r\n;
print \r\n;
//HTML code goes here

print \n;
print ---Boundary-12399\r\n;
print Content-Type: application/octet-stream\r\n;
print Content-Disposition: attachment; filename=foo.tar.gz\r\n\r\n;
readfile(./foo.tar.gz);
print ---Boundary-12399--\r\n;
print \r\n;
?
I'm sure someone has done this before :) What is the correct way to 
achieve this effect? Is multipart content-type the way to go?

Thanks,

Jean-Christian Imbeault

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


[PHP] Frames: how to get the url of the top frame?

2003-08-27 Thread Jean-Christian IMbeault
I am providing content for an other site. My content is getting shown in 
side a frame. My content contains links to other content I provide. It 
also has forms that the user can use to submit information.

The form's submit action depends on some information that the main site 
send to me in the url, i.e., http://bigsite.com/index.html?submit=actionName

The problem is that cannot find a way to access the URL form inside the 
frame. All the $_SERVER vars are relative to my frame.

Is there a way for me to access the top (parent?) frame's URL?

Thanks,

Jean-Christian Imbeault

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


[PHP] Re: Looping through a list - Newbie question

2003-08-27 Thread Jean-Christian IMbeault
explode() and then foreach are your friends :)

explode() using the comma as your separator and then traverse the array
using foreach.

Jean-Christian Imbeault

James Johnson wrote:

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



[PHP] Sessions and frames

2003-08-27 Thread Jean-Christian IMbeault
I'm having problems getting a session to start when my script is loaded 
in a frame.

I provide some content that another web site loads up in a frame. I have 
set session.autostart to true in my php.ini file so that sessions are 
always started automatically and use cookies. The problem is that when a 
user clicks on any links in my first page a new session is started, the 
current one is not used.

I try and set some session vars using the following on my first page:

?php
$_SESSION[a] = a;
$_SESSION[b] = b;
echo a href='index.html'Click Here/a;
?
After this page loads in a frame I look at the /tmp dir on my server and 
I can see that a session file has been created and contains the correct 
values.

However if I click the link (which is just a link to the same page), a 
new session is started. I.e. if I look in /tmp I now see 2 session files 
and the newer one is empty. If I reclick on the link the new session is 
used and the the session vars are properly set.

The problem is that the first session that is created is not used. 
clicking on links in my frame (which go to other pages on my server) 
causes a new session to be started and the original session to be 
forgotten. The second session is then correctly kept across pages.

Why is my first session not kept? I'm a bit confused. Could it have 
anything to do with the fact that the site that is using my content is 
also setting a cookie?

Thanks,

Jean-Christian Imbeault

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


[PHP] Re: Sessions and frames

2003-08-27 Thread Jean-Christian IMbeault
A little update, seems I was wrong about the session cookie being set
when the page is first access. The first time the page is accessed no
session cookie or /tmp file is generated. I think this may be because
the site that is loading my content in a frame is also generating a cookie.

Is that a probable cause for my problem? If yes (or) how can I get a
session to be started (using cookies) when my content is loaded into a
frame?

Thanks,

Jc

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



[PHP] Re: Sessions and frames

2003-08-27 Thread Jean-Christian IMbeault
After much head banging I found the answer. I had set my browser to only
allow cookies from the originating site to be set. (This prevent
banner ads from setting cookies).

Of course the first time my frame was loaded the browser was seeing it
as content not from the originating site and hence blocking the
session cookie from being set ... argh.

One more reason to hate frames :)

Jean-Christian Imbeault

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



[PHP] Re: Stopping Output

2003-08-21 Thread Jean-Christian IMbeault
Oliver wrote:

 I'm in the process of making a forum in PHP, and am wondering if there is a
 way to just stop sending stuff the the client(like if they're banned). 

What about exit or die?

Jean-Christian Imbeault


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



Re: [PHP] Re: error when using $this

2003-08-21 Thread Jean-Christian IMbeault
Jonathan Villa wrote:

 I am in a class as well as a constructor.
 
 class DBI
 {
   //var declarations
   function DBI() 
   {
   $retVal = true;
   
 $this-setDBConn(mysql_connect('localhost',$this-_dbuser,$this-_dbpwd));
   if ($this-getDBConn() == false)
   $retVal = false;
   if(mysql_select_db($this-getDBName(),$this-getDBConn())==false)
   $retVal = false;
   return $retVal;
   }
   //more functions... 
 }

I'm guessing this is your class constructor?

If so then you can't access $this-_dbuser and $this-_dbpw because you
have not set their value anywhere.

You cannot set their value in the section you labeled var declarations
either. PHP does not allow values to be assigned to variables outside of
functions. So if you have any assignments in the var declaration section
put those at the top of your constructor.

Jean-Christian Imbeault


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



Re: [PHP] How to open a save-as dialog and then redirect after donwload?

2003-08-19 Thread Jean-Christian IMbeault
Jim Lucas wrote:

 actually, you should be able to do this without ever leaving the page that
 were clicking from.

I wasn't clear enough in my original post. You are right that the user
never leaves the page he is on. That's ok.

But what I would like to do is have the page reload itself so that it
can remove the file that has just been downloaded from it's list.

Is that possible?

Thanks,

Jean-Christian Imbeault


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



Re: [PHP] How to open a save-as dialog and then redirect after donwload?

2003-08-19 Thread Jean-Christian IMbeault
Jason Sheets wrote:

 Use PHP's file functions to read the file and output it to the browser, 
 sending the attachment header so it opens the save as dialog.  After you 
 finish outputing the file unlink() the file.

You didn't quite catch what I wanted to do. No file exists on my server.
I just give a bunch of buttons to the user, the buttons are in a form.
The form's action is another PHP script.

That script generates some data and forces a save-as dialog to open so
the user can save the data as a file. The script also stores in a
database the fact that this user has generated this file so that the
next time he visits the button for generating this particular file will
not appear in the list again.

The problem is that the page the user is on doesn't change once he
clicks the button.

What I want is that after a button has been clicked the current page,
the I generate the data file, cause a save-as dialog to open, and then
reload the current page (file list) so that I can present the user with
a list of buttons (data files he can generate) again (with the button he
clicked no longer in the list).

Do-able?

Jean-Christian Imbeault


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



[PHP] How to open a save-as dialog and then redirect after donwload?

2003-08-18 Thread Jean-Christian IMbeault
I want to create the following:

1- A screen a series files and associated buttons
2- if the user clicks the button a File | save as dialog opens up
3- after the file the user is redirected to a new page
I've gotten 1 and 2 to work but I can't figure out how to do anything 
after the file has finished downloading. I've tried header(Location: ) 
but that doesn't work because it must be used before any input is sent.

The reason I want this functionality is that once a file is downloaded I 
want the screen with the buttons to refresh itself and remove the 
downloaded file from the list displayed to the user.

How can I accomplish this? All suggestions welcomed!

Jean-Christian Imbeault

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


Re: [PHP] preg_replace question

2003-08-17 Thread Jean-Christian IMbeault
[EMAIL PROTECTED] wrote:
 Then use a simple strstr to first find out if the string does contain 
 mydomain.com :-)

My example was a simple one. I can't just check to see if the string
contains the mydomain.com first because I am not passing a string to
preg_replace but a whole text file.

I want preg_replace to replace all occurrences in the text file of the
regexp:

 #a href=(\|')http://([^\']+)(\|')#ime

But only if the regexp doesn't contain http://www.mydomain.com.

How can I get preg_replace to ignore instances of
http://www.mydomain.com when it is doing it's global search and replace?

Thanks,

Jean-Christian Imbeault


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



[PHP] preg_replace question

2003-08-16 Thread Jean-Christian IMbeault
I found this nice preg_replace function that replaces all occurrences of 
an HTML anchor (a href=...) with a link to another PHP script that log 
the link and then sends the user on his merry way to the the appropriate 
page/site:

preg_replace(
  #a href=(\|')http://([^\']+)(\|')#ime,
  'a href=\/exit.php?url=.base64_encode(\'\\2\').\',
  $originalLink
);
I'd like to modify this expression so that it does the same thing but 
*only* if the link is not to a specific page. I.e. I would like to 
replace all links *unless* the link was to, for example, www.mydomain.com.

How can I achieve this with a regexp? I'm not very good at 'negative' 
regexp ...

Thanks,

Jean-Christian Imbeault

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


[PHP] 4.3.3RC download mirror sites?

2003-08-14 Thread Jean-Christian IMbeault
I am trying to download php-4.3.3RC2 from the PHP site but my connection 
keeps timing out even before the download starts.

I'm guessing the main server is too busy? Does anyone know of any mirror 
sites?

Thanks,

Jean-Christian Imbeault

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


[PHP] how to use array_map() with a class callback function?

2003-08-14 Thread Jean-Christian IMbeault
I'd like to use array map with the callback function being a static 
function in a class. How can I do that?

I have tried:

class Maker {
  function sGetNameId($a) {
return 1;
  }
}
array_map(Maker::sGetNameId, array(1) )

But I get this error:

array_map(): The first argument, 'Maker::sGetNameId', should be either 
NULL or a valid callback

Is it possible to use class functions as callback functions?

Thanks,

Jean-Christian Imbeault

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


Re: [PHP] how to use array_map() with a class callback function?

2003-08-14 Thread Jean-Christian Imbeault
Peter James wrote:

 array_map(array('Maker', 'sGetNameId'), array(1) )
 
 Have a look at the callback type, here:
 http://www.php.net/manual/en/language.pseudo-types.php

Thanks! That did it.

Now if only PHP could treat class functions first-class citizens instead
of having making us jump through hoops ;)

Jc


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



[PHP] OO function overloading?

2003-08-14 Thread Jean-Christian IMbeault
Is it possible to overload a function is a class. I would like to have 
the same function defined differently depending on the number of 
arguments passed in. For example:

function foo() {}
function foo($a) {}
function foo($a, $b) ()
I know I could do it with:

function foo($a = , $b = ) {}

But that is such an ugly hack ...

Thanks,

Jean-Christian Imbeault

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


Re: [PHP] 4.3.3RC download mirror sites?

2003-08-14 Thread Jean-Christian IMbeault
Jason Wong wrote:

 When you go to the download page you *are* presented with a choice of mirror 
 sites. Or are you saying that you cannot even get to the download page?

I guess that is what I am saying since when I click on the download link
I get:

The operation timed out when trying to connect to downloads.php.net

Jean-Christian Imbeault


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



Re: [PHP] OO function overloading?

2003-08-06 Thread Jean-Christian IMbeault
Greg Beaver wrote:

 This statement isn't entirely correct, overloading is possible with the 
 overload extension.

True. Nice work. But still a hack in my mind :) (though a *very* clean
hack).

Jean-Christian Imbeault


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



[PHP] Re: FTP Synching

2003-07-23 Thread Jean-Christian IMbeault
Jwulff wrote:
(B How would I download any new files on a remote machine to my local one (in a
(B specific folder) via ftp?
(B
(BAnd how does this relate to PHP? I can't see a PHP question in there ...
(Bif there is one please make it clear :)
(B
(BJean-Christian Imbeault
(B
(B
(B-- 
(BPHP General Mailing List (http://www.php.net/)
(BTo unsubscribe, visit: http://www.php.net/unsub.php

[PHP] CLI php: how to use different php.ini file

2003-07-22 Thread Jean-Christian IMbeault
I am running some cronjob scripts that are written in PHP. However 
things are not working as expected because my php.ini file auto-prepends 
a file. This auto-prepending is meant for my PHP web pages and I don't 
want it loaded when I run PHP from the command line.

Is there a way from me to either use a different php.ini file for my CLI 
 PHP calls or to tell PHP *not* to auto-prepend the file?

Thanks,

Jean-Christian Imbeault

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


[PHP] Re: Apache 2.x and PHP

2003-07-22 Thread Jean-Christian IMbeault
Miguel Angelo wrote:
(B
(B Is PHP capable of running on Apache 2.x and if so what version ?
(B And is it stable ?
(B
(B
(BPHP will run on Apache 2 but ...
(B
(B#1 Apache 2 is multi-threaded whereas PHP is not. You need to turn
(BApache 2's multi-threading off.
(B
(B#2 Turning Apache 2's multi-threading off pretty much loses any
(Bperformance gains Apache 2 has over Apache 1.2.X
(B
(B#3 I'm not 100% sure that even with multi-threading off PHP is 100% stable.
(B
(BConclusion:
(B
(BIf you want to use PHP on a production server don't use Apache 2.
(B
(BMy 2 cents,
(B
(BJean-Christian Imbeault
(B
(B
(B-- 
(BPHP General Mailing List (http://www.php.net/)
(BTo unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] CLI php: how to use different php.ini file

2003-07-22 Thread Jean-Christian IMbeault
Jacob Vennervald Madsen wrote:
(B
(B php -c php.ini-file
(B
(BThanks!
(B
(BI hate to say it but this was actually in the manual :( I just didn't
(Bknow where to look ...
(B
(Bhttp://php.net/manual/en/features.commandline.php
(B
(BJean-Christian Imbeault
(B
(B
(B-- 
(BPHP General Mailing List (http://www.php.net/)
(BTo unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Apache 2.x and PHP

2003-07-22 Thread Jean-Christian IMbeault
Ivo Fokkema wrote:
(B 
(B May I add this little note from the PHP installation txt file :
(B 
(B  
(B  ATTENTION: Apache 2 Users
(B 
(BAt this time, support for Apache 2 is experimental.  It's
(Bhighly recommended you use PHP with Apache 1.3.x and not
(BApache 2.
(B (...)
(B   
(B
(BHum ... I think that pretty much sums it all up ;)
(B
(BJean-Christian Imbeault
(B
(B
(B-- 
(BPHP General Mailing List (http://www.php.net/)
(BTo unsubscribe, visit: http://www.php.net/unsub.php

[PHP] caching question

2003-07-19 Thread Jean-Christian IMbeault
I am using Apache 1.3.27 and PHP 4.3.3.RC1 and someone has told me that 
my web page cannot be cached but I cannot figure out why. My friend 
tells me my pages all keep sending this in their headers:

Cache-Control: post-check=0, must-revalidate, no-store, no-cache, 
pre-check=0

But I can't figure out why the headers are set like this. I am not 
setting any headers so I am wondering if it is a setting in my web 
server, php.ini file or some other php scripts I have running in the 
background.

Also print_r($HTTP_SERVER_VARS) gives one server variable to be:

[HTTP_CACHE_CONTROL] = max-age=0

What does this variable mean and where was it set?

Any and all help appreciated!

Jean-Christian Imbeault

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


[PHP] Re: classes v. functions

2003-07-19 Thread Jean-Christian IMbeault
I am sure someone will call this heresy, but if you really want OO don't
(Bdo it in PHP. If you are new to OO and start with PHP you will do
(Byourself a grat disfavour. OO programming in PHP is still not ready. If
(Byou try and program in OO in PHP you have to learn all of it's
(Bshortcomings and many "tricks" to get around them. And I promise that
(Bmore than once you will scratch your head and wonder why your object
(Bseems to have lost it's state or some variable never seems to get set
(Bproperly.
(B
(BJean-Christian Imbeault
(B
(B
(B-- 
(BPHP General Mailing List (http://www.php.net/)
(BTo unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: caching question

2003-07-19 Thread Jean-Christian IMbeault
Found somewhat of an answer here http://www.mnot.net/cache_docs/:
(B
(B"By default, objects processed by PHP are not assigned validators, and
(Bare therefore uncacheable"
(B
(BJean-Christian Imbeault
(B
(B
(B-- 
(BPHP General Mailing List (http://www.php.net/)
(BTo unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: stupidity check: (to disable transparent session id)

2003-07-02 Thread Jean-Christian IMbeault
Jason K Larson wrote:
(B I'm almost perfectly certain this *should* work ... can anybody shed 
(B some light on why it doesn't?
(B 
(B $retval1 = ini_set ('session.use_trans_sid',false);
(B
(BJust a quick guess but isn't that one of the settings you *can't* change
(Bon the fly since it has already been read from the php.ini file and used
(Bby PHP before it even gets to your script?
(B
(BJean-Christian Imbeault
(B
(B
(B-- 
(BPHP General Mailing List (http://www.php.net/)
(BTo unsubscribe, visit: http://www.php.net/unsub.php

[PHP] mysql_connect(): '/tmp/mysql.sock' error

2003-06-26 Thread Jean-Christian IMbeault
I've installed PHP from source and MySQL 4.0.9 from rpm on my RH 9 machine.

When I try and connect from php using mysql_connect() I get the 
following error:

Warning: mysql_connect(): Can't connect to local MySQL server through 
socket '/tmp/mysql.sock' (2)

The server is up and running and I can connect fine using the command 
line client.

Do I need some special configuration?

Any advice appriciated!

Jean-Christian Imbeault

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


Re: [PHP] mysql_connect(): '/tmp/mysql.sock' error

2003-06-26 Thread Jean-Christian IMbeault
Jason Wong wrote:
(B 
(B Find out where your mysql.sock is and edit php.ini to match.
(B
(BGood idea.
(B
(BThe problem was that the installation instructions for MySQL for vague
(Band confusing. I started trying to install from rpm and that didn't
(Bwork. I then installed from the binary and that was hell too. All the
(Bproblems stemmed from the fact that I couldn't figure out where MySQL
(Bwas installing itself too.
(B
(BI finally was able to find the source and install with that and force it
(Bto be where I wanted.
(B
(BI had the feeling that installing MySQL was going to be easy but it
(Bisn't all that simple. Maybe thay've made it *too* easy ;)
(B
(BNow, creating users ... what a pain.
(B
(BJean-Christian Imbeault
(B
(B
(B-- 
(BPHP General Mailing List (http://www.php.net/)
(BTo unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: client side cache

2003-06-23 Thread Jean-Christian IMbeault
Aljosa Mohorovic wrote:
(B i have problems with client side cache, how can i disable it?
(B i use this, but it still caches pages.
(B
(BWhat are your problems exactly and what is the client?
(B
(BRemember that the client might not be honouring your caching headers and
(Bif that is the case there is nothing you can do about it. i.e. it may be
(Ban ill-behaving client which isn't following standards.
(B
(BJean-Christian Imbeault
(B
(B
(B-- 
(BPHP General Mailing List (http://www.php.net/)
(BTo unsubscribe, visit: http://www.php.net/unsub.php

[PHP] How to find if a string is an integer?

2003-06-11 Thread Jean-Christian IMbeault
I would like to test wether a $_POST var is an integer or not. What is 
the best way?

I ahve tried is_int() but that fails b/c $_POST vars are always strings. 
is_numeric() doesn't help because it doesn't differentiate bewteen 
numbers (1.0) and integers (1).

The best I have been able to come up with is:

if (is_numeric($var)  is_int((int)$var))

But I ma hoping there is something simpler ...

Any ideas?

thansk,

Jean-Christian Imbeault

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


Re: [PHP] How to find if a string is an integer?

2003-06-11 Thread Jean-Christian IMbeault
Felipe Desiderati wrote:
try this:

if (ereg(^[0-9]+$, $_POST[var_int))
echo is int;
That's not the best regexp. It doesn' take into account negative 
integers and isn't there a [[:numeric:]] or something like regexp that 
would work better.

I'm looking for the simplest method and the one that takes the less 
processing power :)

Calling up the regular expression engine dounds pretty processing 
intensive ...

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


Re: [PHP] How to find if a string is an integer?

2003-06-11 Thread Jean-Christian IMbeault
Dvdmandt wrote:
It's not that killing... :p
preg_match(#^-?[0-9]+$#,$_POST[var_int]);
Not *that's* a mouthful ...

I was also thinking about that === operator.. And this:
if(((string)((int)$_POST[var_int]))==$_POST[var_int])
Cute. Might actually work too! Wonder if there would be any difference 
in using == or === in your suggestion?

Jc

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


[PHP] Re: if ($xxxxx) { function not working?

2003-06-10 Thread Jean-Christian Imbeault
Please post the whole code. If I understand what you are attempting to 
say you are probable just missing braces in the right place or php start 
-end tags.

Jean-Christian Imbeault

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


[PHP] Re: HTML and PHP

2003-06-10 Thread Jean-Christian Imbeault
Christian Ista wrote:
Look the code below. Is it an obligation to multiply the number of ?php ?.
There is no other way ? not possible to use only an open php tag (?php) and
a clode php tag (?)  ?
Sure, instead of using ?php ? use echo or print.

switch($constant_lastupdate[$i][3]){
  case '1' :
  echo img src='design/logo_windows.gif' alt='' width='12' height='10'
 border='0';
break;
And so on ...

Jean-Christian Imbeault

--
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 Jean-Christian Imbeault
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

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


[PHP] PHP vs. jsp, advice please

2003-06-09 Thread Jean-Christian Imbeault
I've just finished a big PHP project and I'm about to start a new 
project. I've had both fun and pain with PHP.

The new project would be another one of those database driven online 
store kind-of things for a somewhat large company.

Before I start my new project I am considering whether to use PHP again 
or to switch to jsp. I'm worried that PHP won't scale well. And by 
scaling I don't mean under heavy load, I mean maintenance wise :) I 
can't imagine having to do a feature upgrade on a PHP project with more 
than 100 files ... (this file requires that file which requires that one 
and so on ...)

I used to be a java programmer and always wax nostalgic about how easy 
it was to program-by-contract using objects and interfaces. And I'm 
always gripping about how much pain session handling is (not because of 
PHP but because HTTP is stateless).

I don't know anything about jsp but I've asked a few jsp programmer and 
I've heard lots of good things about it. They tell me I can get true 
object-oriented programming, object persistence *and* much easier to 
manage session handling. However none of them have ever used PHP so they 
can't really compare the two.

Can anyone give personal opinion of a comparison of the two?

Are they two completely different beast hence totally for totally 
different purposes? Or are they two languages that are mostly used for 
the same things?

Thanks,

Jean-Christian Imbeault

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


[PHP] Re: fetch then put record?

2003-06-09 Thread Jean-Christian Imbeault
Steve B. wrote:
Hello,
In ASP you can set records fields then call a dbupdate function.
There is no such function in PHP.

It appears mysql only supports update with the UPDATE query?
Huh ... MySQL is a database. It understands SQL. dbupdate() is an ASP 
function ... don't blame MySQL if it doesn't understand ASP ;) The only 
way to update data in MySQL is to use SQL, and in SQL to update data you 
use UPDATE queries :)

Here is my code:

$dbrec=getrec($result);
This is not PHP code. There is no function called getrec().

If you want to access a MySQL database using PHP you will also need to 
learn SQL. You need to learn how to write SQL update queries ...

I suggest that you read the PHP online manual and learn all about the 
MySQL functions. Read this section and then try again:

http://jp.php.net/manual/en/ref.mysql.php

Jean-Christian



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


[PHP] Re: working with sessions

2003-06-09 Thread Jean-Christian Imbeault
Matt Palermo wrote:
 
My question is can I search the session folder for:
cf4c4f6a8cffaf3334df48b6ea1d55e4 (or any other session id)  to see if
that session still exists and is active, or if it is gone and doesn't
exist anymore?  Can this be done?  Please let me know if you have any
thoughts.
It can be done using the file series of functions.

The question is though, why? What passes that session id to you script 
and why do you need to check to see if the session is still valid or 
not? PHP automatically detects if a session is not longer valid ...

Can you explain more clearly why you want to do this? Maybe we can offer 
a better way of achieving what you are *really* trying to do :)

Jean-Christian Imbeault



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


[PHP] Re: working with sessions

2003-06-09 Thread Jean-Christian Imbeault
Your original post is below for thos who want to read it :)

I see what you mean now.

Off the top of my head I think a better approach would be this:

- user logs in, his name and a timestamp are added to the list of active 
users
- every time a user accesses a page on your list his timestamp is 
updated to the current timestamp.
- when a user logs out you remove him from the file
- for the chat program, when looking for who is logged in you pick form 
the list all the people who's timestamp is less than, let's say, 10 
minutes old and delete the rest.

The best way to do this of course would be to use a database instead of 
a text file though :)

Jean-Christian Imbeault

Matt Palermo wrote:
 I am doing this, because I am making a text file with a list of all
 existing sessions.  Then another page checks to see if all of these are
 still active and exist, and if not it will take action and remove the
 session id from the list.  It goes along with the question I asked
 earlier about the Flash chat program.  I figured that I would make a log
 file of all sessions when a user logs in to chat, then if the user
 doesn't log out properly (with the log out button) and just closes the
 browser or shuts off the computer, then their id will be removed from
 the list, since the session doesn't exist anymore.  If there is an
 easier way to accomplish this, then please fill me in.  Here is the
 Flash chat question I asked earlier with more details for you:

 Hey, I need some advice if anyone is willing to offer it.  I have a
 chat program I am working on.  The interface is built in flash, and it
 uses PHP also.  There is a main chat area where the users type their
 messages back and forth, and there is also a smaller area which displays
 all of the currently logged-in users.  When a user logs into the chat
 room, it adds their nickname to a users.txt file, which creates a list
 of all the online users and is then displayed in the chat page.  I also
 have a logoff button that will search for the users nickname in the
 users.txt file and remove it, so that it won't be displayed in the chat
 window anymore.  The only problem I am having is that if a user doesn't
 click on the logoff button and instead just closes the internet window
 or shuts off their computer, then their nickname will still appear in
 the list of users, since it wouldn't get a chance to be removed by the
 logoff button.  I'm not sure how to accomplish this, I would appreciate
 any help you can offer me.  Thanks a lot.

 Thanks.

 Matt
--

Jean-Christian Imbeault

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


[PHP] Re: fetch then put record?

2003-06-09 Thread Jean-Christian Imbeault
[reply to a personal email posted here for the benefit of all :)]

 Are you sure you can't?

Yes.

 Could ASP do something that MySQL/SQL can't?

You confusing apples and oranges ... ASP is not a database. You should 
be comparing ASP to PHP.

So the short answer is PHP does not have an equivalent function to ASP's 
update() or whatever it is.

 That is very strange.

No it isn't. These are different languages.

 I wonder what mode ASP is accessing DB which lets you set record 
variables then paste them into
 it?

A very bad mode I would think. Very dangerous. But I can see how it is 
convenient.

 Perhaps it just does an update in the background.

Of course. No you understand. ASP is using a convenience method that 
does all that ugly SQL updating in the background. As far as I know PHP 
does not have such functionality.

 This bugs me because my db has 125 fields and it will be a very long 
sql string!

I bet!

 The form page generates form contents by using a while loop.

 How would you build the sql string from the form page?
Use a while loop ;) Name the GET or POST vars the same as the field 
names in the DB. Then you could use something like (I say like b/c this 
won't work, it's just an idea):

$sql = update table A SET ;
while (list($fieldName, $value) == each($_POST)) {
  $sql .=  $fieldName='$value', ;
}
This won't work because there will be POST values passes in that are not 
part of your form data. Oh, and there will be a trailing , you need to 
trim off ...

Just a quick idea.

--

Jean-Christian Imbeault

--
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-09 Thread Jean-Christian Imbeault
Joel Rees wrote:
You might want to look around the jakarta projects and ask questions on
some of those mailing lists.
Thanks for the advice. I'll try that. But I *would* like to hear the 
opinions of PHP'ers too. I'm worried that by asking people on that list 
Ill get one-sided views.

What do PHP people who've tried jsp or struts think?

(tomcat is an open source java server that can be used with or without
apache, and struts is an application framework.)
The jsp'ers that I talked with could not stop praising struts ... which 
is what got me interested in finding out more and maybe even switching.

I just hope that if I do decide that struts are worth the switch the 
learning curve isn't too steep. Or the installation curve also since I'm 
the lone sysadmin too ...

Thanks,

Jean-Christian Imbeault

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


[PHP] Re: Printing Issue

2003-06-09 Thread Jean-Christian Imbeault
Birdto wrote:
Hi All,

I have a problem in printing database. I have drawn some data from the MySQL
and print to A4 paper. When the data are more than 1 page, it has to print
on other A4 paper. The problem is, I need the program to print the same
heading in every page. How can I do this?
Are you displaying the data in a web browser and then using the web 
browser's print function?

If so then this problem cannot be solved using PHP. You'd need to figure 
out how many lines you can print on a sheet of A4 and add a header after 
that many lines of data.

Unfortunately PHP has no way of knowing what font the browser is using 
to display the data, hence you cannot know how many lines you can print.

PHP cannot help you in this case. I might be wrong but I doubt it.

Jean-Christian Imbeault

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


[PHP] Re: Newman Isn't trying very hard

2003-06-08 Thread Jean-Christian Imbeault
Philip J. Newman wrote:
Is there a way of changing only the 1st letter of a string to caps and the rest to lower?

eg: foo bar 
  to
  Foo Bar
Newman, search the PHP documentation before posting will you?

What you want is the function called ucwords()

http://jp.php.net/manual/en/function.ucwords.php

Jc

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


Re: [PHP] Re: use print

2003-06-08 Thread Jean-Christian Imbeault
 wrote:
thanks to replay
I wont to print to paper printer 
If you mean to have the user print to a paper printer what he sees in 
his web browser then that has nothing to do with PHP.

Printing from a web browser is controlled by the web browser. PHP cannot 
affect the way a web browser prints.

Did I understand you question correctly?

Jean-Christian Imbeault

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


[PHP] Re: Linux question with mysql

2003-06-08 Thread Jean-Christian Imbeault
Azflsite wrote:

You just high jacked someone else's thread. Please don't do that.

I just installed the rpm for mysql 4 on Redhat 7.1.
Now the service is running, but I cannot go to a
command line and type in mysql to get to the mysql
command prompt. Did I install it wrong? Do I need to
add a path like you would in windows (Enviroment
Paths)?
Furthermore this is a PHP list ... for MySQL support you would be much 
better off posting to a MySQL list no? ;)

Unless of course there *was* something related to PHP in your question 
that I somehow missed?

Jean-Christian Imbeault

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


[PHP] Re: [Newman] How to pass an image through PHP.

2003-06-07 Thread Jean-Christian Imbeault
Philip J. Newman wrote:
I would like to know where i should be looking to pass an image through PHP
Could you elaborate on what you mean by pass an image through PHP? I'm 
not quite sure what you mean. What exactly do you want to do?

Jean-Christian Imbeault

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


[PHP] Re: use print

2003-06-07 Thread Jean-Christian Imbeault
Mudhar wrote:
How can I print table in my page without I use print command from file
menu? I means just table not all page
I'm not sure I understand ... what do you mean by print? Print to a 
paper printer or display in the web browser?

Can you explain more clearly exactly what it is you want to do?

Jean-Christian Imbeault

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


[PHP] output_handler in php.ini: how to use custom function

2003-05-30 Thread Jean-Christian Imbeault
I'd like ot set the output_handler in php.ini to be a custom function I 
will write. Is this possible. The documentation say how to redirect to a 
function that is not part of the PHP core ...

Basically I want to have all the output be sent to my custom function, 
which will do something to it, before being sent out to the browser.

Since I will be doing this on all my pages I don't want to hard-code a 
call to ob_start() on each and every page. I am hoping I can do this 
with a setting in the php.ini file.

Any suggestions?

thanks,

Jean-Christian Imbeault

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


[PHP] http-https-http redirection causes browser to show alert dialog

2003-03-13 Thread Jean-Christian Imbeault
I have a login page with a form where users enter there login and
password. The form's action is https://mysite.com/login.php;.
login.php authenticates the user and if the authentication is successful
it ends with a:
header(Location: http://mysite.com/welcome.html?a=bc=etc...;);

The problem I am facing is that the flow of event is:

http - https - http

and this causes IE and Netscape to put up an alert box telling
users that they are leaving a secured site.
The IE messages is:

You are about to be redirected to a connection that is not secure. The
information you are sending to the current site might be retransmitted
to a non-secure site. Do you wish to continue?
I only want to use HTTPS for the parts of my web site that actually need
  it and nothing else. The way I have things set up now I receive the
data through HTTPS, use it, and then put the user back on a regular
HTTP connection since I don't need https anymore. But I get browsers
throwing up these warnings 
Is there a way around this? The messages are annoying at best and
probably scary to users ...
Thanks,

Jc

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


Re: [PHP] http-https-http redirection causes browser to show alertdialog

2003-03-13 Thread Jean-Christian Imbeault
Cpt John W. Holmes wrote:
You'll have to output a message on the HTTPS page, like Thank you, click
here to continue, otherwise there's no way around the message. It's a
client side issue, other browsers may or may not do it.
Yuck.

I see that Hotmail does something similar, You login though HTTPS and 
are sent to a blanks page that redirects you to another. I guess they 
use some kind of META redirect tag?

Thanks,

Jc

PS Love you columns (and all of) php|a.

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


Re: [PHP] http-https-http redirection causes browser to show alertdialog

2003-03-13 Thread Jean-Christian Imbeault
[EMAIL PROTECTED] wrote:
Why don't you just leave them in https?  Is this a performance issue?
Performance and also the fact that (if I remember correctly) session 
variables are not passed from http to https nor vice versa.

And more importantly any relative links in page will turn to https links 
when they should be http links 

Jc

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


[PHP] Security Q (persistent in-memory var possib;e?)

2003-03-05 Thread Jean-Christian Imbeault
I have a PHP application that connects to a DB an retrieves encrypted 
data from it. The PHP application uses the decryption key to decode the 
data to so some work with it.

Right now the key is hard-coded into the PHP script. I am worried that 
if someone hacks into my server they will have access to the the 
encryption key and can then use it to decode the encrypted data that is 
on my DB.

Is there any way for me to remove the decryption key from the script 
itself and make it as inaccessible as possible?

One solution that I was joping would be possible would be to a 
(super)global variable that is put into RAM once the web server is 
started. That way the key is not lying around anywhere.

Is there anyway for me to either make a either $_SERVER var for apache 
(say in the httpd.conf file which I could delete after starting the 
server or in the source code?) or of creating my own superglobal for PHP 
(and then I delete the source code)?

Any suggestions are welcomed!

Jean-Christian Imbeault

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


[PHP] Re: registration

2003-03-05 Thread Jean-Christian Imbeault
Diksha Neel wrote:
?PHP

$connection=mysql_connect(localhost,root,)or die(Could not 
connect);
print Connected successfully;
mysql_select_db(bdoi_change)or die(could not select database);

echo  $login 
pre
The line above you give you an error ...

echo
form
Login ID   font color=\red\* /fontinput name=\login\ 
value=\$login\ 
/form;
?
There's a syntx error in your code as pointed out. The pre is inside 
the ?PHP ? tags but not quoted ... maybe you made a cut-and-paste error?

Jc

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


[PHP] Re: [PHP-I18N] addslashes(): Is it multi-byte safe?

2003-03-02 Thread Jean-Christian Imbeault
Moriyoshi Koizumi wrote:
You can avoid this issue by configuring a PHP build 
with --enable-zend-multibyte option and set mbstring.script_encoding to 
SJIS.
Or better yet, make sure that all pages are in EUC-JP and use that for 
internal encoding too, right :)

And also translate all user input to internal encoding by setting 
encoding_translation = On.

Doing those two things should let me use the regular PHP addslashes().

Jc

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


[PHP] Re: [PHP-I18N] addslashes(): Is it multi-byte safe?

2003-03-01 Thread Jean-Christian Imbeault
Moriyoshi Koizumi wrote:
Partially yes.

Strings encoded in GB2312(CP936), big5, Shift_JIS are known to be 
clobbered by addslashes().
Sh*t ... and I just added a whole bunch of addslashes() to my code to 
prevent SQL attacks. And of course my web pages are for Japanese ... and 
most of them will be using SJIS.

If I have internal_encoding set to EUC-JP does that mean that all POST 
or GET vars passed in will be translated to EUC-Jp and hence my 
addslahes will be fine?

I sure hope so ...

Jc

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


[PHP] addslashes(): Is it multi-byte safe?

2003-03-01 Thread Jean-Christian Imbeault
Is addslashes() multi-byte safe?

I will bu sing it to escape multi-byte input and wouldn't want it to 
mangle anything...

Thanks,

Jc

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


[PHP] Re: [PHP-I18N] addslashes(): Is it multi-byte safe?

2003-03-01 Thread Jean-Christian Imbeault
From an email. Reposting to to list for thos who might have the same 
question later on :)

Moriyoshi Koizumi wrote:

 Oops, I should have said mbstring.encoding_translation=on actually :)
Ok. Turning that on.

In which case I am safe :) But then again anyone who would want to try
an SQL injection attack might try and send some SJIS ... better safe
than sorry :)


 It took some minutes to sort out what you're saying here.. By the word
 clients I meant browsers and there I was trying to mention a case that
 some browsers that have certain settings try to send GET queries in 
UTF-8
 while such queries are basically supposed to be encoded in the same
 encoding as that the page is written in.

Sorry if my intentions were not clear but I am trying to protect myself 
from SQL injection attacks by using addslashes() to user provided 
information. I cannot assume anything about the incoming data (not even 
the encoding) since anyone trying to hack my machine by using such a 
technique could pretty much send whatever they wanted using a telnet 
session or what not ...

 Anyway, Shift_JIS is not a great choice for PHP scripting.

Tell me about it. I have the hardest time getting the people who 
actually make the HTML page to use EUC instead of SJIS. Of course they 
all use MS platforms to create the HTML content so they can't understand 
why SJIS causes me pain when I try and edit it in *NIX box or parse it 
in PHP ...

Thanks for  the info!

Jc

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


[PHP] BBS software in PHP?

2003-02-19 Thread Jean-Christian Imbeault
Can anyone recommend a simple (and free) BBS module/software written in 
PHP. preferably something that writes to a DB and preferably PoserSQL.

I would like to add some bulletin board functionality to my web pages 
but don't feel like reinventing the wheel :)

Jc


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



[PHP] Re: Need To Find A php Person

2003-02-07 Thread Jean-Christian Imbeault
I might be able to help you with support/customization of your 
application depending on what kind of PHP application it is. I have a 
great deal of experience programming with PHP and developing large 
application.

Could you let me know what kind of application you have?

Jc

Michael McGlaughlin wrote:
Hello,

I am looking for someone well versed and established who understands the php language and who can support a product that I have that I cannot receive support from by the original developer.
 
What would be the best way for me to go about finding someone? We paid the developer by making a donation to him for his script, then paid him for some further customizations, which he completed, but now he does not appear interested in additional cusomization work on our system and I am left in a bit of a lurch.
 
Any help you can give would be greatly appreciated.
 
Sincerely,
Michael


_
Get your FREE email address
http://www.hootingowl.com
The Wise Way To Search

_
Select your own custom email address for FREE! Get [EMAIL PROTECTED] w/No Ads, 6MB, POP  more! http://www.everyone.net/selectmail?campaign=tag


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




[PHP] mcrypt installation problems

2003-02-05 Thread Jean-Christian Imbeault
Can anyone point to information on how to install mcrypt support for 
PHP. I tried the PHP mcrypt pages but they are quite lacking in details.

I downloaded libmcrypt and got that installed fine.

I also downloaded mcrypt (do I really need it?) but that wouldn't 
configure. It complains that:

checking for libmcrypt - version = 2.5.0... no
*** Could not run libmcrypt test program, checking why...
*** The test program compiled, but did not run. This usually means
*** that the run-time linker is not finding LIBMCRYPT or finding the 
wrong ...

I tried compiling PHP with  --with-mcrypt=/usr/src/mcrypt-2.6.3/ (the 
locate of the mcrypt source files) but that gave me an error when I did 
make:

cc1: warning: changing search order for system directory 
/usr/local/include
cc1: warning:   as it has already been specified as a non-system directory
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:229:1: warning: MCRYPT_FAILED 
redefined
In file included from /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:34:
[...]

Questions:

1- Do I need both libmcrypt AND mcrypt?
2- What is the installation procedure? I tried the obvious ./configure 
 make combination but to no avail ...

Thanks!

Jc


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



[PHP] Re: Execute at a defined time

2003-02-05 Thread Jean-Christian Imbeault
Do a man crontab to get info.

Or Google for turotials on how to use cron.

Also make sure that PHP is available from the command line. Do a simple 
test, on the command line type:

php --version

If you get version iformation as output the PHP is installed for command 
line useage and will work with cron.

Miguel BrĂ¡S wrote:
Hi,

I was looking on PHP manual but didn't find anything about it.

How can I execute a script all days at the same time? I kno i must have
access to the CRON of the system, but don't know what function should I use
to make this happen (run the script).

Miguel





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




Re: [PHP] mcrypt installation problems

2003-02-05 Thread Jean-Christian Imbeault
Adam Voigt wrote:

Download MCRYPT SRC.
tar -zxf mcrypt.tar.gz
cd mcrypt
./configure --prefix=/usr/local/mcrypt


From the commands you give you imply that libmcrypt is not needed. Are 
you sure?

The configure command you give does not work.

Here's the complete error:

[root@host110 mcrypt-2.6.3]# ./configure --prefix=/usr/local/mcrypt
[delete configure messages ...]
checking for libmcrypt - version = 2.5.0... no
*** Could not run libmcrypt test program, checking why...
*** The test program compiled, but did not run. This usually means
*** that the run-time linker is not finding LIBMCRYPT or finding the wrong
*** version of LIBMCRYPT. If it is not finding LIBMCRYPT, you'll need to 
set your
*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
*** to the installed location  Also, make sure you have run ldconfig if that
*** is required on your system
***
*** If you have an old version installed, it is best to remove it, although
*** you may also be able to get things to work by modifying LD_LIBRARY_PATH
***
configure: error: *** libmcrypt was not found


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



Re: [PHP] mcrypt installation problems

2003-02-05 Thread Jean-Christian Imbeault
Tom Rogers wrote:


I did it this way
untar libmcrypt and mcrypt into /usr/src
then in libmcrypt
./configure --prefix=/usr (could be /usr/local if you want
make
make install
ldconfig
cd ../mcrypt-2.6.3


Up to here fine.


./configure --prefix=/usr


configure: error: You need at least libmhash 0.8.15 to compile this 
program. http://mhash.sf.net/;

Hum ... the PHP manual nor the mcrypt web site mentionned the need for 
mhash 

Do I really need it?

Jc


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



Re: [PHP] mcrypt installation problems

2003-02-05 Thread Jean-Christian Imbeault
Jason Sheets wrote:


You need only libmcrypt, mcrypt is a command line program that is
intended to replace the Unix crypt program.

To build the mcrypt binary you need mhash and libmcrypt, for PHP unless
you want mhash you need only libmcrypt.


Ok, so to build mcrypt support into PHP I only need libmcrypt ... that's it?

I can compile and install that with no errors. But when I try and 
compile PHP I get this big long error error ... Any hints??

gcc  -Iext/mcrypt/ -I/usr/src/php-4.3.0/ext/mcrypt/ -DPHP_ATOM_INC 
-I/usr/src/php-4.3.0/include -I/usr/src/php-4.3.0/main 
-I/usr/src/php-4.3.0 -I/usr/src/php-4.3.0/Zend 
-I/usr/local/psql//include -I/usr/src/php-4.3.0/ext/xml/expat 
-I/usr/src/php-4.3.0/TSRM  -g -O2  -c 
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c -o ext/mcrypt/mcrypt.o   echo  
ext/mcrypt/mcrypt.lo
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:229:1: warning: MCRYPT_FAILED 
redefined
In file included from /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:34:
/usr/local/include/mcrypt.h:31:1: warning: this is the location of the 
previous definition
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c: In function `zm_startup_mcrypt':
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:279: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:280: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:281: `MCRYPT_BLOWFISH_128' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:281: (Each undeclared identifier 
is reported only once
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:281: for each function it appears 
in.)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:282: `MCRYPT_BLOWFISH_192' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:283: `MCRYPT_BLOWFISH_256' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:284: `MCRYPT_BLOWFISH_448' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:285: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:286: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:287: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:288: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:289: `MCRYPT_IDEA' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:290: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:291: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:292: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:293: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:294: `MCRYPT_RC2_128' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:295: `MCRYPT_RC2_256' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:296: `MCRYPT_RC2_1024' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:297: `MCRYPT_RC4' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:298: `MCRYPT_RC6_128' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:299: `MCRYPT_RC6_192' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:300: `MCRYPT_RC6_256' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:301: `MCRYPT_SAFER_64' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:302: `MCRYPT_SAFER_128' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:303: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:304: `MCRYPT_SERPENT_128' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:305: `MCRYPT_SERPENT_192' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:306: `MCRYPT_SERPENT_256' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:307: `MCRYPT_TWOFISH_128' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:308: `MCRYPT_TWOFISH_192' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:309: `MCRYPT_TWOFISH_256' 
undeclared (first use in this function)

Re: [PHP] mcrypt installation problems

2003-02-05 Thread Jean-Christian Imbeault
Tom Rogers wrote:


Looks that way :)
I also have that in /usr/src and in php as

--with-mhash=/usr/src/mhash-0.8.17


Still no go. Did you compile into php 4.3.0? I finally got libmcrypt, 
mhash and mcrypt to make and install, but can't get PHP to work with 
--with-mcrypt OR --with-mcrypt=/usr/local OR --with-mcrypt=../mcrypt-2.6.3/

I get this big compile error:

gcc  -Iext/mcrypt/ -I/usr/src/php-4.3.0/ext/mcrypt/ -DPHP_ATOM_INC 
-I/usr/src/php-4.3.0/include -I/usr/src/php-4.3.0/main 
-I/usr/src/php-4.3.0 -I/usr/src/php-4.3.0/Zend 
-I/usr/local/psql//include -I/usr/src/php-4.3.0/ext/xml/expat 
-I/usr/src/php-4.3.0/TSRM  -g -O2  -c 
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c -o ext/mcrypt/mcrypt.o   echo  
ext/mcrypt/mcrypt.lo
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:229:1: warning: MCRYPT_FAILED 
redefined
In file included from /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:34:
/usr/local/include/mcrypt.h:31:1: warning: this is the location of the 
previous definition
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c: In function `zm_startup_mcrypt':
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:279: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:280: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:281: `MCRYPT_BLOWFISH_128' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:281: (Each undeclared identifier 
is reported only once
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:281: for each function it appears 
in.)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:282: `MCRYPT_BLOWFISH_192' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:283: `MCRYPT_BLOWFISH_256' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:284: `MCRYPT_BLOWFISH_448' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:285: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:286: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:287: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:288: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:289: `MCRYPT_IDEA' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:290: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:291: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:292: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:293: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:294: `MCRYPT_RC2_128' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:295: `MCRYPT_RC2_256' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:296: `MCRYPT_RC2_1024' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:297: `MCRYPT_RC4' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:298: `MCRYPT_RC6_128' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:299: `MCRYPT_RC6_192' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:300: `MCRYPT_RC6_256' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:301: `MCRYPT_SAFER_64' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:302: `MCRYPT_SAFER_128' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:303: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:304: `MCRYPT_SERPENT_128' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:305: `MCRYPT_SERPENT_192' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:306: `MCRYPT_SERPENT_256' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:307: `MCRYPT_TWOFISH_128' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:308: `MCRYPT_TWOFISH_192' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:309: `MCRYPT_TWOFISH_256' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:310: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from 

[PHP] Re: mcrypt installation problems

2003-02-05 Thread Jean-Christian Imbeault
I fixed my problem.

For archive purposes (as of PHP 4.3.0), to install mcrypt support you 
only need to install libmcrypt. No need for mcrypt, or mhash ... forget 
anything else you might read.

The installation problem I had was indeed a bug in PHP which I am happy 
to say is fixed in the latest CVS STABLE snapshot.

Jc


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



[PHP] Last error: how to get?

2003-01-29 Thread Jean-Christian Imbeault
Is there a simple way for me to programmatically know if an error has 
occurred during my script? (besides from writing a custom error handler?)

I want to be able to know at the end of my script if any errors where 
thrown and then show a simple message. I know that if the error is fatal 
my script won't run to completion but that is ok as a fatal error in 
this case should be fatal.

Is there some function like get_last_error()?

Thanks,

Jc


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



[PHP] Accessing $php_errmsg give an error ...

2003-01-29 Thread Jean-Christian Imbeault
I am trying to access the last error message using the superglobal 
$php_errmsg. But trying to acess that var gives a not defined error ...

Running this script gives me:

?php
ini_set(track_errors, true);
error_reporting (E_ALL);

$a = $php_errmsg;
die;
?

Notice: Undefined variable: php_errmsg in err.php on line 5

What am I doing wrong?

Thanks,

Jc


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



[PHP] Re: Accessing $php_errmsg give an error ...

2003-01-29 Thread Jean-Christian Imbeault
My mistake, spelling sold be php_error,sg.

Jc


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




[PHP] Re: Last error: how to get?

2003-01-29 Thread Jean-Christian Imbeault
Found it, if track_errors is set then the last error is in 
$php_errormsg. However be careful as the variable is initially not set 
and doing a if ($php_errormsg != ) will resultin an error.

Jc


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



[PHP] Installation problem

2003-01-26 Thread Jean-Christian Imbeault
I've installed PHP and Apache countless times but it seems I have 
forgotten something somehow because I can't for the life of me get 
apache to install PHP as a static module. Argh ...!

I'm trying to get PHP 4.3.0, Apache 1.3.27, openssl-0.9.7, 
mod_ssl-2.8.12-1.3.27 all working together but to no avail. The best I 
can get is a mod_ssl aware apache server, but no PHP.

These are the steps I am following. Can anyone spot my error?

# cd openssl-0.9.7
# ./config -no-thread
# cd ..
# cd mod_ssl-2.8.12-1.3.27/
# ./configure --with-apache=../apache_1.3.27/
# cd ../apache_1.3.27/
# ./configure
# cd ../php-4.3.0/
# ./configure --with-pgsql=/usr/local/psql/ --without-mysql 
--with-apache=../apache_1.3.27/ --enable-mbstring 
--enable-mbstr-enc-trans --enable-mbregex
# make  make install
# cd ../apache_1.3.27/
# SSL_BASE=../openssl-0.9.7 ./configure --with-pgsql=/usr/local/pgsql/ 
--without-mysql --prefix=/www 
--activate-module=src/modules/php4/libphp4.a --enable=module=ssl
# make
# make install

I add the following line to httpd.conf and start apache:

AddType application/x-httpd-php .php

But when I try and load a .php page I get a Save File dialog ...

What step did I miss or where did I do something wrong?

Thanks!

Jc



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



[PHP] Re: query caching caching in general

2003-01-23 Thread Jean-Christian Imbeault
Justin French wrote:


anyone got any links to decent tutorials on sql caching, and caching in
general?


A few questions:

At what level do you want the caching?
Are you talking about stored procedures?
Do you mean storing functions in the DB? (some DB's, like PostgreSQL can 
compile functions once and reuse the compiled function).

Let me know where you want the caching to be and maybe I have a link or two.

Jc


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



[PHP] Why PHP doesn't work with Apache2?

2003-01-22 Thread Jean-Christian Imbeault
I don't want to start a flame-war here, just asking for specifics on a 
question I have :)

I know that PHP and Apache 2 (on Linux anyway) have some problems 
working together. I was just wondering, for my own education, why is that?

Is it a problem in Apache 2 or in PHP? (Not that I want to lay blame, 
just wondering).

Can someone point me to some ressource explaining the main points of why 
PHP won't work with Apache 2 just yet?

Thanks.

Jc


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



Re: [PHP] Why PHP doesn't work with Apache2?

2003-01-22 Thread Jean-Christian Imbeault
Henry wrote:

Apache2 now work with php in aspx (PHP is as a module)


Really!? I was sure there were still some issues ...

Jc


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




Re: [PHP] Why PHP doesn't work with Apache2?

2003-01-22 Thread Jean-Christian Imbeault
Henry wrote:

what issues for example?
I do know I can successful install php in module with apache2.0.43 without error messages, also execution was successful
can you tell me what issues did you see?


A successful install means nothing.

My question is basically, does Apache2 work with PHP 100% or is it still 
recommend to use Apache 1.3.27?

If it is still not recommended to use Apache2, why?

If you think Apache2 and PHP work perfectly well together can you point 
me to some info that says so? I can't see anywhere on the PHP web site 
that recommends using Apache2.

Jc


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



Re: [PHP] Why PHP doesn't work with Apache2?

2003-01-22 Thread Jean-Christian Imbeault
Yasin Inat wrote:


it  depends  on  you   your aim  


Ok, to put it more simply,

Are there cases where something would work in Apache 1.3.27 + PHP that 
would break in Apache2 + PHP??

A simple yes or no will suffice.

If the answer is no, I am curious as to why not ...

Thanks,

Jc


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



Re: [PHP] Why PHP doesn't work with Apache2?

2003-01-22 Thread Jean-Christian Imbeault
Rasmus Lerdorf wrote:


Because the server doesn't work very well yet.  There are issues in the 
filter api and you can't really uses a threaded mpm as many of the 
3rd-party libraries that are commonly linked into PHP are simply not 
threadsafe.

Thank you! That's the kind of answer I was looking for.

If I understand correctly PHP will not work correctly because some parts 
of it are not thread-safe.

Is the PHP team working on getting PHP to be thread-safe? Does it look 
promising? Might version 5 be thread-safe?

Thanks again,

Jc


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



Re: [PHP] Why PHP doesn't work with Apache2?

2003-01-22 Thread Jean-Christian Imbeault
Rasmus Lerdorf wrote:


No, you didn't understand correctly.  I specifically said the thread
safety issues were in 3rd party libraries and not in PHP.


Sorry, I thought by 3rd party libraries you meant libraries that PHP is 
dependent upon. Do you mean libraries used by PHP or Apache. And if 
these are libraries used by PHP, do you mean library that as in the 
multi-byte library (i.e. libraries that add functionality to PHP), or do 
you mean C libraries used when compiling PHP.

Why exactly are you asking?  Is there some feature in Apache2 that you
need that is not available in Apache-1.3?


I don't want to move from Apache 1-3 to Apache. I just keep hearing that 
PHP is not ready for Apache2 yet and I wanted to educate myself as to 
why. I don't like just being told something and not understanding the 
reason behind the answer.

So this boils down to Apache2 using threads and PHP not being thread-safe?

And the reason that PHP is not thread-safe is that some 3rd party 
libraries PHP used are not thread-safe.

Now the only two questions I have left are : #1 what those libraries are 
used for. I.e. are they part of PHP or libraries that are used to 
compile PHP?

If they are libraries used to compile PHP, I would assume that Apache2 
must have faced similar issues when going from a forking model to a 
threaded model?

#2 Is there progress being made towards having PHP work with Apache2. 
And who is working on this (if not the PHP team).

Thanks again for the clarifications!

Jc


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



[PHP] php.ini: how to load different ini file depending on host?

2003-01-19 Thread Jean-Christian Imbeault
On my web server (Apache) I have two sites and I would like each site to 
use a different php.ini.

What is the correct way for me to have each site use it's own php.ini 
file? I figure it's a setting in the apache conf file but I can't figure 
out which ...

Thanks,

Jc


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



Re: [PHP] php.ini: how to load different ini file depending on host?

2003-01-19 Thread Jean-Christian Imbeault
Timothy Hitchens ) wrote:

Inside each of the Virtual Host defs you can put most of the php_flag
etc settings just like:



Oops .. I forgot to mention that these two website do *not* have 
different IP addresses. Actually these are two testing website on my 
local LAN.

What I have is to have a different php.ini loaded depending on wether 
the user goes to:

http://192.168.254.1/test1
or
http://192.168.254.1/test2

I had read up on the Virtual Host directives put it didn't seem to be 
applicable ... Could I do the same thing you suggested using the apache 
Directory directive?

Thanks,

Jc


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



Re: [PHP] php.ini: how to load different ini file depending on host?

2003-01-19 Thread Jean-Christian Imbeault
Thanks to everyone for the suggestions. I finally got what I wanted by 
doing it a Directory directive in the httpd.conf file.

Thanks again!

Jc


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



[PHP] Re: upgrading from 4.0.6 to 4.3.0

2003-01-14 Thread Jean-Christian Imbeault
Gamin wrote:


I have currently working a Red Hat 7.2 system that installs PHP 4.0.6
from the CD and it works fine. I want to upgrade to ver 4.3.0  what would be
the simplest way to do this without breaking any of the old modules etc. I
wont mind making changes to my scripts in case of changes between versions.


If your old PHP was automatically installed by RH then just do an rpm 
-e php (maybe rpm-r php-4.0.6. To find out the write string to use to 
rpm -qa | grep php)

Do i need to remove the old PHP installation before building the new one
?


No, if you don't you need to take extra steps. And I can't see why you 
want to keep the old version around anyway.

Would using the configure command that shows in the ? phpinfo() ?
currently (with 4.0.6) work with the ver 4.3.0 ?


Most probably. SO I suggest downloading the 4.3.0 source files and doing 
a ./configure with the options you can from phpinfo() and then compiling :)

Jc


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



Re: [PHP] Trapping PHP errors

2003-01-14 Thread Jean-Christian Imbeault
Michael Sims wrote:


My site has a custom error handler (implemented via set_error_handler)
which sends a nicely formatted email including all of the error
details, a variable dump, the contents of the output buffer before the
error occured, and the contents of a call to debug_backtrace, in
addition to logging the error to a file.


If it's not asking too much would you be willing to share that custome 
error handler you wrote?

I'm in the process of writing one but wouldn't want to re-invent the 
wheel if I didn't have too :)

Jc


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



[PHP] Re: Advanced Search

2003-01-14 Thread Jean-Christian Imbeault
[EMAIL PROTECTED] wrote:





I don't want to have to write 50 different ifelse statements unless I have to.


You can add all the boolean fileds in the query and not worry about 
doing if's to check them, the DB will automatically find the fields that 
match for boolean fields (just make sure to initialize all your booleans 
variables first). So

SELECT p.* FROM properties p WHERE beds = $beds AND pool='$pool' AND 
waterfront='$waterfront' AND [other booleans ...] ORDER
by price asc;

Jc


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



Re: [PHP] calculate the traffic size with php(like the apache

2003-01-10 Thread Jean-Christian Imbeault
I'm not sure what you are trying to do exactly (i haven't been following 
this thread) but if you want to analyze apache web logs try analog. It 
can do everything and is *blazzingly* fast. I use on log file that are 
10 Gb or greater ...

http://www.analog.cx

Jc


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



[PHP] Re: version switch problem

2003-01-10 Thread Jean-Christian Imbeault
You high jacked someone else's thread, probably because you hit the 
reply-to button and just changed the subject line instead of posting a 
new message.

Try posting again, creating a new message this time. You'll start your 
own thread and will definitely get more answers ...

Jc

Christian Stalberg wrote:
redhat linux 7.3
apache 1.3.27
mysql 3.23.49
php 4.0.4pl1 (static install)
mod_ssl-2.8.12

the box had php 4.2.3 installed on it originally.
we had a mysql application that would only run
with php version 4.0.4pl1 so we installed that
version of php and everything worked.

later we ran autorpm with the 'interactive' setting
(just downloading and not auto installing) and the 
php-dependent application broke. when we run 
debug_phpinfo it says version 4.2.3. we have 
reinstalled php version 4.0.4pl1 and 
debug_phpinfo still says version 4.2.3 and the app. 
remains broken. yes we copied the php.ini file 
after the reinstall of the old version

we checked the new php binary and its definitely
version 4.0.4pl1. we're pulling our hair out.
what are we doing wrong/do we have yet to do?

thanks!


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




[PHP] proc_open() problems

2003-01-09 Thread Jean-Christian Imbeault
I've written a script that uses proc_open() to call and external program 
and capture it's output.

My script works fine as long as I call/use it in the directory where it 
resides. But if I try to include() it in a script that resides in 
another folder proc_open() return an exit value of 255. I can't access 
the external program.

What am I missing? Some file perms? I did a chown -R apache * from the 
top directory but that didn't help ...

I'm using the php.ini-recommended file. Is there some setting in there I 
should change?

Jc


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



[PHP] string prints out as number (E+10...), why?

2003-01-09 Thread Jean-Christian Imbeault
I'm passing a var into a function which is a 16 digit number, but when I 
try to print it out I get 1.111E+15 instead of the expected 
11.

Why? How can I change this behaviour?

Jc


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



[PHP] Re: output of calling grep lr

2003-01-09 Thread Jean-Christian Imbeault
If this is for output to a web browser you can use nl2br to changed all 
the line-breaks to BR's ...

Jc


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



Re: [PHP] string prints out as number (E+10...), why?

2003-01-09 Thread Jean-Christian Imbeault
- Edwin wrote:


I guess it's because the number is converted automatically to an exponential notation if it goes over a certain number of digits--makes it easier to read...


I figured as much. But why? I found a solution by changing the precision 
of floats in the php.ini file.

But I still find it strange that PHP will, internally, happily treat my 
variable as a string but when it comes time to print it out, it decides 
that it's a number and formats it without my asking it to.

Jc


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



Re: [PHP] string prints out as number (E+10...), why?

2003-01-09 Thread Jean-Christian Imbeault
- Edwin wrote:



[...]


As you can see, PHP didn't touch the string version...


True. My var is being passed in as a POST var so maybe that has 
something to do with it ...

Jc


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



[PHP] Re: how to make server response to emails

2003-01-09 Thread Jean-Christian Imbeault
I'm not sure how it's done exactly but I think the basic concept is to 
have a daemon running, or have your program run by cron, and have the 
program collect it's mail.

On Linux I think you can get your mail simply by fetching and parsing 
the file /var/spool/mail/username, where username is the name of the 
account unsubscribe requests are mailed to.

But you want a mailing list, use major domo or some other ML spftware 
instead of writing your own.

Jc


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



Re: [PHP] How to detect a PHP script time-out?

2003-01-09 Thread Jean-Christian Imbeault
Tamas Arpad wrote:


There was a discussion about this topic on the dev list, and because of many 
reasons the current functionality of register_shutdown_function() will remain 
the same in future releases too. Joseph Tate is working on a new function 
(apache_register_shutdown_function) to make it possible on apache to use the 
old behavior (Thanks Joseph! :)).

Great! Love you guys! This buggy function is coming in quite handy :)

Jc


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




[PHP] Re: money

2003-01-09 Thread Jean-Christian Imbeault
Wilbert Enserink wrote:


I wanrt to display amounts like 2 products a ? 6,25 = ? 12,50

Whatever I try I can't get the comma there (it's showing a point . and it doesn't display the second number behind the comma i.e. 12.5


Show us some code and maybe we can help. If you don't give any code we 
have no idea what you are doing wrong.

Jc


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



  1   2   3   >