[PHP] Sybase Database CONNECTIVITY!
Hi, How can I connect PHP application on Linux to the Sybase database which is lying on the different machine. Please help me. Regards, Vivek
RE: [PHP] Installing Syncronizing
This is where we find several problems. The first one, is the price for such equipment here in Argentina (more than double in US Dollars), which is the main reason we try to get around with software. The second issue, is that the local DB may have to work synchronized with an on-line one in the near future, in order to serve as information to my client's customers. I think I won't be able to tell the PHP scripts to connect to my customer's server, due to a daily IP change from his ISP. -Original Message- From: Dave Goodrich [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 20, 2002 7:41 PM To: César Aracena Cc: PHP General List; MySQL General Subject: Re: [PHP] Installing Syncronizing On Thu, Jun 20, 2002 at 07:26:37PM -0300, César Aracena wrote: Hello all, I have this client who has a T connection and would like to run a PHP / MySQL based program in local mode, but also be able to make the data available from the web but hosted in a remote server kinda strange u think? Me too The problem is that his server doesnt run with IIS but with a little ap called WinGate, which gives him all the approach for his little network. Have anyone installed the PHP / MySQL under MS NT4.0 running WinGate before? Anything to tell me that will help me in the process? Do you mean the Wingate connection sharing software? The experiences I have with clients running Wingate were not good. My thoughts are that if the customer can pay you for the application then they can pay for a gateway router. SOHO routers are not expensive. The customers connection will work better, his application will be more stable, and your task will be easier. Everyone wins. But then again, it is just my opinion ;^) DAve -- Dave Goodrich System Administrator TLS.NET Columbus IN http://tls.net [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mysql Insert from select problem with php
I bet you are double-escaping it. Try without the AddSlashes() call. By default PHP will escape this for you automatically. -Rasmus On Thu, 20 Jun 2002, David McInnis wrote: After posting this on the MySQL list and getting some feedback we were able to determine that this was not a flaw with MySQL. Any ideas from the PHP community? === Can anyone tell me why this does not work? I am using php and mysql. When I do an insert from select into a mysql table I get an error whenever a value from the select portion of the query contains an apostrophe. Before I insert the initial value I use the php addslashes() function to escape the ' and characters. For example: If clients table contans a field called fname and it has a value of O'Henry. Remembering that I have used addslashes() before inserting the value into mysql in the first place. The following query will fail on insert: Sql = insert into orders (fname) SELECT fname from clients where clientid = '$clientid'; David McInnis -- 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] Stumped on a function
I've been using the following function successfully for months, tonight I literally copied/pasted it to another page I was creating, called it exactly the same using the same data type, and I'm getting an incorrect result. The function is supposed to take a standard MySQL CCYY-MM-DD date format and convert it to a Month Day, CCYY format. Here's the function code: function cleandate($indate) { str_replace(-, /, $indate); return date(F j, Y, strtotime($indate)); } And I'm calling it with: $newdate = cleandate($birthdate); $birthdate is a MySQL DATE field and if I echo $birthdate I get 2002-11-04, which is what is entered for that $birthdate record. However, when I echo $newdate using the above code, I get June 20, 2002 - today's date. Now, again I'm using this code as-is successfully on another page. I don't understand why it's returning today's date on this page, but returning the correct date on another page. This is the error that PHP is throwing regarding the above code: [Thu Jun 20 23:16:38 2002] [error] PHP Warning: strtotime() called with empty time parameter in test.php on line 19 Line 19 is the 'return' line in the function. I do not get this error in my successful application of this code. Any ideas? Thanks in advance... Jason Soza -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Stumped on a function
function cleandate($indate) { str_replace(-, /, $indate); return date(F j, Y, strtotime($indate)); } I suspect that you actually need something like this: function cleandate($indate) { $indate = str_replace(-, /, $indate); return date(F j, Y, strtotime($indate)); } Although, to be honest, you can probably get away with: function cleandate($indate) { return date(F j, Y, strtotime($indate)); } And, ultimately, you may even find that you're better off just doing the date manipulation in mysql instead and leave it at that. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] OSX + Apache + PHP + MySQL
I currently develop using a FreeBSD unix box on my network, but when I get OSX, I'm thinking of having everything on the one machine... Do I need OSX SERVER to run everything I'd need for a development environment, or will the base version of OSX have the capabilities I need (running a test server of Apache/PHP4/MySQL/Perl/etc? Sorry it's slightly OT, Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP + SUN SOLARIS + exec() or sytem()
I have php 4.2.1 + apache 1.3.24 on sun solaris 8. In my php files, system() and exec() commands ara not running. Any help? ( my php.ini file, safe_mode=off and safe_mode_exec_dir=no value ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Stumped on a function
Why don't you just use DATE_FORMAT() in your query, then you don't have to do any extra PHP code at all?? ---John Holmes... -Original Message- From: Jason Soza [mailto:[EMAIL PROTECTED]] Sent: Friday, June 21, 2002 3:50 AM To: PHP-General Mailing List Subject: [PHP] Stumped on a function I've been using the following function successfully for months, tonight I literally copied/pasted it to another page I was creating, called it exactly the same using the same data type, and I'm getting an incorrect result. The function is supposed to take a standard MySQL CCYY-MM-DD date format and convert it to a Month Day, CCYY format. Here's the function code: function cleandate($indate) { str_replace(-, /, $indate); return date(F j, Y, strtotime($indate)); } And I'm calling it with: $newdate = cleandate($birthdate); $birthdate is a MySQL DATE field and if I echo $birthdate I get 2002-11-04, which is what is entered for that $birthdate record. However, when I echo $newdate using the above code, I get June 20, 2002 - today's date. Now, again I'm using this code as-is successfully on another page. I don't understand why it's returning today's date on this page, but returning the correct date on another page. This is the error that PHP is throwing regarding the above code: [Thu Jun 20 23:16:38 2002] [error] PHP Warning: strtotime() called with empty time parameter in test.php on line 19 Line 19 is the 'return' line in the function. I do not get this error in my successful application of this code. Any ideas? Thanks in advance... Jason Soza -- 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 Insert from select problem with php
MySQL doesn't care about quotes when doing INSERT INTO ... SELECT. It's got to be something you're doing in PHP. Are you using that exact query? mysql create table list (clientid int, fname varchar(20)); Query OK, 0 rows affected (0.07 sec) mysql create table list2 (fname varchar(20)); Query OK, 0 rows affected (0.02 sec) mysql insert into list values (1,'John'),(2,'O\'Hare'),(3,'Smith'); Query OK, 3 rows affected (0.02 sec) Records: 3 Duplicates: 0 Warnings: 0 mysql select * from list; +--++ | clientid | fname | +--++ |1 | John | |2 | O'Hare | |3 | Smith | +--++ 3 rows in set (0.03 sec) mysql insert into list2 (fname) select fname from list where clientid = 2; Query OK, 1 row affected (0.00 sec) Records: 1 Duplicates: 0 Warnings: 0 mysql select * from list2; ++ | fname | ++ | O'Hare | ++ 1 row in set (0.00 sec) Even if you're using double addslashes(), it'll work... mysql insert into list values (4,'O\\\'Henry'); Query OK, 1 row affected (0.00 sec) mysql insert into list2 (fname) select fname from list where clientid = 4; Query OK, 1 row affected (0.00 sec) Records: 1 Duplicates: 0 Warnings: 0 mysql select * from list2; +--+ | fname| +--+ | O'Hare | | O\'Henry | +--+ 2 rows in set (0.00 sec) ---John Holmes... -Original Message- From: David McInnis [mailto:[EMAIL PROTECTED]] Sent: Friday, June 21, 2002 1:57 AM To: [EMAIL PROTECTED] Subject: [PHP] Mysql Insert from select problem with php After posting this on the MySQL list and getting some feedback we were able to determine that this was not a flaw with MySQL. Any ideas from the PHP community? === Can anyone tell me why this does not work? I am using php and mysql. When I do an insert from select into a mysql table I get an error whenever a value from the select portion of the query contains an apostrophe. Before I insert the initial value I use the php addslashes() function to escape the ' and characters. For example: If clients table contans a field called fname and it has a value of O'Henry. Remembering that I have used addslashes() before inserting the value into mysql in the first place. The following query will fail on insert: Sql = insert into orders (fname) SELECT fname from clients where clientid = '$clientid'; David McInnis -- 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] ARRAY, IF INSERT
Hi all. I have this form in which one Administrator can insert new members and after that, in another page, a form where he/she can insert the new members sons daughters. I want to display a table with text inserts into the admin can type lets say a maximum of 5 kids in the second page. The members table will have one memberID field (which will be shared between parents and kids) and a levelID which will grant 0 for the parent and 1, 2, 3, 4, 5 for the kids. Now, how do I tell PHP to make an array from the kids input, but only from the fields in which lets say the name field was filled out in order to spend the necessary tables rows. Another thing the Array should also specify new levelIDs for each kid from 1 to 5. It would be great if you also show me how to deal with it after its created. Thanks a lot and sorry for so many questions, Cesar Aracena mailto:[EMAIL PROTECTED] CE / MCSE+I Neuquen, Argentina +54.299.6356688 +54.299.4466621
[PHP] Re: ARRAY, IF INSERT
(i am new to these groups, but shouldn't there be a follow-up-to on a X-post?) César aracena wrote: I have this form in which one Administrator can insert new members and after that, in another page, a form where he/she can insert the new members sons daughters. I want to display a table with text inserts into the admin can type lets say a maximum of 5 kids in the second page. The number doesn't matter if you design you db well (I suppose we are talking database). I suppose that you have a table with members with unique ID's? Make a new table with relatives, where you connect to their parents through a ParentID-field This way you'll avoid empty fields for the folks with eg. only 2 sons :-) The query for father + sons and daughters would then be like mysql_query( select members.Name, members.ID, relatives.Name as RelativeName, relatives.ID from parents, relatives where parents.ID = relatives.ParentID ) The members table will have one memberID field (which will be shared between parents and kids) and a levelID which will grant 0 for the parent and 1, 2, 3, 4, 5 for the kids. You _can_ put them all in the same table, but I suppose that you have a lot of data stored on the parents/members, that is non-existing and irellevant for the children - this will give a lot of empty fields, which is why i propose the solution above... Now, how do I tell PHP to make an array from the kids input, but only from the fields in which lets say the name field was filled out in order to spend the necessary tables rows. Another thing the Array should also specify new levelIDs for each kid from 1 to 5. It would be great if you also show me how to deal with it after its created. It's easy to select only rows with contents for at certain field: select * from relatives where Name 0 I hope this was of some help? regards Jesper Brunholm -- Phønix - Danish folkmusic from young musicians - http://www.phonixfolk.dk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 21 Jun 2002 09:55:07 -0000 Issue 1418
php-general Digest 21 Jun 2002 09:55:07 - Issue 1418 Topics (messages 103207 through 103247): Re: Speed tests? RAM usage displays? 103207 by: 1LT John W. Holmes 103208 by: Uros Gruber Re: JPGrapgh and GD Library SAMBAR server 103209 by: Nico Jansen - NiRo IT Consultants B.V. Re: Architecture problem? Google want index files exept the main page. 103210 by: Kevin Stone Installing Syncronizing 103211 by: César Aracena 103232 by: Mark 103238 by: César Aracena Re: alternatives? (Was: Shot in the dark) 103212 by: Chris Garaffa 103213 by: John Taylor-Johnston Re: How many copies 103214 by: Martin Towell Hex operations 103215 by: Frank S. Kicenko 103217 by: Martin Towell 103222 by: Frank S. Kicenko 103223 by: Frank S. Kicenko include() question... 103216 by: Phil Schwarzmann 103218 by: Purushotham Komaravolu 103220 by: Philip Olson 103221 by: David Freeman session in class problem 103219 by: ninti.ninti.com Questions on uploading files. 103224 by: By Proxy Re: insert date with a calendar 103225 by: Justin French Re: Error Reporing Questions with Mac 103226 by: Justin French Re: Can I be an ASP with PHP? 103227 by: Justin French Re: read how many caracter 103228 by: 1LT John W. Holmes PHP, Java integration failed: Red Hat 7.1, JDK 1.4, Apache 1.3x 103229 by: William John Burns How to Show my Own Error Message Instead of Mysql Error? 103230 by: Jack 103231 by: Martin Towell 103235 by: Andy Script text 103233 by: sonjaya Mysql Insert from select problem with php 103234 by: David McInnis 103236 by: Andy 103239 by: Rasmus Lerdorf 103245 by: 1LT John W. Holmes Sybase Database CONNECTIVITY! 103237 by: Vivek Kumar Agrawal Stumped on a function 103240 by: Jason Soza 103241 by: David Freeman 103244 by: 1LT John W. Holmes OSX + Apache + PHP + MySQL 103242 by: Justin French PHP + SUN SOLARIS + exec() or sytem() 103243 by: Fatih Üstündað ARRAY, IF INSERT 103246 by: César Aracena 103247 by: Jesper Brunholm 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--- Is there any way to determine script's memory usage? Depends on your web server. There is a way in apache. Rasmus answered this same question for me a couple weeks ago, look through the archives. I saw an option in IIS to put memory usage into the logs, that may work, too. What about execution time in ms (with breakpoints)? Plenty of classes around that'll do basic timing, but not sure on the breakpoint. shouldn't be that hard to implement, though. PEAR has a class to do it, I think, or search phpclasses.org And is there way to measure MySQL query speed in ms? Not really. I really wish there was a function to return query time, but there isn't. Best you can do is take a timestamp before you issue the query and one afterwards. That's not going to be the actual query time, but it'll give you an idea. Best way to implement that is to make a wrapper for mysql_query() ---John Holmes... ---End Message--- ---BeginMessage--- Hi! Thursday, June 20, 2002, 10:56:40 PM, you wrote: PS Is there any way to determine script's memory usage? When you configure and compile you have some option --with-memory-limit something like that and then add \%{mod_php_memory_usage}n\ in you http.conf of Apache where you define how log files look like. PS What about execution time in ms (with breakpoints)? PS And is there way to measure MySQL query speed in ms? u can use microtime function function getMicrotime() { list($usec, $sec) = explode( ,microtime()); return ((float)$usec + (float)$sec); } in your head of your script than call: $start = getMicrotime(); and then in the end of script $stop = getMicrotime(); $diff = $stop - $start; echo Execution time was: .$diff; You can also use Benchmark module from PEAR there is also support for markers. -- lp, Urosmailto:[EMAIL PROTECTED] ---End Message--- ---BeginMessage--- Hi Christopher, I think that we have the same configuration. I'm running PHP with the SAMBAR server as well and the JP Graph module is working OK with me so it should be working. Have you tried the JP Graph - testsuit : On my notebook ( W2K ) I installed it at http://localhost/jpgraph-1.6.1/src/Examples/testsuit_jpgraph.php Hopes this help : Good Luck N:-J www.niro-it.nl My phpini looks like this: include_path=. [PHP] extension=php_gd.dll My modifications in jpgraph.php for my configuration: // The
[PHP] Setting Cookies in netscape and explorer?
Hi! Cookies makes me go AGHH!! Please help me with this: I am setting a cookie like this in my loginscript: setcookie(devProcCookie, cookie value.|.time(), 31536000); // Set cookie header(Location: inside.php); exit; So far it works! But when I go to the inside.php page that looks like this: $cookie_life = 30; // The cookie lives for 1 hour $tok = explode(|, $HTTP_COOKIE_VARS[devProcCookie]); $cookie_value = $tok[0]; $creation_time = $tok[1]; if((time()-$creation_time) $cookie_life) // If time expires go to cookie_expired.php { // cookie has expired so delete it. setcookie(devProcCookie, ); header (Location: cookie_expired.php); exit; } setcookie(devProcCookie, cookie value.|.time(), 31536000); // If time hasnt expired update the cookie time Something happens in netscape. Everything works fine in IExplorer. Netscape says: Notice: Undefined index: devProcCookie in c:\inetpub\wwwroot\devproc\beta\inside.php on line 2 Notice: Undefined offset: 1 in c:\inetpub\wwwroot\devproc\beta\inside.php on line 4 Warning: Cannot add header information - headers already sent by (output started at c:\inetpub\wwwroot\devproc\beta\inside.php:4) in c:\inetpub\wwwroot\devproc\beta\inside.php on line 9 Warning: Cannot add header information - headers already sent by (output started at c:\inetpub\wwwroot\devproc\beta\inside.php:4) in c:\inetpub\wwwroot\devproc\beta\inside.php on line 10 What is wrong! Please help me someone!!! /Martin --- Ditt utgående mail är virusfritt. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.371 / Virus Database: 206 - Release Date: 2002-06-13
Re: [PHP] Stumped on a function
John Holmes wrote: Why don't you just use DATE_FORMAT() in your query, then you don't have to do any extra PHP code at all?? you might want a link to that: http://www.mysql.com/doc/D/a/Date_and_time_functions.html - look somewhat below the middle of the page function cleandate($indate) { str_replace(-, /, $indate); return date(F j, Y, strtotime($indate)); } check the $indate - response from the db - if you give invalid data there then it will (probably) use a timestamp instead, whith now()-values... when I echo $newdate using the above code, I get June 20, 2002 - today's date. Regards Jesper Brunholm -- Phønix - Danish folk music from young musicians - http://www.phonixfolk.dk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Accessing a form variable before the form is posted
My function for generating a select menu for a city sets the select name to form[city_id]. In one of the forms, there is a selection for City in the address details as well as one for the port of destination. If I use the function both the the select name will be form[city_id]. The port of destination selection overwrites the form[city_id] from the selection of City. Is there a way to access the first form[city_id] for assigning to another variable? In short is it possible to access a variable from the form before the form is posted? Best regards, Siva, -- Ma Siva Kumar BSG LeatherLink, Tamil Nadu, India - 600040 Email: [EMAIL PROTECTED] Website: http://www.leatherlink.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Old config options still showing after updating PHP
I have been compiling some extra configure options into PHP (4.1.2), such as --enable-xslt --with-xslt-sablot, and have had no problem getting PHP to configure, then make, then make install. Even after recompiling PHP, and then restarting (stopping, then starting) apache, phpinfo still shows the old configuration options. (I tried deleting config.cache and re compiling, but that didn't help.) I remember having this issue last time I upgraded, and when I figured it out it was kind of a dumb thing I was forgetting to do, but I can't seem to remember what it was. Any help appreciated. Thanks, Peter Janett New Media One Web Services http://www.newmediaone.net [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How can I output a query in a table with the output in multiple columns?
Dear List, I've got the following situation: I have a list of items i want placed in side-by-side columns in a table like this: name name name name name name name name name name name name name name name name and so on. How can I do it? Name is a string in the database. -- Best regards, Latexmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How can I output a query in a table with the output in multiple columns?
[snip] I've got the following situation: I have a list of items i want placed in side-by-side columns in a table like this: name name name name name name name name name name name name name name name name and so on. How can I do it? Name is a string in the database. [/snip] -- Latex, Others will probably have better insight on this but I can point you in one direction. Fetch the data as an array, then print each row using a for each loop that increments up to the number of columns you desire. (You can even divide by the number of items in the array to determine number of columns on the fly.) I have done some similar things to output Excel spreadsheets. HTH! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Setting Cookies in netscape and explorer?
Martin Johansson [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi! Cookies makes me go AGHH!! Please help me with this: I am setting a cookie like this in my loginscript: setcookie(devProcCookie, cookie value.|.time(), 31536000); // Set cookie header(Location: inside.php); exit; So far it works! But when I go to the inside.php page that looks like this: $cookie_life = 30; // The cookie lives for 1 hour $tok = explode(|, $HTTP_COOKIE_VARS[devProcCookie]); $cookie_value = $tok[0]; $creation_time = $tok[1]; if((time()-$creation_time) $cookie_life) // If time expires go to cookie_expired.php { // cookie has expired so delete it. setcookie(devProcCookie, ); header (Location: cookie_expired.php); exit; } setcookie(devProcCookie, cookie value.|.time(), 31536000); // If time hasnt expired update the cookie time Something happens in netscape. Everything works fine in IExplorer. Netscape says: Notice: Undefined index: devProcCookie in c:\inetpub\wwwroot\devproc\beta\inside.php on line 2 Notice: Undefined offset: 1 in c:\inetpub\wwwroot\devproc\beta\inside.php on line 4 Warning: Cannot add header information - headers already sent by (output started at c:\inetpub\wwwroot\devproc\beta\inside.php:4) in c:\inetpub\wwwroot\devproc\beta\inside.php on line 9 Warning: Cannot add header information - headers already sent by (output started at c:\inetpub\wwwroot\devproc\beta\inside.php:4) in c:\inetpub\wwwroot\devproc\beta\inside.php on line 10 What is wrong! Please help me someone!!! /Martin --- Ditt utgående mail är virusfritt. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.371 / Virus Database: 206 - Release Date: 2002-06-13 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How can I output a query in a table with the output in multiple columns?
I've got the following situation: I have a list of items i want placed in side-by-side columns in a table like this: name name name name name name name name name name name name name name name name and so on. How can I do it? Name is a string in the database. You can try something like this: ? $Count = 1; $Num_Across = 4; $Width = floor(100 / $Num_Across); //start table and first row echo table width='100%'\n; echo tr\n; while($row = MySQL_fetch_array($result)) { //create first cell echo td width='$width'.$row['name']./td\n; //keep a count so you know when to start a new row if($count % $Num_Across == 0) { $retval .= /trtr\n; } $count++; } //this will finish the table, i.e. if you only have one //name on last row, this will fill in the remaining table //cells $left = $Num_Across - (--$count % $Num_Across); for($x=0;$x$left;$x++) { echo tdnbsp;/td\n; } That last part isn't tested. I used a different method, but hopefully this gives you an idea. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Setting Cookies in netscape and explorer?
As opposed to using the Cookies Array HTTP_COOKIES_VAR could you not just use explode the $devProcCookie using if (isset($devProcCookie)){ $tok = explode(|, $devProcCookie); } //Note this will only work if the global variables in your php.ini files are turned on... I have no idea why it can't read the index $devProcCookie in the Cookies Array if you figure it out though please post up... Kondwani Martin Johansson [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi! Cookies makes me go AGHH!! Please help me with this: I am setting a cookie like this in my loginscript: setcookie(devProcCookie, cookie value.|.time(), 31536000); // Set cookie header(Location: inside.php); exit; So far it works! But when I go to the inside.php page that looks like this: $cookie_life = 30; // The cookie lives for 1 hour $tok = explode(|, $HTTP_COOKIE_VARS[devProcCookie]); $cookie_value = $tok[0]; $creation_time = $tok[1]; if((time()-$creation_time) $cookie_life) // If time expires go to cookie_expired.php { // cookie has expired so delete it. setcookie(devProcCookie, ); header (Location: cookie_expired.php); exit; } setcookie(devProcCookie, cookie value.|.time(), 31536000); // If time hasnt expired update the cookie time Something happens in netscape. Everything works fine in IExplorer. Netscape says: Notice: Undefined index: devProcCookie in c:\inetpub\wwwroot\devproc\beta\inside.php on line 2 Notice: Undefined offset: 1 in c:\inetpub\wwwroot\devproc\beta\inside.php on line 4 Warning: Cannot add header information - headers already sent by (output started at c:\inetpub\wwwroot\devproc\beta\inside.php:4) in c:\inetpub\wwwroot\devproc\beta\inside.php on line 9 Warning: Cannot add header information - headers already sent by (output started at c:\inetpub\wwwroot\devproc\beta\inside.php:4) in c:\inetpub\wwwroot\devproc\beta\inside.php on line 10 What is wrong! Please help me someone!!! /Martin --- Ditt utgående mail är virusfritt. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.371 / Virus Database: 206 - Release Date: 2002-06-13 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Setting Cookies in netscape and explorer?
I tried your stuff but it didnt help me! Still works in explorer but when I tried it in netscape It says ERROR!!! in netscape if (isset($devProcTailorCookie)) { $tok = explode(|, $devProcTailorCookie); } else { echo ERRROR!!!; } I have global_variables turned on in my php.ini /Martin Kondwani Spike Mkandawire [EMAIL PROTECTED] skrev i meddelandet [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... As opposed to using the Cookies Array HTTP_COOKIES_VAR could you not just use explode the $devProcCookie using if (isset($devProcCookie)){ $tok = explode(|, $devProcCookie); } //Note this will only work if the global variables in your php.ini files are turned on... I have no idea why it can't read the index $devProcCookie in the Cookies Array if you figure it out though please post up... Kondwani Martin Johansson [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi! Cookies makes me go AGHH!! Please help me with this: I am setting a cookie like this in my loginscript: setcookie(devProcCookie, cookie value.|.time(), 31536000); // Set cookie header(Location: inside.php); exit; So far it works! But when I go to the inside.php page that looks like this: $cookie_life = 30; // The cookie lives for 1 hour $tok = explode(|, $HTTP_COOKIE_VARS[devProcCookie]); $cookie_value = $tok[0]; $creation_time = $tok[1]; if((time()-$creation_time) $cookie_life) // If time expires go to cookie_expired.php { // cookie has expired so delete it. setcookie(devProcCookie, ); header (Location: cookie_expired.php); exit; } setcookie(devProcCookie, cookie value.|.time(), 31536000); // If time hasnt expired update the cookie time Something happens in netscape. Everything works fine in IExplorer. Netscape says: Notice: Undefined index: devProcCookie in c:\inetpub\wwwroot\devproc\beta\inside.php on line 2 Notice: Undefined offset: 1 in c:\inetpub\wwwroot\devproc\beta\inside.php on line 4 Warning: Cannot add header information - headers already sent by (output started at c:\inetpub\wwwroot\devproc\beta\inside.php:4) in c:\inetpub\wwwroot\devproc\beta\inside.php on line 9 Warning: Cannot add header information - headers already sent by (output started at c:\inetpub\wwwroot\devproc\beta\inside.php:4) in c:\inetpub\wwwroot\devproc\beta\inside.php on line 10 What is wrong! Please help me someone!!! /Martin --- Ditt utgående mail är virusfritt. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.371 / Virus Database: 206 - Release Date: 2002-06-13 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] using extract inside an object
Hi does anyone know how to use the function extract inside an object, so as the created variables become attributes of the object ? a little example to be more explicit :) I have the following array: Array ( [one] = 1 [two] = 2 ) that I would like to transform into the following object stdClass Object ( [one] = 1 [two] = 2 ) any idea ? I though I could use someway the function extract, for example by using the prefix this- class someObj { function someObj($someArray) { extract($someArray, EXTR_PREFIX_ALL, this-); } } but it doesn't work ! __ ifrance.com, l'email gratuit le plus complet de l'Internet ! vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP... http://www.ifrance.com/_reloc/email.emailif -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Accessing a form variable before the form is posted
On Fri, 21 Jun 2002, Ma Siva Kumar wrote: In one of the forms, there is a selection for City in the address details as well as one for the port of destination. If I use the function both the the select name will be form[city_id]. The port of destination selection overwrites the form[city_id] from the selection of City. Use different variable names. Or make your function return a value, and use assignment to handle it. In short is it possible to access a variable from the form before the form is posted? In short, no. The flow is like this: Browser requests page. Webserver serves page, after parsing (if needed). Browser displays page to user, and essentially disconnects from webserver. User fills in form. Server has no clue as of yet. User presses submit. Browser connects to server and sends data. Server now knows about the data. -- Sapere aude My mind not only wanders, it sometimes leaves completely. Never attribute to malice that which can be adequately explained by stupidity. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Setting Cookies in netscape and explorer?
Another thing! when I look in netscape/preferences/privacysecurity/cookies/view Stored Cookies.. there is no cookie for my website.. isnt that strange? /Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Old config options still showing after updating PHP
On Friday 21 June 2002 18:25, Peter Janett wrote: I have been compiling some extra configure options into PHP (4.1.2), such as --enable-xslt --with-xslt-sablot, and have had no problem getting PHP to configure, then make, then make install. Even after recompiling PHP, and then restarting (stopping, then starting) apache, phpinfo still shows the old configuration options. (I tried deleting config.cache and re compiling, but that didn't help.) Is Apache looking in the right place for your newly (re)compiled php? If so, try removing the existing source directory and extracting again from the tarball and recompile. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* H. L. Mencken's Law: Those who can -- do. Those who can't -- teach. Martin's Extension: Those who cannot teach -- administrate. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Setting Cookies in netscape and explorer?
Yes!!! I got it to work! The problem was the expirationdate in the cookie: setcookie(devProcTailorCookie, cookie value.|.time(), 31536000); Now I set it like this: setcookie(devProcTailorCookie, cookie value.|.time(), time()+10); But now it doesnt work in explorer. But I would be able to fix that. Thanks /Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Data Post or Get Variable Undefined
Hi, In new version of php 4.2, I am trying to do post or get of data from html form to the php page. But it says undefined variable. Is there something different in new version for post and get. It do have increased security I have read but how can I do post and get. I have changed php INI file variable of cgi force redirect to 0 as PHP was not working for me on other values. But now cannot do post and get. Have read online help but couldnt figure out so please help. How can I do post and get in php new installers. OS : Windows Statbat();
[PHP] (SOLVED) [PHP] How can I output a query in a table with the output in multiple columns?
Hello John, PHP I used your script almost everything is worked. Thanks. Here is the script if someone will need it :) ? $count = 1; $Num_Across = 4; $Width = floor(100 / $Num_Across); while($row = MySQL_fetch_array($result)) { //create first cell $ = $count / $Num_Across; echo td width='.$Width.'.$row['name']./td\n; //keep a count so you know when to start a new row if(round($) == $) { echo /trtr\n; } $count++; }; //this will finish the table, i.e. if you only have one //name on last row, this will fill in the remaining table //cells $left = $Num_Across - (--$count % $Num_Across); for($x=0;$x$left;$x++) { echo tdnbsp;/td\n; }; echo /tr; echo /table; ? Friday, June 21, 2002, 3:42:24 PM, you wrote: I've got the following situation: I have a list of items i want JH placed in side-by-side columns in a table like this: name name name name name name name name name name name name name name name name and so on. How can I do it? Name is a string in the database. JH You can try something like this: JH ? JH $Count = 1; JH $Num_Across = 4; JH $Width = floor(100 / $Num_Across); JH //start table and first row JH echo table width='100%'\n; JH echo tr\n; JH while($row = MySQL_fetch_array($result)) JH { JH //create first cell JH echo td width='$width'.$row['name']./td\n; JH //keep a count so you know when to start a new row JH if($count % $Num_Across == 0) JH { $retval .= /trtr\n; } JH $count++; JH } JH //this will finish the table, i.e. if you only have one JH //name on last row, this will fill in the remaining table JH //cells JH $left = $Num_Across - (--$count % $Num_Across); JH for($x=0;$x$left;$x++) JH { echo tdnbsp;/td\n; } JH That last part isn't tested. I used a different method, but hopefully JH this gives you an idea. JH ---John Holmes... -- Best regards, Latexmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Data Post or Get Variable Undefined
Hello Salman, They have changed the method. Turn global variables on in your php.ini Friday, June 21, 2002, 4:41:30 PM, you wrote: SA Hi, SA In new version of php 4.2, I am trying to do post or get of data from html form to the php page. But it says undefined variable. Is there something different in new version for post and get. It SA do have increased security I have read but how can I do post and get. SA I have changed php INI file variable of cgi force redirect to 0 as PHP was not working for me on other values. But now cannot do post and get. Have read online help but couldnt figure out so SA please help. How can I do post and get in php new installers. SA OS : Windows SA Statbat(); -- Best regards, Latexmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] using extract inside an object
Try this $a = array('one'=1, 'two'=2 ); $b = (object)$a; I have the following array: Array ( [one] = 1 [two] = 2 ) that I would like to transform into the following object stdClass Object ( [one] = 1 [two] = 2 ) any idea ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] insert date with a calendar
On Thursday, June 20, 2002, at 09:16 PM, Justin French wrote: When users have to enter dates on my forms, I always provide them with three drop-down menus, for day (1-31), Month (1-12) and year (usually current year, the next and the next, depending on the application). Then I have three values on the next page ($_POST['day'], $_POST['month'], $_POST['year']) which I can combine into a date format I like, or even into a Unix timestamp. Maybe this will help you -- it's a function that does exactly this. Of course, the mail client will probably mess up the line endings, but if you clean it up, this function will do the following things: 1. create a dropdown listbox for months, days, and years 2. allow you to specify which years should appear (by using a start year and a total year 3. you provide the name of each form input, so you can use this function multiple times on a page (using unique names each time) 4. you provide a default value for when the page loads so that you can make it default to a certain date 5. you decide whether or not to have a dummy Please choose a date or any choice on the listboxes (whose value will be an empty string) 6. you decide whether or not this dummy choice will persist if the default values are not empty. It is a big, ugly subroutine, but I use it in so many places in my application that it has allowed me to remove hundreds of lines of custom date listboxes. Here is the usage, since it may be somewhat confusing (copy this into a PHP script and see what effect it has): $current_year = date('Y', mktime()); // gets the current year $listbox_str = date_listbox_generator( 'month', 'day', 'year', $_POST['month'], $_POST['day'], $_POST['year'], $current_year, $current_year + 5, 'any', true); print $listbox_str; This will generate three date listboxes which each start with any as a choice which has no value when the form is submitted (you can test for an empty string to assume that is the choice). If this form has called itself and for some reason these listboxes reappear in the new instance of the page (which might be the case in, say a search engine interface), then when the page loads, the values chosen on the previous instance of the page will be the default values. The any choice will reappear in this case (so the user can still choose any) because the last argument is true, if the last argument was false then this option would disappear (this is useful for when you want to force the user to make a choice). Here is the function, hope it helps: /** * date_listbox_generator * * generates 3 HTML dropdown lists for selecting a date * * @param string $monthInputName name attribute of HTML select tag for displaying month (e.g., 'month') * @param string $dayInputName name attribute of HTML select tag for displaying days (e.g., 'day') * @param string $yearInputName name attribute of HTML select tag for displaying years (e.g., 'year') * @param string $defaultMonth one- or two-digit number representing a default month (if empty, defaults to current month + day multiplier) * @param string $defaultDay one- or two-digit number representing a default day of the month (if empty, defaults to current day + day multiplier) * @param string $defaultYear four-digit number representing a default year (if empty, defaults to current year + day multiplier) * @param string $startYear four-digit number representing a start year for the years array * @param string $totalYears total number of years to contain in the years array * @param $pleaseChooseMsg string used if there is to be a Please Choose option, the value of * this string is the text of the Please Choose option * @param $forcePleaseChoose bool forces the Please Choose option to persist even if there * is a default value. * @return string code to display 3 HTML select tag listboxes to accept user input for a date */ function date_listbox_generator($monthInputName, $dayInputName, $yearInputName, $defaultMonth, $defaultDay, $defaultYear, $startYear, $totalYears, $pleaseChooseMsg = '', $forcePleaseChoose = false) { // set the name of the month input from the function parameter $month_form = \nselect name=\{$monthInputName}\\n; // create an array of months $months = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); // set the counter to 1 b/c we don't want Jan = 0 $i
[PHP] global variables inside of a function
Is there a way to access a session variables or server variables from inside a function? I have a function and was trying to use $PHP_SELF inside of it. I get a variable undefined error. Out side of the function it works fine. I don't want to parameter pass the global variables to the function, I know this would work, but I would have to many variables to pass. Example: function functionname() { echo $PHP_SELF; } Thanks, Mark. _ Mark McCulligh, Application Developer / Analyst Sykes Canada Corporation www.SykesCanada.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] insert date with a calendar
On Friday, June 21, 2002, at 09:27 AM, Erik Price wrote: * @param string $defaultMonth one- or two-digit number representing a default month (if empty, defaults to current month + day multiplier) * @param string $defaultDay one- or two-digit number representing a default day of the month (if empty, defaults to current day + day multiplier) * @param string $defaultYear four-digit number representing a default year (if empty, defaults to current year + day multiplier) Uh, sorry, I just realized there was some incorrect parameter descriptions in the function I posted. Ignore the parenthesized parts, they are old comments from a previous version of this function -- just erase them. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] global variables inside of a function
On Friday, June 21, 2002, at 09:23 AM, Mark McCulligh wrote: Is there a way to access a session variables or server variables from inside a function? I have a function and was trying to use $PHP_SELF inside of it. I get a variable undefined error. Out side of the function it works fine. I don't want to parameter pass the global variables to the function, I know this would work, but I would have to many variables to pass. This is why superglobals were invented. Use $_SERVER['PHP_SELF'] Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] using extract inside an object
great ! I should have thought about that ! :) and any idea of how to cast into a specific class instead of stdClass ? -Original Message- From: Remy Dufour [mailto:[EMAIL PROTECTED]] Sent: vendredi 21 juin 2002 15:21 To: phpsurf; [EMAIL PROTECTED] Subject: Re: [PHP] using extract inside an object Try this $a = array('one'=1, 'two'=2 ); $b = (object)$a; I have the following array: Array ( [one] = 1 [two] = 2 ) that I would like to transform into the following object stdClass Object ( [one] = 1 [two] = 2 ) any idea ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ ifrance.com, l'email gratuit le plus complet de l'Internet ! vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP... http://www.ifrance.com/_reloc/email.emailif -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] cut text after saving file with php
Hello, I want to save a text - which is created in a selfmade javascipt editor - into a .cnt - file with php... It works fantastically if I work in the LAN - environment, but if I work from outside - it's still saving, but it cuts contingent some text...! I can't I understand why it doesn't work, perhaps anyone has an idea?! Thank you for help...! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] global variables inside of a function
I tried using $_SERVER['PHP_SELF'] and $HTTP_SERVER_VARS['PHP_SELF'] but got the same error. I found the answer on www.php.net. function blah() { global $PHP_SELF; echo $PHP_SELF; } Thanks for your help, Mark. -- On Friday, June 21, 2002, at 09:23 AM, Mark McCulligh wrote: Is there a way to access a session variables or server variables from inside a function? I have a function and was trying to use $PHP_SELF inside of it. I get a variable undefined error. Out side of the function it works fine. I don't want to parameter pass the global variables to the function, I know this would work, but I would have to many variables to pass. This is why superglobals were invented. Use $_SERVER['PHP_SELF'] Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-WIN] RE: [PHP] How to Show my Own Error Message Instead of Mysql Error?
i made a Registration Form for user to input their Data, but i also had some Field Check before the data can be insert to the Mysql_Database! I had a question here, sometime the mysql shows the error : Duplicate Key for xxx I know what is this about, reguarding to my Registration Form, it mean the Login Name is Duplicated! But i want to show my own message to the user for this error instead the Mysql Error! It is meanness to show User the Mysql Error, cause they won't understand it!!! Could Someone pls tell me how i can do this? Here's a function I use. I just pass it the mysql_errno() and mysql_error() that is generated with each query. The error messages are based off the result codes as specified on the mySQL site. Changing these to say what you want will be a simple matter. hth Chris function setErrorMsg( $dbErrorNum, $dbErrorMessage ) { $dbaMessage = ; switch( $dbErrorNum ) { case 1000: $dbaMessage .= Error number : $dbErrorNum - hashchk; break; case 1001: $dbaMessage .= Error number : $dbErrorNum - isamchk; break; case 1002: $dbaMessage .= Error number : $dbErrorNum - NO; break; case 1003: $dbaMessage .= Error number : $dbErrorNum - YES; break; case 1004: $dbaMessage .= Can't create file '%-.64s' (errno: %d); break; case 1005: $dbaMessage .= Can't create table '%-.64s' (errno: %d); break; case 1006: $dbaMessage .= Can't create database '%-.64s'. (errno: %d); break; case 1007: $dbaMessage .= Can't create database '%-.64s'. Database exists; break; case 1008: $dbaMessage .= Can't drop database '%-.64s'. Database doesn't exist; break; case 1009: $dbaMessage .= Error dropping database (can't delete '%-.64s', errno: %d); break; case 1010: $dbaMessage .= Error dropping database (can't rmdir '%-.64s', errno: %d); break; case 1011: $dbaMessage .= Error on delete of '%-.64s' (errno: %d); break; case 1012: $dbaMessage .= Can't read record in system table.; break; case 1013: $dbaMessage .= Can't get status of '%-.64s' (errno: %d); break; case 1014: $dbaMessage .= Can't get working directory (errno: %d); break; case 1015: $dbaMessage .= Can't lock file (errno: %d); break; case 1016: $dbaMessage .= Can't open file: '%-.64s'. (errno: %d); break; case 1017: $dbaMessage .= Can't find file: '%-.64s' (errno: %d); break; case 1018: $dbaMessage .= Can't read dir of '%-.64s' (errno: %d); break; case 1019: $dbaMessage .= Can't change dir to '%-.64s' (errno: %d); break; case 1020: $dbaMessage .= Record has changed since last read in table '%-.64s'; break; case 1021: $dbaMessage .= Disk full.; break; case 1022: $dbaMessage .= This duplicate record could not be added to the database.; break; case 1023: $dbaMessage .= Error on close of '%-.64s' (errno: %d); break; case 1024: $dbaMessage .= Error reading file '%-.64s' (errno: %d); break; case 1025: $dbaMessage .= Error on rename of '%-.64s' to '%-.64s' (errno: %d); break; case 1026: $dbaMessage .= Error writing file '%-.64s' (errno: %d); break; case 1027: $dbaMessage .= '%-.64s' is locked against change; break; case 1028: $dbaMessage .= Sort aborted.; break; case 1029: $dbaMessage .= View '%-.64s' doesn't exist for '%-.64s'; break; case 1030: $dbaMessage .= Got error %d from table handler; break; case 1031: $dbaMessage .= Table handler for '%-.64s' doesn't have this option; break; case 1032: $dbaMessage .= Could not find the record that was requested.; break; case 1033: $dbaMessage .= Incorrect information in file: '%-.64s'; break; case 1034: $dbaMessage .= Key file for table is currupt.; break; case 1035: $dbaMessage .= Old key file for table '%-.64s'; Repair it!; break; case 1036: $dbaMessage .= Table '%-.64s' is read only; break; case 1037: $dbaMessage .= Out of memory.; break; case 1038: $dbaMessage .= Out of sort memory. Increase daemon sort buffer size.; break; case 1039: $dbaMessage .= Unexpected eof found when reading file '%-.64s' (errno: %d); break; case 1040: $dbaMessage .= Too many connections.; break; case 1041: $dbaMessage .= Out of memory; Check if mysqld or some other process uses all available memory. If not you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space;
[PHP] dl() problem
hi I am a new php user. I am working on linux. I have developped a c++ component who interact with MYSQL. I have compiled it onto .SO object. who can I use my methods With PHP. the dl() function return some worning. please help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] syntax error while compiling php
I'm using php-4.2.1 on FreeBSD 4.5 with Apache2, I did the configure fine, I did a './configure --with-mysql --with-apxs2=/usr/local/apache/bin/apxs', but when I do a 'gmake' it comes up with php_functions.c:93: syntax error gmake[3]: *** [php_functions.lo] Error 1 gmake[3]: Leaving directory `/usr2/php-4.2.1/sapi/apache2filter' gmake[2]: *** [all-recursive] Error 1 gmake[2]: Leaving directory `/usr2/php-4.2.1/sapi/apache2filter' gmake[1]: *** [all-recursive] Error 1 gmake[1]: Leaving directory `/usr2/php-4.2.1/sapi' gmake: *** [all-recursive] Error 1 what can I do to fix this? I even tried to just do a 'make' but came up with basically the same thing Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cc / Bcc don't work on win2k but on linux???
hi, i am facing the above issue. i set the headers up for the mail(). tried submitting the email. it worked great on linux server. but when i try to run it on a win2k. i just get: Warning: Server Error in blahblah.php on line blahblah my piece of code: $headers = MIME-Version: 1.0\r\n; $headers .= Content-type: text/html; charset=iso-8859-1\r\n; $headers .= From: [EMAIL PROTECTED]\r\n; $headers .= Cc: [EMAIL PROTECTED]\r\n; $to = [EMAIL PROTECTED]; $subject = my subject; $message = my message; mail($to, $subject, $message, $headers); any idea whats wrong with the above code? the log file shows: #Fields: time c-ip cs-method cs-uri-stem sc-status 12:23:30 127.0.0.1 HELO - 250 12:23:30 127.0.0.1 MAIL - 250 12:23:30 127.0.0.1 RCPT - 250 12:23:30 127.0.0.1 RCPT - 501 12:23:30 127.0.0.1 QUIT - 0 it appears that 501 = Not Implemented on IIS5. but i am not sure on that. thanks regards, lance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cc / Bcc don't work on win2k but on linux???
On Friday, June 21, 2002, 3:14:17 PM, you wrote: i am facing the above issue. i set the headers up for the mail(). tried submitting the email. it worked great on linux server. but when i try to run it on a win2k. i just get: Warning: Server Error in blahblah.php on line blahblah my piece of code: $headers = MIME-Version: 1.0\r\n; $headers .= Content-type: text/html; charset=iso-8859-1\r\n; $headers .= From: [EMAIL PROTECTED]\r\n; $headers .= Cc: [EMAIL PROTECTED]\r\n; $to = [EMAIL PROTECTED]; $subject = my subject; $message = my message; mail($to, $subject, $message, $headers); any idea whats wrong with the above code? the log file shows: #Fields: time c-ip cs-method cs-uri-stem sc-status 12:23:30 127.0.0.1 HELO - 250 12:23:30 127.0.0.1 MAIL - 250 12:23:30 127.0.0.1 RCPT - 250 12:23:30 127.0.0.1 RCPT - 501 12:23:30 127.0.0.1 QUIT - 0 it appears that 501 = Not Implemented on IIS5. but i am not sure on that. That 501 is an SMTP error code, not an IIS error. A 501 error in SMTP means Syntax error in parameters or arguments. Looking at your code, the only thing I can think is that it's complaining because both addresses are the same. Try changing the CC address to something different from the primary recipient. -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] build problems(php4)
Hi, when I build php4.2.1 on sun solaris 8. I get the following error: # make Making all in Zend /bin/sh ../libtool --silent --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../main -D_POSIX_PTHREAD_SEMANTICS -I../TSRM -g -O2 -prefer-non-pic -static -c -o z end_language_parser.lo `test -f zend_language_parser.c || echo './'`zend_languag e_parser.c In file included from zend_compile.h:24, from zend_language_parser.c:147: zend.h:55: unix.h: No such file or directory *** Error code 1 make: Fatal error: Command failed for target `zend_language_parser.lo' Current working directory /usr/local/php-4.2.1/Zend *** Error code 1 make: Fatal error: Command failed for target `all-recursive' I would appreciate if anyone can direct me to a solution. Thanks . Yong Zhang -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-DEV] PHP, Java integration failed: Red Hat 7.1, JDK 1.4,Apache 1.3x
William -- I've also spend a considerable amount of time trying to get this to work on Redhat 7.2 (and maybe 7.1). I did a lot of coaxing and reconfigurations. Best I can say, it doesn't work with JDK 1.4. Once I tried 1.3.x, everything went fine. My guess is that something changed in the upgrade, but I don't have time to figure out what. -adam On Thu, 20 Jun 2002, William John Burns wrote: All: None of the many online user posts in setting up Java connectivity from within PHP have worked. RPM or tarball. Do you know of anyone who has an RPM of PHP, with the standard MySQL, GD, Postgres, WDDX, etc...but also libphp_java.so correctly set-up? The Windows PHP has Java support right off the bat with an edit the the .ini file. On Win 98, no problems at all. But on my Linux paritions... There are at least dozens of people trying to get this to work. All of them could be helped with an RPM or a definitive answer. Why can't someone release linux binaries with this sort of thing compiled in? My system: Sun Java2 JDK 1.4.0, Red Hat 7.1, Apache 1.3x. I have tried all versions of PHP tarballs since 4.04p1 And I'm not alone in this frustration. Yes, sometimes there is a libphp_java. There is always the .jar file. But after editing the .ini, doing all manner of things with LD_LIBRARY_PATH/ldconfig, nothing! The best I ever got was a page that registered the .so module, but never finished output. (I use a test page with phpinfo(), then and a sample call to get a Java timestamp. In this circumstance, the page cuts off before the sample Java timestamp and instance. Any help or leads would be appreciated. Regards, WJ Burns -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Rounding....
Matthew Clark wrote: Seeing as the mathematically correct way to round numbers is to round down to n for n-1=m=n.5 and up to n+1 for n.5mn+1, I wonder why the PHP round() function couldn't include a little 'fuzz' to handle the rounding problems we encounter due to floating point representation in the hardware? It could even be a configurable option - but it would save writing a wrapper... Matthew, I can't agree with you more. I really don't understand the point of php having a round function which gives the wrong answer on even very simple decimals e.g. round(0.35,1) returns 0.3. The fuzz you suggest works fine and need only be very small. pow(10.0,places-DBL_DIG) seems to do the job. e.g. a change to the source of math.c:PHP_FUNCTION(round) as follows, (changes underlined): f = pow(10.0, (double) places); return_val *= f; if (return_val = 0.0) return_val = floor(pow(10.0,places - DBL_DIG)) + 0.5 + return_val); - else return_val = ceil(return_val - (0.5 + pow(10.0,places - DBL_DIG))); return_val /= f; You'll note that this implies a bias to high absolute values, but then we already have that bias since we're rounding up anyway. The only numbers which would be incorrectly rounded because of the bias in the fix, already have more than 14 significant figures e.g 0.349 rounds to 0.4 but 0.34 still rounds to 0.3. I can't see any possible reason for this not being fixed, but then I also think we should fix the rest of the binary representation problems i.e. 1. Comparison of Floating Points 0.8 == 0.7 + 0.1; evaluates as false not true. In general, all the comparison operators, ==, !=, =, , , =, === may give incorrect results if either of the operands is a floating point. 2. Conversion of Floating Point to Integer floor(10 * (0.7 + 0.1)); evaluates to 7 not 8. In general, floor(), ceil() and (int) may give incorrect results. 3. Spurious Differences print (0.8 - (0.7 + 0.1)); outputs 1.1102230246252E-16 not 0 4. Cumulative Conversion Errors for($i=1,$i=10,++$i){$total = $total + 0.1;}; calculates $total as 1. not 1 They all have the same cause as the round problem i.e. the use of binary floating points for decimal arithmetic without any compensation for conversion errors. As it happens, there's a simple fix for all of these as well The fix is to automatically round the results of php's arithmetic operators to 15 significant figures when floating point numbers are involved. It comes to about 20 lines of code change to zend_operators.c i.e.8 calls to the following new function: double decimalise(double dval) { double f; if (dval == 0) { return dval; } f = pow(10.0, DBL_DIG - (1 + floor(log10(fabs(dval); return (double) (rint(dval*f))/f; } There is a performance downside, although much less than doing your own workarounds. To put it in perspective, the impact is a twentieth of that of using a string cast/sprintf. Indeed, the slowdown is less than using objects or arrays in your arithmetic i.e. with the fix $a = $b + $c takes the same or less time than unfixed $a = $b + $c-d Or, to put it another way, if you are not worried about the performance impact of using objects and arrays in arithmetic operations, you should not be worried by the impact of this fix for decimal arithmetic. (The decimalise function could also be speeded up with a more clever calculation of f, e.g. by skipping the log10 and pow functions but I'd rather leave that to a real C programmer ;)) I haven't had a very enthusiastic response from the php developers in the past on these issues, but I'm keen to have another go if you or anyone else thinks it's worth sorting this out properly. Personally, I just don't see the point of having operators/functions in php that can go wrong at even a single decimal digit! Regards, George -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cc / Bcc don't work on win2k but on linux???
i tried that. using different email addresses. all of them are valid. still getting the same error. however, when i change the Cc to cc, no error was thrown. but only the To: will receive the email. the Cc: never get the mail. any other thoughts on that? Stuart Dallas wrote: That 501 is an SMTP error code, not an IIS error. A 501 error in SMTP means Syntax error in parameters or arguments. Looking at your code, the only thing I can think is that it's complaining because both addresses are the same. Try changing the CC address to something different from the primary recipient. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Architecture problem? Google want index files exept the main page.
Are you using a 404 error to generate those deeper pages? If so you will want to send an OK header: header('HTTP/1.1 200 OK'); olinux --- Andy [EMAIL PROTECTED] wrote: Hi guys, I did recently launch my first web site and I am asking myself why google is only indexing the first page. To get a better index on other search engines I am passing parameters a bit strange and the dynamic pages look more like static ones. So I hope this was not a shoot in a hole :-( I am getting the parameters from the url and decode them after a certain key. The file looks to the visitor like it is a directory while I am forcing apache to parse it with php. So this is the first day google is indexing it, but as I said I tryed to search the site with google site search and it does only find the first page. A site like: http://www.globosapiens.net/profiles/A002021.html is not indexed at all!! Did I go the wrong path, or what else is going on? Thank you for any help, Andy -- http://www.globosapiens.net Global Travellers Network! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Which costs more: connecting to a DB or accessing the file system?
I was reading somewhere (can't remember where) that connecting to a db is a pretty costly transaction. DB queries aside, does anyone know of any benchmarks that demonstrate file access vs. db connections? Similarily, while DB queries offer alot of power, would it be cheaper (faster) to drop simple information that does not require heavy queries into a file and access it through the file system? Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cc / Bcc don't work on win2k but on linux???
On Friday, June 21, 2002, 4:01:44 PM, Lance wrote: i tried that. using different email addresses. all of them are valid. still getting the same error. however, when i change the Cc to cc, no error was thrown. but only the To: will receive the email. the Cc: never get the mail. any other thoughts on that? Can you get a transcript of the SMTP session, specifically the line PHP sends to the SMTP server when it gets the 501 reply? -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cc / Bcc don't work on win2k but on linux???
From: Lance [EMAIL PROTECTED] i tried that. using different email addresses. all of them are valid. still getting the same error. however, when i change the Cc to cc, no error was thrown. but only the To: will receive the email. the Cc: never get the mail. any other thoughts on that? You need to include cc: and Bcc: addresses in the first parameter and repeat in the headers, for example: mail('[EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]', 'subject', 'message', To: Receiver [EMAIL PROTECTED]\n . From: Sender [EMAIL PROTECTED]\n . cc: Courtesy [EMAIL PROTECTED]\n . Bcc: Blind [EMAIL PROTECTED]\n); Cc does not work, but cc or CC does, and on Windows servers the Bcc: header is not removed when sending, so recipients can see Bcc: receivers by examining the headers. This is from Kevin Yank's Advanced email in PHP on WebmasterBase.com. -- Lowell Allen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] output control functions
is there some kind of problem with output buffering in php 4.2.1. i use ob_start() ob_end_clean(), ob_get_contents() to capture output. everything worked before and i don't know what could be the problem. my upgrade was focused on xml/xslt stuff. any solution/similar problem? Aljosa -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Rounding....Message repeated
Repeat of previous message in thread without the extra ugly wrapping, (sorry!!!) Matthew Clark wrote: Seeing as the mathematically correct way to round numbers is to round down to n for n-1=m=n.5 and up to n+1 for n.5mn+1, I wonder why the PHP round() function couldn't include a little 'fuzz' to handle the rounding problems we encounter due to floating point representation in the hardware? It could even be a configurable option - but it would save writing a wrapper... Matthew, I can't agree with you more. I really don't understand the point of php having a round function which gives the wrong answer on even very simple decimals e.g. round(0.35,1) returns 0.3. The fuzz you suggest works fine and need only be very small. pow(10.0,places-DBL_DIG) seems to do the job. e.g. a change to the source of math.c:PHP_FUNCTION(round) as follows, (changes underlined): f = pow(10.0, (double) places); return_val *= f; if (return_val = 0.0) return_val = floor(pow(10.0,places - DBL_DIG)) + 0.5 + return_val); - else return_val = ceil(return_val - (0.5 + pow(10.0,places - DBL_DIG))); return_val /= f; You'll note that this implies a bias to high absolute values, but then we already have that bias since we're rounding up anyway. The only numbers which would be incorrectly rounded because of the bias in the fix, already have more than 14 significant figures e.g 0.349 rounds to 0.4 but 0.34 still rounds to 0.3. I can't see any possible reason for this not being fixed, but then I also think we should fix the rest of the binary representation problems i.e. 1. Comparison of Floating Points 0.8 == 0.7 + 0.1; evaluates as false not true. In general, all the comparison operators, ==, !=, =, , , =, === may give incorrect results if either of the operands is a floating point. 2. Conversion of Floating Point to Integer floor(10 * (0.7 + 0.1)); evaluates to 7 not 8. In general, floor(), ceil() and (int) may give incorrect results. 3. Spurious Differences print (0.8 - (0.7 + 0.1)); outputs 1.1102230246252E-16 not 0 4. Cumulative Conversion Errors for($i=1,$i=10,++$i){$total = $total + 0.1;}; calculates $total as 1. not 1 They all have the same cause as the round problem i.e. the use of binary floating points for decimal arithmetic without any compensation for conversion errors. As it happens, there's a simple fix for all of these as well The fix is to automatically round the results of php's arithmetic operators to 15 significant figures when floating point numbers are involved. It comes to about 20 lines of code change to zend_operators.c i.e.8 calls to the following new function: double decimalise(double dval) { double f; if (dval == 0) { return dval; } f = pow(10.0, DBL_DIG - (1 + floor(log10(fabs(dval); return (double) (rint(dval*f))/f; } There is a performance downside, although much less than doing your own workarounds. To put it in perspective, the impact is a twentieth of that of using a string cast/sprintf. Indeed, the slowdown is less than using objects or arrays in your arithmetic i.e. with the fix $a = $b + $c takes the same or less time than unfixed $a = $b + $c-d Or, to put it another way, if you are not worried about the performance impact of using objects and arrays in arithmetic operations, you should not be worried by the impact of this fix for decimal arithmetic. (The decimalise function could also be speeded up with a more clever calculation of f, e.g. by skipping the log10 and pow functions but I'd rather leave that to a real C programmer ;)) I haven't had a very enthusiastic response from the php developers in the past on these issues, but I'm keen to have another go if anyone else shares my view that it's time to sort out decimal arithmetic properly. I just don't see the point of these operators/functions that can go wrong at even a single decimal digit! Regards, George -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Which costs more: connecting to a DB or accessing the file system?
On Friday, June 21, 2002, at 11:19 AM, mike wrote: I was reading somewhere (can't remember where) that connecting to a db is a pretty costly transaction. DB queries aside, does anyone know of any benchmarks that demonstrate file access vs. db connections? Similarily, while DB queries offer alot of power, would it be cheaper (faster) to drop simple information that does not require heavy queries into a file and access it through the file system? I don't have any stats, but I think it really depends. If you're executing a really complex query that uses like six JOINs and eight WHERE clauses, then the bottleneck is the DB and not the DB access itself, so it would probably be quicker to have this information ready in a file (or even better, cached in memory somehow, though I have no experience doing this). But I believe that with a simpler DB query, a DB access is faster than a file read. Here's something that turned up in Google... http://phplens.com/lens/php-book/optimizing-debugging-php.php Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Speed tests? RAM usage displays?
At 6/21/2002, you wrote: PS What about execution time in ms (with breakpoints)? PS And is there way to measure MySQL query speed in ms? u can use microtime function function getMicrotime() { list($usec, $sec) = explode( ,microtime()); return ((float)$usec + (float)$sec); } in your head of your script than call: $start = getMicrotime(); and then in the end of script $stop = getMicrotime(); $diff = $stop - $start; echo Execution time was: .$diff; Thanks! That was really useful. I placed it around the biggest/most complex MySQL query on the code and found out that the biggest slow down there was due ORDER BY command (and not LIKE I thought was). So, I removed the ORDER BY and did array sorting using PHP (PHP did it in less than a millisecond) and got this query speed down from .25s to .07s Optimising can be so much fun! ;) Pekka http://photography-on-the.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is there a replicate function in PHP
Hi, I'd like to print one or more specific characters many times. For example, let's say I'd like to display the '*' 50 times on one line. Is there a function that will do this? Something like: ? replicate('*',50); Thanks, Don
Re: [PHP] Cc / Bcc don't work on win2k but on linux???
yes, and it did show me whats wrong. but i have no idea why is that the case... 127.0.0.1 SMTPSVC1 RCPT - +TO:[EMAIL PROTECTED] 250 127.0.0.1 SMTPSVC1 RCPT - +TO:Cc:[EMAIL PROTECTED] 501 i don't understand why the Cc is been treated as a recipient in TO: Stuart Dallas wrote: On Friday, June 21, 2002, 4:01:44 PM, Lance wrote: i tried that. using different email addresses. all of them are valid. still getting the same error. however, when i change the Cc to cc, no error was thrown. but only the To: will receive the email. the Cc: never get the mail. any other thoughts on that? Can you get a transcript of the SMTP session, specifically the line PHP sends to the SMTP server when it gets the 501 reply? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cc / Bcc don't work on win2k but on linux???
hm... but isn't it weird to include the cc: recipient within to: and then specifying them under cc: again? cos wouldn't it be more straight forward just to simply include all the recipient in cc: to to: and omit the cc: list. and specifying the recipient that is suppose to be in Bcc: under To:, i believe its already telling everybody who will be receiving that email. there is no more reason to stick their email in Bcc: list. am i right to say that? Lowell Allen wrote: You need to include cc: and Bcc: addresses in the first parameter and repeat in the headers, for example: mail('[EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]', 'subject', 'message', To: Receiver [EMAIL PROTECTED]\n . From: Sender [EMAIL PROTECTED]\n . cc: Courtesy [EMAIL PROTECTED]\n . Bcc: Blind [EMAIL PROTECTED]\n); Cc does not work, but cc or CC does, and on Windows servers the Bcc: header is not removed when sending, so recipients can see Bcc: receivers by examining the headers. This is from Kevin Yank's Advanced email in PHP on WebmasterBase.com. -- Lowell Allen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cc / Bcc don't work on win2k but on linux???
On Friday, June 21, 2002, 4:40:00 PM, Lance wrote: yes, and it did show me whats wrong. but i have no idea why is that the case... 127.0.0.1 SMTPSVC1 RCPT - +TO:[EMAIL PROTECTED] 250 127.0.0.1 SMTPSVC1 RCPT - +TO:Cc:[EMAIL PROTECTED] 501 i don't understand why the Cc is been treated as a recipient in TO: As far as the SMTP envelope is concerned, the To:, Cc: and Bcc: recipients are equal. It looks like a bug in PHP to me, but I don't have time to delve into the code to confirm it. It should be stripping the Cc: and the space (which shows in your log as a +) from the Cc: line. The SMTP server is complaining because the address contains invalid characters. -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is there a replicate function in PHP
echo str_repeat(*, 50); Don wrote: ** This Message Was Virus Checked With : SAVI 3.58 May 2002 Last Updated 14th June 2002 ** Hi, I'd like to print one or more specific characters many times. For example, let's say I'd like to display the '*' 50 times on one line. Is there a function that will do this? Something like: ? replicate('*',50); Thanks, Don -- Work: [EMAIL PROTECTED] Home: [EMAIL PROTECTED] Web: www.curvedvision.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Is there a replicate function in PHP
I don't know if the function exists, but it should be easy to create. Something like this: function replicate($Repeat, $RepeatCount) { $Results = ; if ( ($RepeatCount 1) or ($Repeat == ) ) return false; for ($i=0; $i $RepeatCount;$i++) $Results .= $Repeat; return $Results; } -Original Message- I'd like to print one or more specific characters many times. For example, let's say I'd like to display the '*' 50 times on one line. Is there a function that will do this? Something like: ? replicate('*',50); This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] overload extension doesn't load on PHP 4.2.1 + win2k
everything is in the subject :) the error message on apache startup is: Invalid library (maybe not a PHP library) 'php_overload.dll' anyone had this problem ? here is my phpinfo: PHP Version 4.2.1 System Windows NT 5.0 build 2195 Build Date May 12 2002 23:51:56 Server API Apache Virtual Directory Support enabled Configuration File (php.ini) Path C:\WINNT\php.ini Debug Build no Thread Safety enabled __ ifrance.com, l'email gratuit le plus complet de l'Internet ! vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP... http://www.ifrance.com/_reloc/email.emailif -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php __ ifrance.com, l'email gratuit le plus complet de l'Internet ! vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP... http://www.ifrance.com/_reloc/email.emailif -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cc / Bcc don't work on win2k but on linux???
yes, the + is a whitespace. hm... a bug, you could be right on that. i dont have a copy of php4.2.1 on linux to test and see if it is just windows2k that is giving the problem, or php4.2.1 is the main culprit. but i did get the same piece of code to run on php4.0.6 on linux. it runs smoothing in there. btw, i forgot to mention that i am running php4.2.1 on win2k sp2 server. Stuart Dallas wrote: As far as the SMTP envelope is concerned, the To:, Cc: and Bcc: recipients are equal. It looks like a bug in PHP to me, but I don't have time to delve into the code to confirm it. It should be stripping the Cc: and the space (which shows in your log as a +) from the Cc: line. The SMTP server is complaining because the address contains invalid characters. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Is there a replicate function in PHP
have look at the function 'str_pad' http://www.php.net/manual/en/function.str-pad.php -Original Message- From: Lazor, Ed [mailto:[EMAIL PROTECTED]] Sent: vendredi 21 juin 2002 17:57 To: 'Don'; php list Subject: RE: [PHP] Is there a replicate function in PHP I don't know if the function exists, but it should be easy to create. Something like this: function replicate($Repeat, $RepeatCount) { $Results = ; if ( ($RepeatCount 1) or ($Repeat == ) ) return false; for ($i=0; $i $RepeatCount;$i++) $Results .= $Repeat; return $Results; } -Original Message- I'd like to print one or more specific characters many times. For example, let's say I'd like to display the '*' 50 times on one line. Is there a function that will do this? Something like: ? replicate('*',50); ** ** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ ifrance.com, l'email gratuit le plus complet de l'Internet ! vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP... http://www.ifrance.com/_reloc/email.emailif -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Script text
On Fri, Jun 21, 2002 at 11:03:30AM +0700, sonjaya wrote: I have capture serial port (pabx phone) ,and get the file dat like in attachement. 17/06/02 07:27:3008 00:00:59 437 2034224 ... snip ... I want make screen lay out like this 17/06/02 437 2034224 00:00:59 Local 500 Take a look at fopen(), fgets() and preg_split() in the manual. Open the file with fopen() then put fgets() in a while loop to go through the file one line at a time, passing each line to the split. For the split, use '/\s+/' as the string pattern That will produce an array from which you can display the data in any way you want. Aw, heck, something like this untested tidbit... $File = fopen('./filename.txt', 'r'); while ( $Data = preg_split('/\s+/', fgets($File)) ) { echo $Data[0]\t$Data[5] ... etc ...\n; } Enjoy, --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] any reason why mail() returns a false value?
FRUSTRATION. I figured it was time to upgrade PHP anyway since I was using 4.1.2 and then there's that Apache security problem, so I upgraded that too. And my sendmail problem is still present -- every time I try to call the mail() function, even with the simplest of arguments (the first three required arguments, all three of them simple string literals: mail('[EMAIL PROTECTED]', 'SubjectString', 'BodyText')), it fails. No email is sent, the return value of the function, when cast to integer, is zero, and I have thoroughly tested that sendmail works just fine. It is a RedHat 7.2 server, if that matters (though I don't think it does). I have done all of my compiling as root, and /usr/sbin/sendmail was definitely in my PATH. If I had any money, I would PAY for someone to explain to me what is going wrong. Thank you in advance if you can help me. Sincerely, Erik Price Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stumped on a function
To be honest, I didn't know I could format the date within my query. For some reason, I was under the assumption that since dates go into MySQL in a specific format, that's how they came out. Anyway, thanks for pointing this out to me! Very helpful. Jason Soza - Original Message - From: Jesper Brunholm [EMAIL PROTECTED] Date: Friday, June 21, 2002 2:02 am Subject: Re: [PHP] Stumped on a function John Holmes wrote: Why don't you just use DATE_FORMAT() in your query, then you don't have to do any extra PHP code at all?? you might want a link to that: target=lhttp://www.mysql.com/doc/D/a/Date_and_time_functions.html - look somewhat below the middle of the page function cleandate($indate) { str_replace(-, /, $indate); return date(F j, Y, strtotime($indate)); } check the $indate - response from the db - if you give invalid data there then it will (probably) use a timestamp instead, whith now()- values... when I echo $newdate using the above code, I get June 20, 2002 - today's date. Regards Jesper Brunholm -- Phønix - Danish folk music from young musicians - http://www.phonixfolk.dk -- 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] Cc / Bcc don't work on win2k but on linux???
Try a recent dev-snapshot from snaps.php.net/win32. The mail function has been reworked. Christoph Lance wrote: yes, the + is a whitespace. hm... a bug, you could be right on that. i dont have a copy of php4.2.1 on linux to test and see if it is just windows2k that is giving the problem, or php4.2.1 is the main culprit. but i did get the same piece of code to run on php4.0.6 on linux. it runs smoothing in there. btw, i forgot to mention that i am running php4.2.1 on win2k sp2 server. Stuart Dallas wrote: As far as the SMTP envelope is concerned, the To:, Cc: and Bcc: recipients are equal. It looks like a bug in PHP to me, but I don't have time to delve into the code to confirm it. It should be stripping the Cc: and the space (which shows in your log as a +) from the Cc: line. The SMTP server is complaining because the address contains invalid characters. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problems with .htaccess - crypt-passwords doesn't mach
Hi all, I'm new in here and from Germany, so I hope I can make clear what my problem is. I also didn't do too complicated things with php upto now. And the problem I have at the moment is the following: I have done a simple website as a frontend for changing the .htaccess- and .htusers-files via a combination of javascript and php. Seems as if everything works with just one (important) exception: The crypt-command doesn't give the right passwords... I have already tried the tip on the official php-site to use the first two chars of the password, but that didn't work. One example: when I enter the string into a form on the web which invokes a perl-script, I get back strings beginning with iN or something like this. Anyway, they are working when I use them as passwords. But I never get results like this with php-crypt. And as this command seems to work only in one way I think that there has to be another encryption method I have to use? Btw, I also tried md5(), but with no result. Thanks muchly for any help provided. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Which costs more: connecting to a DB or accessing the file system?
Erik, thaks for the reply. I conducted a simple/rough benchmark to which is more expensive. I tested on a Intel PIII (450MHz 384MB ram) box running Win Xp, Apache 1.3.26 and PHP 4.2.1, and mysql 3.23.49 and freeBSD of similar stats (1000MHz, 1G ram). I used the adodb database abstraction layer to make my connections (which adds extra weigt to the db initialization and queries, but this is the default method I use to access databases) to a db, and then queried a smallish db with a select * from table. I then benchmarked a file read of a similarily sized file. Win DB results average (not including the include of the adodb class): time indexex time % Start1024676092.32095600-0.00% init db 1024676092.342583000.021627 75.19% query 1024676092.349426000.006843 23.79% close1024676092.349631000.000205 0.71% Stop1024676092.349719000.880.31% total - 0.028763 100.00% Win Filesystem results average: time indexex time % Start 1024676092.35610400-0.00% file open1024676092.35685300 0.000749 28.59% read 1024676092.35846200 0.001609 61.41% close 1024676092.35863700 0.000175 6.68% Stop 1024676092.35872400 0.87 3.32% total- 0.002620 100.00% freeBSD DB results average (not including the include of the adodb class): time indexex time % Start 1024677559.22131200 -0.00% init adodb 1024677559.22266700 0.001355 75.66% query 1024677559.22303400 0.000367 20.49% close 1024677559.22307900 0.45 2.51% Stop 1024677559.22310300 0.241.34% total - 0.001791 100.00% freeBSD Filesystem results average: time index ex time % Start 1024677559.22374400- 0.00% file open1024677559.22380700 0.63 11.23% read 1024677559.22423200 0.000425 75.76% close 1024677559.22428200 0.508.91% Stop 1024677559.22430500 0.234.10% total-0.000561 100.00% On the win box, file system access was 11 times faster, while on the freeBSD box, file system access was 3 times faster. The include of the adodb class is not benchmarked, as part of this test, that that adds extra overhead as well. I suppose that filesystem access is faster. Michael Erik Price [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Friday, June 21, 2002, at 11:19 AM, mike wrote: I was reading somewhere (can't remember where) that connecting to a db is a pretty costly transaction. DB queries aside, does anyone know of any benchmarks that demonstrate file access vs. db connections? Similarily, while DB queries offer alot of power, would it be cheaper (faster) to drop simple information that does not require heavy queries into a file and access it through the file system? I don't have any stats, but I think it really depends. If you're executing a really complex query that uses like six JOINs and eight WHERE clauses, then the bottleneck is the DB and not the DB access itself, so it would probably be quicker to have this information ready in a file (or even better, cached in memory somehow, though I have no experience doing this). But I believe that with a simpler DB query, a DB access is faster than a file read. Here's something that turned up in Google... http://phplens.com/lens/php-book/optimizing-debugging-php.php Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] display_error=Off in php.ini
Hi, In php.ini file i have set: display_errors = Off log_errors = /var/log/php-errors.log but i cant see anything coming in to php-errors.log file. I have tried to change the query in my php code...but it dispays error on the gui( the display errors doesnt seem to get off). I hope someone can help me with this. thanx anil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] any reason why mail() returns a false value?
Please send code generating the problem. -Original Message- my sendmail problem is still present -- every time I try to call the mail() function, even with the simplest of arguments (the first three required arguments, all three of them simple string literals: mail('[EMAIL PROTECTED]', 'SubjectString', 'BodyText')), it fails. No email is sent, the return value of the function, when cast to integer, is zero, and I have thoroughly tested that sendmail works just fine. It is a RedHat 7.2 server, if that matters (though I don't think it does). I have done all of my compiling as root, and /usr/sbin/sendmail was definitely in my PATH. This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cc / Bcc don't work on win2k but on linux???
i downloaded php4.2.2dev and tried my codes on it. still giving me the same problem. Cc: is not been parsed correctly. so i changed to cc: and CC: no errors thrown out this time. however, only the recipient specified in To: managed to receive the email. the one specified under CC: never gets it. i looked at the smtp log file and i can only find the To: been executed. no CC: was shown on the log file. seems that php never send the CC: list to the smtp server. Christoph Grottolo wrote: Try a recent dev-snapshot from snaps.php.net/win32. The mail function has been reworked. Christoph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] display_error=Off in php.ini
Did you restart your webserver after you made the change in php.ini? If you didn't, make sure you restart it now. Restarting your webserver should fix it. -- Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com On Fri, 21 Jun 2002 12:57:34 -0400 Anil Garg [EMAIL PROTECTED] wrote: Hi, In php.ini file i have set: display_errors = Off log_errors = /var/log/php-errors.log but i cant see anything coming in to php-errors.log file. I have tried to change the query in my php code...but it dispays error on the gui( the display errors doesnt seem to get off). I hope someone can help me with this. thanx anil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] display_error=Off in php.ini
Also make sure that your webserver has write privileges to the file... RAY HUNTER - Original Message - From: Anil Garg [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, June 21, 2002 10:57 AM Subject: [PHP] display_error=Off in php.ini Hi, In php.ini file i have set: display_errors = Off log_errors = /var/log/php-errors.log but i cant see anything coming in to php-errors.log file. I have tried to change the query in my php code...but it dispays error on the gui( the display errors doesnt seem to get off). I hope someone can help me with this. thanx anil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] any reason why mail() returns a false value?
Ed, thanks for taking a look at this: [eprice@media eprice]$ less public_html/testmail.php html head titlea mail Test/title /head body ?php $return = mail('[EMAIL PROTECTED]', 'subject', 'message'); print pNow, hopefully your message has been sent.; print The return value of mail() is . (int)$return . ./p\n; ? /body /html The results I get are: Now, hopefully your message has been sent.The return value of mail() is 0. My path_to_sendmail is confirmed to be correct, and again, I have tested sendmail -- it works fine from the command line. It's executable by all users, so my Apache user shouldn't have a hard time executing it. There's just no explanation! I've even pointed my path_to_sendmail to an executable shell script that prints a confirmation message if it is executed, and the mail() function has the exact same effect if I do this. Gratefully, Erik On Friday, June 21, 2002, at 12:56 PM, Lazor, Ed wrote: Please send code generating the problem. -Original Message- my sendmail problem is still present -- every time I try to call the mail() function, even with the simplest of arguments (the first three required arguments, all three of them simple string literals: mail('[EMAIL PROTECTED]', 'SubjectString', 'BodyText')), it fails. No email is sent, the return value of the function, when cast to integer, is zero, and I have thoroughly tested that sendmail works just fine. It is a RedHat 7.2 server, if that matters (though I don't think it does). I have done all of my compiling as root, and /usr/sbin/sendmail was definitely in my PATH. * *** This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much. Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php.ini not creating logs
Hi, sorry i forgot to mention that. yes i restarted my webserver. In fact the error messages are getting hidden(on setting display_errors = Off) but the logs are not getting created:(log_errors = /var/log/php-errors.log ) in php.ini file. thanx anil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: ARRAY, IF INSERT
Thanks for the input. I wasn't considering the possibility of making a new table for kids until now which seems pretty logic when trying to save space. The only thing missing now is how to assign a unique relation number for each kid/relative. That's 1 for the first born, 2 for the second one, etc... and it can't be done by auto_incrementing, for it will start over when a new member is inserted... i.e. the relatives table should show: Member level nameaddress 00251 Jr.1same as 0025/0 00252 Jr.2same as 0025/0 00261 Jr.1same as 0026/0 00262 Jr.2same as 0026/0 00263 Jr.3same as 0026/0 The catch would be to make PHP to auto assign the relatives level by knowing it has to start from $i=1 and loop $i++ until no other kid is inserted. Now that I write it, it seems I could use a for loop, but what should be the structure of it using the $name 0 you told me? Thanks -Original Message- From: Jesper Brunholm [mailto:[EMAIL PROTECTED]] Sent: Friday, June 21, 2002 6:56 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP] Re: ARRAY, IF INSERT (i am new to these groups, but shouldn't there be a follow-up-to on a X-post?) César aracena wrote: I have this form in which one Administrator can insert new members and after that, in another page, a form where he/she can insert the new members sons daughters. I want to display a table with text inserts into the admin can type lets say a maximum of 5 kids in the second page. The number doesn't matter if you design you db well (I suppose we are talking database). I suppose that you have a table with members with unique ID's? Make a new table with relatives, where you connect to their parents through a ParentID-field This way you'll avoid empty fields for the folks with eg. only 2 sons :-) The query for father + sons and daughters would then be like mysql_query( select members.Name, members.ID, relatives.Name as RelativeName, relatives.ID from parents, relatives where parents.ID = relatives.ParentID ) The members table will have one memberID field (which will be shared between parents and kids) and a levelID which will grant 0 for the parent and 1, 2, 3, 4, 5 for the kids. You _can_ put them all in the same table, but I suppose that you have a lot of data stored on the parents/members, that is non-existing and irellevant for the children - this will give a lot of empty fields, which is why i propose the solution above... Now, how do I tell PHP to make an array from the kids input, but only from the fields in which lets say the name field was filled out in order to spend the necessary tables rows. Another thing the Array should also specify new levelIDs for each kid from 1 to 5. It would be great if you also show me how to deal with it after its created. It's easy to select only rows with contents for at certain field: select * from relatives where Name 0 I hope this was of some help? regards Jesper Brunholm -- Phønix - Danish folkmusic from young musicians - http://www.phonixfolk.dk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.ini not creating logs
Like i said make sure the webserver has the privilege to write to the log file... S RAY HUNTER email: [EMAIL PROTECTED] www: http://www.venticon.com aim: spinebl8d3 - Original Message - From: Anil Garg [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, June 21, 2002 11:40 AM Subject: [PHP] php.ini not creating logs Hi, sorry i forgot to mention that. yes i restarted my webserver. In fact the error messages are getting hidden(on setting display_errors = Off) but the logs are not getting created:(log_errors = /var/log/php-errors.log ) in php.ini file. thanx anil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Which costs more: connecting to a DB or accessing the file system?
Mike wrote: Erik, thaks for the reply. I conducted a simple/rough benchmark to which is more expensive. I tested on a Intel PIII (450MHz 384MB ram) box running Win Xp, Apache 1.3.26 and PHP 4.2.1, and mysql 3.23.49 and freeBSD of similar stats (1000MHz, 1G ram). I used the adodb database abstraction layer to make my connections (which adds extra weigt to the db initialization and queries, but this is the default method I use to access databases) to a db, and then queried a smallish db with a select * from table. I then benchmarked a file read of a similarily sized file. Win DB results average (not including the include of the adodb class): time indexex time % Start1024676092.32095600-0.00% init db 1024676092.342583000.021627 75.19% query 1024676092.349426000.006843 23.79% close1024676092.349631000.000205 0.71% Stop1024676092.349719000.880.31% total - 0.028763 100.00% Win Filesystem results average: time indexex time % Start 1024676092.35610400-0.00% file open1024676092.35685300 0.000749 28.59% read 1024676092.35846200 0.001609 61.41% close 1024676092.35863700 0.000175 6.68% Stop 1024676092.35872400 0.87 3.32% total- 0.002620 100.00% freeBSD DB results average (not including the include of the adodb class): time indexex time % Start 1024677559.22131200 -0.00% init adodb 1024677559.22266700 0.001355 75.66% query 1024677559.22303400 0.000367 20.49% close 1024677559.22307900 0.45 2.51% Stop 1024677559.22310300 0.241.34% total - 0.001791 100.00% freeBSD Filesystem results average: time index ex time % Start 1024677559.22374400- 0.00% file open1024677559.22380700 0.63 11.23% read 1024677559.22423200 0.000425 75.76% close 1024677559.22428200 0.508.91% Stop 1024677559.22430500 0.234.10% total-0.000561 100.00% On the win box, file system access was 11 times faster, while on the freeBSD box, file system access was 3 times faster. The include of the adodb class is not benchmarked, as part of this test, that that adds extra overhead as well. I suppose that filesystem access is faster. Michael Erik Price [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Friday, June 21, 2002, at 11:19 AM, mike wrote: I was reading somewhere (can't remember where) that connecting to a db is a pretty costly transaction. DB queries aside, does anyone know of any benchmarks that demonstrate file access vs. db connections? Similarily, while DB queries offer alot of power, would it be cheaper (faster) to drop simple information that does not require heavy queries into a file and access it through the file system? I don't have any stats, but I think it really depends. If you're executing a really complex query that uses like six JOINs and eight WHERE clauses, then the bottleneck is the DB and not the DB access itself, so it would probably be quicker to have this information ready in a file (or even better, cached in memory somehow, though I have no experience doing this). But I believe that with a simpler DB query, a DB access is faster than a file read. Here's something that turned up in Google... http://phplens.com/lens/php-book/optimizing-debugging-php.php Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] Mike, I'm not quite sure what you are trying to achieve, but if holding the data in a file is realistically an option i.e. your data is static, then why not consider holding your final output e.g. your web page/partpage in the file system? If you need your php script to generate it in the first place or regenerate it on request there are simple techniques to allow you to do this without reassembling it on every request. Basically you get your script to see if the output has been already created (if (file_exist), and simply redirect or include the output if it does. If it isn't you can get the script to run on and
Re: [PHP] php.ini not creating logs
ya i have tried that too.. wot else can be the problem. my php.ini looks like this: ; Print out errors (as a part of the output). For production web sites, ; you're strongly encouraged to turn this feature off, and use error logging ; instead (see below). Keeping display_errors enabled on a production web site ; may reveal security information to end users, such as file paths on your Web ; server, your database schema or other information. display_errors = Off ; Even when display_errors is on, errors that occur during PHP's startup ; sequence are not displayed. It's strongly recommended to keep ; display_startup_errors off, except for when debugging. display_startup_errors = Off ; Log errors into a log file (server-specific log, stderr, or error_log (below)) ; As stated above, you're strongly advised to use error logging in place of ; error displaying on production web sites. log_errors = /var/log/php-errors.log ; Store the last error/warning message in $php_errormsg (boolean). track_errors = On ; Disable the inclusion of HTML tags in error messages. ;html_errors = Off ; String to output before an error message. ;error_prepend_string = font color=ff ; String to output after an error message. ;error_append_string = /font ; Log errors to specified file. ;error_log = Off --- - Original Message - From: Ray Hunter [EMAIL PROTECTED] To: Anil Garg [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, June 21, 2002 1:53 PM Subject: Re: [PHP] php.ini not creating logs Like i said make sure the webserver has the privilege to write to the log file... S RAY HUNTER email: [EMAIL PROTECTED] www: http://www.venticon.com aim: spinebl8d3 - Original Message - From: Anil Garg [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, June 21, 2002 11:40 AM Subject: [PHP] php.ini not creating logs Hi, sorry i forgot to mention that. yes i restarted my webserver. In fact the error messages are getting hidden(on setting display_errors = Off) but the logs are not getting created:(log_errors = /var/log/php-errors.log ) in php.ini file. thanx anil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.ini not creating logs
Do this, set log_errors = on in your php.ini file. Do not set the error_log = file comment that line out and all other error_log ones as well. This will then log all errors to apache's log files and you can view the errors there. RAY HUNTER - Original Message - From: Anil Garg [EMAIL PROTECTED] To: Ray Hunter [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, June 21, 2002 12:00 PM Subject: Re: [PHP] php.ini not creating logs ya i have tried that too.. wot else can be the problem. my php.ini looks like this: ; Print out errors (as a part of the output). For production web sites, ; you're strongly encouraged to turn this feature off, and use error logging ; instead (see below). Keeping display_errors enabled on a production web site ; may reveal security information to end users, such as file paths on your Web ; server, your database schema or other information. display_errors = Off ; Even when display_errors is on, errors that occur during PHP's startup ; sequence are not displayed. It's strongly recommended to keep ; display_startup_errors off, except for when debugging. display_startup_errors = Off ; Log errors into a log file (server-specific log, stderr, or error_log (below)) ; As stated above, you're strongly advised to use error logging in place of ; error displaying on production web sites. log_errors = /var/log/php-errors.log ; Store the last error/warning message in $php_errormsg (boolean). track_errors = On ; Disable the inclusion of HTML tags in error messages. ;html_errors = Off ; String to output before an error message. ;error_prepend_string = font color=ff ; String to output after an error message. ;error_append_string = /font ; Log errors to specified file. ;error_log = Off --- - Original Message - From: Ray Hunter [EMAIL PROTECTED] To: Anil Garg [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, June 21, 2002 1:53 PM Subject: Re: [PHP] php.ini not creating logs Like i said make sure the webserver has the privilege to write to the log file... S RAY HUNTER email: [EMAIL PROTECTED] www: http://www.venticon.com aim: spinebl8d3 - Original Message - From: Anil Garg [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, June 21, 2002 11:40 AM Subject: [PHP] php.ini not creating logs Hi, sorry i forgot to mention that. yes i restarted my webserver. In fact the error messages are getting hidden(on setting display_errors = Off) but the logs are not getting created:(log_errors = /var/log/php-errors.log ) in php.ini file. thanx anil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] some one PLEASE help me!
Ok, I have never, in my entire life, have such a persistant little freakin problem with a programming language... It started out while i was running 4.1.2 where sessions would not write to the disk properly. I researched and found a bug. I couldnt get php properly upgraded... dont know why so i had to whip out the whole system and start from scratch. After doing this I am now running Apache 1.3.26, php 4.2.1 and the os is Freebsd 4.6-Release, platform i386. I just want to do some simple authentication with sessions so this is the session code in the script: $start_time = mktime(); error_reporting(2047); session_start(); session_register(encrypted); session_register(user); session_register(start_time); session_register(cdomain); session_write_close(); header(Location: blalbalballafdskljf); i even tried that same code but instead of using session_register i assigned the vars manually by doing like $_SESSION['encrypted'] = $encrypted; but that produced the same errors as using session_register. I tried with reg_globals on and off. no difference. Its set to write in the /tmp directory which has the following permissions. drwxrwxrwt 3 root wheel 512 Jun 21 13:00 tmp I also tried changing it to /usr/local/apache/sessions which has the permissions: drwxrwxrwx 3 nobody nobody 512 Jun 21 12:36 sessions Nothing works NOTHING AT ALL, i cant get this shit to work for the life of me and its really irritating. apache error_logs report NOTHING at all and if php has its own log i have no idea where it is. Even if you cant directly tell me what the problem is, if there is a way to even find out what could be causeing it please let me know, this is killing me. Oh and here is the output i get when i run the script. Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in /usr/local/apache/htdocs/cp/login.php on line 43 Warning: Cannot add header information - headers already sent by (output started at /usr/local/apache/htdocs/cp/login.php:43) in /usr/local/apache/htdocs/cp/login.php on line 45 - Thanks Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.ini not creating logs
First, run a php script that calls phpinfo() and make sure that the php module in your server is running against the php.ini file you think it is. Verify the name and path of the log file. Second, make sure that errors are being reported, meaning check your php.ini file for the error_reporting directive and make sure it says something like error_reporting = E_ALL ~E_NOTICE - make sure the line is not commented out. Third, check the ownership and permissions on the log file AND the directory the log file is in and make sure that they're such that the webserver can write to them. Restart the webserver. Write a php script with an error in it and request the script. Rinse and repeat. ..michael.. On Fri, 2002-06-21 at 11:00, Anil Garg wrote: ya i have tried that too.. wot else can be the problem. my php.ini looks like this: Like i said make sure the webserver has the privilege to write to the log file... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] some one PLEASE help me!
Why don't you try using mm for the sessions...then you do not have to write to disk, it is all in memory... RAY HUNTER - Original Message - From: Rick Kukiela [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, June 21, 2002 12:09 PM Subject: [PHP] some one PLEASE help me! Ok, I have never, in my entire life, have such a persistant little freakin problem with a programming language... It started out while i was running 4.1.2 where sessions would not write to the disk properly. I researched and found a bug. I couldnt get php properly upgraded... dont know why so i had to whip out the whole system and start from scratch. After doing this I am now running Apache 1.3.26, php 4.2.1 and the os is Freebsd 4.6-Release, platform i386. I just want to do some simple authentication with sessions so this is the session code in the script: $start_time = mktime(); error_reporting(2047); session_start(); session_register(encrypted); session_register(user); session_register(start_time); session_register(cdomain); session_write_close(); header(Location: blalbalballafdskljf); i even tried that same code but instead of using session_register i assigned the vars manually by doing like $_SESSION['encrypted'] = $encrypted; but that produced the same errors as using session_register. I tried with reg_globals on and off. no difference. Its set to write in the /tmp directory which has the following permissions. drwxrwxrwt 3 root wheel 512 Jun 21 13:00 tmp I also tried changing it to /usr/local/apache/sessions which has the permissions: drwxrwxrwx 3 nobody nobody 512 Jun 21 12:36 sessions Nothing works NOTHING AT ALL, i cant get this shit to work for the life of me and its really irritating. apache error_logs report NOTHING at all and if php has its own log i have no idea where it is. Even if you cant directly tell me what the problem is, if there is a way to even find out what could be causeing it please let me know, this is killing me. Oh and here is the output i get when i run the script. Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in /usr/local/apache/htdocs/cp/login.php on line 43 Warning: Cannot add header information - headers already sent by (output started at /usr/local/apache/htdocs/cp/login.php:43) in /usr/local/apache/htdocs/cp/login.php on line 45 - Thanks Rick -- 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] Log files.
I was having some problems with my error logs. I just figured out what the problem was! Thought everybody might benefit from it's solution so here it goes. The problem was that the php error log was only showing errors created by my command line scripts that were being executed by cron. The solution was that one of my cron jobs deleted the PHP error file late every night so it would be fresh and only showing today's errors. The first error output was usually created by one of the PHP scripts run through cron. When this script wrote it's error out it created my error file with the owner being root. Then when the website users started creating errors (later in the morning), apache was unable to write to the file because it was owned by root. Duhhh!! Maybe this will help someone in the future. James E Hicks III -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Scree Resolution
Hi, Are there any way to know what screen resolution use a user in your monitor? Thank you in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] some one PLEASE help me!
how do u do that? - Original Message - From: Ray Hunter [EMAIL PROTECTED] To: Rick Kukiela [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, June 21, 2002 1:16 PM Subject: Re: [PHP] some one PLEASE help me! Why don't you try using mm for the sessions...then you do not have to write to disk, it is all in memory... RAY HUNTER - Original Message - From: Rick Kukiela [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, June 21, 2002 12:09 PM Subject: [PHP] some one PLEASE help me! Ok, I have never, in my entire life, have such a persistant little freakin problem with a programming language... It started out while i was running 4.1.2 where sessions would not write to the disk properly. I researched and found a bug. I couldnt get php properly upgraded... dont know why so i had to whip out the whole system and start from scratch. After doing this I am now running Apache 1.3.26, php 4.2.1 and the os is Freebsd 4.6-Release, platform i386. I just want to do some simple authentication with sessions so this is the session code in the script: $start_time = mktime(); error_reporting(2047); session_start(); session_register(encrypted); session_register(user); session_register(start_time); session_register(cdomain); session_write_close(); header(Location: blalbalballafdskljf); i even tried that same code but instead of using session_register i assigned the vars manually by doing like $_SESSION['encrypted'] = $encrypted; but that produced the same errors as using session_register. I tried with reg_globals on and off. no difference. Its set to write in the /tmp directory which has the following permissions. drwxrwxrwt 3 root wheel 512 Jun 21 13:00 tmp I also tried changing it to /usr/local/apache/sessions which has the permissions: drwxrwxrwx 3 nobody nobody 512 Jun 21 12:36 sessions Nothing works NOTHING AT ALL, i cant get this shit to work for the life of me and its really irritating. apache error_logs report NOTHING at all and if php has its own log i have no idea where it is. Even if you cant directly tell me what the problem is, if there is a way to even find out what could be causeing it please let me know, this is killing me. Oh and here is the output i get when i run the script. Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in /usr/local/apache/htdocs/cp/login.php on line 43 Warning: Cannot add header information - headers already sent by (output started at /usr/local/apache/htdocs/cp/login.php:43) in /usr/local/apache/htdocs/cp/login.php on line 45 - Thanks Rick -- 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] Resoltuion
Hi, Are there any way to know what screen resolution use a user in your monitor? Thank you in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] some one PLEASE help me!
you need to compile php with-mm and then you need to edit your php.ini file to use mm instead of files. this increases your php performance for sessions. Check you phpinfo() to see if you have mm compiled in and then edit your php.ini file like this: session.save_handler = mm S RAY HUNTER email: [EMAIL PROTECTED] www: http://www.venticon.com aim: spinebl8d3 - Original Message - From: Rick Kukiela [EMAIL PROTECTED] To: Ray Hunter [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, June 21, 2002 12:25 PM Subject: Re: [PHP] some one PLEASE help me! how do u do that? - Original Message - From: Ray Hunter [EMAIL PROTECTED] To: Rick Kukiela [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, June 21, 2002 1:16 PM Subject: Re: [PHP] some one PLEASE help me! Why don't you try using mm for the sessions...then you do not have to write to disk, it is all in memory... RAY HUNTER - Original Message - From: Rick Kukiela [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, June 21, 2002 12:09 PM Subject: [PHP] some one PLEASE help me! Ok, I have never, in my entire life, have such a persistant little freakin problem with a programming language... It started out while i was running 4.1.2 where sessions would not write to the disk properly. I researched and found a bug. I couldnt get php properly upgraded... dont know why so i had to whip out the whole system and start from scratch. After doing this I am now running Apache 1.3.26, php 4.2.1 and the os is Freebsd 4.6-Release, platform i386. I just want to do some simple authentication with sessions so this is the session code in the script: $start_time = mktime(); error_reporting(2047); session_start(); session_register(encrypted); session_register(user); session_register(start_time); session_register(cdomain); session_write_close(); header(Location: blalbalballafdskljf); i even tried that same code but instead of using session_register i assigned the vars manually by doing like $_SESSION['encrypted'] = $encrypted; but that produced the same errors as using session_register. I tried with reg_globals on and off. no difference. Its set to write in the /tmp directory which has the following permissions. drwxrwxrwt 3 root wheel 512 Jun 21 13:00 tmp I also tried changing it to /usr/local/apache/sessions which has the permissions: drwxrwxrwx 3 nobody nobody 512 Jun 21 12:36 sessions Nothing works NOTHING AT ALL, i cant get this shit to work for the life of me and its really irritating. apache error_logs report NOTHING at all and if php has its own log i have no idea where it is. Even if you cant directly tell me what the problem is, if there is a way to even find out what could be causeing it please let me know, this is killing me. Oh and here is the output i get when i run the script. Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in /usr/local/apache/htdocs/cp/login.php on line 43 Warning: Cannot add header information - headers already sent by (output started at /usr/local/apache/htdocs/cp/login.php:43) in /usr/local/apache/htdocs/cp/login.php on line 45 - Thanks Rick -- 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] Scree Resolution
On Fri, 21 Jun 2002, Edgar wrote: Hi, Are there any way to know what screen resolution use a user in your monitor? See javascript. -- Sapere aude My mind not only wanders, it sometimes leaves completely. Never attribute to malice that which can be adequately explained by stupidity. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] some one PLEASE help me!
Well, i would rather not have to recompile becuase of all the problems i had compiling with mod_perl and mod_ssl together with apache so does anyone else have any ideas how to get files to work??? anyone else have this problem? what gives? Rick - Original Message - From: Ray Hunter [EMAIL PROTECTED] To: Rick Kukiela [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, June 21, 2002 1:33 PM Subject: Re: [PHP] some one PLEASE help me! you need to compile php with-mm and then you need to edit your php.ini file to use mm instead of files. this increases your php performance for sessions. Check you phpinfo() to see if you have mm compiled in and then edit your php.ini file like this: session.save_handler = mm S RAY HUNTER email: [EMAIL PROTECTED] www: http://www.venticon.com aim: spinebl8d3 - Original Message - From: Rick Kukiela [EMAIL PROTECTED] To: Ray Hunter [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, June 21, 2002 12:25 PM Subject: Re: [PHP] some one PLEASE help me! how do u do that? - Original Message - From: Ray Hunter [EMAIL PROTECTED] To: Rick Kukiela [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, June 21, 2002 1:16 PM Subject: Re: [PHP] some one PLEASE help me! Why don't you try using mm for the sessions...then you do not have to write to disk, it is all in memory... RAY HUNTER - Original Message - From: Rick Kukiela [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, June 21, 2002 12:09 PM Subject: [PHP] some one PLEASE help me! Ok, I have never, in my entire life, have such a persistant little freakin problem with a programming language... It started out while i was running 4.1.2 where sessions would not write to the disk properly. I researched and found a bug. I couldnt get php properly upgraded... dont know why so i had to whip out the whole system and start from scratch. After doing this I am now running Apache 1.3.26, php 4.2.1 and the os is Freebsd 4.6-Release, platform i386. I just want to do some simple authentication with sessions so this is the session code in the script: $start_time = mktime(); error_reporting(2047); session_start(); session_register(encrypted); session_register(user); session_register(start_time); session_register(cdomain); session_write_close(); header(Location: blalbalballafdskljf); i even tried that same code but instead of using session_register i assigned the vars manually by doing like $_SESSION['encrypted'] = $encrypted; but that produced the same errors as using session_register. I tried with reg_globals on and off. no difference. Its set to write in the /tmp directory which has the following permissions. drwxrwxrwt 3 root wheel 512 Jun 21 13:00 tmp I also tried changing it to /usr/local/apache/sessions which has the permissions: drwxrwxrwx 3 nobody nobody 512 Jun 21 12:36 sessions Nothing works NOTHING AT ALL, i cant get this shit to work for the life of me and its really irritating. apache error_logs report NOTHING at all and if php has its own log i have no idea where it is. Even if you cant directly tell me what the problem is, if there is a way to even find out what could be causeing it please let me know, this is killing me. Oh and here is the output i get when i run the script. Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in /usr/local/apache/htdocs/cp/login.php on line 43 Warning: Cannot add header information - headers already sent by (output started at /usr/local/apache/htdocs/cp/login.php:43) in /usr/local/apache/htdocs/cp/login.php on line 45 - Thanks Rick -- 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] some one PLEASE help me!
umm, well i had the same problem on freebsd 4.5-release so i dunno if its neccessarily a freebsd problem, i mean the directory exists, the www has write permissions to it so it should work and it doesnt so im thinking something in php is broke. - Original Message - From: Ray Hunter [EMAIL PROTECTED] To: Rick Kukiela [EMAIL PROTECTED] Sent: Friday, June 21, 2002 1:40 PM Subject: Re: [PHP] some one PLEASE help me! You might have to check on your freebsd4.6, how stable is it running... S RAY HUNTER email: [EMAIL PROTECTED] www: http://www.venticon.com aim: spinebl8d3 - Original Message - From: Rick Kukiela [EMAIL PROTECTED] To: Ray Hunter [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, June 21, 2002 12:37 PM Subject: Re: [PHP] some one PLEASE help me! Well, i would rather not have to recompile becuase of all the problems i had compiling with mod_perl and mod_ssl together with apache so does anyone else have any ideas how to get files to work??? anyone else have this problem? what gives? Rick - Original Message - From: Ray Hunter [EMAIL PROTECTED] To: Rick Kukiela [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, June 21, 2002 1:33 PM Subject: Re: [PHP] some one PLEASE help me! you need to compile php with-mm and then you need to edit your php.ini file to use mm instead of files. this increases your php performance for sessions. Check you phpinfo() to see if you have mm compiled in and then edit your php.ini file like this: session.save_handler = mm S RAY HUNTER email: [EMAIL PROTECTED] www: http://www.venticon.com aim: spinebl8d3 - Original Message - From: Rick Kukiela [EMAIL PROTECTED] To: Ray Hunter [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, June 21, 2002 12:25 PM Subject: Re: [PHP] some one PLEASE help me! how do u do that? - Original Message - From: Ray Hunter [EMAIL PROTECTED] To: Rick Kukiela [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, June 21, 2002 1:16 PM Subject: Re: [PHP] some one PLEASE help me! Why don't you try using mm for the sessions...then you do not have to write to disk, it is all in memory... RAY HUNTER - Original Message - From: Rick Kukiela [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, June 21, 2002 12:09 PM Subject: [PHP] some one PLEASE help me! Ok, I have never, in my entire life, have such a persistant little freakin problem with a programming language... It started out while i was running 4.1.2 where sessions would not write to the disk properly. I researched and found a bug. I couldnt get php properly upgraded... dont know why so i had to whip out the whole system and start from scratch. After doing this I am now running Apache 1.3.26, php 4.2.1 and the os is Freebsd 4.6-Release, platform i386. I just want to do some simple authentication with sessions so this is the session code in the script: $start_time = mktime(); error_reporting(2047); session_start(); session_register(encrypted); session_register(user); session_register(start_time); session_register(cdomain); session_write_close(); header(Location: blalbalballafdskljf); i even tried that same code but instead of using session_register i assigned the vars manually by doing like $_SESSION['encrypted'] = $encrypted; but that produced the same errors as using session_register. I tried with reg_globals on and off. no difference. Its set to write in the /tmp directory which has the following permissions. drwxrwxrwt 3 root wheel 512 Jun 21 13:00 tmp I also tried changing it to /usr/local/apache/sessions which has the permissions: drwxrwxrwx 3 nobody nobody 512 Jun 21 12:36 sessions Nothing works NOTHING AT ALL, i cant get this shit to work for the life of me and its really irritating. apache error_logs report NOTHING at all and if php has its own log i have no idea where it is. Even if you cant directly tell me what the problem is, if there is a way to even find out what could be causeing it please let me know, this is killing me. Oh and here is the output i get when i run the script. Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in /usr/local/apache/htdocs/cp/login.php on line 43 Warning: Cannot add header information - headers already sent by (output started at
[PHP] tracing include
Hi, is there any way to know in the included file the filename of the parent file? for example for restricting the script execution in the included file to certain files. thanks, -- Tigran Nazaryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Application level logging module
Hi all, Did anyone work on application level logging module ? Please let me know the correct architecture, since I am not able to create a singleton per webserver. Thanks Regards, Puru
RE: [PHP] tracing include
You could look at $HTTP_SERVER_VARS['SCRIPT_NAME'] in the included file, for one. Kirk Hi, is there any way to know in the included file the filename of the parent file? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Resoltuion
On Thu, 20 Jun 2002, Edgar wrote: Are there any way to know what screen resolution use a user in your monitor? From a quick search with Google: http://www.alt-php-faq.org/local/89/ Good luck. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Scree Resolution
Edgar, Using Javascript, yes. This has been answered on this list about a week ago. I suggest you search the archives for the details. HTH Chris Edgar wrote: Hi, Are there any way to know what screen resolution use a user in your monitor? Thank you in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Which costs more: connecting to a DB or accessing the file system?
George, George Whiffen [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I'm not quite sure what you are trying to achieve, but if holding the data in a file is realistically an option i.e. your data is static, then why not consider holding your final output e.g. your web page/partpage in the file system? For my purposes, I am not concerned with outputing dynamic web pages (that uses a corresponding caching system), but rather parsing data that effects code logic. I've noticed that it is pretty popular amongst many PHP applications to maintain script config information in a DB. This has it's advantages, but the extra calls to the DB looks to be pretty resource heavy. What I am trying to judge is the effectiveness of such practice. Regards, Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mod_mm problems now....
Nothing is ever easy... I now accept this fact I cant get sessions files handler to work so now im trying to compile --with-mm, php compiles fine but when i compile apache this happens: === src/modules/php4 === src/modules gcc -c -I. -I/usr/libdata/perl/5.00503/mach/CORE -I./os/unix -I./include - funsigned-char -DMOD_SSL=208109 -DMOD_PERL -DUSE_PERL_SSI -I/usr/local/src/ php-4.2.1 -I/usr/local/src/php-4.2.1/main -I/usr/local/src/php-4.2.1/main -I /usr/local/src/php-4.2.1/Zend -I/usr/local/src/php-4.2.1/Zend -I/usr/local/s rc/php-4.2.1/TSRM -I/usr/local/src/php-4.2.1/TSRM -I/usr/local/src/php-4.2.1 -DEAPI -DUSE_EXPAT -I./lib/expat-lite `./apaci` modules.c gcc -c -I. -I/usr/libdata/perl/5.00503/mach/CORE -I./os/unix -I./include - funsigned-char -DMOD_SSL=208109 -DMOD_PERL -DUSE_PERL_SSI -I/usr/local/src/ php-4.2.1 -I/usr/local/src/php-4.2.1/main -I/usr/local/src/php-4.2.1/main -I /usr/local/src/php-4.2.1/Zend -I/usr/local/src/php-4.2.1/Zend -I/usr/local/s rc/php-4.2.1/TSRM -I/usr/local/src/php-4.2.1/TSRM -I/usr/local/src/php-4.2.1 -DEAPI -DUSE_EXPAT -I./lib/expat-lite `./apaci` buildmark.c gcc -funsigned-char -DMOD_SSL=208109 -DMOD_PERL -DUSE_PERL_SSI -I/usr/loca l/src/php-4.2.1 -I/usr/local/src/php-4.2.1/main -I/usr/local/src/php-4.2.1/m ain -I/usr/local/src/php-4.2.1/Zend -I/usr/local/src/php-4.2.1/Zend -I/usr/l ocal/src/php-4.2.1/TSRM -I/usr/local/src/php-4.2.1/TSRM -I/usr/local/src/php -4.2.1 -DEAPI -DUSE_EXPAT -I./lib/expat-lite ./apaci` -L/usr/lib -Wl,-E -o httpd buildmark.o modules.o modules/php4/libphp4.a modules/standard/libstandard.a modules/ssl/libssl.a modules/perl/libperl.a main/libmain.a ./os/unix/libos.a ap/libap.a lib/expat-lite/libexpat.a -R/usr/local/lib -rdynamic -L/usr/local/lib -Lmo dules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4 -lpam -lc-clien t4 -lcrypt -lpam -lcrypt -lm -lcrypt -lcrypt -lssl -lcrypto -Wl,-R/us r/lib -Wl,-E -lperl -lm /usr/libdata/perl/5.00503/mach/auto/DynaLoader/DynaLoader.a -L/usr/libdata/p erl/5.00503/mach/CORE -lperl -lm -lc -lcrypt -lperl -lm modules/php4/libphp4.a(mod_mm.o): In function `hash_split': /usr/local/src/php-4.2.1/ext/session/mod_mm.c:96: undefined reference to `mm_calloc' /usr/local/src/php-4.2.1/ext/session/mod_mm.c:111: undefined reference to `mm_free' modules/php4/libphp4.a(mod_mm.o): In function `ps_sd_new': /usr/local/src/php-4.2.1/ext/session/mod_mm.c(.text+0xc2): undefined reference to `mm_malloc' /usr/local/src/php-4.2.1/ext/session/mod_mm.c(.text+0xd0): undefined reference to `mm_error' /usr/local/src/php-4.2.1/ext/session/mod_mm.c(.text+0xde): undefined reference to `mm_available' modules/php4/libphp4.a(mod_mm.o): In function `ps_sd_destroy': /usr/local/src/php-4.2.1/ext/session/mod_mm.c(.text+0x23b): undefined reference to `mm_free' /usr/local/src/php-4.2.1/ext/session/mod_mm.c(.text+0x24c): undefined reference to `mm_free' modules/php4/libphp4.a(mod_mm.o): In function `ps_mm_initialize': /usr/local/src/php-4.2.1/ext/session/mod_mm.c(.text+0x331): undefined reference to `mm_create' /usr/local/src/php-4.2.1/ext/session/mod_mm.c(.text+0x358): undefined reference to `mm_calloc' /usr/local/src/php-4.2.1/ext/session/mod_mm.c(.text+0x372): undefined reference to `mm_destroy' modules/php4/libphp4.a(mod_mm.o): In function `ps_mm_destroy': /usr/local/src/php-4.2.1/ext/session/mod_mm.c(.text+0x3dc): undefined reference to `mm_free' /usr/local/src/php-4.2.1/ext/session/mod_mm.c(.text+0x3e6): undefined reference to `mm_destroy' modules/php4/libphp4.a(mod_mm.o): In function `ps_read_mm': /usr/local/src/php-4.2.1/ext/session/mod_mm.c(.text+0x5b2): undefined reference to `mm_lock' /usr/local/src/php-4.2.1/ext/session/mod_mm.c(.text+0x60b): undefined reference to `mm_unlock' modules/php4/libphp4.a(mod_mm.o): In function `ps_write_mm': /usr/local/src/php-4.2.1/ext/session/mod_mm.c(.text+0x635): undefined reference to `mm_lock' /usr/local/src/php-4.2.1/ext/session/mod_mm.c(.text+0x67a): undefined reference to `mm_free' /usr/local/src/php-4.2.1/ext/session/mod_mm.c(.text+0x68e): undefined reference to `mm_malloc' /usr/local/src/php-4.2.1/ext/session/mod_mm.c(.text+0x6e5): undefined reference to `mm_unlock' modules/php4/libphp4.a(mod_mm.o): In function `ps_delete_mm': /usr/local/src/php-4.2.1/ext/session/mod_mm.c(.text+0x714): undefined reference to `mm_lock' /usr/local/src/php-4.2.1/ext/session/mod_mm.c(.text+0x73e): undefined reference to `mm_unlock' modules/php4/libphp4.a(mod_mm.o): In function `ps_gc_mm': /usr/local/src/php-4.2.1/ext/session/mod_mm.c(.text+0x77d): undefined reference to `mm_lock' /usr/local/src/php-4.2.1/ext/session/mod_mm.c(.text+0x7d3): undefined reference to `mm_unlock' *** Error code 1 Stop in /usr/local/src/apache_1.3.26/src. *** Error code 1 Stop in /usr/local/src/apache_1.3.26. *** Error code 1 Stop in /usr/local/src/apache_1.3.26. Anyone have any ideas? -- im thinking it may have to do with ldconfig but how do i know what directory to add to ldconfig for this to work right???