[PHP] how to change session timeout output text
A message Session timeout! Please relogin again. appears after the session expires. I was looking in the php where can I: 1. modify the above text message 2. redirect after some seconds to another page. But I could not find anything in my code to do that. How can I do this? Any hints, Encouragements, -- Luis Cordova -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to change session timeout output text
I have been hunting for it for hours and seems like it is not there... It should but do you know how can I trace to which file is it pointing or what function? Is there anything close to debugging in php? Encouragements, On Thu, Jul 10, 2008 at 6:48 PM, Jim Lucas [EMAIL PROTECTED] wrote: Luis Cordova wrote: A message Session timeout! Please relogin again. appears after the session expires. I was looking in the php where can I: 1. modify the above text message 2. redirect after some seconds to another page. But I could not find anything in my code to do that. How can I do this? Any hints, Encouragements, #1 is in your PHP code and is unique to your php scripts. It is not a generic message that PHP generates. #2 is done client side with either Javascript or meta .../ tag redirects -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- Luis Cordova -- Luis Cordova -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Session Vars Flash Movie
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I have a small application made in flash, that uses a set of PHP scripts to pull data from a database. I've added sessions to this scripts so they would only return the data if a proper session has been initialized, the flash movie is hosted in a sessioned php as well so you can only see it if a session has been initialized. All of it works well, the flash movie calls the scripts and the scripts return the data if and only if a session has been started. all of this was tested on Apache 2.2.2 and PHP 5.1.6 and works as expected. however, moving the whole thing to another server running Apache 2.2.6 with PHP 5.2.4 does not work, the flash movie calls the scripts, but it seems to be calling them outside the session set in PHP, thus the scripts return and invalid session message, if we call the scripts directly once the session has been initialized they return the correct data. So, the question is, is the above working because we are relaying on some bug in the previous versions of apache+php or are we missing some setting in the new versions ? We have tried to find a relevant setting making a difference but so far we are not able to do so. Thank you very much for your help. Regards. - -- Luis Magaña Gnovus Networks Software www.gnovus.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (Darwin) iD8DBQFHZzXtqSchlMT6gK4RAjHRAJ4pU81dw8BpZBf7bhF5QS7mxRqMcQCaAtIu eTMSRMXsmddN0jvqEWUOlrw= =fSiN -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie question - current date - time
Hi! Look at this: http://es.php.net/manual/es/function.date.php [EMAIL PROTECTED] escribió: Hi Folks, Newbie question : - how do I get and display the current date? - how do I get and display the current time? I see the getdate function - but I'm not sure if this is the right function or how to display it http://www.php.net/manual/en/function.getdate.php -- Thanks - RevDave Cool @ hosting4days . com [db-lists] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] pg_query and COPY in transaction
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I've found the problem and this is not a PHP issue with the pg_query function at all. It turned out the COPY command was executing properly since the specified file for copying records was empty, therefore the COPY was not issuing any error as it should be. Thank you for the help. Jochem Maas wrote: Luis Magaña wrote: It is a PHP question because the Postgres querys do work, I ran them directly on the postgres server and there is no problem, but if you use pg_query then it does not work, and pg_query is a PHP function, is it no t? Any way, I've tried already giving each query in separate function calls, and it does not work either. As the rollback you suggest, I haven't tried that since it is suppoused to be automatic. So I will try that and it might work but that does not change the fact that the pg_query function is not doing what the manual says it should do, or at least does not beheave as expected. so it seems that you _may_ have a bug. what version of php are you using? and do pg_last_error() and/or pg_last_notice() offer any useful info? (having read the pg_*() docs somewhat I can only - ouch! makes firebird look even simpler than it is already) I don't know what the COPY syntax in your SQL does exactly but have you looked at pg_copy_from() and pg_copy_to() ? thank you very much for your help. regards. Jochem Maas wrote: Luis Magaña wrote: I have the following code: pg_query($conn,BEGIN TRANSACTION; DELETE FROM codigo_postal; COPY codigo_postal(codigo_postal,asentamiento,tipo_asentamiento,municipio,estado) FROM '$tmpfname2' DELIMITER '|'; COMMIT); It is suppoused as I understand it, that if an error occurs on the copy statement, then the codigo_postal table should still have all of the previous records. Actually I've tested it within psql and it works as expected. However, the shown code does not. If an error occurs on the copy transaction, the data on the table gets deleted. wrapping an SQL question in a php function doesn't make it a php question. ;-) $apps = array(apache, mysql, windows); $i = 0; while ($i++ 100) printf(how do I install %s?\n, $apps[ rand(0,2) ]); // I ran that code for a laugh a number of times - seems to a bias towards // asking how to install windows... go figure on a php list. I'm certainly lost on this one, is it a bug ?, am I doing something wrong ? (most likely I guess) you are wrong. there is no ROLLBACK specified. I suggest you do the queries one by one (i.e. one call to pg_query() for each statement) and if the 'COPY' fails call a 'ROLLBACK' disclaimer: I know nothing about PG as such - I mostly use Firebird; Any help will be apprecciated. PHP: 5.1.2 PostgreSQL: 8.1.4 Apache: 2.0.55 Debian Linux with Kernel 2.6.16 - -- Luis Magaña Gnovus Networks Software www.gnovus.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (Darwin) iD8DBQFEvmTQ+QIHCUdTm7sRAib8AKCcdlpR+cv4eMQRNEVJRTRiLycW5QCeNx1d HsJ2PvsiKOQ1PLN+92JmnrA= =KEzZ -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] pg_query and COPY in transaction
I have the following code: pg_query($conn,BEGIN TRANSACTION; DELETE FROM codigo_postal; COPY codigo_postal(codigo_postal,asentamiento,tipo_asentamiento,municipio,estado) FROM '$tmpfname2' DELIMITER '|'; COMMIT); It is suppoused as I understand it, that if an error occurs on the copy statement, then the codigo_postal table should still have all of the previous records. Actually I've tested it within psql and it works as expected. However, the shown code does not. If an error occurs on the copy transaction, the data on the table gets deleted. I'm certainly lost on this one, is it a bug ?, am I doing something wrong ? (most likely I guess) Any help will be apprecciated. PHP: 5.1.2 PostgreSQL: 8.1.4 Apache: 2.0.55 Debian Linux with Kernel 2.6.16 -- Luis Magaña Gnovus Networks Software www.gnovus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] pg_query and COPY in transaction
It is a PHP question because the Postgres querys do work, I ran them directly on the postgres server and there is no problem, but if you use pg_query then it does not work, and pg_query is a PHP function, is it no t? Any way, I've tried already giving each query in separate function calls, and it does not work either. As the rollback you suggest, I haven't tried that since it is suppoused to be automatic. So I will try that and it might work but that does not change the fact that the pg_query function is not doing what the manual says it should do, or at least does not beheave as expected. thank you very much for your help. regards. Jochem Maas wrote: Luis Magaña wrote: I have the following code: pg_query($conn,BEGIN TRANSACTION; DELETE FROM codigo_postal; COPY codigo_postal(codigo_postal,asentamiento,tipo_asentamiento,municipio,estado) FROM '$tmpfname2' DELIMITER '|'; COMMIT); It is suppoused as I understand it, that if an error occurs on the copy statement, then the codigo_postal table should still have all of the previous records. Actually I've tested it within psql and it works as expected. However, the shown code does not. If an error occurs on the copy transaction, the data on the table gets deleted. wrapping an SQL question in a php function doesn't make it a php question. ;-) $apps = array(apache, mysql, windows); $i = 0; while ($i++ 100) printf(how do I install %s?\n, $apps[ rand(0,2) ]); // I ran that code for a laugh a number of times - seems to a bias towards // asking how to install windows... go figure on a php list. I'm certainly lost on this one, is it a bug ?, am I doing something wrong ? (most likely I guess) you are wrong. there is no ROLLBACK specified. I suggest you do the queries one by one (i.e. one call to pg_query() for each statement) and if the 'COPY' fails call a 'ROLLBACK' disclaimer: I know nothing about PG as such - I mostly use Firebird; Any help will be apprecciated. PHP: 5.1.2 PostgreSQL: 8.1.4 Apache: 2.0.55 Debian Linux with Kernel 2.6.16 -- Luis Magaña Gnovus Networks Software www.gnovus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Coding Practice: Use global $var or pass in by refernce
I would go for: - you can create a new instance (new DB) in every methode (but you usually only want a single DB-connection per script, and where do you pass config-data to access the DB?) or This way the code keeps well organized and about the use of only one connection I wouldn't worry too much since usually one thread/process is created per script called, so if this is a multiuser application you end up with several connections anyway, besides I think PHP reuses the connections when possible so the performance of your application does not seem affected at all. I use it, works perfectly with big databases and several users. Regards. Andreas Korthaus wrote: Hi Gustav! Gustav Wiberg wrote: My oponion is that is insane to use global variables. The main drawback with global variables is that is very easy to mix up variables, and keep track of what variable belongs to what. So an advice: Don't use it! Ok, so what's your recommendation to solve the problem with using a DB class in many other objects/methodes? Think of a DB class: class DB {...} And a lot of classes which want to use the DB class: class Foo { function saveChangesInDb() {...} } class Bar { function saveChangesInDb() {...} } - You can use a global $db = new DB... and pass it to every class/methode, - you can make $db global in each methode, - you can create a new instance (new DB) in every methode (but you usually only want a single DB-connection per script, and where do you pass config-data to access the DB?) or - use a factory/singleton, which is not so much better than a global variable (and again, what about config-data?). So what's the way you'd recommend and why? best regards Andreas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] glob behavior on OSX
Hi, am using glob in linux to match files like this with no problems: glob(../dbimages/banners/{*.[jJ][pP][gG],*.[gG][iI][fF]},GLOB_BRACE); that matches gif o jpg case insensitive, now this works on linux with no problems, but it does not in OSX. //This works nice in OSX glob(../dbimages/banners/*.[jJ][pP][gG]); //This also works but not case insensistive glob(../dbimages/banners/{*.jpg,*.gif},GLOB_BRACE); //This does not work at all glob(../dbimages/banners/{*.[jJ][pP][gG],*.[gG][iI][fF]},GLOB_BRACE); It seem that GLOB_BRACE + the complex regexp does not work in OSX. PHP is 4.3.11 OSX is 8.2.0 Thanks -- Luis Magaña Gnovus Networks Software www.gnovus.com signature.asc Description: This is a digitally signed message part
Re: [PHP] string tokenization
Git the first set of tokens to an array, then walk that array retrieving the subtokens. Regards babu wrote: Hi, I have different types of main strings seperated by commas(,). I want to tokenize the main string using php's string token function. I have substrings in the main string which are seperated by -. examples: 1. 20,21-24 2. 21-24,20 3. 10,20,21-24,25,26,30 so on the whole the main string is seperated by comma and some of the substrings(tokes) are seperated by hypen. can some one give me an idea how to implement in php. Thanks babu. - To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. -- Luis Magaña Gnovus Networks Software www.gnovus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: System Call Troubles
maybe you should check your php safe_mode config cheers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] System Call Troubles
[EMAIL PROTECTED] - Original Message - From: Rasmus Lerdorf [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; php-general@lists.php.net Sent: Thursday, May 19, 2005 12:57 PM Subject: Re: [PHP] System Call Troubles Michael Stearne wrote: I am having the strangest problem using system() or exec() or any variation. None of them work on the Fedora Core 3 system that was just loaded. The PHP is Version 4.3.11 with Apache 2.0.52, the default installation for Fedora Core 3. Everything in PHP works as expected except when trying a system call. If I run : ? system(/bin/ls /tmp); ? on my OS X (Apache/1.3.33 (Darwin) PHP/4.3.4) this returns the desired results, a listing of the tmp directory. On the Fedora box I get nothing, a blank page. There is content in the /tmp directory on the Fedora box. These sorts of problems are easy to debug. Switch to your web server user id and issue the same command. You will most often find you have a permission problem, or in the Fedora/Redhat world you will find that SELinux is yanking your chain. You may want to read through: http://fedora.redhat.com/docs/selinux-faq-fc3/ -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sending a string with $_POST/$_GET
Ross wrote: I want to write a string to a variable and use $_POST or $_GET to retrieve it on another page. I keep gettting an undefined index errror. Can someone show me how this is done? Do I have to use session_start() ? or just use cookies: setcookie('myvarname', 'some value'); and in the other page: echo $_COOKIE['myvarname']; will output 'some value' regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] array_diff odities
-unsubscribe-digest- - Original Message - From: Pablo Gosse [EMAIL PROTECTED] To: PHP php-general@lists.php.net Sent: Wednesday, May 18, 2005 11:03 PM Subject: [PHP] array_diff odities Howdy folks. I'm running into something strange with array_diff that I'm hoping someone can shed some light on. I have two tab-delimited text files, and need to find the lines in the first that are not in the second, and vice-versa. There are 794 records in the first, and 724 in the second. Simple enough, I thought. The following code should work: $tmpOriginalGradList = file('/path/to/graduate_list_original.txt'); $tmpNewGradList = file('/path/to/graduate_list_new.txt'); $diff1 = array_diff($tmpOriginalGradList, $tmpNewGradList); $diff2 = array_diff($tmpNewGradList, $tmpOriginalGradList); I expected that this would set $diff1 to have all elements of $tmpOriginalGradList that did not exist in $tmpNewGradList, but it actually contains many elements that exist in both. The same is true for $diff2, in that many of its elements exist in both $tmpOriginalGradList and $tmpNewGradList as well. Since this returns $diff1 as having 253 elements and $diff2 as having 183, it sort of makes sense, since the difference between those two numbers is 70, which is the difference between the number of lines in the two files. But the bottom line is that both $diff1 and $diff2 contain elements common to both files, which using array_diff simply should not be the case. However, when I loop through each file and strip out all the tabs: foreach ($tmpOriginalGradList as $k=$l) { $tmp = str_replace(chr(9), '', $l); $tmpOriginalGradList[$k] = $tmp; } foreach ($tmpNewGradList as $k=$l) { $tmp = str_replace(chr(9), '', $l); $tmpNewGradList[$k] = $tmp; } I get $diff1 as having 75 elements and $diff2 as having 5, which also sort of makes sense since there numerically there are 70 lines difference between the two files. I also manually replaced the tabs and checked about 20 of the elements in $diff1 and none were found in the new text file, and none of the 5 elements in $diff2 were found in the original text file. However, if in the code above I replace the tabs with a space instead of just stripping them out, then the numbers are again 253 and 183. I'm inclined to think the second set of results is accurate, since I was unable to find any of the 20 elements I tested in $diff1 in the new text file, and none of the elements in $diff2 are in the original text file. Does anyone have any idea why this is happening? The tab-delimited files were generated from Excel spreadsheets using the same script, so there wouldn't be any difference in the formatting of the files. This one has me confused as I really thought the simple code posted above should have worked. If anyone can pass along any advice I would greatly appreciate it. Cheers and TIA, Pablo -- 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] Change Object Type
-- mierdas saquenme de aca carajo --- Banco de Crédito BCP - Dedicados a hacerte la Banca más simple. Visita nuestra Banca por Internet http://www.viabcp.com --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Error en PHP
como puedo salir de sta lista q esta llenando mi correo. -- --- Banco de Crédito BCP - Dedicados a hacerte la Banca más simple. Visita nuestra Banca por Internet http://www.viabcp.com --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help for me about session
-- mierda carajo saquenme de sta lista de mierda q llema mi correo de huevadas rapido carjo.nierdas --- Banco de Crédito BCP - Dedicados a hacerte la Banca más simple. Visita nuestra Banca por Internet http://www.viabcp.com --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] IE problem downloading files
I have just changed the server that was being used our public website. In the process the php scripts used to download files stopped working with IE. The new box is running Debian Testing. The php version is listed as PHP Version 4.3.10-9. Apache 1.0.33. The download script looks like this: if(file_exists($path)) { $filesize = filesize($path); Header(Content-Length: $filesize); Header(Content-type: application/download); Header(Content-Disposition-type: attachment); Header(Content-Disposition: filename=$filename); Header(Content-Transfer-Encoding: binary); $fp = fopen($path,rb); $result = fpassthru($fp); unlink($path); exit; } else { print Could not create backup file; } Any ideas on where to look? I have tried searching php.net, google and the php mailing lists and have tried a variety of variations on the script but I still can't get it work. Works fine with Firefox though. Thanks, Luis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: bulk emailer
quitenme de la lista porfavor quiero salir de aqui -- --- Banco de Crédito BCP - Dedicados a hacerte la Banca más simple. Visita nuestra Banca por Internet http://www.viabcp.com --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ayuda
-- como pueddo hacer para salir de esta lista --- Banco de Crédito BCP - Dedicados a hacerte la Banca más simple. Visita nuestra Banca por Internet http://www.viabcp.com --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] incrementing a number from a text file
Is it possible to let the OS handle the collisions? For example: $last_value = system('cat counter.txt', $retval); $last_value++; $result = system('echo $last_value counter.txt', $retval); ...just a suggestion! Regards /Luis -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Thursday, March 10, 2005 3:14 PM To: Ross Hulford Cc: php-general@lists.php.net Subject: Re: [PHP] incrementing a number from a text file I want to read a number from an external (txt) file and increment it.then save the number back on the text file. I know this is possible but want a simple amd economical way to do this. That's what you *THINK* you want to do :-) But what happens when *TWO* users hit that same script at exactly the same time. At best, you get: User1 User2 Reads 9 Reads 9 Writes 10 Writes 10 and when you should have 11, you've only got 10. [aside] My amp goes to 11! [/aside] But it's worse than that: It's entirely poassible that your script, instead of having two users write 10 one after the other, will have two users both trying to write 10 at EXACTLY the same time. The result is comparable to a head-on collision between two trains. Your file is TOAST. This is why so many early hit counter scripts back in the day were always getting messed up and reset to 0. What you really want, almost for sure, is an SQL database with sequences You have to forge those in MySQL by making a table with auto_increment. You *can* use http://php.net/flock, but even that is a Bad Idea, because flock under Un*x is self-imposed -- If some *other* program/script/user decides not change that file and doesn't use flock, well, they're not STOPPED from doing that. flock is therefore all too subject to human fallibility when you re-work, re-write, or add more code to your system. The SQL guys have worked out this problem, in all respects. This is one of those things that SEEMS so simple that turns out to be a hell of a lot more involved than you thought at first. So it goes. -- Like Music? http://l-i-e.com/artists.htm -- 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] software catalog
Well... I see in HotScripts that there is a category named E-Commerce and inside there is a sub-category named Shopping Carts... [ http://www.hotscripts.com/PHP/Scripts_and_Programs/E-Commerce/Shopping_C arts/index.html ] Good Luck! /Luis -Original Message- From: Ryan A [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 09, 2005 5:51 PM To: [EMAIL PROTECTED] Cc: php Subject: Re: [PHP] software catalog Hey! Thanks for replying. Hot scripts and script search ware the two places which i checked out first before writing to the list, then google, because I dont need a jackass who has been on the list for 2 days telling me to f***ing google for it, just coz it would make him feel happy with himself :-) I dont want to build this from scratch as I am sure there must be quite a few out there, i'm just surprised that nobody has recommended one that they used or heard about other than Chris (from this same list) A very basic cart would do but searching for shopping cart php gives me hundreds of results, its really hard sorting through all that trying to find one that caters to just software selling. I have not checked SF as yet, thanks for the tip, will hit that immd after this email. In the meantime if anything comes to mind please drop me a line. Thanks, Ryan On 3/8/2005 9:12:58 PM, James Williams ([EMAIL PROTECTED]) wrote: What's up Ryan, I do believe that the cart software you choose should for the most part be independent upon what exactly your selling. There are a few big shopping cart solutions that work for selling anything and I'm sure there are features and / or plugins that will allow you to do discounts based on multiple product purchases. hit up sourceforge or hot scipts and you're sure to find plenty of awsome results. Good Luck! Ryan A wrote: Hey! Anybody know of a software catalog (or cart preferably) that is free? A site i am working for sells software, now they want to have a cart feature so people can put the packages in a cart and get discounts etc if they purchase more than 1 product...they are using 2checkout for processing. I checked the usual places and google of php software cart but got back garbled results, most of that carts are for tangible products :-( Any help or recommendations would be appreciated. Thanks in advance, Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.7.0 - Release Date: 3/8/2005 -- 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] anyone has successful to use a PHP SoapClient talking with .Net Web services?
I recently had to get one to work. The key in my case was building the soap message for the paramaters instead of the standard paramaters array something like $parameters = Login UsernameUsername/Username PasswordPassword/Password /Login; Also, I am using the nusoap library. Luis -Original Message- From: Michael Leung [mailto:[EMAIL PROTECTED] Sent: Monday, January 17, 2005 9:08 PM To: [EMAIL PROTECTED]; PHP-GEMERAL Subject: [PHP] anyone has successful to use a PHP SoapClient talking with .Net Web services? Hi all, anyone has successful to use a PHP SoapClient talking with .Net Web services? at this moment, that seem to no success for my testes. If anyone has successful to do this, please tell me. yours, Michael -- 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] Problem with PHP Curl support and Apache
I have a server running RH 8, Apache 1.3.27, PHP 4.3.9. I tried to recompile PHP with Curl support. Everything seemed to compile correctly. However, when I restarted apache I got the following error: Cannot load /etc/httpd/modules/libssl.so into server: /etc/httpd/modules/libssl.so: undefined symbol: dbm_firstkey I tried googling but haven't found any relevant info yet. Luis R. Lebron Project Manager Sigmatech, Inc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: performance: large includes vs small includes with lots of reads
You may find this useful: http://www.hudzilla.org/php/18_1_0.php Hans H. Anderson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm trying to tweak my server a bit and wonder if it is better to have a large include file, say 20-40 kb with 15 user-defined functions, of which maybe 3 or 4 are used on any given page, or to have each function in it's own file and include (disk access/read) them only as needed. Is it faster/more efficient to read one large file or several smaller ones? It's a RS Linux server with a gig of memory. I'm also looking at PHP Accelerator and such. Do those store only in memory what the script needs, or does it include all that you require or include in, as well? Thanks, Hans -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: HOWTO: Install PHP on Fedora Core / Redhat
John Swartzentruber [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On 10/3/2004 4:02 PM Matthew Fonda wrote: Howdy, I noticed that quite a few people were having a hard time installing PHP on Fedora Core or Redhat, so I put together a little tutorial explaining how to do it. Hope it helps :D http://mfonda.dotgeek.org/fcrh.php I'm not complaining about any tutorials, but this doesn't quite fit with my experience. I installed FC2 (not an upgrade). I then ran phpinfo() to get the configure options for the installed PHP. I used those options to configure PHP5. After running make and make install, I edited /etc/httpd/conf.d/php.ini to change the LoadModule line. does your installation have apxs? mine doesn't even though phpinfo says that (the fedora installed) php4 was configured with it. I believe I also needed to remove the domxml.ini file from /etc/php.d. I may have also needed to more some other files around. My point isn't to provide another tutorial, but to say that a PHP and linux newbie (me) can install PHP5 without also installing Apache. I am inexperienced with Apache and PHP, so I'm not claiming it is *better* not to re-install Apache, just that it isn't necessary under FC2. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] I need to execute PHP scripts from Apache/mod_php using the owner of scripts as user/group for execution.
I need to execute PHP scripts from Apache/mod_php using the owner of scripts as user/group for execution. I have included the 'User' and 'Group' directives into the virtualhost declaration in my httpd.conf but scripts keep on executing with user/group from Apache. Urgent help needed. Thanks. Qkidamon. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How can i force PHP scripts been executed using their owner user/group with Apache and PHP loaded as module ?
How can i force PHP scripts been executed using their owner user/group with Apache and PHP loaded as module ? Now my scripts use Apache`s user/group (wwwrun/www in my ditribution). I've included User an Group directives in the virtualhost configuration. I need any kind of help refered to this issue. Thanks. Miguel. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [Fwd: Warning: could not send message for past 1 hour]
Hi... Im trying to compile PHP 4.3.8 on Solaris 7 with apache 1.3.27. First, I configure PHP using this parameters: # ./configure --with-apache=../apache_1.3.27 --enable-versioning \ --without-mysql --with-sybase=/usr/local/freetds --without-gd \ --enable-track-vars --with-system-regex --enable-trans-id It works fine, but I got this error when I execute make: # make /bin/sh /usr/local/src/temp/temp/php-4.3.8/libtool --silent --preserve-dup-deps --mode=link gcc -export-dynamic -I/usr/local/include -L/usr/ucblib -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.7/3.3.2 -L/usr/local/freetds/lib -R /usr/ucblib -R /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/3.3.2 -R /usr/local/freetds/lib ext/ctype/ctype.lo ext/overload/overload.lo ext/pcre/pcrelib/maketables.lo ext/pcre/pcrelib/get.lo ext/pcre/pcrelib/study.lo ext/pcre/pcrelib/pcre.lo ext/pcre/php_pcre.lo ext/posix/posix.lo ext/session/session.lo ext/session/mod_files.lo ext/session/mod_mm.lo ext/session/mod_user.lo regex/regcomp.lo regex/regexec.lo regex/regerror.lo regex/regfree.lo ext/standard/array.lo ext/standard/base64.lo ext/standard/basic_functions.lo ext/standard/browscap.lo ext/standard/crc32.lo ext/standard/crypt.lo ext/standard/cyr_convert.lo ext/standard/datetime.lo ext/standard/dir.lo ext/standard/dl.lo ext/standard/dns.lo ext/standard/exec.lo ext/standard/file.lo ext/standard/filestat.lo ext/standard/flock_compat.lo ext/standard/formatted_print.lo ext/standard/fsock.lo ext/standard/head.lo ext/standard/html.lo ext/standard/image.lo ext/standard/info.lo ext/standard/iptc.lo ext/standard/lcg.lo ext/standard/link.lo ext/standard/mail.lo ext/standard/math.lo ext/standard/md5.lo ext/standard/metaphone.lo ext/standard/microtime.lo ext/standard/pack.lo ext/standard/pageinfo.lo ext/standard/parsedate.lo ext/standard/quot_print.lo ext/standard/rand.lo ext/standard/reg.lo ext/standard/soundex.lo ext/standard/string.lo ext/standard/scanf.lo ext/standard/syslog.lo ext/standard/type.lo ext/standard/uniqid.lo ext/standard/url.lo ext/standard/url_scanner.lo ext/standard/var.lo ext/standard/versioning.lo ext/standard/assert.lo ext/standard/strnatcmp.lo ext/standard/levenshtein.lo ext/standard/incomplete_class.lo ext/standard/url_scanner_ex.lo ext/standard/ftp_fopen_wrapper.lo ext/standard/http_fopen_wrapper.lo ext/standard/php_fopen_wrapper.lo ext/standard/credits.lo ext/standard/css.lo ext/standard/var_unserializer.lo ext/standard/ftok.lo ext/standard/aggregation.lo ext/standard/sha1.lo ext/sybase/php_sybase_db.lo ext/tokenizer/tokenizer.lo ext/xml/xml.lo ext/xml/expat/xmlparse.lo ext/xml/expat/xmlrole.lo ext/xml/expat/xmltok.lo TSRM/TSRM.lo TSRM/tsrm_strtok_r.lo TSRM/tsrm_virtual_cwd.lo main/main.lo main/snprintf.lo main/spprintf.lo main/php_sprintf.lo main/safe_mode.lo main/fopen_wrappers.lo main/alloca.lo main/php_scandir.lo main/php_ini.lo main/SAPI.lo main/rfc1867.lo main/php_content_types.lo main/strlcpy.lo main/strlcat.lo main/mergesort.lo main/reentrancy.lo main/php_variables.lo main/php_ticks.lo main/streams.lo main/network.lo main/php_open_temporary_file.lo main/php_logos.lo main/output.lo main/memory_streams.lo main/user_streams.lo Zend/zend_language_parser.lo Zend/zend_language_scanner.lo Zend/zend_ini_parser.lo Zend/zend_ini_scanner.lo Zend/zend_alloc.lo Zend/zend_compile.lo Zend/zend_constants.lo Zend/zend_dynamic_array.lo Zend/zend_execute_API.lo Zend/zend_highlight.lo Zend/zend_llist.lo Zend/zend_opcode.lo Zend/zend_operators.lo Zend/zend_ptr_stack.lo Zend/zend_stack.lo Zend/zend_variables.lo Zend/zend.lo Zend/zend_API.lo Zend/zend_extensions.lo Zend/zend_hash.lo Zend/zend_list.lo Zend/zend_indent.lo Zend/zend_builtin_functions.lo Zend/zend_sprintf.lo Zend/zend_ini.lo Zend/zend_qsort.lo Zend/zend_multibyte.lo Zend/zend_execute.lo sapi/cli/php_cli.lo sapi/cli/getopt.lo main/internal_functions_cli.lo -lsybdb -lresolv -lm -ldl -lnsl -lbind -lgcc -o sapi/cli/php ld: warning: symbol `__p_type_syms' has differing sizes: (file /usr/lib/libresolv.so value=0x1ec; file /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/3.3.2/../../../libbind.a(res_debug.o) value=0x258); /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/3.3.2/../../../libbind.a(res_debug.o) definition taken Undefined first referenced symbol in file getsockopt main/network.o (symbol belongs to implicit dependency /usr/lib/libsocket.so.1) send main/network.o (symbol belongs to implicit dependency /usr/lib/libsocket.so.1) recvfrom /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/3.3.2/../../../libbind.a(res_send.o) (symbol belongs to implicit dependency /usr/lib/libsocket.so.1) connect main/network.o (symbol belongs to implicit dependency /usr/lib/libsocket.so.1) dbopen ext/sybase/php_sybase_db.o getsockname /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/3.3.2/../../../libbind.a(res_send.o) (symbol belongs to implicit dependency /usr/lib/libsocket.so.1) getpeername /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/3.3.2/../../../libbind.a(res_send.o) (symbol belongs to implicit dependency
[PHP] Compiling trouble.
/libsocket.so.1) recv main/network.o (symbol belongs to implicit dependency /usr/lib/libsocket.so.1) socket main/network.o (symbol belongs to implicit dependency /usr/lib/libsocket.so.1) ld: fatal: Symbol referencing errors. No output written to sapi/cli/php collect2: ld returned 1 exit status make: *** [sapi/cli/php] Error 1 Any ideas ??? Should I change some paths ??? setenv LIBS_SHLIB -lbind setenv CFLAGS -I/usr/local/include setenv LDFLAGS -L/usr/local/lib setenv LIBS -lbind setenv LD_LIBRARY_PATH /usr/local/lib Thanks. Regards. Luis Crker. www.megared.net.mx ___ pub 1024D/5656330D - [EMAIL PROTECTED] Key fingerprint = 01A9 1D8C 99A7 415F A8DC EF94 D18F 9C2D 5656 330D signature.asc Description: This is a digitally signed message part
[PHP] Re: https sessions failing to persist
Apache or IIS? CGI or ISAPI module? Michael R. Wayne [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Upgraded our PHP installation from 4.1.2 to 4.3.4, scripts that worked fine before are no longer doing so. The failure can be traced to the fact that sessions are never being reused (i.e. a new session gets started with each connection). The session files get written with proper information but never get read. The relevant session variables are: Session Support enabled session.auto_start On session.use_cookies Off session.use_trans_sid On and, as noted in the subject line, all connections are via https. Any suggestions on how to debug this? /\/\ \/\/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problems with mail and php
I have a development box that uses our company's Exchange server as an smtp host. All of a sudden, the php mail function has stopped working. I can, however, send a message using mutt. Here's the output of the maillog: Apr 12 10:38:51 localhost sendmail[11879]: i3CFckaV011877: to=[EMAIL PROTECTED], ctladdr=[EMAIL PROTECTED] (48/48), delay=00:00:04, xdelay=00:00:04, mailer=relay, pri=30323, relay=sigma2.localdomain. [192.168.168.4], dsn=2.0.0, stat=Sent (OK) As far as I can tell the message is being sent by sendmail. Any ideas on where to look? thanks, Luis R. Lebron Project Manager Sigmatech, Inc
[PHP] php + mysql + japanese???
hi! i have developed a web site in php using mysql 3.x and have to implement it in japanese, it seems that i have to use unicode/UTF-8, but i am having problems with mysql... anyone could help or anyone knows of any resource that helps in doing this? thanx in advance, luis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] slow script
Hi all. I am developing a system using php 4.3.2 + apache 1.3.29. The db is a mssql msde (were going to mysql, but not yet due to some internal reasons). All things are running in a local, standalone station, because we had to use the app on line and off line states. The off-line one should have all stuff, so. It just connect to internet to send a data replication. The stations are windows 98. The problem is: I have to run this stuff in small boxes, like some pentium 200mhz with 64-80mb ram, and in these machines the system is very slow. The html page takes about 70 seconds to be showed in the browser. I saw cpu and ram, and are all normal, even the mssql. Just the apache activity goes up to 70% cpu. We notice that while the php is running, anything happens and suddenly(after ~70 seconds) the page arises. Our php code is a kind of big, about 160kb, and the html is generated equally big. I am going to break the jscript stuff it in some small peaces, but will not help to much, I guess. Well, if someboddy could point out me a way, a tip or a tool to discover what the script is doing while I am waiting its response, or just an ideia, I would really thank you. Gustavo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Regular expression checker
an excelent tool: The Regex Coach, its free and you can grab it from http://weitz.de/regex-coach/ and its available for windows and linux! luis. [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] Hello all, For a while I tried in vain to find a decent regular expression tester. The closest I found was RegExpEditor, by the same people who produce PHPEdit, but I found it to be slow and didn't like its constant bitching about invalid delimiters or some such thing. Anyway, I ended up writing a little tester for Perl-compatible regular expressions and thought I'd share it with you. Maybe it'll come in handy to people who often need to use regular expressions in their projects. Just copy the code below the dotted line (which has Unix line breaks) and save it to a file. Cheers, Erik html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 titleRegular Expression Tester/title ?php( isset($_POST['text']) isset($_POST['regexp']) ) { $error = false; if($_POST['mode'] == 'one') { if( @preg_match('/'.$_POST['regexp'].'/', $_POST['text'], $matches) === false ) { $error = true; } } else { if( @preg_match_all('/'.$_POST['regexp'].'/', $_POST['text'], $matches) === false ) { $error = true; } } } ? /head body style=font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; form action=?php print $_SERVER['PHP_SELF']; ? method=post enctype=multipart/form-data table width=750 tr td width=135div align=rightRegular expression:/div/td td width=591 input name=regexp type=text size=87 ?php if( isset($_POST['regexp']) ) {print 'value='.$_POST['regexp'].'';} ? / /td /tr tr td width=135div align=rightText:/div/td td width=591 textarea name=text rows=6 cols=65 ?php if( isset($_POST['text']) ) {print $_POST['text'];} ? /textarea /td /tr tr td width=135div align=rightMode:/div/td td width=591 select name=mode option value=one ?php( isset($_POST['mode']) $_POST['mode'] == 'one' ) { print 'selected'; } ? First match/option option value=all ?php( isset($_POST['mode']) $_POST['mode'] == 'all' ) { print 'selected'; } ? All matches/option /select /td /tr tr td width=135nbsp;/td tdinput type=submit value=RUN TEST/ nbsp;nbsp;nbsp; input type=reset value=CLEAR FORM//td /tr /table /form p/ div style=background-color:#00; color:#FF; table width=750 border=10 bordercolor=#00 ?php($error) { exit('trtdspan style=color: lime; font-weight: bold;'. 'Invalid regular expression!/span/td/tr'); } ( isset($matches) !empty($matches[0]) ) { print 'trtd colspan=2 style=font-weight:bold;Full match(es):/td/tr'. 'trtd colspan=2nbsp;/td/tr'; if( !is_array($matches[0]) ) { print 'tr'. 'td width=25 style=font-weight: bold;1/td'.\n. 'td'.htmlentities($matches[0]).'/td'. 'tr/'; } else { foreach($matches[0] as $key = $val) { print 'td width=25 style=font-weight: bold;'.($key+1). '/td'.\n.'td'.htmlentities($val).'/td'.\n. '/tr'; } } } { print 'trtdspan style=color: lime; font-weight: bold;'. 'No matches found./span/td/tr'; } ( isset($matches[1]) !empty($matches[1]) ) { print 'tr width=100%td colspan=2nbsp;/td/tr'. 'tr width=100%td colspan=2hr//td/tr'. 'tr width=100%td colspan=2nbsp;/td/tr'. 'tr width=100%td colspan=2 style=font-weight:bold;'. 'Sub-pattern match(es):/td/tr'. 'tr width=100%td colspan=2nbsp;/td/tr'; for($i = 1; $i count($matches); $i++) { if( !is_array($matches[$i]) ) { print 'tr width=100%'. 'td width=25 style=font-weight: bold;'.$i.'/td'.\n. 'td'.htmlentities($matches[$i]).'/td'. '/tr'; } else { foreach($matches[$i] as $key = $val) { print 'tr width=100%'. 'td width=25 style=font-weight: bold;'.$i.'.'.($key+1). '/td'.\n.'td'.htmlentities($val).'/td'.\n. '/tr'; } } if( isset($matches[$i+1]) ) { print 'tr width=100%td colspan=2nbsp;/td/tr'; } } } ? /table /div /body /html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] js date picker
anyone knows a good javascript date picker, i need it to be compatible with all major browsers thx, luis. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Stupid question
when you are working with classes and objects in php, and you are coding inside a class, you must use the $this variable to access the members of the class, for example: class test { //Class vars (something like properties) var $a; var $b; var $c; var $sum; //Class function (Constructor) function test() { $this-a = 'value for a'; $this-b = 'value for b'; $this-c = 'value for c'; $this-set(); } //Class function function set() { $sum = $this-a . $this-b . $this-c; } } //end class luis. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: js date picker
i am using it from a php program... maybe i was not clear enough... but thanx, i found some at phpclasses.org Ben Ramsey [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] This is a wee bit off topic, seeing as how this is a PHP mailing list. We'll be happy to help with PHP-related questions. As for JavaScript stuff, use Google to find a good resource. :-) Luis Mirabal wrote: anyone knows a good javascript date picker, i need it to be compatible with all major browsers thx, luis. -- Regards, Ben Ramsey http://benramsey.com http://www.phpcommunity.org/wiki/People/BenRamsey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Stupid question
as Chris W. Parker noticed, there is a little mistake in the example above posted by me, it says: //Class function function set() { $sum = $this-a . $this-b . $this-c; } and it should say: //Class function function set() { $this-sum = $this-a . $this-b . $this-c; } sorry :P luis. Luis Mirabal [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] when you are working with classes and objects in php, and you are coding inside a class, you must use the $this variable to access the members of the class, for example: class test { //Class vars (something like properties) var $a; var $b; var $c; var $sum; //Class function (Constructor) function test() { $this-a = 'value for a'; $this-b = 'value for b'; $this-c = 'value for c'; $this-set(); } //Class function function set() { $sum = $this-a . $this-b . $this-c; } } //end class luis. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dbg extension...
yes, i found that the extension functions only works in debug sessions, so i replaced it by Xdebug, it is very cool, i recommend it! http://www.xdebug.org/ luis. Tom Rogers [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] Hi, Tuesday, March 16, 2004, 9:51:46 AM, you wrote: LM hey guys, i have a question on dbg extension, i want to get debug details LM using the functions from php, ie. dbg_get_profiler_results, but they return LM nothing... i am developing on windows using apache and php 4.3, any LM suggestions? You probably have to trigger the debugger by doing something like this: http://domain.com/test.php?DBGSESSID=123456 -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Calculate
from sql?? if you are doing: select ... count(date) ...from ... where ... do: select ... count(date) ...from ... where ... group by date luis. Tommi Virtanen [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] Hi! How I can calculate following: I have table: id(int) start_date(date) end_date(date) 001 2004-03-10 2004-03-12 002 2004-03-27 2004-04-02 003 2004-04-05 2004-04-06 Total count of date is 12. But how I can calculate count of date per month? regards, gustavus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mappath and unmappath function
does someone knows a function to map a server path to a fs path, and a function that does the inverse? i mean, if you have /var/www/html/script and applies function unmappath, it returns /script and if apply mappath to /script it returns /var/www/html/script. somebody has something like this? thanx luis. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: $_FILE
it is not $_FILE, it is $_FILES :P luis. Bruno Santos [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] Hello. I've read in a book that we can access several file properties (when uploading a file) in two ways: 1st with the array $_FILE 2nd with $HTTP_POST_FILES i've used the 1st, but my program give many erros, and when using the 2nd, everything was fine. the 1st is avaiable from PHP 4.1.0, and im using PHP 4.3.4. Can someone tell me why does not work ??? cheers -- - .-'-. .' `. : : : : : _/| : Bruno Santos : =/_/ : [EMAIL PROTECTED] `._/ | .' ( / ,|...-'Pagina Pessoal \_/^\/||__ http://feiticeir0.no-ip.org _/~ `~`` \_ __/ -'/ `-._ `\_\__ /jgs /-'` `\ \ \-.\ Written very small on the back poket of a girl's jeans - 'If you can read this, you're WAY too close.' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] current url function
hey! i am working in an open source development, and have done a function that gives me the current url, but i need it to work always, everywhere, in every server with all browsers, could you tell me if you think it will or if you have any suggestions? here is the code: /* Returns the current URL TODO: The function can not manage nor return user and pass in the URL if present because it seems that you can not fetch them from PHP (or at least I dont't know how to do it :P) LIMITATIONS: fragment (after # sign) can not be fetched since it is a client-side feature */ function url($host=true, $querystring=true) { $url = ''; if($host) { if ( (!empty($_SERVER['HTTPS']) $_SERVER['HTTPS']=='on') || (!empty($_ENV['HTTPS']) $_ENV['HTTPS']=='on') ) $url = 'https://'; else $url = 'http://'; $url .= !empty($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']; //if((int)$_SERVER['SERVER_PORT']!=80) $url .= ':' . $_SERVER['SERVER_PORT']; } //$url .= $_SERVER['SCRIPT_NAME']; //if($querystring !empty($_SERVER['QUERY_STRING'])) $url .= '?' . $_SERVER['QUERY_STRING']; if($querystring) $url .= $_SERVER['REQUEST_URI']; else $url .= $_SERVER['PHP_SELF']; return $url; } thanx in advance! luis. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] dbg extension...
hey guys, i have a question on dbg extension, i want to get debug details using the functions from php, ie. dbg_get_profiler_results, but they return nothing... i am developing on windows using apache and php 4.3, any suggestions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] current url function
i checked http://sk2.php.net/manual/en/features.http-auth.php, but it doesnt shows how to see if i passed user:pass in the url. i try http://user:[EMAIL PROTECTED]/ and dumped globals, and there is nothing... any ideas? Marek Kilimajer [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] Luis Mirabal wrote: hey! i am working in an open source development, and have done a function that gives me the current url, but i need it to work always, everywhere, in every server with all browsers, could you tell me if you think it will or if you have any suggestions? here is the code: /* Returns the current URL TODO: The function can not manage nor return user and pass in the URL if present because it seems that you can not fetch them from PHP (or at least I dont't know how to do it :P) False, check http://sk2.php.net/manual/en/features.http-auth.php LIMITATIONS: fragment (after # sign) can not be fetched since it is a client-side feature True */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Problem with mkdir() under windows.
mmmh... i think your problem isn't in mkdir, it is in evil MAGIC QUOTES! (they are on by default) if you are getting the name of the directory from GET, POST or COOKIE, check the get_magic_quotes_gpc(), else check get_magic_quotes_runtime(), if the problem is in get_magic_quotes_runtime(), you can do set_magic_quotes_runtime(0) beforegetting the directory name, so it won't be quoted, but if the problem is in get_magic_quotes_gpc(), you will have to do something like: if(get_magic_quotes_gpc()) stripslashes($dirname); luis. Brian J. Celenza [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] I'm having a problem using the mkdir() function under windows when the directory containts a special character. For instance, the directory Someone's Files, a forward slash is added before the 's and the directory returns an error. Is there a way around this? Thank you Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Printing landscape
actually, you can control your printer, look: http://www.php.net/manual/en/function.printer-set-option.php you have to do: $handle = printer_open(); printer_set_option ($handle, PRINTER_ORIENTATION , PRINTER_ORIENTATION_LANDSCAPE); printer_close($handle); you've got many interesting options with this function. ( These functions are only available under Windows 9.x, ME, NT4 and 2000. They have been added in PHP 4.0.4.) and you can do something about the phase of the moon too, look here :P http://www.phpclasses.org/browse/package/1201.html?download=targz Cheers, Luis. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Passing array from class to class produces more than one result...
mmmh... i think its not coded the right way, first of all, you shouldn't put this: $this-setArray(@mysql_fetch_array($this-getResultID())); in the Select method, you should do it in your FetchArray method, every time it gets called, and return the value directly or false if there are no more rows, an example: function FetchArray() { return @mysql_fetch_array($this-getResultID()); } or something like that Jonathan Villa [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] I'm writing a DBI class with the following function function Select($sql) { $this-setResultID(@mysql_query($sql,$this-getDBConn())); if ($this-getResultID() == false) Error::fatalError(__FILE__.' ('.__LINE__.') : Unable to run query : '.mysql_error().'('.mysql_errno().')'); $this-setNumRows(@mysql_num_rows($this-getResultID())); $this-setArray(@mysql_fetch_array($this-getResultID())); } When I call this, I want to be able to run while($data = $objDBI-FetchArray) { echo $data['username']; } but the results I get are jvillajvillajvillajvillajvillajvillajvillajvillajvillajvillajvillajvilla etc my $sql query is simple SELECT username FROM staff; and there are four rows in the db... For some reason, I can't pass the value of mysql_fetch_array out of the Select function. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] arrays, loops, vars and props
i would do it this way function MyClass() { $this-myArray = range(0, 99); } luis. Chris W. Parker [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] Jason Davidson mailto:[EMAIL PROTECTED] on Wednesday, March 10, 2004 12:25 AM said: would the following example be faster or slower had i simply done $this-myArray[$i] = $i; class MyClass { var $myArray = array(); function MyClass() { $myTempArray = array(); for($i=0;$i100;$i++) $myTempArray[$i] = $i; $this-myArray = $myTempArray; } } here's how i would do it (coding styles aside): function MyClass() { $limit = 100; $i = -1; while(++$i $limit) { $this-myArray[] = $i; } } chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: what does this mean?
the casting is as follows, any value distinct from zero, null or empty string is converted to true, else the it is converted to false Harry Wiens [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] $this-styles['shadow'] = (boolean)$bool; what does (boolean)$bool mean? mfg. harry wiens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Screen Res
please post the code, so we can see the errors luis. Res0b8b6 [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] I am trying to get the users screen res into a var for php. And I have the Javascript that gets the screen res. But when I try to put that into a var, it puts it in as a string, storing the javascript code instead of the results of that code. Is there a way to fix this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-DB] Re: [PHP] Oracle + PHP
IT WORKS. Exactly, I need to unset the locale variables With that It works without problems. Thank you all. in the start script to see which variables are set. Boot, move /tmp/apache-start to /tmp/apache-boot, stop apache, start apache from your root shell. diff -u /tmp/apache-boot /tmp/apache-start will show the differences. Or try to unset the locale variables in the start script: unset LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION LC_ALL Some parts of Apache/Oracle/whatever-else apparently has trouble with locales. Regards... Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-DB] Re: [PHP] Oracle + PHP
Ok, thanks I will try it. Michael Mauch wrote: Luis Moran Ochoa wrote: ORACLE_SID=OWEB ;export ORACLE_SID; ORACLE_HOME=/usr/oracle/product; export ORACLE_HOME; TNS_ADMIN=/usr/oracle/product/network/admin; export TNS_ADMIN; ORACLE_BASE=/usr/oracle; export ORACLE_BASE; ORA_NLS33=/usr/oracle/product/ocommon/nls/admin/data; export ORA_NLS33; ORA_NLS=/usr/oracle/product/ocommon/nls/admin/data; export ORA_NLS; NLS_LANG=spanish_spain.we8dec; export NLS_LANG; TNS_ADMIN=/usr/oracle/product/network/admin; export TNS_ADMIN; CLASSPATH=:/usr/local/jre:/usr/oracle/product/jdbc/lib/classes111.zip: export CLASSPATH; LD_LIBRARY_PATH=/usr/oracle/product/lib:/usr/oracle/product/jdbc/lib: export LD_LIBRARY_PATH Perhaps some variables are set in the start script, but not in your root shell. Put a export /tmp/apache-start in the start script to see which variables are set. Boot, move /tmp/apache-start to /tmp/apache-boot, stop apache, start apache from your root shell. diff -u /tmp/apache-boot /tmp/apache-start will show the differences. Or try to unset the locale variables in the start script: unset LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION LC_ALL Some parts of Apache/Oracle/whatever-else apparently has trouble with locales. Regards... Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Oracle + PHP
Hello I have Oracle 9 + RedHat 7 + PHP 4.3.4 + Apache 1.3.29. I've compiled apache and php I've compiled PHP using the documentation and activating OCI. I've build the typical script for starting apache, it's like this: $ORACLE_HOME=blablahblah... more oracle variables case $1 in start) /opt/apache/bin/apachectl startssl ;; stop) /opt/apache/bin/apachectl stop ;; esac But the problem is the next: When I login as root (on a console or an xterm) and run that script (/etc/init.d/apache start) everything works fine. So I've created a link from /etc/rc5.d/S99apache to /etc/init.d/apache for starting it during boot process.. But when I reboot the system and apache is started on boot (oracle is launche thru S20oracle), it start. If you request a php page or other kind of webpage it works fine, until you request a php page that connects to oracle Then the instance that is serving that request dies, raise an error that says something like Couldn't connect to database and no more php+oracle pages can be requested... But php and apache still works. If I stop apache and launch it again from console using /etc/init.d/apache start It works again and works fine, all connections are successfull. User apache belongs to oinstall group and have read and execution access to all the oracle directories. Where can be the problem Why it works if I launch it from a console or xterm and not if the system starts it??? Thank you -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Oracle + PHP
These are the exact details... /usr/oracle permissions 750 owner oracle.oinstall apache belongs to oinstall. script permissions in /etc/init.d/apache -- 755 ORACLE_SID=OWEB ;export ORACLE_SID; ORACLE_HOME=/usr/oracle/product; export ORACLE_HOME; TNS_ADMIN=/usr/oracle/product/network/admin; export TNS_ADMIN; ORACLE_BASE=/usr/oracle; export ORACLE_BASE; ORA_NLS33=/usr/oracle/product/ocommon/nls/admin/data; export ORA_NLS33; ORA_NLS=/usr/oracle/product/ocommon/nls/admin/data; export ORA_NLS; NLS_LANG=spanish_spain.we8dec; export NLS_LANG; TNS_ADMIN=/usr/oracle/product/network/admin; export TNS_ADMIN; CLASSPATH=:/usr/local/jre:/usr/oracle/product/jdbc/lib/classes111.zip: export CLASSPATH; LD_LIBRARY_PATH=/usr/oracle/product/lib:/usr/oracle/product/jdbc/lib: export LD_LIBRARY_PATH case $1 in start) /opt/apache/bin/apachectl startssl ;; stop) /opt/apache/bin/apachectl stop ;; esac But the problem is the next: When I login as root (on a console or an xterm) and run that script (/etc/init.d/apache start) everything works fine. So I've created a link from /etc/rc5.d/S99apache to /etc/init.d/apache for starting it during boot process.. But when I reboot the system and apache is started on boot (oracle is launche thru S20oracle), it start. If you request a php page or other kind of webpage it works fine, until you request a php page that connects to oracle Then the instance that is serving that request dies, raise an error that says something like Couldn't connect to database and no more php+oracle pages can be requested... But php and apache still works. If I stop apache and launch it again from console using /etc/init.d/apache start It works again and works fine, all connections are successfull. User apache belongs to oinstall group and have read and execution access to all the oracle directories. Where can be the problem Why it works if I launch it from a console or xterm and not if the system starts it??? Thank you -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question about PEAR::raiseError use in XML_RPC client
Greetings; I recently grabbed the latest source for XML_RPC from CVS for use with a project I am working on. I grabbed the latest source rather than the stable build mainly because it includes a handy base class that defines a raiseError method. However, I am puzzled by own thing. XML_RPC_Base::raiseError calls PEAR::raiseError but does not return the resulting object; no error handler has been set either. Am I overlooking how the PEAR_Error object created by PEAR::raiseError would be propagated back to the caller? It seems like the error would go undetected if not returned. class XML_RPC_Base { function raiseError($msg, $code) { include_once 'PEAR.php'; PEAR::raiseError(get_class($this) . : . $msg, $code); } } --- Luis A. Cruz [EMAIL PROTECTED] Web Project Manager Astaro http://www.astaro.com --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.568 / Virus Database: 359 - Release Date: 1/26/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question about PEAR::raiseError use in XML_RPC client
Greetings; I recently grabbed the latest source for XML_RPC from CVS for use with a project I am working on. I grabbed the latest source rather than the stable build mainly because it includes a handy base class that defines a raiseError method. However, I am puzzled by own thing. XML_RPC_Base::raiseError calls PEAR::raiseError but does not return the resulting object; no error handler has been set either. Am I overlooking how the PEAR_Error object created by PEAR::raiseError would be propagated back to the caller? It seems like the error would go undetected if not returned. class XML_RPC_Base { function raiseError($msg, $code) { include_once 'PEAR.php'; PEAR::raiseError(get_class($this) . : . $msg, $code); } } --- Luis A. Cruz [EMAIL PROTECTED] Web Project Manager Astaro http://www.astaro.com --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.566 / Virus Database: 357 - Release Date: 1/22/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Simple table sorting
You may want to also try a javascript solution See http://www.kryogenix.org/code/browser/sorttable/ for an example. Luis -Original Message- From: Tommi Virtanen [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 02, 2003 8:30 PM To: [EMAIL PROTECTED] Subject: [PHP] Simple table sorting Hi! I have simple table like: namedepartment [data: first name] [data: dep. no] [data: second name] [data: dep. no] Now I have only sorting which sorts using ORDER BY name. How I make header name / department active link, which I can change sorting order Department and then back to Name? regards, gustavus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] IE download problem
I am working on a script to force downloading a file. The script works fine with NS (4.8 and 7) but does not work correctly with IE 6.0 I have looked at examples on php.net and have googled for a solution, but still can't find a solution. I think IE wants to download the script instead of the file. Here's what the code I'm working on looks like: ?php $sender=$_GET[sender]; $filename=$_GET[filename]; //Data validation goes here $filePath=../users/.$sender./.$filename; if(file_exists($filePath)) { Header(Content-Length: .filesize($filePath)); Header(Content-type: application/download); Header(Content-Disposition-type: attachment); Header(Content-Disposition: filename=\.$filename.\\n); Header(Content-Transfer-Encoding: binary); $fp = fopen($filePath,rb); fpassthru($fp); } ? The funny thing is that I have a similar script that I use to download an sql file and it works correctly. Luis R. Lebron Sigmatech, Inc
RE: [PHP] Re: IE download problem
I tried your code. I'm still getting the same errors. thanks, Luis -Original Message- From: pete M [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 26, 2003 10:52 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: IE download problem thsi si a nighmare area. and loast days on same problem This works for me.. hope it does for you $file = $_GET['file']; $path = '/www/cgi-bin/docu/personal/'.$file; //force download dialog header(Content-type: application/octet-stream\n); header(Content-disposition: attachment; filename=\$file\\n); header(Content-transfer-encoding: binary\n); header(Content-length: . filesize($path) . \n); //send file contents $fp=fopen($path, r); fpassthru($fp); Luis Lebron wrote: I am working on a script to force downloading a file. The script works fine with NS (4.8 and 7) but does not work correctly with IE 6.0 I have looked at examples on php.net and have googled for a solution, but still can't find a solution. I think IE wants to download the script instead of the file. Here's what the code I'm working on looks like: ?php $sender=$_GET[sender]; $filename=$_GET[filename]; //Data validation goes here $filePath=../users/.$sender./.$filename; if(file_exists($filePath)) { Header(Content-Length: .filesize($filePath)); Header(Content-type: application/download); Header(Content-Disposition-type: attachment); Header(Content-Disposition: filename=\.$filename.\\n); Header(Content-Transfer-Encoding: binary); $fp = fopen($filePath,rb); fpassthru($fp); } ? The funny thing is that I have a similar script that I use to download an sql file and it works correctly. Luis R. Lebron Sigmatech, Inc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] trim...
You need to strip the newlines. str_replace(\n, , $body); Luis -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 26, 2003 10:59 AM To: [EMAIL PROTECTED] Subject: [PHP] trim... Why doesn't this work...? $body = pblurb blah phappy days pend of text; $body = trim($body); $body now should output: pblurb blah\nphappy days\npend of text but it doesn't...? I'm using a text string in a javascript, adn it needs to be outbut on one line to work, yet this isn't doing it... Any ideas? * The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. ***
RE: [PHP] Re: IE download problem
Here's the error I'm getting Internet Explorer cannot download...?sender=171filename=.jpg from somedomain.com. Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later. thanks, Luis -Original Message- From: Bogdan Stancescu [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 26, 2003 11:14 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: IE download problem I was thinking the same. But until we can squeeze some information about the actual error from Luis, I think we're stuck. Bogdan Warren Vail wrote: Could the problem be the associations stored in the windows system registry? I've had problems trying to download files whose name ends in a suffix that is registered as being associated with a given program (i.e. .txt with notepad, .doc with word). I believe that IE tries to open the file in the registered application and Netscape doesn't always do that (could be wrong here, but that's how it seemed to me). Warren -Original Message- From: Luis Lebron [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 26, 2003 8:54 AM To: 'pete M'; [EMAIL PROTECTED] Subject: RE: [PHP] Re: IE download problem I tried your code. I'm still getting the same errors. thanks, Luis -Original Message- From: pete M [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 26, 2003 10:52 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: IE download problem thsi si a nighmare area. and loast days on same problem This works for me.. hope it does for you $file = $_GET['file']; $path = '/www/cgi-bin/docu/personal/'.$file; //force download dialog header(Content-type: application/octet-stream\n); header(Content-disposition: attachment; filename=\$file\\n); header(Content-transfer-encoding: binary\n); header(Content-length: . filesize($path) . \n); //send file contents $fp=fopen($path, r); fpassthru($fp); Luis Lebron wrote: I am working on a script to force downloading a file. The script works fine with NS (4.8 and 7) but does not work correctly with IE 6.0 I have looked at examples on php.net and have googled for a solution, but still can't find a solution. I think IE wants to download the script instead of the file. Here's what the code I'm working on looks like: ?php $sender=$_GET[sender]; $filename=$_GET[filename]; //Data validation goes here $filePath=../users/.$sender./.$filename; if(file_exists($filePath)) { Header(Content-Length: .filesize($filePath)); Header(Content-type: application/download); Header(Content-Disposition-type: attachment); Header(Content-Disposition: filename=\.$filename.\\n); Header(Content-Transfer-Encoding: binary); $fp = fopen($filePath,rb); fpassthru($fp); } ? The funny thing is that I have a similar script that I use to download an sql file and it works correctly. Luis R. Lebron Sigmatech, Inc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: IE download problem
I tried sending the correct mime type and still had the same problem. I did get rid of the newline for the test code. Luis -Original Message- From: Bogdan Stancescu [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 26, 2003 11:28 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: IE download problem Oh, so you're actively trying to trick IE, are you? Why don't you provide the proper image/jpeg MIME type? And why do you add a newline character at the end of the MIME type? (As previously asked before.) Bogdan Luis Lebron wrote: Here's the error I'm getting Internet Explorer cannot download...?sender=171filename=.jpg from somedomain.com. Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later. thanks, Luis -Original Message- From: Bogdan Stancescu [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 26, 2003 11:14 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: IE download problem I was thinking the same. But until we can squeeze some information about the actual error from Luis, I think we're stuck. Bogdan Warren Vail wrote: Could the problem be the associations stored in the windows system registry? I've had problems trying to download files whose name ends in a suffix that is registered as being associated with a given program (i.e. .txt with notepad, .doc with word). I believe that IE tries to open the file in the registered application and Netscape doesn't always do that (could be wrong here, but that's how it seemed to me). Warren -Original Message- From: Luis Lebron [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 26, 2003 8:54 AM To: 'pete M'; [EMAIL PROTECTED] Subject: RE: [PHP] Re: IE download problem I tried your code. I'm still getting the same errors. thanks, Luis -Original Message- From: pete M [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 26, 2003 10:52 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: IE download problem thsi si a nighmare area. and loast days on same problem This works for me.. hope it does for you $file = $_GET['file']; $path = '/www/cgi-bin/docu/personal/'.$file; //force download dialog header(Content-type: application/octet-stream\n); header(Content-disposition: attachment; filename=\$file\\n); header(Content-transfer-encoding: binary\n); header(Content-length: . filesize($path) . \n); //send file contents $fp=fopen($path, r); fpassthru($fp); Luis Lebron wrote: I am working on a script to force downloading a file. The script works fine with NS (4.8 and 7) but does not work correctly with IE 6.0 I have looked at examples on php.net and have googled for a solution, but still can't find a solution. I think IE wants to download the script instead of the file. Here's what the code I'm working on looks like: ?php $sender=$_GET[sender]; $filename=$_GET[filename]; //Data validation goes here $filePath=../users/.$sender./.$filename; if(file_exists($filePath)) { Header(Content-Length: .filesize($filePath)); Header(Content-type: application/download); Header(Content-Disposition-type: attachment); Header(Content-Disposition: filename=\.$filename.\\n); Header(Content-Transfer-Encoding: binary); $fp = fopen($filePath,rb); fpassthru($fp); } ? The funny thing is that I have a similar script that I use to download an sql file and it works correctly. Luis R. Lebron Sigmatech, Inc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] [Q] Development Best Practices
Before considering using templates you may want to take a look at http://www.phppatterns.com/index.php/article/articleview/4/1/1/ Luis -Original Message- From: Adam [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 7:39 PM To: [EMAIL PROTECTED] Subject: [PHP] [Q] Development Best Practices All, I'm not new to programing or web development but I am new to creating dynamic pages. I've read through a couple books. I've worked through problems and exercises. Installed and configured the software a few different times in Win32 and OS X. At this point, I feel I have a good handle on the environment and lexical structure. What I don't have is a grasp on best practices. For real sites I'm a little confused on how to implement all this new knowledge. For example, I've got a site that was static with bits of CGI to PHP. I was going to generate all the HTML from a PHP script, but that turned into a mess. So I tried creating the pages is mostly HTML with little bits of PHP. Placing the logic in another file and linking the two pages. I'm not really sure if that is the best approach. My question, how do you guys build your pages? Do your scripts generate all the HTML? I'm looking for tips and resources. Remember for my first site I've embarked on a fairly large site. Code maintenance will be an issue for me as I need to enhance and fix it later on. Thanks guys! Regards, Adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Generating test data
I would like to create some dummy mysql tables for load testing an application. Are there any tools that would make this task easier? At the moment I'm thinking of generating a series of arrays based on actual data (i.e Select distinct fielndname, followed by an array_push). And then randomly picking items from each array to create the dummy table rows. thanks, Luis R. Lebron Sigmatech, Inc
RE: [PHP] High bandwidth application tips
Excellent tips. I think I'm really going to have to polish my sql skills for this task. Any good tools for benchmarking sql queries? -Original Message- From: Wouter van Vliet [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 7:06 PM To: 'Luis Lebron'; 'Jay Blanchard'; 'Marco Tabini'; [EMAIL PROTECTED] Cc: 'Php-General (E-mail)' Subject: RE: [PHP] High bandwidth application tips That depends on the moment this emailing is sent, and how. If you do it at night, when there's less visitors (assuming you run a site mostly meant for ppl in 'your own country'), there's no real need to get a second server to to this. I fourth the thing about database access. As long as you realize that reading from disk isn't the fastest thing around either. Make sure you reduce the number of files to be read to as little as possible. And output with something like readfile() to prevent the files being loaded into memory. Some other things to think about (not only for the sake of performance, but also readability): * Use elseif or switch as much as possible rather than if statements One time I had this script somebody else wrote. About 1000 lines, a complete CMS in one file. It if'ed on simple $_GET vars about 10 times, by opening a new if statement each and every time. After I changed this to if ($_GET['p'] == 'one') { .. } elseif ($_GET['p'] == 'two') { .. }; and so on the script became TWO SECONDS faster. Switch { case 'one': ... }; was not an option here, cuz there were more advanced expressions to be evaluated. * Unset when not used anymore If you load a large amount of data in a variable that exists untill the end of your script but is used only untill a point higher, call unset($Var); to free some memory * Only code what is neccisery (still can't spell that word :D) Logically, do not write something in 5 lines what can be done in 1. And only create temp vars if you really need them. Usually this is when you use it's value more than once. On the same hand, only call a function as much as you need to. One time I found this in some code that reached me: $ID = Array(1, 5, 3, 7, 3, 9); $i = 1; while($i = count($ID)) { $query = SELECT * FROM table WHERE id = '.$ID[$i].'; $result = mysql_query($query); $value = mysql_fetch_array($result); /* .. Do stuff with $value .. */ } I optimized it to: $IDs = Array(1, 5, 3, 7, 3, 9); $ResultSet = mysql_query('SELECT * FROM table WHERE id IN ('.join(',', $IDs).')'); while($value = mysql_fetch_assoc($ResultSet)) { /* .. Do stuff with $value .. */ } Don't think I have to explain why the second version is quite faster. Let me know if some of my lines were of any value to you.. Or anybody else ;) Wouter -Original Message- From: Luis Lebron [mailto:[EMAIL PROTECTED] Sent: Wednesday 05 November 2003 21:12 To: 'Jay Blanchard'; Marco Tabini; [EMAIL PROTECTED] Cc: Luis Lebron; Php-General (E-mail) Subject: RE: [PHP] High bandwidth application tips One of the things I have suggested to the customer is offloading some of the work to a different server. For example, he wants to email a weekly message to all the users with information on records that match their search criteria. I suggested setting up a second server that handles this and other admin function while the main server takes care of the users. Does this sound like a good idea? thanks, Luis -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 2:10 PM To: Marco Tabini; [EMAIL PROTECTED] Cc: Luis Lebron; Php-General (E-mail) Subject: RE: [PHP] High bandwidth application tips [snip] limit the number of times you need to hit the database. I second Chris on this. [/snip] I third that. The problem can become especially apparent in large databases containing millions of records. Other than that just code cleanly and document, document, document.
RE: [PHP] High bandwidth application tips
I guess there is a configuration option in my.cnf for logging slow queries? Luis -Original Message- From: Chris Shiflett [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 9:11 AM To: Luis Lebron; 'Wouter van Vliet'; 'Jay Blanchard'; 'Marco Tabini'; [EMAIL PROTECTED] Cc: 'Php-General (E-mail)' Subject: RE: [PHP] High bandwidth application tips --- Luis Lebron [EMAIL PROTECTED] wrote: Any good tools for benchmarking sql queries? This may not directly answer your question, but I find the mytop utility very helpful for seeing what is happening with a MySQL server. It's available here: http://jeremy.zawodny.com/mysql/mytop/ Another thing you can do is configure MySQL to log slow queries, and configure slow queries to be more and more critical, so that you can focus on the queries that would make the biggest difference. Sorry fi you're not using MySQL, since I'm assuming you are. :-) Of course, I still think that avoiding database calls as much as possible is a good thing. Hope that helps. Chris = My Blog http://shiflett.org/ HTTP Developer's Handbook http://httphandbook.org/ RAMP Training Courses http://www.nyphp.org/ramp
[PHP] Issues with Mysql 4.0 and PHP in a production environment
Are there any issues with running PHP 4.3.X and Mysql 4.0 in a production environment? thanks, Luis R. Lebron Project Manager Sigmatech, Inc
[PHP] Load Stress tool
I am looking for suggestions on a tool to load stress a php application. We want to make sure that the application/web server will be able to handle the amount of users we expect. I have found a few but they seem to be very expensive. Can anyone suggestion an affordable and user friendly stress test app? thanks, Luis R. Lebron Sigmatech, Inc
RE: [PHP] Load Stress tool
Thanks for the information. I also found the MS Web Application Stress Tool which may work http://www.microsoft.com/technet/treeview/default.asp?url=/technet/itsolutio ns/intranet/downloads/webstres.asp -Original Message- From: Mike Migurski [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 9:32 AM To: Luis Lebron Cc: Php-General (E-mail) Subject: Re: [PHP] Load Stress tool I am looking for suggestions on a tool to load stress a php application. We want to make sure that the application/web server will be able to handle the amount of users we expect. I have found a few but they seem to be very expensive. Can anyone suggestion an affordable and user friendly stress test app? Apache ships free with 'ab', a benchmarking tool: http://httpd.apache.org/docs/programs/ab.html It doesn't do a whole lot, but it will happily hammer away at a given URL and tell you how your server did. - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html
[PHP] High bandwidth application tips
I have been coding php for a few years now, but I haven't build a high bandwidth application. I am currently working on an application for a customer that may have a very large amount of users (10,000 or more according to the customer). Are there any good reference books, articles and general information on building such a site. I have been googling for a while but have found anything on this particular topic. thanks, Luis R. Lebron Sigmatech, Inc
RE: [PHP] High bandwidth application tips
One of the things I have suggested to the customer is offloading some of the work to a different server. For example, he wants to email a weekly message to all the users with information on records that match their search criteria. I suggested setting up a second server that handles this and other admin function while the main server takes care of the users. Does this sound like a good idea? thanks, Luis -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 2:10 PM To: Marco Tabini; [EMAIL PROTECTED] Cc: Luis Lebron; Php-General (E-mail) Subject: RE: [PHP] High bandwidth application tips [snip] limit the number of times you need to hit the database. I second Chris on this. [/snip] I third that. The problem can become especially apparent in large databases containing millions of records. Other than that just code cleanly and document, document, document.
RE: [PHP] Performance of dynamically generated select boxes
--- Luis Lebron [EMAIL PROTECTED] wrote: I am rebuilding a php application to handle a higher load. The previous programmer had created a series of dynamically generated select boxes using a mysql table. Would it be faster or less resource intensive to create a series of arrays to generate the select boxes and avoid the database queries. I've done some informal testing using Pear Benchmark and it seems the array based script usually takes less time. --- Chris Shiflett wrote: Basically, anything you can do to eliminate talking to the database will usually improve performance by a fair margin. The downside is convenience; if you have data hard-coded in your PHP scripts, it is less convenient to maintain the data. You effectively eliminate the separation between the data and your logic. A similar idea is to eliminate PHP. Apache can serve a lot more static pages than it can PHP pages at any given time. Of course, this has a similar disadvantage as well. Now your pages are static rather than dynamic. I figured that writing the select boxes as plain html would be the fastest solution. However, I did not know of a way of repeating back the database contents using plain html. Now I can compare the the array with the database information and show the previously selected element in the select box. The data is fairly static (i.e. states, countries, etc) so I just created an include file with the arrays and include it as needed. Thanks for the feedback. Luis
[PHP] Performance of dynamically generated select boxes
I am rebuilding a php application to handle a higher load. The previous programmer had created a series of dynamically generated select boxes using a mysql table. Would it be faster or less resource intensive to create a series of arrays to generate the select boxes and avoid the database queries. I've done some informal testing using Pear Benchmark and it seems the array based script usually takes less time. thanks, Luis R. Lebron Project Manager Sigmatech, Inc
Re: [PHP] Problems with remote include
El mi? 29-10-2003 a las 16:49, Evan Nemerson escribió: Don't be insulted he asked. You'd be amazed at the level of idiocy around here, and you're not known on the list... He meant no disrespect. NOOO..i'm sorry if MY answer seemed ugly..i'm impressed by the amount of help i received. By no means i meant to be rude. I'm sorry for it, i just tried to be brief with the answer. Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problems with remote include
El mi? 29-10-2003 a las 17:38, Marek Kilimajer escribió: Can you connect from your server to the other server? yes Marek, both files are under the same domain(and server) now. I'm using the remote inclusion, because when it works they'll be on separate domains. Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Menu populated based on previous menu
You may want to look at the following article: http://www.zend.com/zend/tut/drop-down.php Luis -Original Message- From: Robb Kerr [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 28, 2003 9:46 AM To: [EMAIL PROTECTED] Subject: [PHP] Menu populated based on previous menu Searched all the sites I could find for this problem to no avail. I have two dropdown menus in a form. The first menu contains a list of MANUFACTURERS obtained from a database. The second contains a list of MODELS also obtained from the database. I want the second menu to be populated based upon the selection in the first. In other words, once a visitor has selected a MANUFACTURER they'll be presented with a list of MODELS that are available from the selected MANUFACTURER. I know how to do the queries, but don't know how to initiate the query and rebuild the second menu when the first selection is made without adding a SUBMIT button and loading a second page. Anyone know how to accomplish this? Thanx in advance. -- Robb Kerr Digital IGUANA Helping Digital Artists Achieve their Dreams http://www.digitaliguana.com http://www.cancerreallysucks.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Post variables and mysql queries
This may be a dumb question but here goes. I have been trying to use $_POST globals in sql queries. If I use the following query string it does not work $query=Select * from users where userid='$_POST['userid']'; However, this works $userid=$_POST[userid] $query=Select * from users where userid='$userid'; Is there a mistake in my syntax? thanks, Luis R. Lebron Sigmatech, Inc
[PHP] preg match compilation error
I found a reqular expresion that I'm using to check for valid characters in file names. Here's the sample code: if(preg_match([^a-zA-Z0-9,._\+\()\-],$filename)) { //blah, blah, blah } However, when I run the script I get the following error: Warning: Compilation failed: unmatched parentheses at offset 17 in /home/httpd/sigmarapid/html/test/upload.php on line 137 (the line with the preg_match) I'm new to regular expressions so any help would be greatly appreciated. Luis R. Lebron Sigmatech, Inc
RE: [PHP] Re: preg match compilation error (Resolved)
Thanks, That did the trick. Luis -Original Message- From: DvDmanDT [mailto:[EMAIL PROTECTED] Sent: Monday, October 27, 2003 3:19 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: preg match compilation error Start and end with same char, for example with a / or a #... Like if(preg_match(#[^a-zA-Z0-9,._\+\()\-]#,$filename)) -- // DvDmanDT MSN: dvdmandt¤hotmail.com Mail: dvdmandt¤telia.com ## Please, if you are using windows, you may be infected by Swen. Please go here to find out more: http://us.mcafee.com/virusInfo/default.asp?id=helpCenterhcName=swen http://securityresponse.symantec.com/avcenter/venc/data/[EMAIL PROTECTED] ## Luis Lebron [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] I found a reqular expresion that I'm using to check for valid characters in file names. Here's the sample code: if(preg_match([^a-zA-Z0-9,._\+\()\-],$filename)) { //blah, blah, blah } However, when I run the script I get the following error: Warning: Compilation failed: unmatched parentheses at offset 17 in /home/httpd/sigmarapid/html/test/upload.php on line 137 (the line with the preg_match) I'm new to regular expressions so any help would be greatly appreciated. Luis R. Lebron Sigmatech, Inc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Post form variables to a frame
Here is the frameset: frameset rows=80,*,30 cols=* frameborder=NO border=0 framespacing=0 frame src=header.php name=topFrame scrolling=NO noresize frameset rows=* cols=250,* framespacing=0 frameborder=NO border=0 frame src=browse.php name=leftFrame scrolling=AUTO noresize frame src=info.php name=mainFrame /frameset frame src=footer.php name=bottonFrame scrolling=NO noresize /frameset and here is the form: form action=frame.php method=POST target=leftFrame select name=category option value=1 label=11/option option value=2 label=22/option option value=3 label=33/option option value=4 label=44/option /select input type=submit / and here is the relevant lines of browse.php $category=$_POST[category]; $query=Select username, age, height, eyeColor, haircolor, build, id from users where category='$category'; thanks, Luis -Original Message- From: Pablo Gosse [mailto:[EMAIL PROTECTED] Sent: Friday, October 24, 2003 11:38 PM To: Luis Lebron; [EMAIL PROTECTED] Subject: RE: [PHP] Post form variables to a frame On Friday, October 24, 2003 8:28 PM Luis Lebron wrote I tried that but it did not work. Can you post the html code you used? Setting form action=foo.php target=frame should do the trick. This is very standard, so if it's not working that's very strange. Post the code so we can take a look. Cheers, Pablo -Original Message- From: Evan Nemerson [mailto:[EMAIL PROTECTED] Sent: Friday, October 24, 2003 10:14 PM To: Luis Lebron; [EMAIL PROTECTED] Subject: Re: [PHP] Post form variables to a frame On Friday 24 October 2003 06:08 pm, Luis Lebron wrote: How can I post a form to the left frame of a frameset. I want to have an user submit a form that opens a frameset. The left frame contains the results of a query based on the posted parameters. Try setting the target attribute of the form element to the name of the left frame. http://www.w3schools.com/tags/tag_form.asp What I want to create is a master detail page. Let's say a person is looking for a particular car. They would fill out a form. When the form is submitted a frameset shows up with thumbnails and some information on the car on the left frame. When the person clicks on the thumbnail, a larger picture and more information shows up on the right hand frame. My only problem is getting the form variables to the left frame. thanks, Luis -- Evan Nemerson [EMAIL PROTECTED] -- ...the whole idea of revenge and punishment is a childish daydream. Properly speaking, there is no such thing as revenge. Revenge is an act which you want to commit when you are powerless and because you are powerless: as soon as the sense of impotence is removed, the desire evaporates also. -George Orwell -- 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] Post form variables to a frame
How can I post a form to the left frame of a frameset. I want to have an user submit a form that opens a frameset. The left frame contains the results of a query based on the posted parameters. What I want to create is a master detail page. Let's say a person is looking for a particular car. They would fill out a form. When the form is submitted a frameset shows up with thumbnails and some information on the car on the left frame. When the person clicks on the thumbnail, a larger picture and more information shows up on the right hand frame. My only problem is getting the form variables to the left frame. thanks, Luis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Post form variables to a frame
I tried that but it did not work. Luis -Original Message- From: Evan Nemerson [mailto:[EMAIL PROTECTED] Sent: Friday, October 24, 2003 10:14 PM To: Luis Lebron; [EMAIL PROTECTED] Subject: Re: [PHP] Post form variables to a frame On Friday 24 October 2003 06:08 pm, Luis Lebron wrote: How can I post a form to the left frame of a frameset. I want to have an user submit a form that opens a frameset. The left frame contains the results of a query based on the posted parameters. Try setting the target attribute of the form element to the name of the left frame. http://www.w3schools.com/tags/tag_form.asp What I want to create is a master detail page. Let's say a person is looking for a particular car. They would fill out a form. When the form is submitted a frameset shows up with thumbnails and some information on the car on the left frame. When the person clicks on the thumbnail, a larger picture and more information shows up on the right hand frame. My only problem is getting the form variables to the left frame. thanks, Luis -- Evan Nemerson [EMAIL PROTECTED] -- ...the whole idea of revenge and punishment is a childish daydream. Properly speaking, there is no such thing as revenge. Revenge is an act which you want to commit when you are powerless and because you are powerless: as soon as the sense of impotence is removed, the desire evaporates also. -George Orwell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Document Management App
You may want to look at Verity's products http://downloadcenter.verity.com/dlc/index.jsp -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 1:59 PM To: [EMAIL PROTECTED] Subject: [PHP] Document Management App Howdy Good Afternoon! I am about to run off to a project's development group meeting (the general audience kind, requestors and developers) and this question came up this morning for a potential answer in this afternoon's meeting. I have googled, searched, poked and prodded...but I need to see if I can find something more specific than I have overturned. I was asked about a doc mgmt system that would allow users spread over disparate systems to upload docs of all types, have them scanned for content, cataloged, and finally searchable. All sorts of doc types, spreadheets, pdf's, word docs, word perfect docs, xml, html, etc. etc. etc. The system would need to be installed, configured, and then sent on a search of existing docs to scan and catalog. Does anyone have a favorite application like this or near this? Is anyone familiar with an app that would not require too much front end noodling to accomplish this? Or should I clean the white board and get started? TVMIA! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Using PHP to do something with Acrobat PDF....
I use htmldoc http://www.easysw.com/htmldoc/ to generate pdf files from html documents. Another options is fpdf http://www.fpdf.org. Luis -Original Message- From: Scott Fletcher [mailto:[EMAIL PROTECTED] Sent: Friday, September 12, 2003 9:11 AM To: [EMAIL PROTECTED] Subject: [PHP] Using PHP to do something with Acrobat PDF Hi Fellas!! Know of any good websites that would provide tutorials, step-by-step, and/or a PHP scripts of creating a PDF, putting datas into PDF, along with Printing PDF, Saving PDF files, etc... I have no experience with using PHP and PDF so I need both a tutorial and quick, plain to the point of PHP script of PDF stuffs. From there I can start reviewing on how it work, what function is being used, etc. Then look at all of the available PHP functions for PDF, add what I need or take out what I don't need, etc. (Customize), etc... Another question, does using PDF require the use of some configuration in php.ini?? How does PHP do the PDF stuffs if there is no PDF on the server? Etc... Thanks! Scott F. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] String substiion for flash text
I have a script that creates html files to be used with a flash scroll box. The problem I am having right now is that the Flash scroll box does not underline the hyperlinks. Is there a way I can change something like a href=mylink.htmlMy Link/a to a href=mylink.htmlulMy Link/ul/a thanks, Luis
[PHP] Question on class syntax
I am currently using a php class that uses the following syntax: $value= htmlcleaner::cleanup($value); What exactly is the :: used for? Is there a different syntax for :: ? thanks, Luis R. Lebron Project Manager Sigmatech, Inc
RE: [PHP] Question on class syntax
Thanks for the information. I checked the manual but wasn't able to find it. Luis -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 1:35 PM To: Luis Lebron; Php-General (E-mail) Subject: Re: [PHP] Question on class syntax From: Luis Lebron [EMAIL PROTECTED] I am currently using a php class that uses the following syntax: $value= htmlcleaner::cleanup($value); What exactly is the :: used for? Is there a different syntax for :: ? You're calling the cleanup() method of the htmlcleaner class. You could also have: $ob = new htmlcleaner; $value = $ob-cleanup($value); You can use the first method without having to actually make a new object. Whether that's better or not depends upon your application. It basically turns your object into a function repository. ---John Holmes...
RE: [PHP] Invalid Characters, XML...
Here's what I have been using. $trans= array(' = #39;, ' = #39;, = #62;, = #60;, = #38;,- = #45;, ° = #176;, ± = #177;, - = #150;, = #147;, = #148;,... = #8230;,' = #8216;,² =#178;,· = #183; ); $value=strtr($value,$trans); Luis -Original Message- From: David Otton [mailto:[EMAIL PROTECTED] Sent: Monday, August 04, 2003 7:18 AM To: Russell P Jones Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Invalid Characters, XML... On Sun, 3 Aug 2003 21:51:53 -0400 (EDT), you wrote: Im using PHP to write to XML files, but I am having some problems. A lot of users are cutting and pasting content from text editors like word, which uses odd quotation marks, dashes, etc. which PHP writes to the XML file, and then the XML parser does not under stand. Is there a stripslashes() or htmlspecialchars() equivalent that will convert this kind of stuff to the correct ascii text? This should get you started. It behaves as does htmlentities(). For those high-ASCII characters out of Word/IE... decide what regular ASCII character you want to map them to, (eg slanted-quote-open and -close to regular quote), and add them to the $trans array before performing the array_walk(). function xmlentities ($string, $quote_style = ENT_COMPAT) { static $trans; if (!is_array ($trans)) { $trans = get_html_translation_table (HTML_ENTITIES, $quote_style); array_walk ($trans, create_function ('$a, $b', '$a = # . ord ($b) . ;;')); } return (strtr ($string, $trans)); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Redirect to HTTPS
Here's another way to do it: ?php $url=$_SERVER[SCRIPT_URI]; $url_array=parse_url($url); if($url_array[scheme]!=https) { header(Location: https://$url_array[host]$url_array[path];); } ? Luis -Original Message- From: Richard Baskett [mailto:[EMAIL PROTECTED] Sent: Friday, August 01, 2003 3:25 AM To: PHP General Subject: Re: [PHP] Redirect to HTTPS This is how I do it: if ($_SERVER['HTTPS']!='on') { header(Location: https://mynet.com/pay.php;); exit; } It is my ambition to say in ten sentences; what others say in a whole book. - Friedrich Nietzsche From: [EMAIL PROTECTED] Date: Fri, 1 Aug 2003 10:20:58 +0200 To: [EMAIL PROTECTED] Subject: [PHP] Redirect to HTTPS I have a stupid question. I need if i be in a http make a redirect to https. Http is a 80 port and ssl is a 443 port if ($HTTP_SERVER_VARS['SERVER_PORT']==80) { header(Location: https://mynet.com/pay.php;); exit; } Is the correct way to do this ??? Exist any function to make this ??? Excuse my broken English, Regards from Spain Un saludo, Danny -- 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] Updating a table after a successful download
I currently have some code in a document management system that is used to check-out a document. It looks like this: //Update the status of the document $query = UPDATE $table_data SET status = '$SESSION_UID' WHERE id = '$id'; $result=$conn-Execute($query); //Download the document. header (Content-Type: application/octet-stream); header (Content-Disposition: attachment; filename=$realname); readfile($filename); The problem I am having is that when the download is canceled by the user the document still shows up as being checked out. Is there a way to know if the document has been successfully downloaded before I update the database. Something like: //Download the document. header (Content-Type: application/octet-stream); header (Content-Disposition: attachment; filename=$realname); readfile($filename); //Determine if download is successful. Set download variable. if($download=1) { //Update the status of the document $query = UPDATE $table_data SET status = '$SESSION_UID' WHERE id = '$id'; $result=$conn-Execute($query); } thanks, Luis R. Lebron
RE: [PHP] Updating a table after a successful download
I tried changing the code to: // send headers to browser to initiate file download header (Content-Type: application/octet-stream); header (Content-Disposition: attachment; filename=$realname); readfile($filename); if(connection_aborted()==0) { $query = UPDATE $table_data SET status = '$SESSION_UID' WHERE id = '$id'; $result=$conn-Execute($query); } But it still doesn't work as expected. What am I doing wrong? thanks, Luis -Original Message- From: David Nicholson [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 8:18 AM To: Luis Lebron Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Updating a table after a successful download Hello, This is a reply to an e-mail that you wrote on Wed, 30 Jul 2003 at 13:46, lines prefixed by '' were originally written by you. The problem I am having is that when the download is canceled by the user the document still shows up as being checked out. Is there a way to know if the document has been successfully downloaded before I update the database. The connection handling section of the manual may help you... http://uk.php.net/manual/en/features.connection-handling.php You could possibly use register_shutdown_function() and connection_aborted() to set the status back if the connection was cancelled. David. -- phpmachine :: The quick and easy to use service providing you with professionally developed PHP scripts :: http://www.phpmachine.com/ Professional Web Development by David Nicholson http://www.djnicholson.com/ QuizSender.com - How well do your friends actually know you? http://www.quizsender.com/ (developed entirely in PHP)
RE: [PHP] images in databases Flash via PHP
There a few different ways to do this. One method that we use here is to do something like this in the embed/object tags flash.swf?image=?php echo $image; ? The php $image variable, of course, could be set by any method (post/get, db query, etc...) Luis -Original Message- From: Tim Baker [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 22, 2003 12:01 PM To: '[EMAIL PROTECTED]' Subject: [PHP] images in databases Flash via PHP I was wondering - are there any good tutorials/examples of serving updating images from a mySQL database via PHP? I assume this is possible, but I'm almost a newbie having not used PHP/mySQL for ages with some knowledge but would like to know more... Also now Flash MX can dynamically take JPEGs and MPEGs in 'dynamically' at runtime now, anyone combined this with PHP/mySQL to serve images? (I'd guess someone or many people have :-) I've done it from the Flash only side, loading variables and images/music, building modular duplicated movieclips etc. and want to do the next step which is to combine that with databases (I'm currently using text files, files on a webserver etc.) thanks Tim Baker -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] walking through database one record at a time with forms.
The trick is in using the MySQL 0limit statement. For the first record use: $sql = mysql_query(SELECT * FROM temp_table limit 0, 1); then increment the limit for the next record $sql = mysql_query(SELECT * FROM temp_table limit 1, 1); Luis -Original Message- From: Artoo [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2003 10:38 AM To: [EMAIL PROTECTED] Subject: [PHP] walking through database one record at a time with forms. I'm tring to create a script for the WEBMASTER to go through a temporary table in a MySQL database, and either accept or reject the data submitted by users. $sql = mysql_query(SELECT * FROM temp_table); $result = mysql_num_rows($sql); Then with, while($row = mysql_fetch_array($sql)) { ... ... } I create variables and read the first record of the database, Then inside a form the data of the record is displayed along with a ACCEPT and REJECT buttons. How do I have the script stop after displaying the first record and wait until the ACCEPT or REJECT button has been pressed before displaying the next record? Right now the script just continues and displays all the forms in one long page, rather then haveing the execution pause until the ACCEPT/REJECT button beeing pressed. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Allowing punctuation marks in regular expressions
I found the following function to test a string for alphanumeric characters function is_alphanumeric($string) { return (preg_match(/^[a-z0-9]+$/i, $string)); } How can I modify it so that it also allows punctuation marks? thanks, Luis R. Lebron
RE: [PHP] Allowing punctuation marks in regular expressions
I tried adding a period to the end but a string will a period still returns false function is_alphanumeric($string) { return (preg_match(/^[A-Za-z0-9.]+$/i, $string)); } -Original Message- From: Dan Joseph [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 2:42 PM To: Php-General (E-mail) Subject: RE: [PHP] Allowing punctuation marks in regular expressions Hi, return (preg_match(/^[a-z0-9]+$/i, $string)); That a-z0-9 is where you can do it. Just add ! or . or ? to the end: a-z0-9!?. Also, if you want upper case letters, make sure you add A-Z: A-Za-z0-9!?. -Dan Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How easy is this idea?
Take a look at http://www.zend.com/zend/tut/drop-down.php Luis -Original Message- From: Simon Thurtle [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2003 4:38 AM To: [EMAIL PROTECTED] Subject: [PHP] How easy is this idea? OK, now I have I have been convinced that PHP is the best thing since cheese burgers, I have a question... How easy is it to... Have a set of 6 HTML drop downs each with texted based info that when selections are made generate a dynamic on screen price? So in english, drop down one could be vehicle type, drop down two could be engine size, three is CD player (yes / no selection). OK? So would I need to make a DB for this? (Baring in mind the prices are pretty much static) or can I justy define the variables in an include? Or am I talking rubbish? Cheers, S -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql backup solution
This is what I use http://members.lycos.co.uk/wipe_out/automysqlbackup/ -Original Message- From: John Kaspar [mailto:[EMAIL PROTECTED] Sent: Friday, April 25, 2003 3:48 PM To: [EMAIL PROTECTED] Subject: [PHP] mysql backup solution I've got a large mysql database (~400 megs) on a host that I need to backup regularly. If I use phpMyAdmin's dump features, it just freezes. I've currently got a php script that goes thru each table and backs up about 10,000 records iteratively (for example accounts1.txt, accounts2.txt). But it just backs them up to the host itself. (a) I need it to zip up the files to make them smaller, (b) I would like the script to save the zipped files to a designated folder on my local harddrive via ftp download (without me having to say where, or giving it an okay). Is that possible? Does someone have a better backup method? Thanks, John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Web Server Firewall Suggested
I know there is a lot of expertise on running web servers in this group. So, I'm going to ask a couple of questions. I am currently a public web server with an iptables firewall. A security consultant has suggested that we buy a separate firewall for the firewall instead of running iptables. He recommended a Symantec VelociRaptor or one of their firewall appliances. Does this sound like good advice? Are there any other models we sould look at? thanks, Luis R. Lebron