[PHP] Manage link.

2003-12-18 Thread Vincent M.
Hello, Is there any way to manage links in an array and transform them. For example, I have this text in the database: --- Software Support Media, produc-ers of the International PHP Conference, are pleased to announce a new monthly version of their print publication. For more information, you

Re: [PHP] Manage link.

2003-12-18 Thread Vincent M.
This one is perfect: $text = preg_replace( /(?!a href=\)((http|ftp)+(s)?:\/\/[^\s]+)/i, a style=\text-decoration:underline\ href=\\\0\URL/a, $text ); :D Evan Nemerson wrote: On Thursday 18 December 2003 01:37 pm, Vincent M. wrote: Hello, Is there any way to manage links in an array

[PHP] Function disabled.

2003-11-21 Thread Vincent M.
Hello, How to test if a function has been disabled. I tried doing this: if(function_exists(rmdir)) { echo rmdir Function exists ; } else { echo rmdir Function DOES NOT exists ; } So the test says that the function exists, but if we use it, I get: rmdir() has been disabled for security

[PHP] Usort an array.

2003-11-20 Thread Vincent M.
Hello, I have an array like that: $return[0][photo] = monuments_01.jpg $return[1][photo] = monuments_00.jpg $return[2][photo] = monuments_03.jpg $return[3][photo] = monuments_02.jpg $return[4][photo] = monuments_04.jpg If I use the sort function: sort($return) ; I get:

[PHP] rmdir withour rmdir function.

2003-11-17 Thread Vincent M.
Hello, I can't use the function rmdir: Warning: rmdir() has been disabled for security reasons But I do need to delete a directory with php. How can I do ? Is there any way to delete an empty directory without using the rmdir function ? I tried to use the unlink function on the directory, but

Re: [PHP] rmdir withour rmdir function.

2003-11-17 Thread Vincent M.
I'm not lucky, there is no ftp access to the server. This can sound a little strange, but there is no... :( Marek Kilimajer wrote: ftp_rmdir() Vincent M. wrote: Hello, I can't use the function rmdir: Warning: rmdir() has been disabled for security reasons But I do need to delete a directory

Re: [PHP] Unzip a file.

2003-11-16 Thread Vincent M.
Kim Steinhaug wrote: on phpclasses.org there is a ZIP class that does all you need to do. Havnt got the time to give you the url right now, but look there. All I found are classes to extract tar/gzip files: http://www.phpclasses.org/search.html?words=zipgo_search=1restrict=method=andsort=score Is

[PHP] Unzip a file.

2003-11-15 Thread Vincent M.
Hello, Is there an easy way to unzip a zipped file which contains files (images), using a function from the zlib or any. To something like that: exec(unzip zipfile.zip -d /path/to/images) ; But without using the exec function. Thanks, Vincent. -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] ls as function.

2003-11-13 Thread Vincent M.
John Nichel wrote: Chris Shiflett wrote: --- Marek Kilimajer [EMAIL PROTECTED] wrote: So, i am looking for a function which return the result of the unix shell command: ls mydir/name* www.php.net/glob I think you read that question wrong, or else I am. :-) Try the second user note on this

[PHP] ls as function.

2003-11-12 Thread Vincent M.
Hello, Is there any function to do: $thumb = exec(ls $dir/name*) ; without using the exec function and without making a while: $direc_src_obj = dir($dir) ; while($entry=$direc_src_obj-read()) { ... } So, i am looking for a function which return the result of the unix shell command: ls

[PHP] Calling a function.

2003-09-12 Thread Vincent M.
Hello, Is there any way to call a function with a variable inside the call. ie: if($preferences != ) { dis_display$$preferences() ; } If $preferences = menus this will call the function dis_displaymenus() Thanks, Vincent. -- PHP General Mailing List (http://www.php.net/) To

[PHP] Downloading a file.

2003-06-11 Thread Vincent M.
Hello, To download a file after a form like that: form name=download action=downloadit.php method=post Do you want to download? /form If he wants to download, in the file downloadit.php, there is: header(Content-type: application/octet-stream\n); header(Content-Disposition: attachment;

[PHP] How to secure a download ?

2003-05-31 Thread Vincent M.
Hello, Is there any way to launch a download of a Zip file to the user without a link. The user must not know where the file is on the server. The transfert of the file must be made by a php file with special headers, no ? header(Content-type: zip); or something... Thanks. -- PHP General

[PHP] So many functions!

2003-04-02 Thread Vincent M.
Hello, There so many functions in php that I can't find the one I need. I have a table like that: $lang[english][category]= Category ; $lang[english][backpage]= Go to the back page ; $lang[english][nextpage]= Go to the next page ; ... $lang[francais][category]= Catégorie ;

[PHP] Protecting Code source.

2003-03-27 Thread Vincent M.
Hello, I'd like to sell an application to 24$ US and I have to protect my source code. But I don't want to make my customer install anything on the server to be able to run my application. So the Zend encoder seems good for me: http://www.zend.com/store/products/zend-encoder.php Or, make it

Re: [PHP] Protecting Code source.

2003-03-27 Thread Vincent M.
John Wards wrote: On Thursday 27 Mar 2003 7:31 pm, Vincent M. wrote: The only trouble is the price (960$), it's a little expensive for the student I am :-/ Does anyone know any other less expensive way to protect my source code ? http://www.ioncube.com/ They have a web based version that you

Re: [PHP] Test the server.

2003-03-22 Thread Vincent M.
Sebastian wrote: put this in a .php file: ?php phpinfo(); ? it'll tell you what OS, (usually) check if safe mode is on.. if it's on then usually you can't exec anything. cheers, - Sebastian Yes I know but my aim is to make a php script which checks automaticly if the php and the shell functions I

[PHP] Test the server.

2003-03-21 Thread Vincent M.
Hello, Is there anyway to check these two things: - If the server is an Unix server. - If a command is available on the server. For exemple, I need to test if the shell command unzip is avalaible to do: exec(unzip ...something...) ; So I can test if exec is available doing:

[PHP] Zip Way of life.

2003-03-19 Thread Vincent M.
Hello, I'd like to uncompress to the Hard disk a zip file send by the browser. At this time I do this: function uncompresszip($zipfile) { copy($zipfile, dirname($_SERVER['PATH_TRANSLATED'])./zip/zipfile.zip) ; } But I do not understand how to uncompress the zip file, I tried for exemple:

Re: [PHP] Zip Way of life.

2003-03-19 Thread Vincent M.
Marek Kilimajer wrote: readgzfile is for *.gz files. Either use zip file functions (rarely supported) or PclZip (http://www.phpconcept.net/pclzip/index.en.php) No, it works with .zip files too, I just don't know how to manage it :-( -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Zip Way of life.

2003-03-19 Thread Vincent M.
David T-G wrote: Vincent, et al -- ...and then Vincent M. said... % % Marek Kilimajer wrote: % readgzfile is for *.gz files. ... % No, it works with .zip files too, I just don't know how to manage it :-( You mentioned wanting the files (note the plural) in the zip file. AFAIK gunzip can unzip

Re: [PHP] Zip Way of life.

2003-03-19 Thread Vincent M.
Daevid Vincent wrote: You could use the exec() or shell_exec() and just do it via command line method... Yes but gunzip does not work when there are more than one file in the zip file and unzip is not installed by default on Unix servers. :-( -- PHP General Mailing List (http://www.php.net/)

[PHP] Searching for a file.

2003-03-17 Thread Vincent M.
Hello, I am looking for a way to search a file knowing the beginig of his name. For exemple, I know that the file I am looking for is: montreal_13_120.jpg But I just know: montreal_13 And I can't know _120.jpg So at this time I did this: $dirthumbs = $dir./thumbs ; $direc_src_obj2 =

[PHP] HTTP_POST_VARS empty!

2003-03-12 Thread Vincent M.
Hello, I don't understand this code empty my HTTP_POST_VARS variable: if ((get_magic_quotes_gpc() == 1)) { switch ($REQUEST_METHOD) { case POST: while (list ($key, $val) = each ($HTTP_POST_VARS)) { $$key = stripslashes($val); } break; case GET: while (list ($key, $val)

[PHP] Re: HTTP_POST_VARS empty!

2003-03-12 Thread Vincent M.
Vincent M. wrote: Vincent M. wrote: Hello, I don't understand this code empty my HTTP_POST_VARS variable: if ((get_magic_quotes_gpc() == 1)) { switch ($REQUEST_METHOD) { case POST: while (list ($key, $val) = each ($HTTP_POST_VARS)) { $$key = stripslashes($val); } break

[PHP] Easy Way.

2003-03-09 Thread Vincent M.
Hello, Is there an easy way to change an integer to a 5 caracters string. For example: $i = 3 ; $j = 110 ; After having changed them: $i = 3 ; $j = 00110 ; Is there a php function to do so instead of doing this: if( ($i0)($i10)) { $i = .$i ; } else if( ($i9)($i100)) {

Re: [PHP] Easy Way.

2003-03-09 Thread Vincent M.
Jason Sheets wrote: Hello, Use str_pad, the manual page is available at http://www.php.net/str_pad, a short example would be: $i = 3; $i = str_pad($i, 5, 0, STR_PAD_LEFT); This function is described in the PHP manual in the string functions section, the manual is an excellent place to go first

[PHP] Global VARS.

2003-03-07 Thread Vincent M.
Hello, To get ride of magic_quotes I do: function no_magicquotes() { global $HTTP_GET_VARS ; global $HTTP_POST_VARS ; global $HTTP_COOKIE_VARS ; if (get_magic_quotes_gpc()) { // Overrides GPC variables for (reset($HTTP_GET_VARS); list($k, $v) = each($HTTP_GET_VARS); ) $$k =

[PHP] define variables.

2003-03-05 Thread Vincent M.
Hello, I do a lot of define like that: define (_LANG1, Server options); define (_LANG1, Manage your system); etc... And stuff like that: if($num == 1) { $mgs = _LANG1 ; }else if($num == 2) { $mgs = _LANG2 ; } etc... But I do want to avoid all these if and else, is there a way to do

Re: [PHP] define variables.

2003-03-05 Thread Vincent M.
Jason K Larson wrote: http://www.php.net/manual/en/function.constant.php $msg = constant('_LANG'.$num); HTH, -- Jason k Larson Strange it does not work if I do: $num = _LANG.$num ; $msg = constant($num) ; echo $mgs ; //It does not display anything! But If I do it directly, it works: $num

[PHP] Re: Php and JavaScript

2003-03-02 Thread Vincent M.
Valentin wrote: Hi, Is any way to write JavaScript code into PHP function or to send PHP's variables values to the JScript variables? Thanks, Of course, you can create dynamicaly javascript via php, ie: echo script language=\JavaScript\ var yourvar = $onephpvar ; /script ; Is that what you

[PHP] Re: Php and JScript

2003-03-02 Thread Vincent M.
Valentin wrote: Hi, Is any way to write JavaScript code into PHP function or to send PHP's variables values to the JScript variables? Thanks, Yes, I think there is a way to do so! ;-) Vincent. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] 2 questions !

2003-03-01 Thread Vincent M.
Hello, I didn't find in the doc how to: - Know the full path of the current directory. Like /var/www/to/the/path - Know under which user work apache, to know when I create a file whose file it is... Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] Re: 2 questions !

2003-03-01 Thread Vincent M.
Greg Beaver wrote: Vincent M. [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, I didn't find in the doc how to: - Know the full path of the current directory. Like /var/www/to/the/path try using dirname(__FILE__) or dirname($_SERVER['PATH_TRANSLATED']) dirname($_SERVER

[PHP] What ?

2003-03-01 Thread Vincent M.
Hello, I am the bus stop boy. The business I was talking about is an php gallery editor. You can see mine in action here: My photos of Montreal: http://www.siova.net/photos/index.php?type=mtlimg=mtl_diapo=0pref_size=512version=2 My photos of Toulouse, the city I was born in:

[PHP] Sessions and phplib.

2003-02-17 Thread Vincent M.
Hello, I am using the phplib just for the sessions management and unfortunately this projects seems dead (no?), no official realise using the php4 session support. What's more, i am looking for a sessions library which could check the IP adress of users not only the cookie. In case of bad hats

[PHP] Resizing a png tranparent image.

2002-12-28 Thread Vincent M.
Hello, I am trying to resize a png file, my autograph ;-) Good result thanks to gimp: http://boxfly.free.fr/test/test1.jpg Bad result with php: http://boxfly.free.fr/test/test2.jpg This is my PHP code to resize the autograph: $newAuto = imagecreatetruecolor( $widthImgAu, $heightImgAu) ;