[PHP] Re: Problem with include PHP 4.3.0 (Fixed)
I wrote : I have problems with relative paths and 4.3.0. Include() do not seem to work the same way in 4.3.0 and 4.2.1. This is mostly due to a characteristic of Solaris and a minor change in the way PHP handles includes (I guess): 1) Before parsing a script, PHP sets the directory of this script as the working dir. In pathnames and include_paths, '.' represents this directory, and '..' its parent, but PHP needs to getcwd in order to use them. On Solaris, getcwd() needs r access to _all_ directories of the path, otherwise you get (from man getcwd): EACCESA parent directory cannot be read to get its name. It's not a bug, but a feature (seems strange to me). 2) If PHP can't find an included file in any directory of include_path, it tries the directory of the main script in 4.2.1, and that of the including file in 4.3.0 (I guess that from my tests). On my server, a directory of the script path was not readable by the user the server runs under. I fixed it, and now PHP is able to include the requested file by way of '..' in include_path. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] session lost after window close
I have problem with session in MS IE. When I open new window from main window and then I close this window, in parent window are lost all session variables. Libor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Different dates with lmost same script
Hi, I have 2 pages that shows a table contents On one, it shows the title and date with the following script ** ? // includes include(../regulations/conf.php); include(../regulations/functions.php); // abre ligação à base de dados $connection = mysql_connect($host, $user, $pass) or die (Erro de execução. Informe-nos sobre a situação!); // escolhe a base de dados mysql_select_db($db) or die (Erro de execução. Informe-nos sobre a situação!); // gera e executa o pedido SQL $query = SELECT * FROM noticias ORDER BY id DESC LIMIT 6; $result = mysql_query($query) or die (Erro no pedido: $query. . mysql_error()); // se algum registo if (mysql_num_rows($result) 0) { // iterate através do conj resultados // print titulo dos artigos while($row = mysql_fetch_object($result)) { ? tr td width=7% align=leftfont size=1 face=Arialimg border=0 src=images/ez1.jpg width=18 height=16/font/td td width=7% align=left/td td width=51% align=left font color=#808080 size=1 face=Ariala href=http://www.ivao-pt.org/noticias/;? echo $row-titulo; ?/font/a/td td width=35% align=left p align=leftfont color=#808080 size=1 face=Arial ? echo formatDate ($row-timestamp); ?/font/td /tr tr td width=100% align=left colspan=4br /td /tr ? } } else { ? p align=centerfont size=1 face=Arial color=#4F547ANenhuma notícia disponível!/font/p ? } // fecha ligação à base de dados mysql_close($connection); ? * functions.php script ? // format MySQL DATETIME value into a more readable string function formatDate($val) { $arr = explode(/, $val); return date(d/m/y, mktime(0,0,0, $arr[1], $arr[2], $arr[0])); } ? * On the other one, besides showing date and title, it shows also the text, autor and some other stuff almost with same code The problem is that on the one where only the title and date are shown, he gives me always the same date, no matter if i posted yesterday or today. The date is always 30/11/02 On the more detailed page, the date is shown correctly, today's date if posted today, yesterday's date if posted yesterday. Any idea for that? I checked the table, and the date is correct...i don't know what else to do Miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: problems with ==?
Peter Gumbrell wrote: In the following code $view = $HTTP_GET_VARS[view]; print $view; if ($view == vendor) { code here } print $view produces 'vendor' but the if statement in the next section isn't being triggered. Can anyone see what is wrong here? I have tried double quotes, single quotes and no quotes around 'vendor' but none of them work. You forgot the qoutes around the array argument: $HTTP_GET_VARS[view] should be $HTTP_GET_VARS['view']. -Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] empty variables from a form
- Original Message - From: Erich Beyrent [EMAIL PROTECTED] To: Sunfire [EMAIL PROTECTED] hi.. how would you test for an empty (unused) variable from a form.. i have a phone number split into 3 different vairiables and want to test to see if they were used in the form before displaying either the phone number itself or just leaving it out of the display... what code would be good to test it with.. the variables are $ac2 $ext2 and $num2 Use the isset() function: if(isset($ac2)) and if(isset($ext2)) and if(isset($num2)) { do something } else { do something else } Eesh! I think you mean: if (isset($ac2) isset($ext2) isset($num2)) { do something } And, depending on what sort of form field it is, isset() might not be a very good test anyway! Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dynamic input fields in Form
Hi, Does anyone have a working example or a hint in the right direction for the following; I have a form where the user selects for example; how many cars you have: 4. Then it most dynamicly create 4 input fields (with different names) in the form where they can fill in the car brand and also a field for the car type. Many thanks for helping me out! Thanks, Frank -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] dynamic form input fields
Hi, Does anyone have a working example or a hint in the right direction for the following; I have a form where the user selects for example; how many cars you have: 4. Then it most dynamicly create 4 input fields (with different names) in the form where they can fill in the car brand and also a field for the car type. Many thanks for helping me out! Thanks, Frank -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Dynamic input fields in Form
Hi Frank, I have a form where the user selects for example; how many cars you have: 4. Then it most dynamicly create 4 input fields [...] Using only PHP, you'll have to make this a two-step process where page 1 collects the number of cars and posts to page 2, which generates the form accordingly. If is has to be done on the same page, you'll need to call a Javascript function every time the number of cars changes. That function will have to add or remove inputs from the form depending on the number of cars entered, and of course the whole page will break completely for anyone without Javascript. I'd make it a two-step process myself, it's considerably more robust and offers considerably less room for problems (what happens if I claim I have five cars, fill out their details, and then change it to three cars? which details do you get rid of?) Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Powerpoint presentations?!?
I've been asked to write code that will dynamically generate Microsoft Powerpoint presentations. It has to assemble collections of pages, and possibly substitute a word or phrase here and there (mailmerge style). There doesn't seem to be a published document describing Powerpoint file format or capabilities. The only generation tool I can find is a sourceforge.net project that has no files. The only conversion tools I can find convert FROM powerpoint, not TO it. a French company www.arpege.tm.fr has made a software called Soprano which uses this scenario : - you create powerpoint files with variables embedded into something like %myvariable1% %mypicture% etc - their program replace the variables with data from a database. (It is used to animate elections shows) So it is possible, but I don't know how they did that. I don't think they will give you the tip. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] looking for php mailing-list in chinese language
I'm sorry for my english if you know mailing-list about php in Chinese language, please let me know! thanks! Yang Zhaori
RE: [PHP] empty and isset
-Original Message- From: Sunfire [mailto:[EMAIL PROTECTED]] Sent: 06 February 2003 21:27 actually so does empty end up testing true on an empty var... thats because empty thinks or string(0) is actually a string just blank... a trick to do with empty is use !empty which will say if the string is at least 1 char long other wish if it is less than 1 char long even though a string does exist then it must be empty.. because: if(empty(var)){ echo its blank;//eek doesnt work cuz string does exist }else{ echo something in there;//defaults regardless string(0) //is a string so above block will never be used //im sort of confused because: if(!empty(var)){ echo something in there;//it works for a wierd reason }else{ echo its blank//works if string(0) or null exists } its strange that !empty will always return a 0 char string/null as false but empty it doesnt care its always true regardless... any reason for that? cuz im confused as to why you have to use !empty instead of empty OK, let's set some of this confusion to rest: isset($x) will be TRUE if $x *both*: - exists as a variable in the current scope (even if it has not yet been assigned a value, as might happen if you use a var or global declaration). - is not NULL empty($x) will be TRUE if $x is *any* of the following: - a non-existent variable (in the current scope) - NULL - a numeric 0 (or 0.0) - the empty string () or the string 0 - an empty array is_null($x) is the same as !isset($x), except that is_null() produces an undefined variable notice if $x does not exist (which you will not see if your error_reporting is set not to display notices, or if you suppress it with @). and finally, if($x) is the same as if(!empty($x)), except that if($x) will also produce an undefined variable notice. This is all defined in the online manual, although it's sometimes a bit hard to digest. There's also a great little set of tables that may help you visualize things better at http://www.blueshoes.org/en/developer/php_cheat_sheet/ Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] 4.0.6 to 4.3.0
Any thoughts as to why this snippet: 25: if ($attach != none) 26: { 27:$file = fopen($attach, r); 28:$contents = fread($file, $attach_size); 29:$encoded_attach = chunk_split(base64_encode($contents)); 30:fclose($file); would produce these errors: Warning: fread(): supplied argument is not a valid stream resource in /usr/virtual/share/pkgs/installed/aeromail/1.40/aeromail/send_message.php on line 28 Warning: fclose(): supplied argument is not a valid stream resource in /usr/virtual/share/pkgs/installed/aeromail/1.40/aeromail/send_message.php on line 30 After upgrading from 4.0.6 to 4.3.0 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: 4.0.6 to 4.3.0
Yes, see http://www.php.net/manual/en/language.variables.predefined.php You should use $attach = $_GET['attach']; before if it's comming from an URI or $_POST or $_SESSION or $_COOKIE... -- Regards. M.CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com Hébergement de sites internets. Brian V Bonini [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Any thoughts as to why this snippet: 25: if ($attach != none) 26: { 27:$file = fopen($attach, r); 28:$contents = fread($file, $attach_size); 29:$encoded_attach = chunk_split(base64_encode($contents)); 30:fclose($file); would produce these errors: Warning: fread(): supplied argument is not a valid stream resource in /usr/virtual/share/pkgs/installed/aeromail/1.40/aeromail/send_message.php on line 28 Warning: fclose(): supplied argument is not a valid stream resource in /usr/virtual/share/pkgs/installed/aeromail/1.40/aeromail/send_message.php on line 30 After upgrading from 4.0.6 to 4.3.0 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Why is function imagecreatefromjpeg() undefined in PHP 4.3 when GD is enabled and imagecreatefrompng() id defined? A bug?
Hi, Why is function imagecreatefromjpeg() undefined in PHP 4.3 when GD is enabled and imagecreatefrompng() id defined? Is it a bug? Or? My ISP config: System Linux titan 2.4.18-3 #1 Thu Apr 18 07:37:53 EDT 2002 i686 Build Date Jan 24 2003 19:35:29 Configure Command './configure' '--with-mysql' '--with-apxs' '--with-zlib' '--with-bz2' '--with-gd' '--with-gettext' '--with-pgsql' Server API Apache Virtual Directory Support disabled Configuration File (php.ini) Path /usr/local/lib/php.ini PHP API 20020918 PHP Extension 20020429 Zend Extension 20021010 Debug Build no Thread Safety disabled Registered PHP Streams php, http, ftp, compress.bzip2, compress.zlib Regards, Sumarlidi E. Dadason SED - Graphic Design E-mail: [EMAIL PROTECTED] website: www.sed.is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Why is function imagecreatefromjpeg() undefined in PHP 4.3 when GD is enabled and imagecreatefrompng() id defined? A bug?
You need to install jpeg-6bftp://ftp.uu.net/graphics/jpeg/ and dd --with-jpeg-dir=DIR. -- Regards. M.CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com Hébergement de sites internets. Sed [EMAIL PROTECTED] a écrit dans le message de news: 000901c2ceb3$90746450$[EMAIL PROTECTED] Hi, Why is function imagecreatefromjpeg() undefined in PHP 4.3 when GD is enabled and imagecreatefrompng() id defined? Is it a bug? Or? My ISP config: System Linux titan 2.4.18-3 #1 Thu Apr 18 07:37:53 EDT 2002 i686 Build Date Jan 24 2003 19:35:29 Configure Command './configure' '--with-mysql' '--with-apxs' '--with-zlib' '--with-bz2' '--with-gd' '--with-gettext' '--with-pgsql' Server API Apache Virtual Directory Support disabled Configuration File (php.ini) Path /usr/local/lib/php.ini PHP API 20020918 PHP Extension 20020429 Zend Extension 20021010 Debug Build no Thread Safety disabled Registered PHP Streams php, http, ftp, compress.bzip2, compress.zlib Regards, Sumarlidi E. Dadason SED - Graphic Design E-mail: [EMAIL PROTECTED] website: www.sed.is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Why is function imagecreatefromjpeg() undefined in PHP 4.3 when GD is enabled and imagecreatefrompng() id defined? A bug?
Typos: You need to install jpeg-6b ftp://ftp.uu.net/graphics/jpeg/ and then add --with-jpeg-dir=DIR on your configure line. Regards. M.CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com Hébergement de sites internets. - Original Message - From: [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Friday, February 07, 2003 3:14 PM Subject: Re: Why is function imagecreatefromjpeg() undefined in PHP 4.3 when GD is enabled and imagecreatefrompng() id defined? A bug? You need to install jpeg-6bftp://ftp.uu.net/graphics/jpeg/ and dd --with-jpeg-dir=DIR. -- Regards. M.CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com Hébergement de sites internets. Sed [EMAIL PROTECTED] a écrit dans le message de news: 000901c2ceb3$90746450$[EMAIL PROTECTED] Hi, Why is function imagecreatefromjpeg() undefined in PHP 4.3 when GD is enabled and imagecreatefrompng() id defined? Is it a bug? Or? My ISP config: System Linux titan 2.4.18-3 #1 Thu Apr 18 07:37:53 EDT 2002 i686 Build Date Jan 24 2003 19:35:29 Configure Command './configure' '--with-mysql' '--with-apxs' '--with-zlib' '--with-bz2' '--with-gd' '--with-gettext' '--with-pgsql' Server API Apache Virtual Directory Support disabled Configuration File (php.ini) Path /usr/local/lib/php.ini PHP API 20020918 PHP Extension 20020429 Zend Extension 20021010 Debug Build no Thread Safety disabled Registered PHP Streams php, http, ftp, compress.bzip2, compress.zlib Regards, Sumarlidi E. Dadason SED - Graphic Design E-mail: [EMAIL PROTECTED] website: www.sed.is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Why is function imagecreatefromjpeg() undefined in PHP 4.3 when GD is enabled and imagecreatefrompng() id defined? A bug?
So, why is this function not included in GD like imagecreatefrompng()? Can this be just bad configuration at my Administrator behalf? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 7. febrúar 2003 14:15 To: [EMAIL PROTECTED] Subject: [PHP] Re: Why is function imagecreatefromjpeg() undefined in PHP 4.3 when GD is enabled and imagecreatefrompng() id defined? A bug? You need to install jpeg-6bftp://ftp.uu.net/graphics/jpeg/ and dd --with-jpeg-dir=DIR. -- Regards. M.CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com Hébergement de sites internets. Sed [EMAIL PROTECTED] a écrit dans le message de news: 000901c2ceb3$90746450$[EMAIL PROTECTED] Hi, Why is function imagecreatefromjpeg() undefined in PHP 4.3 when GD is enabled and imagecreatefrompng() id defined? Is it a bug? Or? My ISP config: System Linux titan 2.4.18-3 #1 Thu Apr 18 07:37:53 EDT 2002 i686 Build Date Jan 24 2003 19:35:29 Configure Command './configure' '--with-mysql' '--with-apxs' '--with-zlib' '--with-bz2' '--with-gd' '--with-gettext' '--with-pgsql' Server API Apache Virtual Directory Support disabled Configuration File (php.ini) Path /usr/local/lib/php.ini PHP API 20020918 PHP Extension 20020429 Zend Extension 20021010 Debug Build no Thread Safety disabled Registered PHP Streams php, http, ftp, compress.bzip2, compress.zlib Regards, Sumarlidi E. Dadason SED - Graphic Design E-mail: [EMAIL PROTECTED] website: www.sed.is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Why is function imagecreatefromjpeg() undefined in PHP 4.3 when GD is enabled and imagecreatefrompng() id defined? A bug?
It is not included because your didn't installed jpeg lib. GD needs an external lib to work with jpeg, so yes it's an administrator's work. -- Regards. M.CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com Hébergement de sites internets. Sed [EMAIL PROTECTED] a écrit dans le message de news: 000d01c2ceb4$c96f60b0$[EMAIL PROTECTED] So, why is this function not included in GD like imagecreatefrompng()? Can this be just bad configuration at my Administrator behalf? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 7. febrúar 2003 14:15 To: [EMAIL PROTECTED] Subject: [PHP] Re: Why is function imagecreatefromjpeg() undefined in PHP 4.3 when GD is enabled and imagecreatefrompng() id defined? A bug? You need to install jpeg-6bftp://ftp.uu.net/graphics/jpeg/ and dd --with-jpeg-dir=DIR. -- Regards. M.CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com Hébergement de sites internets. Sed [EMAIL PROTECTED] a écrit dans le message de news: 000901c2ceb3$90746450$[EMAIL PROTECTED] Hi, Why is function imagecreatefromjpeg() undefined in PHP 4.3 when GD is enabled and imagecreatefrompng() id defined? Is it a bug? Or? My ISP config: System Linux titan 2.4.18-3 #1 Thu Apr 18 07:37:53 EDT 2002 i686 Build Date Jan 24 2003 19:35:29 Configure Command './configure' '--with-mysql' '--with-apxs' '--with-zlib' '--with-bz2' '--with-gd' '--with-gettext' '--with-pgsql' Server API Apache Virtual Directory Support disabled Configuration File (php.ini) Path /usr/local/lib/php.ini PHP API 20020918 PHP Extension 20020429 Zend Extension 20021010 Debug Build no Thread Safety disabled Registered PHP Streams php, http, ftp, compress.bzip2, compress.zlib Regards, Sumarlidi E. Dadason SED - Graphic Design E-mail: [EMAIL PROTECTED] website: www.sed.is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 7 Feb 2003 14:23:58 -0000 Issue 1869
php-general Digest 7 Feb 2003 14:23:58 - Issue 1869 Topics (messages 134702 through 134724): problems with ==? 134702 by: Peter Gumbrell 134703 by: Martin Towell 134710 by: Seraphim Re: WYSIWYG Content Management system? 134704 by: . Nilaab 134705 by: Luke Woollard Re: Client Side PHP 134706 by: Justin French Re: Problem with include PHP 4.3.0 (Fixed) 134707 by: Jean-Pierre Gallou session lost after window close 134708 by: Libor Bubik Different dates with lmost same script 134709 by: Miguel Brás Re: empty variables from a form 134711 by: Ford, Mike [LSS] Dynamic input fields in Form 134712 by: fkeessen.planet.nl 134714 by: Jon Haworth dynamic form input fields 134713 by: fkeessen.planet.nl Re: Powerpoint presentations?!? 134715 by: Philippe Saladin looking for php mailing-list in chinese language 134716 by: yang.baozhang.com Re: empty and isset 134717 by: Ford, Mike [LSS] 4.0.6 to 4.3.0 134718 by: Brian V Bonini 134719 by: nicos.php.net Why is function imagecreatefromjpeg() undefined in PHP 4.3 when GD is enabled and imagecreatefrompng() id defined? A bug? 134720 by: SED 134721 by: nicos.php.net 134722 by: nicos.php.net 134723 by: SED 134724 by: nicos.php.net Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- In the following code $view = $HTTP_GET_VARS[view]; print $view; if ($view == vendor) { code here } print $view produces 'vendor' but the if statement in the next section isn't being triggered. Can anyone see what is wrong here? I have tried double quotes, single quotes and no quotes around 'vendor' but none of them work. Thanks Peter Gumbrell ---End Message--- ---BeginMessage--- check for leading/trailing spaces if (trim($view) == vendor) HTH Martin -Original Message- From: Peter Gumbrell [mailto:[EMAIL PROTECTED]] Sent: Friday, February 07, 2003 3:07 PM To: Php-General Subject: [PHP] problems with ==? In the following code $view = $HTTP_GET_VARS[view]; print $view; if ($view == vendor) { code here } print $view produces 'vendor' but the if statement in the next section isn't being triggered. Can anyone see what is wrong here? I have tried double quotes, single quotes and no quotes around 'vendor' but none of them work. Thanks Peter Gumbrell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- Peter Gumbrell wrote: In the following code $view = $HTTP_GET_VARS[view]; print $view; if ($view == vendor) { code here } print $view produces 'vendor' but the if statement in the next section isn't being triggered. Can anyone see what is wrong here? I have tried double quotes, single quotes and no quotes around 'vendor' but none of them work. You forgot the qoutes around the array argument: $HTTP_GET_VARS[view] should be $HTTP_GET_VARS['view']. -Peter ---End Message--- ---BeginMessage--- Why don't you two gather up a few more developers, decide on what is needed and what the goals are, then assign parts to build for the new CMS. Once finished, you can maybe present it to PHP.net and see if they will allow it to be developed and documented in the future by other developers. A CMS is a very important and popular prog, so it might get the same attention as basic templates get, like SMARTY. Who knows, maybe it can even be integrated with SMARTY too, and/or other PHP programs still out there. This might yield one of the best CMS out there in the PHP world, which can constantly be developed. There's my two cents, good luck... -Original Message- From: Sascha Braun [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 7:01 PM To: PHP General list; Hardik Doshi Subject: Re: [PHP] WYSIWYG Content Management system? I am working on such a CMS right yet. I want to implement infinitly Language Support and an Wordpad like HTML Editor which allows you to chose basic design tem- plates and lets you upload some images. I want to build an extraordinary Usermanagement, where you can write parts of an Text while somebody else is writing on another Part of the same text maybe in different language at the same Time. When you wrote a text you can chose between your mates for let them make the translation based on userprofiles every web- content admin has to fill out. And a lota more things, but right now i dont have very much time, I have to build a small shop inbetween. But the Multilanguage sup- port ist basically finished. But I may say some more, have you ever read about the
RE: [PHP] WYSIWYG Content Management system?
Hey Thanks for your nice advice. I will definately think about it. Hardik --- @ Nilaab [EMAIL PROTECTED] wrote: Why don't you two gather up a few more developers, decide on what is needed and what the goals are, then assign parts to build for the new CMS. Once finished, you can maybe present it to PHP.net and see if they will allow it to be developed and documented in the future by other developers. A CMS is a very important and popular prog, so it might get the same attention as basic templates get, like SMARTY. Who knows, maybe it can even be integrated with SMARTY too, and/or other PHP programs still out there. This might yield one of the best CMS out there in the PHP world, which can constantly be developed. There's my two cents, good luck... -Original Message- From: Sascha Braun [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 7:01 PM To: PHP General list; Hardik Doshi Subject: Re: [PHP] WYSIWYG Content Management system? I am working on such a CMS right yet. I want to implement infinitly Language Support and an Wordpad like HTML Editor which allows you to chose basic design tem- plates and lets you upload some images. I want to build an extraordinary Usermanagement, where you can write parts of an Text while somebody else is writing on another Part of the same text maybe in different language at the same Time. When you wrote a text you can chose between your mates for let them make the translation based on userprofiles every web- content admin has to fill out. And a lota more things, but right now i dont have very much time, I have to build a small shop inbetween. But the Multilanguage sup- port ist basically finished. But I may say some more, have you ever read about the execCommand in IE (Internet Explorer)? You can build an fully working wysiwyg HTML Editor with these commands. I'm going to send you a nice example after- wards Hardik. Maybe somebody wants to help me with the CMS System. I dont really like the Design of PHPNuke and I want to build an even more professional Article Management than it is developed in phpnuke. See Ya Sascha - Original Message - From: Hardik Doshi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 05, 2003 3:32 PM Subject: Re: [PHP] WYSIWYG Content Management system? Hey Jason, I am looking for the same. Do you have or any one in this list has any idea? Please let me know. thanks Hardik Jason Wong [EMAIL PROTECTED] wrote:On Wednesday 05 February 2003 09:43, J J wrote: I've seen CMS systems like phpnuke but it's kind of overkill for what I need and almost more news like. I'm looking for something that would allow the user to change content, change/upload images, all in a wysiwyg style so it's easy to see and use. It'd be cool to be able to login to the admin area, select a page to edit, and it would allow you to preview the page just like it looks. Then you click on a text area or image you want to update. Is there a CMS that allows for WYSIWYG like editing but will work within specified headers/footers, style sheets, etc? Then the site content would all be generated on the fly from php/mysql. All the major/popular ones would/should have been registered at freshmeat and soureforge so check them out. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* You're already carrying the sphere! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php - Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] 4.0.6 to 4.3.0
Any thoughts as to why this snippet: 25: if ($attach != none) 26: { 27:$file = fopen($attach, r); 28:$contents = fread($file, $attach_size); 29:$encoded_attach = chunk_split(base64_encode($contents)); 30:fclose($file); would produce these errors: Warning: fread(): supplied argument is not a valid stream resource in /usr/virtual/share/pkgs/installed/aeromail/1.40/aeromail/send_mess age.php on line 28 Warning: fclose(): supplied argument is not a valid stream resource in /usr/virtual/share/pkgs/installed/aeromail/1.40/aeromail/send_mess age.php on line 30 After upgrading from 4.0.6 to 4.3.0 Most probably because with 4.3.0 register_globals is set to OFF by default - where does $attach get set? Rich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] 4.0.6 to 4.3.0
On Fri, 2003-02-07 at 09:44, Rich Gray wrote: Any thoughts as to why this snippet: 25: if ($attach != none) 26: { 27:$file = fopen($attach, r); 28:$contents = fread($file, $attach_size); 29:$encoded_attach = chunk_split(base64_encode($contents)); 30:fclose($file); would produce these errors: Warning: fread(): supplied argument is not a valid stream resource in /usr/virtual/share/pkgs/installed/aeromail/1.40/aeromail/send_mess age.php on line 28 Warning: fclose(): supplied argument is not a valid stream resource in /usr/virtual/share/pkgs/installed/aeromail/1.40/aeromail/send_mess age.php on line 30 After upgrading from 4.0.6 to 4.3.0 Most probably because with 4.3.0 register_globals is set to OFF by default - where does $attach get set? Nope, I do have register_globals on in php.ini Its being set in another file like this: form enctype=multipart/form-data name-doit action=send_message.php method=POST input type=file name=attach size=68 It behaves like, if ($_GET['attach'] != none) or ($attach != none) is always true. If I attach something it goes through no prob, if I do not attach something it still goes through but with all the error messages and an empty attachment at the recieving end. Only thng that has changes was upgrading PHP from 4.0.6 to 4.3.0 -B -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] 4.0.6 to 4.3.0
[snip] After upgrading from 4.0.6 to 4.3.0 Most probably because with 4.3.0 register_globals is set to OFF by default - where does $attach get set? Nope, I do have register_globals on in php.ini Its being set in another file like this: form enctype=multipart/form-data name-doit action=send_message.php method=POST input type=file name=attach size=68 It behaves like, if ($_GET['attach'] != none) or ($attach != none) is always true. If I attach something it goes through no prob, if I do not attach something it still goes through but with all the error messages and an empty attachment at the recieving end. Only thng that has changes was upgrading PHP from 4.0.6 to 4.3.0 Hi Brian Why are you using $_GET[] when your form is submitting via the 'post' method? Secondly for file uploads why are you not using the $_FILES[] superglobal array? Rich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] 4.0.6 to 4.3.0
On Fri, 2003-02-07 at 10:13, Rich Gray wrote: Hi Brian Why are you using $_GET[] when your form is submitting via the 'post' method? My bust, just a typo. It's actually: if ($attach != none) that is beign used anyway. Secondly for file uploads why are you not using the $_FILES[] superglobal array? I did not write the app, just trying to figure out why it stopped working after upgrading PHP. You think that's the problem? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] 3 tier web development
Hi Everyone, I am curious to know how one can develop 3-tier web based applications using PHP, MySQL. Here Database should be changed in future using database abstraction layer. Can anybody tell me in detail that how can i build 3 tier flexible web application? More questions on this thread: 1. How one can seperate HTML and PHP (or any other programming code). Is there anything in PHP so i can seperate Interface layer and programming logic layer? 2. I know that we can use Database abstraction layer so in future it is really easy to change database as per need. Can any one tell me which database abstraction layer is the best for future applications. 3. There is lots of talk about CMS today. Does anyone know about PHP based CMS (PHP-Nuke?? i dont know)? Currently i am making 2 tier systems (HTML+PHP, Database) I want to switch my applications to 3 tier (HTML, php and database). Please give me enough guidance. thanks Hardik __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] WYSIWIG CMS Part1
Ok, overspoken. I'm going to write my basic CMS Concept here, and let us see what happens then. My Multilanguage Frontend Engine has even finished, but still needs a nice Admin Frontend to do the translation of the Frontend. Ok, lets start. Later I will tell some about the things which I could not really understand yet, maybe somebody is able to help. Tasks of the CMS (I called it freecon, dont know if there is something similar): 1. Template Engine 2. Design Management 3. Article Management 4. Content Management 5. User Management 6. Customer Management 7. Message Management 1. The Template Engine should help developers to easy build Websites based on the CMS. The only Thing the Developer has to do, is to develop an static HTML Webpage Design and replace all the Visitor viewable and Admin viewable textparts with special CMS Based Tags. As there is possibility to write parts of the CMS as Modules, it would be very nice if fx. the customer login could consist of a small code sniped and a border (Table and Images fx.) so the developer can easely change the design of the page, probably with the Design Management. 2. The Design Management is part of the Administration Kit for the CMS. With this tool you should be able to change the Design of the Templates and if you used the CMS Based Tags you should be able to upload new parts of the homepage design and change the hole page look, with a few mouseclicks. So there has be an Design Table in the Database or an configuration file, where all the Imageparts are stored and together build the page look and feel. The CSS Stylesheet should the be changeable to a lot of forms, seen in phpbb or other nice templated website tools. 3. The Article Management should be part of the Admin Interface where you can deside, of which parts an article should be consist. Fx. an Article could possibly consist of an Headline, Introduction, Shortdescription, Description, 1 Image, 2 Images and much more. So it would be nice, if the Admin could give some orders on which parts a text may consist of and which design you should be able to chose from. When you want to write a new Newstext and the Admin decided that newstexts should consist of an headline and a short description toghether with the maximum of 1 Picture, you will chose when you want to create the text in which language you want to create it and you will enter an custom frontend for the article, where only the form fields are visible you may use to write the article, when you wanted you create the article in more than one language, you will able to choose if you want to see all forms. (I mean for the different translations on one page or you will be able to enter the translate mode, where you will see fx, headline in english and an empty headline form below for Italian language, But Later Ill explain more about the article mana- gement). I choosed to do it in this way, because it will reduce the space needed by the database enormously, because there is an table which only holds the head- lines, in all languages, and another one only holds the introductions, in all langua- ges, and so on. 4. The Content Management, I started to explain in 3. a little about how it should work. Now I will get a little deeper into it. When your Chief decides that you should write an article, he starts entering a new title or headline for the task and sets the priority and chooses in which language the article should be translated in. After he did this, he chooses between his em- ployes who should write this article, if he doesnt direktly choose one, he can choose the knowledge which the employe needs to have (At this point fits the usermanagement I'll explain later). After he has did all this, one or a couple of of employes will receive an email, that there is a new task to do. When the Chief only choosed one special employe only one will get the message on the other hand of he choosed somebody who knows a lot about PHP and there are ten people in the company who know a lot of php all these ten people will receive the message unless one of the does not speak or is able to write text in one of the needed languages. When of of the employes enters the page, the first thing he will look at is is task pool. In the Task are stored all undone articles who need to be written. After the employe(from now on just called user) did chose one of the tasks from the todo list the article will dis- apear from all the other user pools. Till the first text in any of the chosed languages is written completely the text will only apear in the tasks/todo list of the authoring user. after this text has finished the author can choose, based on the user management, which user or users are able to write the translations to the other languages. If the text has to be translated into english, german, italian und french the user can choose between one out of all french speaking and one of all italian speakin users or just send to text to all french or italian
[PHP] WYSIWYG CMS Part2
Parts which should be entered in the Site, but which are not written down yet: 1. Newsletter / Mailinglist Funktionality The Newsletter should be part of the Article Management and work in the same way as writing a new article. Mailinglist is what ever it is. Maybe a Majodomo implementation or something else. 2. Maybe a nice webbased E-Mail Client for all the Users, so this webpage becomes a very important position in a company and saves a lot of money, cause of all the technican and installation support for MS-DOS Mailclients and so on. And Maybe other things. Now I will writte down the translation of my handwritten notes, maybe its a little repetition of the part above, but maybe its good for the understanding. Customers should be able to write commentarys to the Articles, The Author or the Administrator should be able to choose if the arcticles are for the internal use or may be viewed from outer space. Every Article is having a clear designator, consisting of charakters and a number. Translation of Articles: Every Employe has, after the login, access to his personal Tasks Pool. This pool consist of tasks which where personaly assigned to him or tasks which are able to be worked out from multiple persons. Due to the Priority the User, he can decide which task he wants to do first, and start with the work. After the user has choosen which task he wants to do, he is asked in which language he want to to translate the article. After this is done a mask/form is generated where the user sees the text in the choosen language and can enter his translation below. When the translation is done, the article is going to be written back in the pool of the main author, who can decide if the text is ready to be published. If the text is not ready the text can be written back to the pool of the translator of the article. It should be possible to enter internal comments to the articles, which only the users of the admin tool can see, and external comments from customers. Entering Texts: The CMS should, cause of an interaktive Inquiry of the needed functions, generate a, for the article design, customized input mask. The writing of the Content follows the given Sample: The User wants to create an Article. He clicks on a button and and can decide in which languages the text should be published in. In fact of the number of languages, there will be created an custo- mized input mask. 1. Content written only in one language is going to be entered just on one page which consists of some WYSIWYG Editor Elements Designed for the parts of the texts eg. Headline, Intro, Short, description, Imageupload and so on. 2. Cause of the number of languages the content should be published in there will be generated different customized input masks. First the text has to be written in you motherlanguage or language you are able to write in best. After this is done you will enter into some forms where you see the first part you have done and down below that you will see a input mask where you can enter the translation or choose a user who should do this translation for you. When the text has to be written in the languages there will be three steps and forms you have to work thru or you have to choose translaters for. Fx.: The User is only able to do two of the needed translations, the user can explicitly define one user to do the translation in a certain language or he is able to choose a group of users who are able to speak the needed language. 3. If the User starts to work in an translation the task is going to hide in the pool of users who are able to translate in the same language as the user. The Task doesnt hide in the pools of other language speaking users as long the content is translated in a fully publishable language eg. all parts of the text are translated. 4. For every texttranslation the Author is able to set a priotity bit. User Management: Every User may choose parts of the website he want to take part in developing content. After the the Administrator has created a user account for the user, the user is able to create a profile about his abilities. Did the user enter a language into the porfile, which the CMS did not recognize all forms are automatically exented with this new language, and the texts which should be trans- lated to every language should automatically be shown in the pool of the user, so the parts can be translated direcly into the new language. Alternative to the Userprofile the Administrator is able to decide in which Field the user should work in. Ok, this was it. How you will like what i though myself about. I can just send you the things i have done until yet. I wanted to past links to my work, but I have problems on installing freecon on my webserver. Something is wrong with the PHP Configuration and today I dont have time to find out. the URL's are http://bmc.customer.speedlink.de/freecon For the Frontend http://bmc.customer.speedlink.de/freecon/admin
[PHP] Catching Oracle Errors
I'm working with Oracle 8.1.5 and my connection is working fine as well as my SQL parsing but I want that when there's an error, show and friendly message to the user and not an Oracle error. How can I catch the error and display it ?? Thanks, Fernando Cruz - Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now
Re: [PHP] 3 tier web development
Ok so for seperating interface and PHP code, smarty templace engine is the best right? What about database abstraction layer? thanks for your information. I really appreciate that. Hardik --- John Wells [EMAIL PROTECTED] wrote: Hardik Doshi said: 1. How one can seperate HTML and PHP (or any other programming code). Is there anything in PHP so i can seperate Interface layer and programming logic layer? http://smarty.php.net __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] 3 tier web development
Hardik: Maybe this can help: Im currently using PHP using MCV (Model Control View) Methology, Model is about libraries and classes like the business rules of your application, Control has to do with the como control sentences you must use like IF, WHILE,FOREACH, ... , and View is the look and file of the app , HTML, IMAGES, ... Have a look on smarty http://smarty.php.net , and there you can learn how to use HTML and PHP And about the databse tier .. I use a class named data_base .. with attributes like: -dbtype -dbhost -dbuser -dbpassword and the instances of the class can handle many databases .. and guarantee the portability .. I hope this helps. Regards. Daniel. -Mensaje original- De: Hardik Doshi [mailto:[EMAIL PROTECTED]] Enviado el: viernes, 07 de febrero de 2003 10:24 Para: [EMAIL PROTECTED] Asunto: [PHP] 3 tier web development Hi Everyone, I am curious to know how one can develop 3-tier web based applications using PHP, MySQL. Here Database should be changed in future using database abstraction layer. Can anybody tell me in detail that how can i build 3 tier flexible web application? More questions on this thread: 1. How one can seperate HTML and PHP (or any other programming code). Is there anything in PHP so i can seperate Interface layer and programming logic layer? 2. I know that we can use Database abstraction layer so in future it is really easy to change database as per need. Can any one tell me which database abstraction layer is the best for future applications. 3. There is lots of talk about CMS today. Does anyone know about PHP based CMS (PHP-Nuke?? i dont know)? Currently i am making 2 tier systems (HTML+PHP, Database) I want to switch my applications to 3 tier (HTML, php and database). Please give me enough guidance. thanks Hardik __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] 4.0.6 to 4.3.0
Secondly for file uploads why are you not using the $_FILES[] superglobal array? I did not write the app, just trying to figure out why it stopped working after upgrading PHP. You think that's the problem? Well try ... if (is_uploaded_file($_FILES['attach']['tmp_name'])) { // Blah Blah Blah } Rich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: RE: [PHP] WYSIWYG Content Management system?
Hi Sascha, Really Nice. I like your thoughts about CMS. Today i am looking in PHP Nuke CMS and i found it has really nice functionalities. I don't know much about PHP nuke CMS. That's what you are looking for? Give some thoughts on PHP Nuke project. thanks and all the best for your ideas Hardik --- Sascha Braun [EMAIL PROTECTED] wrote: Ok, overspoken. I'm going to write my basic CMS Concept here, and let us see what happens then. My Multilanguage Frontend Engine has even finished, but still needs a nice Admin Frontend to do the translation of the Frontend. Ok, lets start. Later I will tell some about the things which I could not really understand yet, maybe somebody is able to help. Tasks of the CMS (I called it freecon, dont know if there is something similar): 1. Template Engine 2. Design Management 3. Article Management 4. Content Management 5. User Management 6. Customer Management 7. Message Management 1. The Template Engine should help developers to easy build Websites based on the CMS. The only Thing the Developer has to do, is to develop an static HTML Webpage Design and replace all the Visitor viewable and Admin viewable textparts with special CMS Based Tags. As there is possibility to write parts of the CMS as Modules, it would be very nice if fx. the customer login could consist of a small code sniped and a border (Table and Images fx.) so the developer can easely change the design of the page, probably with the Design Management. 2. The Design Management is part of the Administration Kit for the CMS. With this tool you should be able to change the Design of the Templates and if you used the CMS Based Tags you should be able to upload new parts of the homepage design and change the hole page look, with a few mouseclicks. So there has be an Design Table in the Database or an configuration file, where all the Imageparts are stored and together build the page look and feel. The CSS Stylesheet should the be changeable to a lot of forms, seen in phpbb or other nice templated website tools. 3. The Article Management should be part of the Admin Interface where you can deside, of which parts an article should be consist. Fx. an Article could possibly consist of an Headline, Introduction, Shortdescription, Description, 1 Image, 2 Images and much more. So it would be nice, if the Admin could give some orders on which parts a text may consist of and which design you should be able to chose from. When you want to write a new Newstext and the Admin decided that newstexts should consist of an headline and a short description toghether with the maximum of 1 Picture, you will chose when you want to create the text in which language you want to create it and you will enter an custom frontend for the article, where only the form fields are visible you may use to write the article, when you wanted you create the article in more than one language, you will able to choose if you want to see all forms. (I mean for the different translations on one page or you will be able to enter the translate mode, where you will see fx, headline in english and an empty headline form below for Italian language, But Later Ill explain more about the article mana- gement). I choosed to do it in this way, because it will reduce the space needed by the database enormously, because there is an table which only holds the head- lines, in all languages, and another one only holds the introductions, in all langua- ges, and so on. 4. The Content Management, I started to explain in 3. a little about how it should work. Now I will get a little deeper into it. When your Chief decides that you should write an article, he starts entering a new title or headline for the task and sets the priority and chooses in which language the article should be translated in. After he did this, he chooses between his em- ployes who should write this article, if he doesnt direktly choose one, he can choose the knowledge which the employe needs to have (At this point fits the usermanagement I'll explain later). After he has did all this, one or a couple of of employes will receive an email, that there is a new task to do. When the Chief only choosed one special employe only one will get the message on the other hand of he choosed somebody who knows a lot about PHP and there are ten people in the company who know a lot of php all these ten people will receive the message unless one of the does not speak or is able to write text in one of the needed languages. When of of the employes enters the page, the first thing he will look at is is task pool. In the Task are stored all undone articles who need to be written. After the employe(from now on just called user) did chose one of the tasks from the todo list the article will dis- apear from all the other user pools. Till the first text in any of the chosed languages is
RE: [PHP] 3 tier web development
Hi Daniel, Thanks for your comments. What is the difference between PHP nuke and Smarty engine? Can we use PEAR or ADODB as database abstraction layer? Which one is the best on everyone's experience? thanks Hardik --- Daniel Masson [EMAIL PROTECTED] wrote: Hardik: Maybe this can help: Im currently using PHP using MCV (Model Control View) Methology, Model is about libraries and classes like the business rules of your application, Control has to do with the como control sentences you must use like IF, WHILE,FOREACH, ... , and View is the look and file of the app , HTML, IMAGES, ... Have a look on smarty http://smarty.php.net , and there you can learn how to use HTML and PHP And about the databse tier .. I use a class named data_base .. with attributes like: -dbtype -dbhost -dbuser -dbpassword and the instances of the class can handle many databases .. and guarantee the portability .. I hope this helps. Regards. Daniel. -Mensaje original- De: Hardik Doshi [mailto:[EMAIL PROTECTED]] Enviado el: viernes, 07 de febrero de 2003 10:24 Para: [EMAIL PROTECTED] Asunto: [PHP] 3 tier web development Hi Everyone, I am curious to know how one can develop 3-tier web based applications using PHP, MySQL. Here Database should be changed in future using database abstraction layer. Can anybody tell me in detail that how can i build 3 tier flexible web application? More questions on this thread: 1. How one can seperate HTML and PHP (or any other programming code). Is there anything in PHP so i can seperate Interface layer and programming logic layer? 2. I know that we can use Database abstraction layer so in future it is really easy to change database as per need. Can any one tell me which database abstraction layer is the best for future applications. 3. There is lots of talk about CMS today. Does anyone know about PHP based CMS (PHP-Nuke?? i dont know)? Currently i am making 2 tier systems (HTML+PHP, Database) I want to switch my applications to 3 tier (HTML, php and database). Please give me enough guidance. thanks Hardik __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] is_numeric fails and don't know why
Hi, I'm trying to read a file that contains a group of numbers, each of them in one line of the file. I need to verify that the file is valid, so i read line by line and test if the line is numeric: ... $line = fgets ($FileDesc); $line = trim ($line); if (!is_numeric ($line)) return 0; ... It doesn't work for the first and last line of the file. Last line is a \r, so perhaps it's normal, but I don't understand why it fails with first line. Example: .101972E+00 (first line) -.122713E+01 .784379E-01 -.135826E+01 -.217017E+01 ... first line is not considered as a number. Rest of lines are considered as numbers. Where is the problem? Thanks for your help. _ Horas ilimitadas para leer y enviar correos con Tarifa Plana Wanadoo ¡¡ desde las 3 de la tarde!! Compruébalo en http://www.wanadoo.es/acceso-internet -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] 3 tier web development
--- Hardik Doshi [EMAIL PROTECTED] wrote: What is the difference between PHP nuke and Smarty engine? A better question would be what is the similarity. Smarty is a template engine. PHP Nuke is an application written in PHP. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: 3 tier web development
You may be interested in the article: Using PHP to Develop Three-Tier Architecture Applications (http://www.zend.com/zend/tut/tutsweatpart1.php) David Eisenhart. Hardik Doshi [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi Everyone, I am curious to know how one can develop 3-tier web based applications using PHP, MySQL. Here Database should be changed in future using database abstraction layer. Can anybody tell me in detail that how can i build 3 tier flexible web application? More questions on this thread: 1. How one can seperate HTML and PHP (or any other programming code). Is there anything in PHP so i can seperate Interface layer and programming logic layer? 2. I know that we can use Database abstraction layer so in future it is really easy to change database as per need. Can any one tell me which database abstraction layer is the best for future applications. 3. There is lots of talk about CMS today. Does anyone know about PHP based CMS (PHP-Nuke?? i dont know)? Currently i am making 2 tier systems (HTML+PHP, Database) I want to switch my applications to 3 tier (HTML, php and database). Please give me enough guidance. thanks Hardik __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] 3 tier web development
Hardik: PHP nuke is 100% CMS, snarty offers the posibility to integrate SMART templates to you php application, smarty templates can do lots of tasks that you used to perform on your php scripts ... there are tutorials on zend.com .. and im sure that if you learn how to use it ... youll be very satisfied with smarty. Regards. Daniel. Daniel E Massón. Ingeniero de desarrollo [EMAIL PROTECTED] Imagine S.A. Su Aliado Efectivo en Internet www.imagine.com.co (57 1)2182064 - (57 1)6163218 Bogotá - Colombia - Soluciones web para Internet e Intranet - Soluciones para redes - Licenciamiento de Software - Asesoría y Soporte Técnico -Mensaje original- De: Hardik Doshi [mailto:[EMAIL PROTECTED]] Enviado el: viernes, 07 de febrero de 2003 10:50 Para: [EMAIL PROTECTED]; [EMAIL PROTECTED] Asunto: RE: [PHP] 3 tier web development Hi Daniel, Thanks for your comments. What is the difference between PHP nuke and Smarty engine? Can we use PEAR or ADODB as database abstraction layer? Which one is the best on everyone's experience? thanks Hardik --- Daniel Masson [EMAIL PROTECTED] wrote: Hardik: Maybe this can help: Im currently using PHP using MCV (Model Control View) Methology, Model is about libraries and classes like the business rules of your application, Control has to do with the como control sentences you must use like IF, WHILE,FOREACH, ... , and View is the look and file of the app , HTML, IMAGES, ... Have a look on smarty http://smarty.php.net , and there you can learn how to use HTML and PHP And about the databse tier .. I use a class named data_base .. with attributes like: -dbtype -dbhost -dbuser -dbpassword and the instances of the class can handle many databases .. and guarantee the portability .. I hope this helps. Regards. Daniel. -Mensaje original- De: Hardik Doshi [mailto:[EMAIL PROTECTED]] Enviado el: viernes, 07 de febrero de 2003 10:24 Para: [EMAIL PROTECTED] Asunto: [PHP] 3 tier web development Hi Everyone, I am curious to know how one can develop 3-tier web based applications using PHP, MySQL. Here Database should be changed in future using database abstraction layer. Can anybody tell me in detail that how can i build 3 tier flexible web application? More questions on this thread: 1. How one can seperate HTML and PHP (or any other programming code). Is there anything in PHP so i can seperate Interface layer and programming logic layer? 2. I know that we can use Database abstraction layer so in future it is really easy to change database as per need. Can any one tell me which database abstraction layer is the best for future applications. 3. There is lots of talk about CMS today. Does anyone know about PHP based CMS (PHP-Nuke?? i dont know)? Currently i am making 2 tier systems (HTML+PHP, Database) I want to switch my applications to 3 tier (HTML, php and database). Please give me enough guidance. thanks Hardik __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] regex
Hello there, i have to check if there's a dot in a string, and i need nothing but the regex pattern for this... tryed a lot, but the dot itself means to matches all. can u help ? regards marian feiler -- Internetservice Marketing Agentur isurfin.net Marian Feiler Altenessener Str. 99 45326 Essen Tel. 0201 279 86 71 Fax. 0201 294 62 67 E-Mail: [EMAIL PROTECTED] Web: http://isurfin.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] 3 tier web development
About the database sigue .. i dont use ADOD or PEAR .. I use this: //Class to handle ALL operations an ANY database Class data_base ( //Predetermined value of attributes, you can safely override this when //do many instances of this class $dbtype = mssql; $duser = user; $dbname = name; $dbpass = x; function connect() { if ($this-dbtype == mssql) { retrun function_to_connect_to_mssql($this-user, ); } elseif ($this-dbtype == mysql) { retrun function_to_connect_to_mysql($this-user, ); } } function query(){ if ($this-dbtype == mssql) { retrun function_to_query_mssql($this-connection, ); } elseif ($this-dbtype == mysql) { retrun function_to_query_mysql($this-connection, ); } } ); Daniel E Massón. Ingeniero de desarrollo [EMAIL PROTECTED] Imagine S.A. Su Aliado Efectivo en Internet www.imagine.com.co (57 1)2182064 - (57 1)6163218 Bogotá - Colombia - Soluciones web para Internet e Intranet - Soluciones para redes - Licenciamiento de Software - Asesoría y Soporte Técnico -Mensaje original- De: Hardik Doshi [mailto:[EMAIL PROTECTED]] Enviado el: viernes, 07 de febrero de 2003 10:50 Para: [EMAIL PROTECTED]; [EMAIL PROTECTED] Asunto: RE: [PHP] 3 tier web development Hi Daniel, Thanks for your comments. What is the difference between PHP nuke and Smarty engine? Can we use PEAR or ADODB as database abstraction layer? Which one is the best on everyone's experience? thanks Hardik --- Daniel Masson [EMAIL PROTECTED] wrote: Hardik: Maybe this can help: Im currently using PHP using MCV (Model Control View) Methology, Model is about libraries and classes like the business rules of your application, Control has to do with the como control sentences you must use like IF, WHILE,FOREACH, ... , and View is the look and file of the app , HTML, IMAGES, ... Have a look on smarty http://smarty.php.net , and there you can learn how to use HTML and PHP And about the databse tier .. I use a class named data_base .. with attributes like: -dbtype -dbhost -dbuser -dbpassword and the instances of the class can handle many databases .. and guarantee the portability .. I hope this helps. Regards. Daniel. -Mensaje original- De: Hardik Doshi [mailto:[EMAIL PROTECTED]] Enviado el: viernes, 07 de febrero de 2003 10:24 Para: [EMAIL PROTECTED] Asunto: [PHP] 3 tier web development Hi Everyone, I am curious to know how one can develop 3-tier web based applications using PHP, MySQL. Here Database should be changed in future using database abstraction layer. Can anybody tell me in detail that how can i build 3 tier flexible web application? More questions on this thread: 1. How one can seperate HTML and PHP (or any other programming code). Is there anything in PHP so i can seperate Interface layer and programming logic layer? 2. I know that we can use Database abstraction layer so in future it is really easy to change database as per need. Can any one tell me which database abstraction layer is the best for future applications. 3. There is lots of talk about CMS today. Does anyone know about PHP based CMS (PHP-Nuke?? i dont know)? Currently i am making 2 tier systems (HTML+PHP, Database) I want to switch my applications to 3 tier (HTML, php and database). Please give me enough guidance. thanks Hardik __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] WYSIWYG CMS Part2
Now it is fixed, and the language translation does work now the right way. Its not much to see, but there is something to see. So dont expect to much. In http://bmc.customer.speedlink.de/freecon/admin/admin_from.php is a small script which alows you to to enter a new language, but yet there is no frontend for entering frontend translations into the DB so if you want to do so, it has to be done with phpMyAdmin at: http://bmc.customer.speedlink.de/phpMyAdmin The Tables for the CMS are: front_lang page_kat languages art_desc art_short art_headline art_images Please excuse that they are not placed in an extra database but instead in the weitsicht DB, something went wrong as i entered the freecon DB, there for i just used the otherone. The Server is not configured very nice, because as i got it i was not so super well at jugling around with linux, and i began to install linux at home. It took all my time to install XFree and all the other nice proggies so i had no time for configuring the server anymore. Ok, hope you will be satisfied for the moment. Rock on. Sascha - Original Message - From: Hatem Ben [EMAIL PROTECTED] To: Sascha Braun [EMAIL PROTECTED]; PHP General list [EMAIL PROTECTED] Sent: Friday, February 07, 2003 4:32 PM Subject: Re: [PHP] WYSIWYG CMS Part2 Warning: Access denied for user: 'root@localhost' (Using password: YES) in /home/sascha/www/docs/freecon/includes/global.inc.php on line 8 Warning: MySQL Connection Failed: Access denied for user: 'root@localhost' (Using password: YES) in /home/sascha/www/docs/freecon/includes/global.inc.php on line 8 Fehler beim Öffnen der DB auf localhost User: root Take your time to install it :))) Cheers, Hatem - Original Message - From: Sascha Braun [EMAIL PROTECTED] To: PHP General list [EMAIL PROTECTED] Sent: Friday, February 07, 2003 4:27 PM Subject: [PHP] WYSIWYG CMS Part2 Parts which should be entered in the Site, but which are not written down yet: 1. Newsletter / Mailinglist Funktionality The Newsletter should be part of the Article Management and work in the same way as writing a new article. Mailinglist is what ever it is. Maybe a Majodomo implementation or something else. 2. Maybe a nice webbased E-Mail Client for all the Users, so this webpage becomes a very important position in a company and saves a lot of money, cause of all the technican and installation support for MS-DOS Mailclients and so on. And Maybe other things. Now I will writte down the translation of my handwritten notes, maybe its a little repetition of the part above, but maybe its good for the understanding. Customers should be able to write commentarys to the Articles, The Author or the Administrator should be able to choose if the arcticles are for the internal use or may be viewed from outer space. Every Article is having a clear designator, consisting of charakters and a number. Translation of Articles: Every Employe has, after the login, access to his personal Tasks Pool. This pool consist of tasks which where personaly assigned to him or tasks which are able to be worked out from multiple persons. Due to the Priority the User, he can decide which task he wants to do first, and start with the work. After the user has choosen which task he wants to do, he is asked in which language he want to to translate the article. After this is done a mask/form is generated where the user sees the text in the choosen language and can enter his translation below. When the translation is done, the article is going to be written back in the pool of the main author, who can decide if the text is ready to be published. If the text is not ready the text can be written back to the pool of the translator of the article. It should be possible to enter internal comments to the articles, which only the users of the admin tool can see, and external comments from customers. Entering Texts: The CMS should, cause of an interaktive Inquiry of the needed functions, generate a, for the article design, customized input mask. The writing of the Content follows the given Sample: The User wants to create an Article. He clicks on a button and and can decide in which languages the text should be published in. In fact of the number of languages, there will be created an custo- mized input mask. 1. Content written only in one language is going to be entered just on one page which consists of some WYSIWYG Editor Elements Designed for the parts of the texts eg. Headline, Intro, Short, description, Imageupload and so on. 2. Cause of the number of languages the content should be published in there will be generated different customized input masks. First the text has to be written in you motherlanguage or language you are able to write in best. After this is done you will enter into some forms where you see the first part you have done and down below that you will see a input mask where you can
Re: [PHP] regex
i have to check if there's a dot in a string, and i need nothing but the regex pattern for this... tryed a lot, but the dot itself means to matches all. you can read a little and not very clear introduction here: http://nl.php.net/manual/nl/pcre.pattern.modifiers.php and http://nl.php.net/manual/nl/pcre.pattern.syntax.php I cannot find it there eitherr but i am pretty sure the normal escape \ counts, so \. in stead of . . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: regex
On Fri, Feb 07, 2003 at 05:29:49PM +0100, Marian Feiler wrote: i have to check if there's a dot in a string, and i need nothing but the regex pattern for this... tryed a lot, but the dot itself means to matches all. You can escape the dot either by putting a backslash in front of it or putting it inside square brackets. So: ereg(a.b,aaabbb); is true, but ereg(a[.]b,aaabbb); is false. Other sensitive characters can also be escaped in this way; the bracket expression [][.^$()|*+?-] matches any of those characters. And to match any *except* those characters, use [^][.^$()|*+?-]. Check the re_format(7) man page for details. If you don't have a unix box handy, check http://www.freebsd.org/cgi/man.cgi?query=re_format . -- Paul Chvostek [EMAIL PROTECTED] Operations / Abuse / Whatever it.canada, hosting and development http://www.it.ca/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] update to table errors/strange things happen
i have a combo box on a web page that gets all the companies names from a mysql table and puts them in the combobox.. when someone picks a name and hits an edit button it takes them to a form where all the values in the table fields for that record are shown as default values for the form fields. my problem is when someone changes a value say the city or state (but it happens with any of the fields) and if for some reason they change it to the same value that was already in the record then all of the records get changed and updated to show that every records have the same values for all fields... does anybody know why that is and possible how to fix that problem so only that record gets changed? my source is rather huge in size and since i cant find the place where the problem is coming from it would be hard to post all the source here.. can anybody help? my update statement has all 16 fields in it because i dont know if you can do conditional updates with variables and if you can how to do that... --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] issues with ksort()
What else does ksort() do to the array??? Does it matter that my keys look like this: '[some-text]'??? This works great: foreach($myarray as $key = $val) { echo $key = $val; } This gives me a Warning: Invalid argument supplied for foreach(): $sortedarray = ksort($myarray); foreach($sortedarray as $key = $val) { echo $key = $val; } Any ideas??? TIA -Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] substr() help
working on a peice of code that should be pretty easy, but for some reason I am not getting any results. I want the first 10 characters of each line from the file I am reading and am using this code: $temp = str_replace(\n, , fgets($fp, 4096)); $line = substr ($temp, 0, 5); when I test for temp I get 30 responses - which is correct, but when I test for $line I get Zero responses. Did I make a mistake in my code Paul Reilly [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: issues with ksort()
On Fri, Feb 07, 2003 at 11:09:10AM -0600, Shawn McKenzie wrote: What else does ksort() do to the array??? Does it matter that my keys look like this: '[some-text]'??? This works great: foreach($myarray as $key = $val) { echo $key = $val; } This gives me a Warning: Invalid argument supplied for foreach(): $sortedarray = ksort($myarray); foreach($sortedarray as $key = $val) { echo $key = $val; } Any ideas??? Inserting a print_r into your test script tells you the problem, as does a closer look at http://www.php.net/ksort . You're assuming ksort()'s return value is the sorted array. It is not. Try something more along the lines of: $testarray=array( [three] = 3, [two] = 2, [one] = 1, ); ksort($testarray); print_r($testarray); -- Paul Chvostek [EMAIL PROTECTED] Operations / Abuse / Whatever it.canada, hosting and development http://www.it.ca/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql auto increment question
I have an application that updates two MySQL database tables. One table has an auto_increment id field. I need to use this id to link to an entry in the other table. Is there an easy way to find out what the auto_incremented number is so I can use it to update the other table? Robbert van Andel
RE: [PHP] substr() help
Try this $temp = fgets($fp,4096); $line = substr($temp,0,10); Robbert van Andel -Original Message- From: Paul Reilly [mailto:[EMAIL PROTECTED]] Sent: Friday, February 07, 2003 9:06 AM To: [EMAIL PROTECTED] Subject: [PHP] substr() help working on a peice of code that should be pretty easy, but for some reason I am not getting any results. I want the first 10 characters of each line from the file I am reading and am using this code: $temp = str_replace(\n, , fgets($fp, 4096)); $line = substr ($temp, 0, 5); when I test for temp I get 30 responses - which is correct, but when I test for $line I get Zero responses. Did I make a mistake in my code Paul Reilly [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql auto increment question
Hi Robbert, Is there an easy way to find out what the auto_incremented number is so I can use it to update the other table? Sure, have a look at mysql_insert_id: http://php.net/mysql_insert_id Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] GD Chinese support - php4.3
any one know how display Chinese Characters (tradition or simplified) in GD.? is that something deal with multibyte functions...? i have installed the bundled GD and Libjpeg they all worked perfectly with english words but when i generate a Chinese character, it just display two symbols i've already set the encoding (of php) to BIG5 and even i use mb_detect_encoding() it can show BIG-5 but when i use ImageTTFtext(blah blah blah , mb_convert_encoding([Chinese word here],BIG-5) it pops out 2 symbol the ttf font i loaded is the one distributed by Microsoft (HKSCS) any php experts know how to solve this problem? Thank you all :) Regards, Eddy @ Hong Kong [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] update to table errors/strange things happen
//connect to server and database ?php include(conf.inc);//config file for db, username... mysql_connect($host, $mysqluser, $mysqlpwd)||die(cant find $host or username/pwd wrong); mysql_select_db($db)||die($db doesnt exist or has a problem...); //following code goes for each combobox to use //if you have a different field for each //combobox..otherwise //put this at top of file $query=mysql_query(select company from members); ? //start combo box select name=name option value=select a member to editbr //code to populate combobox from db ?php while($edit=mysql_fetch_array($query)){ //use your variables instead of mine make sure to use the //\ before and after all var names echo option value=\$edit[Company]\\$edit[Company]br; } ? /select //rest of code for page here... not that hard probably about 4 lines of code to make the box and put db stuff in it... still need to figure out why my update statement updates all records if someone retypes the same value in the form though - Original Message - From: Guru Geek [EMAIL PROTECTED] To: Sunfire [EMAIL PROTECTED] Sent: Friday, February 07, 2003 12:08 PM Subject: Re: [PHP] update to table errors/strange things happen Could I just see the section of code that populates the combo box with database info? I'm trying to do that exact same thing, but can't figure out the code Thanks, Roger Sunfire wrote: i have a combo box on a web page that gets all the companies names from a mysql table and puts them in the combobox.. when someone picks a name and hits an edit button it takes them to a form where all the values in the table fields for that record are shown as default values for the form fields. my problem is when someone changes a value say the city or state (but it happens with any of the fields) and if for some reason they change it to the same value that was already in the record then all of the records get changed and updated to show that every records have the same values for all fields... does anybody know why that is and possible how to fix that problem so only that record gets changed? my source is rather huge in size and since i cant find the place where the problem is coming from it would be hard to post all the source here.. can anybody help? my update statement has all 16 fields in it because i dont know if you can do conditional updates with variables and if you can how to do that... --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql auto increment question
Thanks, I knew there was a function like this, but couldn't for the life of me remember what it was or find it. Robbert van Andel -Original Message- From: Jon Haworth [mailto:[EMAIL PROTECTED]] Sent: Friday, February 07, 2003 9:28 AM To: Van Andel, Robbert; [EMAIL PROTECTED] Subject: RE: [PHP] mysql auto increment question Hi Robbert, Is there an easy way to find out what the auto_incremented number is so I can use it to update the other table? Sure, have a look at mysql_insert_id: http://php.net/mysql_insert_id Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: issues with ksort()
Ah Thanks! -Shawn - Original Message - From: Paul Chvostek [EMAIL PROTECTED] To: Shawn McKenzie [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, February 07, 2003 11:18 AM Subject: Re: issues with ksort() On Fri, Feb 07, 2003 at 11:09:10AM -0600, Shawn McKenzie wrote: What else does ksort() do to the array??? Does it matter that my keys look like this: '[some-text]'??? This works great: foreach($myarray as $key = $val) { echo $key = $val; } This gives me a Warning: Invalid argument supplied for foreach(): $sortedarray = ksort($myarray); foreach($sortedarray as $key = $val) { echo $key = $val; } Any ideas??? Inserting a print_r into your test script tells you the problem, as does a closer look at http://www.php.net/ksort . You're assuming ksort()'s return value is the sorted array. It is not. Try something more along the lines of: $testarray=array( [three] = 3, [two] = 2, [one] = 1, ); ksort($testarray); print_r($testarray); -- Paul Chvostek [EMAIL PROTECTED] Operations / Abuse / Whatever it.canada, hosting and development http://www.it.ca/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Max Limit of post variables
I was making an aplication few months ago, and i had your same problems. I think that crash because the php file send to the client its to large, and the client machine dont have the necesary memory to suport that in the navigator. So i chanche my grid to one row of controls, and i put all the information in one html table. If i want to modify the one html table row, i have a link in that row, and automatic the information appear in the controls row and you can modify. So the controls row modify and insert information. From: Stuart Donald [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP] Max Limit of post variables Date: Thu, 6 Feb 2003 11:18:51 -0800 I am trying to generate an html form with approximately 3000 post variables (1500 input type text and 1500 hidden, I am mimicing a grid control). The page will handle several hundred but it crashes with more. Is there a limit to the number of variables that can be sent post. Or is it possible I am violating some html tag rules and the browser does not have a too much problem with the few hundred post variables. I am using apache2, php4 and Explorer for the browser, however it also crashes in Netscape (but not as bad). Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Escaping Chars
I need to get a password value from a form, store it in a database and then later be able to compare a login password to the one stored in the db. This works great unless the password contains the '\' char. magic_quotes_gpc is ON and magic_quotes_runtime is OFF. As a klude, I tried just removing slashes from the input password using stripslashes() before storing it in the db and then testing to see if stripslashes(val from db)=stripslashes(val from form) in the login test to see if they match. (the user shouldn't even know that slashes are being striped, so I have to strip them on each input). They still don't match if a slash is input for the original password storage, but I don't know why. However, instead of this work-around (that doesn't even work), what I'd really like to do is allow ANY character in the password, but take care of all the quoting and escaping along the way (both ways...). How is the best way to do that? Thanks, [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dynamic input fields in Form
Hi, Thanks for the answer; but there is nobody who can show me an example in code??? Regards, Frank - Original Message - From: Jon Haworth [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, February 07, 2003 1:45 PM Subject: RE: [PHP] Dynamic input fields in Form Hi Frank, I have a form where the user selects for example; how many cars you have: 4. Then it most dynamicly create 4 input fields [...] Using only PHP, you'll have to make this a two-step process where page 1 collects the number of cars and posts to page 2, which generates the form accordingly. If is has to be done on the same page, you'll need to call a Javascript function every time the number of cars changes. That function will have to add or remove inputs from the form depending on the number of cars entered, and of course the whole page will break completely for anyone without Javascript. I'd make it a two-step process myself, it's considerably more robust and offers considerably less room for problems (what happens if I claim I have five cars, fill out their details, and then change it to three cars? which details do you get rid of?) Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Uploading an image to a db
Greetings, people. I have the following code to upload an image to a db: if (isset($imgLogo) $imgLogo != none) $data = addslashes(fread(fopen($imgLogo, r), filesize($imgLogo))); else $data = ; Then I just INSERT INTO table (image) VALUES $data but I think that the string that contains the image gets truncated somehow. Can anybody tell me why? Is the addslashes really needed? I'm using php 4.2.1. Thanks in advance. -- Un gran saludo/Big regards... Arturo Barajas, Tech Support Supervisor IT PPG México (427) 271-9918, x448 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GD Chinese support - php4.3
Hi, Saturday, February 8, 2003, 3:30:11 AM, you wrote: ED any one know how display Chinese Characters (tradition or simplified) in ED GD.? ED is that something deal with multibyte functions...? ED i have installed the bundled GD and Libjpeg ED they all worked perfectly with english words ED but when i generate a Chinese character, it just display two symbols ED i've already set the encoding (of php) to BIG5 ED and even i use mb_detect_encoding() it can show BIG-5 ED but when i use ImageTTFtext(blah blah blah , mb_convert_encoding([Chinese ED word here],BIG-5) ED it pops out 2 symbol ED the ttf font i loaded is the one distributed by Microsoft (HKSCS) ED any php experts know how to solve this problem? ED Thank you all :) ED Regards, ED Eddy @ Hong Kong ED [EMAIL PROTECTED] You will probably find the microsoft font is unicode not Big5 -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strings and regular expression?
Hi guys, I have 2 strings $a1=1,8,98,244,9,243,2,6,36,3,111,; $a2=8,98,244,9,243,2,1,6,36,3,111,; How can I exactly match 1, in both strings using one regular expression? (first 1 is the first element and second time in a random position)? Thanks, Radu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dynamic input fields in Form
Based on your description it could litterally be coded one of a hundred different ways. The way I would code a small problem like this is in a monolithic logical construct such as the if/else statement below. This allows you to be a little bit more careless how you construct the page. Another conditional statement can be put above or below the form to capture and perform whatever is needed on the $_POST[carmake] array. form method=POST value=test.php ? if (isset($_POST['numcars']) is_numeric($_POST['numcars'])) { for ($i=1; $i=$_POST['numcars']; $i++) { echo Car # $i select name=\carmake[]\ option selected value=''-- Choose Car Make --/option optionChrysler/option optionChevy/option optionDodge/option optionFord/option /selectbr; } } else { echo How many cars? input type=\text\ name=\numcars\ value=\\br; } ? input type=submit value=SUBMIT /form - Kevin - Original Message - From: Frank Keessen [EMAIL PROTECTED] To: Jon Haworth [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, February 07, 2003 10:54 AM Subject: Re: [PHP] Dynamic input fields in Form Hi, Thanks for the answer; but there is nobody who can show me an example in code??? Regards, Frank - Original Message - From: Jon Haworth [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, February 07, 2003 1:45 PM Subject: RE: [PHP] Dynamic input fields in Form Hi Frank, I have a form where the user selects for example; how many cars you have: 4. Then it most dynamicly create 4 input fields [...] Using only PHP, you'll have to make this a two-step process where page 1 collects the number of cars and posts to page 2, which generates the form accordingly. If is has to be done on the same page, you'll need to call a Javascript function every time the number of cars changes. That function will have to add or remove inputs from the form depending on the number of cars entered, and of course the whole page will break completely for anyone without Javascript. I'd make it a two-step process myself, it's considerably more robust and offers considerably less room for problems (what happens if I claim I have five cars, fill out their details, and then change it to three cars? which details do you get rid of?) Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Column count doesn't match value count at row 1?
Hey, I can't seem to figure this out. I am modifying some else's script I added some rows to the myself database and no I get this error when I try to add information to the database. I am searching the docs but I can't seem to find the answer. Thanks, Jeremy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Virtual Directory Support
On my phpinfo() it shows Virtual Directory Support to be DISABLED .. does anyone know what the switch setting is called in the php.ini file to ENABLE this setting? Thanks!
Re: [PHP] Column count doesn't match value count at row 1?
- Original Message - From: Jeremy Bowen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 07, 2003 1:30 PM Subject: [PHP] Column count doesn't match value count at row 1? That means the the number of columns in the fields clause doesn't match the number in the values. For example: INSERT INTO table (column1,column2) values('hello','cruel','world'); [that' two columns, and three values, right] If you're not listing columns, then you have to list all columns in values or at least pass NULL. Echo out the sql, and count the columns. I find it useful in long sql statements to add newlines regularly, and the line number becomes more useful (although in your case that probably won't help much since it's going to error at the end). Post the sql if you can' figure it out -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Avoiding several windows with the same session
I place session_start(); if (!session_is_registered('somevar')) { header('location: login.php'); exit(); } at the top of all my pages to prevent people to view pages before they log in. However, once thay have logged in succesfully, they can ctrl-U in IE to open a new window. This new window 'inherits' the session id and hence it does not redirects to the login page. Is there any way to avoid this situation so that people cannot have several windows with the same session open? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Column count doesn't match value count at row 1?
--- Jeremy Bowen [EMAIL PROTECTED] wrote: I am modifying some else's script I added some rows to the myself database and no I get this error when I try to add information to the database. Most likely, the SQL statement in question is something like this: insert into foo values ('bar', 'php', 'stuff'); In this example, table foo has three columns. Because the insert statement doesn't specify the columns, it is assumed that a value is being given for each. If you alter the database to add a column to foo, this statement will fail, because there are four columns and three values. You can: 1. Change the SQL statement to specify the columns that were being used before (basically all of them except the ones you added) or 2. Change the SQL statement to include a value for each column you added. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problems in uploading files due to upload_max_filesize
I have a problem with transfer of Image files to the server. I've checked with the aid of phpinfo on my service provider's server and this is what I found upload_max_filesize 200K. My page needs to upload 9 images simultaneously each one of them having the size between 45 kb to 50kb, Can any one help me with this? Thanks again. GD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fw: [PHP] Avoiding several windows with the same session
That's interesting.. the session id should be different for each instance of the browser. The only exception I can think of is the MacOS since it runs multiple windows within the same instance of the application. This assumption is untested of course. Maybe it would help for you to explain why you need to do this? -Kevin - Original Message - From: Roman Sanchez [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 07, 2003 11:56 AM Subject: [PHP] Avoiding several windows with the same session I place session_start(); if (!session_is_registered('somevar')) { header('location: login.php'); exit(); } at the top of all my pages to prevent people to view pages before they log in. However, once thay have logged in succesfully, they can ctrl-U in IE to open a new window. This new window 'inherits' the session id and hence it does not redirects to the login page. Is there any way to avoid this situation so that people cannot have several windows with the same session open? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PhpBB2 Error
Hello All, I have been runing PHP BB2 successfully on my site for a couple of months . Recently I got this error. phpBB : Critical Error Could not connect to the database Can someone tell what this means..?? Many Thanks --Pushpinder Singh Garcha _ Web Architect Pushpinder Singh Garcha _ Web Architect
Re: [PHP] PhpBB2 Error
I have been runing PHP BB2 successfully on my site for a couple of months . Recently I got this error. phpBB : Critical Error Could not connect to the database Can someone tell what this means..?? It means phpBB cannot connect to the database. ---John Holmes... PS: You'll want to check your login and password, make sure the database is running, etc...all of the stuff that should be obvious when you get an error like this. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Avoiding several windows with the same session
I place session_start(); if (!session_is_registered('somevar')) { header('location: login.php'); exit(); } at the top of all my pages to prevent people to view pages before they log in. However, once thay have logged in succesfully, they can ctrl-U in IE to open a new window. This new window 'inherits' the session id and hence it does not redirects to the login page. Is there any way to avoid this situation so that people cannot have several windows with the same session open? No. It shouldn't matter, as that's a client side issue. Who cares how many windows they have open. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Avoiding several windows with the same session
If you are using cookies the new window will pick it up. Have the original page change a variable to say that it has loaded then when the new window loads have it check that variable first. -Original Message- From: Roman Sanchez [mailto:[EMAIL PROTECTED]] Sent: Friday, February 07, 2003 1:57 PM To: [EMAIL PROTECTED] Subject: [PHP] Avoiding several windows with the same session I place session_start(); if (!session_is_registered('somevar')) { header('location: login.php'); exit(); } at the top of all my pages to prevent people to view pages before they log in. However, once thay have logged in succesfully, they can ctrl-U in IE to open a new window. This new window 'inherits' the session id and hence it does not redirects to the login page. Is there any way to avoid this situation so that people cannot have several windows with the same session open? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Avoiding several windows with the same session
If you are using cookies the new window will pick it up. Have the original page change a variable to say that it has loaded then when the new window loads have it check that variable first. How do you tell a new window from a new request though? You can't. The cookies are all there, the session is still there. Two requests from two windows will look the same as two requests from a single window to a web server. It shouldn't matter to your application. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dynamic input fields in Form
Thanks for the answer; but there is nobody who can show me an example in code??? You mean do the work for you? Do you want the PHP or Javascript solution? Only one can be posted on this list... The PHP one is simple. Assuming $_POST['num'] is the number from your drop down... for($x=0;$x$_POST['num'];$x++) { echo 'input type=text'; } That's it. ---John Holmes... I have a form where the user selects for example; how many cars you have: 4. Then it most dynamicly create 4 input fields [...] Using only PHP, you'll have to make this a two-step process where page 1 collects the number of cars and posts to page 2, which generates the form accordingly. If is has to be done on the same page, you'll need to call a Javascript function every time the number of cars changes. That function will have to add or remove inputs from the form depending on the number of cars entered, and of course the whole page will break completely for anyone without Javascript. I'd make it a two-step process myself, it's considerably more robust and offers considerably less room for problems (what happens if I claim I have five cars, fill out their details, and then change it to three cars? which details do you get rid of?) Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Protecting include files
If someone wants to call your .inc file like http://www.my.site/lib.inc they will see the code, as it is a text file. OK, we all know that. As the .inc file is in reality a renamed php script, containing variables, functions, etc, if you call it .php instead of .inc, it will be parsed by PHP, but as you have no output (echo or print() ), you will just see a blank page. To illustrate better, I use a large (20k) PHP library on my site. It was called stdlib.inc, but because of the problem listing .inc files, I renamed it stdlib.php. If you want to test, look here. You should only see a blank page, and not 1200 lines of code! http://www.dlpage.com/lib/stdlib.php Cheers, Daniel Sid [EMAIL PROTECTED] a écrit dans le message news: [EMAIL PROTECTED] Hi, I have a php script which includes .inc files. Is there any way in which I can prevent a normal surferfrom viewing these files. Is there any command that I can add to a .htaccess file. Thanks ~~~ \\__ ! SIDDHARTH HEGDE / CHAOSGAMERZ.COM ! ! Webmaster \ For PC Game screeshots, cheat! ! http://www.ChaosGamerz.COM o| o codes, trainers, downloads, ! ![EMAIL PROTECTED]( |_ game music, FREE e-mail and even ! ! ICQ 84475206 |-- FREE FULL VERSION games for that ! ~~ \___/ 486-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strings and regular expression?
$a1=1,8,98,244,9,243,2,6,36,3,111,; $a2=8,98,244,9,243,2,1,6,36,3,111,; How can I exactly match 1, in both strings using one regular expression? (first 1 is the first element and second time in a random position)? if(preg_match('/(^|,)1(,|$)/',$str)) { echo one is found; } ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Multi-User phpMyAdmin
Can anyone tell me a tutorial on how to setup a multi-user phpmyadmin installation? I would like to just have one central copy, then have other users able to access their corresponding database in phpMyAdmin. How can I do this? Thanks,Stephen Cratonhttp://www.melchior.us "What's the point in appearance if your true love, doesn't care about it?" -- http://www.melchior.us -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 3 tier web development
//Class to handle ALL operations an ANY database You may want to change that... it only does 2 operations and it only does them for two databases... ---John Holmes... - Original Message - From: Daniel Masson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 07, 2003 11:28 AM Subject: RE: [PHP] 3 tier web development About the database sigue .. i dont use ADOD or PEAR .. I use this: //Class to handle ALL operations an ANY database Class data_base ( //Predetermined value of attributes, you can safely override this when //do many instances of this class $dbtype = mssql; $duser = user; $dbname = name; $dbpass = x; function connect() { if ($this-dbtype == mssql) { retrun function_to_connect_to_mssql($this-user, ); } elseif ($this-dbtype == mysql) { retrun function_to_connect_to_mysql($this-user, ); } } function query() { if ($this-dbtype == mssql) { retrun function_to_query_mssql($this-connection, ); } elseif ($this-dbtype == mysql) { retrun function_to_query_mysql($this-connection, ); } } ); Daniel E Massón. Ingeniero de desarrollo [EMAIL PROTECTED] Imagine S.A. Su Aliado Efectivo en Internet www.imagine.com.co (57 1)2182064 - (57 1)6163218 Bogotá - Colombia - Soluciones web para Internet e Intranet - Soluciones para redes - Licenciamiento de Software - Asesoría y Soporte Técnico -Mensaje original- De: Hardik Doshi [mailto:[EMAIL PROTECTED]] Enviado el: viernes, 07 de febrero de 2003 10:50 Para: [EMAIL PROTECTED]; [EMAIL PROTECTED] Asunto: RE: [PHP] 3 tier web development Hi Daniel, Thanks for your comments. What is the difference between PHP nuke and Smarty engine? Can we use PEAR or ADODB as database abstraction layer? Which one is the best on everyone's experience? thanks Hardik --- Daniel Masson [EMAIL PROTECTED] wrote: Hardik: Maybe this can help: Im currently using PHP using MCV (Model Control View) Methology, Model is about libraries and classes like the business rules of your application, Control has to do with the como control sentences you must use like IF, WHILE,FOREACH, ... , and View is the look and file of the app , HTML, IMAGES, ... Have a look on smarty http://smarty.php.net , and there you can learn how to use HTML and PHP And about the databse tier .. I use a class named data_base .. with attributes like: -dbtype -dbhost -dbuser -dbpassword and the instances of the class can handle many databases .. and guarantee the portability .. I hope this helps. Regards. Daniel. -Mensaje original- De: Hardik Doshi [mailto:[EMAIL PROTECTED]] Enviado el: viernes, 07 de febrero de 2003 10:24 Para: [EMAIL PROTECTED] Asunto: [PHP] 3 tier web development Hi Everyone, I am curious to know how one can develop 3-tier web based applications using PHP, MySQL. Here Database should be changed in future using database abstraction layer. Can anybody tell me in detail that how can i build 3 tier flexible web application? More questions on this thread: 1. How one can seperate HTML and PHP (or any other programming code). Is there anything in PHP so i can seperate Interface layer and programming logic layer? 2. I know that we can use Database abstraction layer so in future it is really easy to change database as per need. Can any one tell me which database abstraction layer is the best for future applications. 3. There is lots of talk about CMS today. Does anyone know about PHP based CMS (PHP-Nuke?? i dont know)? Currently i am making 2 tier systems (HTML+PHP, Database) I want to switch my applications to 3 tier (HTML, php and database). Please give me enough guidance. thanks Hardik __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How to insert time and date into mysql?
The easiest way is to create a timestamp field (see manual depending on how you want to store the date, as you can go from to ddmmhhmmss...), and when you create your DB update query, use now(). for example, update a field with a new email address, and the user's current ip with the time of the update where his user id number is 123456789. UPDATE mail_address SET email = '$email', timesent = now(), ip = '$ip' WHERE user_id = 123456789; now() will set the value of the field timesent to the current time of the mysql server. Cheers, Daniel Zenith [EMAIL PROTECTED] a écrit dans le message news: 97jep3$sgu$[EMAIL PROTECTED] How can I insert time and date into mysql table, if the table i have to insert has a field of type time, and a field of type date. Then how can I insert it in PHP, if I use time() function?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Multi-User phpMyAdmin
Can anyone tell me a tutorial on how to setup a multi-user phpmyadmin installation? I would like to just have one central copy, then have other users able to access their corresponding database in phpMyAdmin. How can I do this? Thanks, Stephen Craton http://www.melchior.us What's the point in appearance if your true love, doesn't care about it? -- http://www.melchior.us -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is_numeric fails and don't know why
Well, since is_numeric('.101972E+00') works on it's own, there must be something else coming with it from the file that makes it fail. Try to trim() each number before you test it. Maybe that'll help. ---John Holmes... - Original Message - From: fmendezpalma [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 07, 2003 7:29 AM Subject: [PHP] is_numeric fails and don't know why Hi, I'm trying to read a file that contains a group of numbers, each of them in one line of the file. I need to verify that the file is valid, so i read line by line and test if the line is numeric: ... $line = fgets ($FileDesc); $line = trim ($line); if (!is_numeric ($line)) return 0; ... It doesn't work for the first and last line of the file. Last line is a \r, so perhaps it's normal, but I don't understand why it fails with first line. Example: .101972E+00 (first line) -.122713E+01 .784379E-01 -.135826E+01 -.217017E+01 ... first line is not considered as a number. Rest of lines are considered as numbers. Where is the problem? Thanks for your help. _ Horas ilimitadas para leer y enviar correos con Tarifa Plana Wanadoo ¡¡ desde las 3 de la tarde!! Compruébalo en http://www.wanadoo.es/acceso-internet -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Protecting include files
--- Daniel Page [EMAIL PROTECTED] wrote: If someone wants to call your .inc file like http://www.my.site/lib.inc they will see the code, as it is a text file. OK, we all know that. No, we don't, because that is not entirely correct. There are many cases where your Web server will not serve that content raw. You can make it treat *.inc files as PHP (which is just as bad of a suggestion as your suggestion of renaming them *.php), you can deny requests to *.inc files, or you can place your *.inc files outside of document root, just to name a few. As the .inc file is in reality a renamed php script, containing variables, functions, etc, if you call it .php instead of .inc, it will be parsed by PHP Actually, it will be executed, not just parsed. Executing modules out of context like this can be dangerous, but placing everything within functions as you mention does mitigate this risk. However, when possible (when is it not?), it is much safer to simply place your *.inc files outside of document root. PHP includes files based on their path on the filesystem, not by URL, so this works out well. This should be in an FAQ somewhere... Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Limit the amount of returns in a MySQL query
Hi All, Imagine I have a giant database table tracking email addresses (I don't but it is the first example that jumps to mind after my recent antispam campaign!). If i do a select * from mailaddresses; I will get all of the table. If i do a select * from mailaddresses where id 10; I will get all the records where the id is less than 10... The problem is that I want 10 records, period, so if id is not a primary key, I could have 60 records that match... or if it is a P.K., but I delete 2 to 8, it will only return 2 records (1 and 9...) How can I structure the query to only return only 10 records ? the idea being able to construct a query where if there are more than 10 (or x) results on a page, you click on a link 'page 2' and so on, and the next query will return the next 10 (or x) records... Cheers, Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Limit the amount of returns in a MySQL query
select * from mailaddresses where id 10 LIMIT 10; -Original Message- From: Daniel Page [mailto:[EMAIL PROTECTED]] Sent: Friday, February 07, 2003 2:53 PM To: [EMAIL PROTECTED] Subject: [PHP] Limit the amount of returns in a MySQL query Hi All, Imagine I have a giant database table tracking email addresses (I don't but it is the first example that jumps to mind after my recent antispam campaign!). If i do a select * from mailaddresses; I will get all of the table. If i do a select * from mailaddresses where id 10; I will get all the records where the id is less than 10... The problem is that I want 10 records, period, so if id is not a primary key, I could have 60 records that match... or if it is a P.K., but I delete 2 to 8, it will only return 2 records (1 and 9...) How can I structure the query to only return only 10 records ? the idea being able to construct a query where if there are more than 10 (or x) results on a page, you click on a link 'page 2' and so on, and the next query will return the next 10 (or x) records... Cheers, Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Limit the amount of returns in a MySQL query
if (!isset($startlimit)) { $startlimit = 0; } $endlimit = $startlimit + 10; $yourquery = your query data LIMIT $startlimit, $endlimit that should give you enough insight on how to work it. Chad -Original Message- From: Daniel Page [mailto:[EMAIL PROTECTED]] Sent: Friday, February 07, 2003 3:53 PM To: [EMAIL PROTECTED] Subject: [PHP] Limit the amount of returns in a MySQL query Hi All, Imagine I have a giant database table tracking email addresses (I don't but it is the first example that jumps to mind after my recent antispam campaign!). If i do a select * from mailaddresses; I will get all of the table. If i do a select * from mailaddresses where id 10; I will get all the records where the id is less than 10... The problem is that I want 10 records, period, so if id is not a primary key, I could have 60 records that match... or if it is a P.K., but I delete 2 to 8, it will only return 2 records (1 and 9...) How can I structure the query to only return only 10 records ? the idea being able to construct a query where if there are more than 10 (or x) results on a page, you click on a link 'page 2' and so on, and the next query will return the next 10 (or x) records... Cheers, Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Multi-User phpMyAdmin
IIRC, when you use the 'cookie' or 'http' method of authentication, it'll validate everything against the actual mysql.user database and only let them access what they have permissions to. In other words, you set up your users and permissions in MySQL. When they log into PHPMyAdmin, they're actually logging into MySQL and they get the permissions you set for them. ---John Holmes... - Original Message - From: Stephen [EMAIL PROTECTED] To: PHP List [EMAIL PROTECTED] Sent: Friday, February 07, 2003 3:31 PM Subject: [PHP] Multi-User phpMyAdmin Can anyone tell me a tutorial on how to setup a multi-user phpmyadmin installation? I would like to just have one central copy, then have other users able to access their corresponding database in phpMyAdmin. How can I do this? Thanks, Stephen Craton http://www.melchior.us What's the point in appearance if your true love, doesn't care about it? -- http://www.melchior.us -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ImageJPEG?
Quickie I want to save a modified jpeg to a file. I can out put it by doing this: Header(Content-type: image/jpeg); imagejpeg($image_thum); imagedestroy($image_thum); I want to save it to this location: /images/1000/ with its original filename but with a t_ attached to the begining. I tried this: $uploadpath = /images/1000/; $temp = t_.$imagefilename; $imagefilename = $temp; $dest = $uploadpath.$imagefilename; ImageJPEG($image_thum,$dest); but that did nothing. What am I doing wrong? Cheers John Wards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problems with sessions
I've got an odd problem . . . I've got a PHP site (PHP 4.2.2, Apache 1.3.26, Linux box) that uses sessions to track a user_id for each user. I use the user_id to grant various rights. This works like a dream 95% of the time. But every once in awhile, the session information gets lost. It's so rare that I have only seen it happen once or twice, but my customer, who works on the site all day, sees it 4 or 5 times a day. I added code to send me an email whenever it happens, with some debugging info. The session parameter (called $user_id), just ends up blank (actually, unset) at random times. I've tried to see some pattern, but there doesn't seem to be one. It can happen on any page at any time. It doesn't seem to correlate to times of heavy usage, either. I'm really at a loss for this. Any ideas would be mucho appreciated! -- John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] 3 tier web development
Mr. Holmes Im assuming that you can add all the other database operations and the other dbtypes ... that was just the short version. Daniel E Massón. Ingeniero de desarrollo [EMAIL PROTECTED] Imagine S.A. Su Aliado Efectivo en Internet www.imagine.com.co (57 1)2182064 - (57 1)6163218 Bogotá - Colombia - Soluciones web para Internet e Intranet - Soluciones para redes - Licenciamiento de Software - Asesoría y Soporte Técnico -Mensaje original- De: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] Enviado el: viernes, 07 de febrero de 2003 15:35 Para: [EMAIL PROTECTED]; [EMAIL PROTECTED] Asunto: Re: [PHP] 3 tier web development //Class to handle ALL operations an ANY database You may want to change that... it only does 2 operations and it only does them for two databases... ---John Holmes... - Original Message - From: Daniel Masson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 07, 2003 11:28 AM Subject: RE: [PHP] 3 tier web development About the database sigue .. i dont use ADOD or PEAR .. I use this: //Class to handle ALL operations an ANY database Class data_base ( //Predetermined value of attributes, you can safely override this when //do many instances of this class $dbtype = mssql; $duser = user; $dbname = name; $dbpass = x; function connect() { if ($this-dbtype == mssql) { retrun function_to_connect_to_mssql($this-user, ); } elseif ($this-dbtype == mysql) { retrun function_to_connect_to_mysql($this-user, ); } } function query() { if ($this-dbtype == mssql) { retrun function_to_query_mssql($this-connection, ); } elseif ($this-dbtype == mysql) { retrun function_to_query_mysql($this-connection, ); } } ); Daniel E Massón. Ingeniero de desarrollo [EMAIL PROTECTED] Imagine S.A. Su Aliado Efectivo en Internet www.imagine.com.co (57 1)2182064 - (57 1)6163218 Bogotá - Colombia - Soluciones web para Internet e Intranet - Soluciones para redes - Licenciamiento de Software - Asesoría y Soporte Técnico -Mensaje original- De: Hardik Doshi [mailto:[EMAIL PROTECTED]] Enviado el: viernes, 07 de febrero de 2003 10:50 Para: [EMAIL PROTECTED]; [EMAIL PROTECTED] Asunto: RE: [PHP] 3 tier web development Hi Daniel, Thanks for your comments. What is the difference between PHP nuke and Smarty engine? Can we use PEAR or ADODB as database abstraction layer? Which one is the best on everyone's experience? thanks Hardik --- Daniel Masson [EMAIL PROTECTED] wrote: Hardik: Maybe this can help: Im currently using PHP using MCV (Model Control View) Methology, Model is about libraries and classes like the business rules of your application, Control has to do with the como control sentences you must use like IF, WHILE,FOREACH, ... , and View is the look and file of the app , HTML, IMAGES, ... Have a look on smarty http://smarty.php.net , and there you can learn how to use HTML and PHP And about the databse tier .. I use a class named data_base .. with attributes like: -dbtype -dbhost -dbuser -dbpassword and the instances of the class can handle many databases .. and guarantee the portability .. I hope this helps. Regards. Daniel. -Mensaje original- De: Hardik Doshi [mailto:[EMAIL PROTECTED]] Enviado el: viernes, 07 de febrero de 2003 10:24 Para: [EMAIL PROTECTED] Asunto: [PHP] 3 tier web development Hi Everyone, I am curious to know how one can develop 3-tier web based applications using PHP, MySQL. Here Database should be changed in future using database abstraction layer. Can anybody tell me in detail that how can i build 3 tier flexible web application? More questions on this thread: 1. How one can seperate HTML and PHP (or any other programming code). Is there anything in PHP so i can seperate Interface layer and programming logic layer? 2. I know that we can use Database abstraction layer so in future it is really easy to change database as per need. Can any one tell me which database abstraction layer is the best for future applications. 3. There is lots of talk about CMS today. Does anyone know about PHP based CMS (PHP-Nuke?? i dont know)? Currently i am making 2 tier systems (HTML+PHP, Database) I want to switch my applications to 3 tier (HTML, php and database). Please give me enough guidance. thanks Hardik __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you
Re: [PHP] PhpBB2 Error
Pushpinder Singh Garcha wrote: Hello All, I have been runing PHP BB2 successfully on my site for a couple of months . Recently I got this error. phpBB : Critical Error Could not connect to the database Can someone tell what this means..?? Many Thanks --Pushpinder Singh Garcha _ Web Architect Pushpinder Singh Garcha _ Web Architect It means that the MySQL server is down, or your database account was removed or you or someone with access messed with the config and messed up the DB settings. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail() vs sockets
Question regarding php's mail function. I've created a targetted mail system for a client, that uses the mail() function to send the the customer list. I find it's ok for a few hundred names, however the client has a list of over 1 and I know that would be way to taxing on the server, as some tests have shown. I got the following function off the php.net site and I'm wondering if something like this will be significantly more efficient than using the mail function. function sendmail($to='', $subject='', $message='', $headers='', $extra='') { $fd = popen(/usr/sbin/sendmail -t $extra, 'w'); fputs($fd, To: $to\n); fputs($fd, Subject: $subject\n); fputs($fd, X-Mailer: PHP4\n); if ($headers) { fputs($fd, $headers\n); } fputs($fd, \n); fputs($fd, $message); pclose($fd); } At this point using perl or another language is not an option. Any advice or links would be appreciated. Cheers, Jeff.
Re: [PHP] ImageJPEG?
On Friday 07 Feb 2003 9:26 pm, you wrote: Other than that you're code looks good to me. Arrrgh! Bl*0dy cacheing in my ftp programgr Cheers for looking though! John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Limit the amount of returns in a MySQL query
--- Chad Day [EMAIL PROTECTED] wrote: if (!isset($startlimit)) { $startlimit = 0; } $endlimit = $startlimit + 10; $yourquery = your query data LIMIT $startlimit, $endlimit that should give you enough insight on how to work it. Nice example. As an interesting tidbit, the LIMIT clause is not standard ANSI92 SQL and was invented by PHP's creator, Rasmus. So, you can thank him for this useful clause. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] odbc_prepare
I am using MSSQL. I need to speed up a page. I have 3 count queries and one data query that gets loop through by the # of items * # of weeks that I need to return. Basically 460 as a general idea. I thought about using the prepare statement, something I have notice in pear. But its not support in mssql. So I decide to try the odbc but am having trouble. Not sure how to pass different variables through the odbc execute. Is there a better way? If not has anyone use this type of arrangement before? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] more efficient alternative to mail()
Question regarding php's mail function. I've created a targetted mail system for a client, that uses the mail() function to send the the customer list. I find it's ok for a few hundred names, however the client has a list of over 1 and I know that would be way to taxing on the server, as some tests have shown. I got the following function off the php.net site and I'm wondering if something like this will be significantly more efficient than using the mail function. function sendmail($to='', $subject='', $message='', $headers='', $extra='') { $fd = popen(/usr/sbin/sendmail -t $extra, 'w'); fputs($fd, To: $to\n); fputs($fd, Subject: $subject\n); fputs($fd, X-Mailer: PHP4\n); if ($headers) { fputs($fd, $headers\n); } fputs($fd, \n); fputs($fd, $message); pclose($fd); } At this point using perl or another language is not an option. Any advice or links would be appreciated. Cheers, Jeff.
Re: [PHP] Strings and regular expression?
This one time, at band camp, 1LT John W. Holmes [EMAIL PROTECTED] wrote: $a1=1,8,98,244,9,243,2,6,36,3,111,; $a2=8,98,244,9,243,2,1,6,36,3,111,; How can I exactly match 1, in both strings using one regular expression? (first 1 is the first element and second time in a random position)? if(preg_match('/(^|,)1(,|$)/',$str)) { echo one is found; } if(strstr($string, '1,') == 'FALSE){ echo 'No match found'; }else{ echo 'Found a match'; } No need for costly regex Kevin -- __ (_ \ _) ) | / / _ ) / _ | / ___) / _ ) | | ( (/ / ( ( | |( (___ ( (/ / |_| \) \_||_| \) \) Kevin Waterson Port Macquarie, Australia -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] more efficient alternative to mail()
Question regarding php's mail function. I've created a targetted mail system for a client, that uses the mail() function to send the the customer list. I find it's ok for a few hundred names, however the client has a list of over 1 and I know that would be way to taxing on the server, as some tests have shown. I got the following function off the php.net site and I'm wondering if something like this will be significantly more efficient than using the mail function. function sendmail($to='', $subject='', $message='', $headers='', $extra='') { $fd = popen(/usr/sbin/sendmail -t $extra, 'w'); fputs($fd, To: $to\n); fputs($fd, Subject: $subject\n); fputs($fd, X-Mailer: PHP4\n); if ($headers) { fputs($fd, $headers\n); } fputs($fd, \n); fputs($fd, $message); pclose($fd); } At this point using perl or another language is not an option. Any advice or links would be appreciated. Cheers, Jeff.
[PHP] Efficient alternative to mail()
Question regarding php's mail function. I've created a targetted mail system for a client, that uses the mail() function to send the the customer list. I find it's ok for a few hundred names, however the client has a list of over 1 and I know that would be way to taxing on the server, as some tests have shown. I got the following function off the php.net site and I'm wondering if something like this will be significantly more efficient than using the mail function. function sendmail($to='', $subject='', $message='', $headers='', $extra='') { $fd = popen(/usr/sbin/sendmail -t $extra, 'w'); fputs($fd, To: $to\n); fputs($fd, Subject: $subject\n); fputs($fd, X-Mailer: PHP4\n); if ($headers) { fputs($fd, $headers\n); } fputs($fd, \n); fputs($fd, $message); pclose($fd); } At this point using perl or another language is not an option. Any advice or links would be appreciated. Cheers, Jeff. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Protecting include files
I have used a few different Web hosting companies, and I have never seen a case where my home directory was my document root. I have always had a directory like public_html/ or www/ that was my personal document root, so as long as I don't place files in there, they are not accessible via URL. Does your experience differ? I have experience with 3 hosters...My homepage - 10 ? a year, no frills, no tech support except via forum where I parked my domain. They allocate a web root directory (/home/dh) for my homepage,You control what you place there and everything is visible unless you .htaccess the directory. For work, our old ISP still has a hosting contract for our old site that is still active. You can get the company to create a directory with specific access rights for FTP access... but you cannot access these directories at all via the web server (lack of access rights for apache and php) - and their phone support is worse than what I pay 10 euros a year from my personal host, but that is another discussion! As for our 50 meg of space that we recieve at work from FT-Oleane with our internet access package, I believe that it is again a plain, no frills, no private directory visible root... I know that you can get much better services, but from there, you really need to go and rent a virtual linux box, and not just space on what is called here mutualised hosting, or even trust your business oriented ISP to give you a professional hosting and online storage solution... but for that, the price is not the same... The final solution is to install a Linux gateway for the home network, and get a dynamic DNS solution up and running, and from there, you manage your own rights, and to heck with 200 sites on a box! (the bandwidth could be better too!) Cheers, Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] delete query doesnt work
i have a delete query: mysql_query(delete from members where company='$delete'); it doesnt work should i change it to : mysql_query(delete from members where company like '$delete');?? the first one worked in mysql client but it doesnt work in php script for some reason... also having problems with update... if nothing on the form changes and it gets submitted anyways all the records in the db gets changed to the same thing that one record has in it... --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strings and regular expression?
$a1=1,8,98,244,9,243,2,6,36,3,111,; $a2=8,98,244,9,243,2,1,6,36,3,111,; How can I exactly match 1, in both strings using one regular expression? (first 1 is the first element and second time in a random position)? if(preg_match('/(^|,)1(,|$)/',$str)) { echo one is found; } if(strstr($string, '1,') == 'FALSE){ echo 'No match found'; }else{ echo 'Found a match'; } No need for costly regex Very true, I agree. For your solution, though, wouldn't it correctly match a string such as '2,3,11,12' even though there is no entry that's just one? I assumed that one could be the last value in the string also, though, and hence the regular expression. If the 1 can be the last number in the string, then you could also use something like your solution (looking for ',1,') and include an OR that checks for the last two characters being ',1' OR the first two characters being '1,' Check if that or the regex is faster. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php