[PHP] how to get calling method identity?
Hi! I already made this question, but probably I kinda made it in obscure terms. Trying to get clearer. let's look at this: function utility() { } Class a { function some_method() { utility(); } } now, how can utility know that it's being called by a::some_method()? What I need is to build something that will output an error message like error in a::some_method get_class() will work only if I pass a reference every time I call utility, like utility($this) which is already not really what I want. And anyway this would not solve the problem of knowing which method was executed when the event occurred. Any idea? Alberto Kiev -- -_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_- LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange MySQL Query Problem
eat pasta type fasta wrote: $result = mysql_query(SELECT some_id, some_description, some_feature FROM '$pop-up1' WHERE some_description LIKE '%$texfield%' AND some_feature LIKE '%$pop-up2'); have this query echoed to video and then cut it and paste it to mysql terminal. Most probably you'll find out that it's an uppercase/lowcase problem. Unlike Oracle Mysql IS case sensitive on tablenames and columnnames. Alberto Kiev -- -_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_- LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Weird preg problem
On Thu, 4 Jul 2002, SP wrote: Hi I am trying to check if a word contains only capital letters. For some reason it's not working. The below example is checking the word weird to see if it's all capital letters but it's saying it's matches. I've tried checking for only lower case letters with WEIRD and it's not working there too. What am I doing wrong? $pattern = A-Z; $regexp = '/^['.$pattern.']*$/i'; if( preg_match($regexp, weird) ) echo matches; else echo does not match; Easiest approach: if ($str != strtoupper($str)) echo 'String contains lower-case letters.'; Using preg: if (preg_match('/[a-z]/', $str)) echo 'String contains lower-case letters.'; If you don't want any other characters to appear, ONLY capital letters (your question was a little ambiguous to me): if (preg_match('/[^A-Z]/', $str)) echo 'String contains something other than capital letters.'; miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] addslahes and magic quote woes
On Wed, 3 Jul 2002, Jean-Christian Imbeault wrote: Erik Price wrote: Turn off magic_quotes and do addslashes() explicitly every time you do a database insert. Then make sure you always stripslash() data returned from a database query. magic_quotes is convenient for newbies, but after a while you'll find it only trips you up, as you've discovered. I totally agree. Chalk me up as another magic_quotes hater. Unless your code is very simplistic, you'll end up with far more stripslasheses than you would have had addslasheses. So it's a net waste of time, and leads to all sorts of irritating data corruption bugs that are a nuisance to track down. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Java in PHP4
Hi, I'm really new to Java in PHP, and curious to this great features. Q: How do I convert the sample code below so that it can run within PHP? === import com.my.sm.api.*; import com.my.sm.api.interfaces.*; public class my1 { public static void main(String args[]) { if (args.length != 3) { System.err.println(Usage : java my1 server username password); return; } System.out.println(Starting Engine..); String server = args[0]; String username = args[1]; String password = args[2]; ApiSession session = null; try { session = ApiSession.openSession(server, username, password); } catch (RuntimeException e) { System.out.println(e.getMessage()); return; } } } = FYI, I'm using PHP 4.2.1 with Java extension and JDK1.3. Thanks. --idaham -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fsockopen question
Hi, i'm making a script to transfer all the zips from my old server to my new one, i mean, server to server. That's the easy part. The cuestion is: Can i open more than just one instance for fsockopen to retrieve more files in the same script, at the same time? i mean, not one by one (that will be slow), but 4 or 5 at the same time... some people think it's possible, some people don't...thx :D _ MSN. Más Útil cada Día. http://www.msn.es/intmap/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fopen with external file
On Thu, Jul 04, 2002 at 08:04:59AM +0100, morka ++ wrote: i try to open the external file using fopen() function. I use the example from php.net: $filename = http://www.aaa.com/index.html; $fd = fopen ($filename, r); $contents = fread ($fd, filesize ($filename)); This function will not work on remote files -- http://www.php.net/manual/en/function.filesize.php Use $contents = file($filename); --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] fsockopen question
you can do more than one fsockopen(), but since php isn't multi-threaded - you'll still only be able to download one file at a time. -Original Message- From: Jose Arce [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 04, 2002 4:39 PM To: [EMAIL PROTECTED] Subject: [PHP] fsockopen question Hi, i'm making a script to transfer all the zips from my old server to my new one, i mean, server to server. That's the easy part. The cuestion is: Can i open more than just one instance for fsockopen to retrieve more files in the same script, at the same time? i mean, not one by one (that will be slow), but 4 or 5 at the same time... some people think it's possible, some people don't...thx :D _ MSN. Más Útil cada Día. http://www.msn.es/intmap/ -- 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: PHP: Script Security: Best coding practices
Manuel Lemos wrote: Check out http://www.phpadvisory.com/ . An ok site but only three articles, of which two are on security. One article is too general and the other too specific :) Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] checking the path from which someone has arrived at aspecific script
On Fri, 28 Jun 2002, Kris Vose wrote: Basically I want to check to see if a user has gone to PayPal.com and paid for a product before I disseminate the username and password through a script called thankyou.php. I tried using an if statement that checks the global variable $HTTP_REFERER: if($GLOBALS['HTTP_REFERER'] == https://www.paypal.com/cgi-bin/webscr?__track=_xclick-flow:p/xcl/pay/buy-confirm:_xclick-payment-confirm-submit;) { //access code that disseminates usernames and passwords } Unfortunately...This is not working. I went to the php manual and it basically stated that not all web sites will post the $HTTP_REFERER. I believe that is what is happening in this case. Also, anyone can fake HTTP_REFERER to be anything they want, so it's a pretty lousy payment verification mechanism. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] fsockopen question
So...i can do more than one fsockopen()...but is not multi-thread? i don't understand...i mean...if i can open more than one fsockopen...it is multithread, or in wich cases php open more than one fsockopen? thx :D From: Martin Towell [EMAIL PROTECTED] To: 'Jose Arce' [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: [PHP] fsockopen question Date: Thu, 4 Jul 2002 16:39:36 +1000 you can do more than one fsockopen(), but since php isn't multi-threaded - you'll still only be able to download one file at a time. -Original Message- From: Jose Arce [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 04, 2002 4:39 PM To: [EMAIL PROTECTED] Subject: [PHP] fsockopen question Hi, i'm making a script to transfer all the zips from my old server to my new one, i mean, server to server. That's the easy part. The cuestion is: Can i open more than just one instance for fsockopen to retrieve more files in the same script, at the same time? i mean, not one by one (that will be slow), but 4 or 5 at the same time... some people think it's possible, some people don't...thx :D _ MSN. Más Útil cada Día. http://www.msn.es/intmap/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ MSN Fotos: la forma más fácil de compartir e imprimir fotos. http://photos.msn.es/support/worldwide.aspx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Weird preg problem
Thanks Miguel it works now! $str = abcA; if (preg_match('/^[a-z]*$/', $str)) echo The string '$str' contains only lower-case letters.; -Original Message- From: Miguel Cruz [mailto:[EMAIL PROTECTED]] Sent: July 4, 2002 2:29 AM To: SP Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Weird preg problem On Thu, 4 Jul 2002, SP wrote: Hi I am trying to check if a word contains only capital letters. For some reason it's not working. The below example is checking the word weird to see if it's all capital letters but it's saying it's matches. I've tried checking for only lower case letters with WEIRD and it's not working there too. What am I doing wrong? $pattern = A-Z; $regexp = '/^['.$pattern.']*$/i'; if( preg_match($regexp, weird) ) echo matches; else echo does not match; Easiest approach: if ($str != strtoupper($str)) echo 'String contains lower-case letters.'; Using preg: if (preg_match('/[a-z]/', $str)) echo 'String contains lower-case letters.'; If you don't want any other characters to appear, ONLY capital letters (your question was a little ambiguous to me): if (preg_match('/[^A-Z]/', $str)) echo 'String contains something other than capital letters.'; miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] fsockopen question
I mean, you can do ? // been a while, so syntax is prob. wrong :( $sock1 = fsockopen($host, 80); $sock2 = fsockopen($host, 80); fputs($sock1, GET /file1.html HTTP/1.0\r\n\r\n); fputs($sock2, GET /file2.html HTTP/1.0\r\n\r\n); $content1 = fgets($sock1, 102400); $content2 = fgets($sock1, 102400); $fclose($sock1); $fclose($sock2); ? each of the fgets()'s will be executed sequentially. But there's two sockets open... -Original Message- From: Jose Arce [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 04, 2002 4:48 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP] fsockopen question So...i can do more than one fsockopen()...but is not multi-thread? i don't understand...i mean...if i can open more than one fsockopen...it is multithread, or in wich cases php open more than one fsockopen? thx :D From: Martin Towell [EMAIL PROTECTED] To: 'Jose Arce' [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: [PHP] fsockopen question Date: Thu, 4 Jul 2002 16:39:36 +1000 you can do more than one fsockopen(), but since php isn't multi-threaded - you'll still only be able to download one file at a time. -Original Message- From: Jose Arce [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 04, 2002 4:39 PM To: [EMAIL PROTECTED] Subject: [PHP] fsockopen question Hi, i'm making a script to transfer all the zips from my old server to my new one, i mean, server to server. That's the easy part. The cuestion is: Can i open more than just one instance for fsockopen to retrieve more files in the same script, at the same time? i mean, not one by one (that will be slow), but 4 or 5 at the same time... some people think it's possible, some people don't...thx :D _ MSN. Más Útil cada Día. http://www.msn.es/intmap/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ MSN Fotos: la forma más fácil de compartir e imprimir fotos. http://photos.msn.es/support/worldwide.aspx -- 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] checking the path from which someone has arrived at a specific script
Miguel Cruz [EMAIL PROTECTED] wrote in message... Unfortunately...This is not working. I went to the php manual and it basically stated that not all web sites will post the $HTTP_REFERER. I believe that is what is happening in this case. Also, anyone can fake HTTP_REFERER to be anything they want, so it's a pretty lousy payment verification mechanism. Paypal offers the use of a direct response to a url you designate for verification.. send them to a thank you page, and maybe give them temp access.. there are directions on setting up verification with paypal in their payment manuals.. -- === Michael J. Ryan - tracker1[*at*]theroughnecks.com Roughneck BBS: http://www.theroughnecks.net telnet://theroughnecks.net === Y!: aztracker1 - aim: azTracker1 - icq: 4935386 - msn: see email One program for aim/icq/yahoo/msn/irc - http://www.trillian.cc/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: PHP: Script Security: Best coding practices
I thought it was a good site. I was reading up on the security bugs found and now I know what not to do. -Original Message- From: Jean-Christian Imbeault [mailto:[EMAIL PROTECTED]] Sent: July 4, 2002 2:41 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: PHP: Script Security: Best coding practices Manuel Lemos wrote: Check out http://www.phpadvisory.com/ . An ok site but only three articles, of which two are on security. One article is too general and the other too specific :) Jc -- 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] gc_probability: requests tallied per server or domain?
On Tue, 2 Jul 2002, Johnson, Kirk wrote: Is the number of requests (used for garbage collection), tallied on a per server basis, or on a per domain basis? What about in a load-balanced environment? Pretty fair bet it's a per-server basis. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fsockopen question
you can do more than one fsockopen, which means you will have multiple sockets open, however, these are part of the same thread in the same process.. in other words, you can't do two things at once by default.. with php-gtk, you can maybe have multiple user events.. and not sure if you can emulate it.. -- === Michael J. Ryan - tracker1[*at*]theroughnecks.com Roughneck BBS: http://www.theroughnecks.net telnet://theroughnecks.net === Y!: aztracker1 - aim: azTracker1 - icq: 4935386 - msn: see email One program for aim/icq/yahoo/msn/irc - http://www.trillian.cc/ Jose Arce [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... So...i can do more than one fsockopen()...but is not multi-thread? i don't understand...i mean...if i can open more than one fsockopen...it is multithread, or in wich cases php open more than one fsockopen? thx :D From: Martin Towell [EMAIL PROTECTED] To: 'Jose Arce' [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: [PHP] fsockopen question Date: Thu, 4 Jul 2002 16:39:36 +1000 you can do more than one fsockopen(), but since php isn't multi-threaded - you'll still only be able to download one file at a time. -Original Message- From: Jose Arce [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 04, 2002 4:39 PM To: [EMAIL PROTECTED] Subject: [PHP] fsockopen question Hi, i'm making a script to transfer all the zips from my old server to my new one, i mean, server to server. That's the easy part. The cuestion is: Can i open more than just one instance for fsockopen to retrieve more files in the same script, at the same time? i mean, not one by one (that will be slow), but 4 or 5 at the same time... some people think it's possible, some people don't...thx :D _ MSN. Más Útil cada Día. http://www.msn.es/intmap/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ MSN Fotos: la forma más fácil de compartir e imprimir fotos. http://photos.msn.es/support/worldwide.aspx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP in South Africa
Rudolf Visagie Principal Software Developer Digital Healthcare Solutions mailto:[EMAIL PROTECTED] Tel: +27 11 2655484 Cell: 082 895 1598 -Original Message- From: MindHunter [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 03, 2002 4:19 PM To: [EMAIL PROTECTED] Subject: [PHP] PHP in South Africa I am looking for PHP programmers in South Africa, specifically in the Gauteng area. Please mail me. Tx Bk -- 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: Weird preg problem
the /i means case insensitive, remove the i, and it will work as intended. -- === Michael J. Ryan - tracker1[*at*]theroughnecks.com Roughneck BBS: http://www.theroughnecks.net telnet://theroughnecks.net === Y!: aztracker1 - aim: azTracker1 - icq: 4935386 - msn: see email One program for aim/icq/yahoo/msn/irc - http://www.trillian.cc/ Sp [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi I am trying to check if a word contains only capital letters. For some reason it's not working. The below example is checking the word weird to see if it's all capital letters but it's saying it's matches. I've tried checking for only lower case letters with WEIRD and it's not working there too. What am I doing wrong? $pattern = A-Z; $regexp = '/^['.$pattern.']*$/i'; if( preg_match($regexp, weird) ) echo matches; else echo does not match; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] fsockopen question
now it's clear thx :D is not the same thing as: while ($i 100) { $sock = fsockopen($host, 80); fputs($sock, GET /file.$i.html HTTP/1.0\r\n\r\n); } isn't? From: Martin Towell [EMAIL PROTECTED] To: 'Jose Arce' [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: [PHP] fsockopen question Date: Thu, 4 Jul 2002 16:49:59 +1000 I mean, you can do ? // been a while, so syntax is prob. wrong :( $sock1 = fsockopen($host, 80); $sock2 = fsockopen($host, 80); fputs($sock1, GET /file1.html HTTP/1.0\r\n\r\n); fputs($sock2, GET /file2.html HTTP/1.0\r\n\r\n); $content1 = fgets($sock1, 102400); $content2 = fgets($sock1, 102400); $fclose($sock1); $fclose($sock2); ? each of the fgets()'s will be executed sequentially. But there's two sockets open... -Original Message- From: Jose Arce [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 04, 2002 4:48 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP] fsockopen question So...i can do more than one fsockopen()...but is not multi-thread? i don't understand...i mean...if i can open more than one fsockopen...it is multithread, or in wich cases php open more than one fsockopen? thx :D From: Martin Towell [EMAIL PROTECTED] To: 'Jose Arce' [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: [PHP] fsockopen question Date: Thu, 4 Jul 2002 16:39:36 +1000 you can do more than one fsockopen(), but since php isn't multi-threaded - you'll still only be able to download one file at a time. -Original Message- From: Jose Arce [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 04, 2002 4:39 PM To: [EMAIL PROTECTED] Subject: [PHP] fsockopen question Hi, i'm making a script to transfer all the zips from my old server to my new one, i mean, server to server. That's the easy part. The cuestion is: Can i open more than just one instance for fsockopen to retrieve more files in the same script, at the same time? i mean, not one by one (that will be slow), but 4 or 5 at the same time... some people think it's possible, some people don't...thx :D _ MSN. Más Útil cada Día. http://www.msn.es/intmap/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ MSN Fotos: la forma más fácil de compartir e imprimir fotos. http://photos.msn.es/support/worldwide.aspx -- 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 _ Únase al mayor servicio mundial de correo electrónico: http://www.hotmail.com/es -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Handling of constants in strings
On Tue, 2 Jul 2002, Uwe Birkenhain wrote: A question - since english is not my first language - what do you mean with It's not all that common to bury constants in strings Is something bad about it? I think so. It would slow parsing down to a crawl and create a host of ambiguities if every letter that ever appeared in a string had to be compared against the list of defined constants (after all, you might have a constant called 'a'). With normal variables, it only has to worry about it when there's a $ before it or {} around it, which is much simpler. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] fsockopen question
That's still running sequentially -Original Message- From: Jose Arce [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 04, 2002 5:01 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP] fsockopen question now it's clear thx :D is not the same thing as: while ($i 100) { $sock = fsockopen($host, 80); fputs($sock, GET /file.$i.html HTTP/1.0\r\n\r\n); } isn't? From: Martin Towell [EMAIL PROTECTED] To: 'Jose Arce' [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: [PHP] fsockopen question Date: Thu, 4 Jul 2002 16:49:59 +1000 I mean, you can do ? // been a while, so syntax is prob. wrong :( $sock1 = fsockopen($host, 80); $sock2 = fsockopen($host, 80); fputs($sock1, GET /file1.html HTTP/1.0\r\n\r\n); fputs($sock2, GET /file2.html HTTP/1.0\r\n\r\n); $content1 = fgets($sock1, 102400); $content2 = fgets($sock1, 102400); $fclose($sock1); $fclose($sock2); ? each of the fgets()'s will be executed sequentially. But there's two sockets open... -Original Message- From: Jose Arce [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 04, 2002 4:48 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP] fsockopen question So...i can do more than one fsockopen()...but is not multi-thread? i don't understand...i mean...if i can open more than one fsockopen...it is multithread, or in wich cases php open more than one fsockopen? thx :D From: Martin Towell [EMAIL PROTECTED] To: 'Jose Arce' [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: [PHP] fsockopen question Date: Thu, 4 Jul 2002 16:39:36 +1000 you can do more than one fsockopen(), but since php isn't multi-threaded - you'll still only be able to download one file at a time. -Original Message- From: Jose Arce [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 04, 2002 4:39 PM To: [EMAIL PROTECTED] Subject: [PHP] fsockopen question Hi, i'm making a script to transfer all the zips from my old server to my new one, i mean, server to server. That's the easy part. The cuestion is: Can i open more than just one instance for fsockopen to retrieve more files in the same script, at the same time? i mean, not one by one (that will be slow), but 4 or 5 at the same time... some people think it's possible, some people don't...thx :D _ MSN. Más Útil cada Día. http://www.msn.es/intmap/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ MSN Fotos: la forma más fácil de compartir e imprimir fotos. http://photos.msn.es/support/worldwide.aspx -- 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 _ Únase al mayor servicio mundial de correo electrónico: http://www.hotmail.com/es -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using fsockopen
Help I'm a newbie to indepth PHP. I want to issue an fsockopen command to pass a POST data set to a remote server script. I understand the pricipals behind fsockopen, but I cannot figure out the string I need to pass to POST the data - I will be emulating the output from a Form element. In addition, how do I detect a successful operation? before closing the socket?. Any help greatfully received. thks Richard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP: Script Security: Best coding practices
Sp wrote: I thought it was a good site. I was reading up on the security bugs found and now I know what not to do. True. It's just too specific. In order for me to figure out what to do I need to read every advisory to see what it is about and how to prevent against that particular problem. If you have the time it is probably worth reading most of those advisories. But a general list of Do's and Don't would be more handy :) Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help!
Hi, I installed apache with support of php as i found on the online manual at php.net. I created a simple php file named hello.php html head titlePHP Test Page/title /head body ?php echo Hello p; ? /body /html and i put the file in my htdocs directory i restarted apache and when i'm trying to access the page http://localhost/hello.php as a result i'm getting the contents of the file hello.,php which are: html head titlePHP Test Page/title /head body ?php echo Hello p; ? /body /html What is wrong is my apache able to display php pages? Thanx for your time! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help!
John Lazos wrote: and i put the file in my htdocs directory i restarted apache and when i'm trying to access the page http://localhost/hello.php as a result i'm getting the contents of the file hello.,php What is wrong is my apache able to display php pages? Looks like Apache does not know about PHP :) in your /usr/local/apache/conf/httpd.conf file (or another path, if you have set another prefix while compiling the tarball) you seem to miss this: AddType application/x-httpd-php .php AddType application/x-httpd-php .phtml AddType application/x-httpd-php .php3 AddType application/x-httpd-php-source .phps have fun :)) Alberto Kiev -- -_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_- LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Thanx!!!
Thanx all for your help it worked..!!! :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help!
John Lazos wrote: and i put the file in my htdocs directory i restarted apache and when i'm trying to access the page http://localhost/hello.php as a result i'm getting the contents of the file hello.,php What is wrong is my apache able to display php pages? Looks like Apache does not know about PHP :) in your /usr/local/apache/conf/httpd.conf file (or another path, if you have set another prefix while compiling the tarball) you seem to miss this: AddType application/x-httpd-php .php AddType application/x-httpd-php .phtml AddType application/x-httpd-php .php3 AddType application/x-httpd-php-source .phps I almost forgot. Also check the module list. It should be something like this (but you might have much less modules installed then I do, anyway, just make sure that after deleting those you don't have the LoadModule and AddModule order do match with the example. Apache gets quite nervous if you give it some other module order) LoadModule agent_log_module libexec/mod_log_agent.so LoadModule referer_log_module libexec/mod_log_referer.so LoadModule mime_magic_module libexec/mod_mime_magic.so LoadModule status_module libexec/mod_status.so LoadModule info_modulelibexec/mod_info.so LoadModule speling_module libexec/mod_speling.so LoadModule rewrite_module libexec/mod_rewrite.so LoadModule proxy_module libexec/libproxy.so LoadModule expires_module libexec/mod_expires.so LoadModule usertrack_module libexec/mod_usertrack.so LoadModule unique_id_module libexec/mod_unique_id.so LoadModule php4_modulelibexec/libphp4.so IfDefine SSL LoadModule ssl_module libexec/libssl.so /IfDefine # Reconstruction of the complete module list from all available modules # (static and shared ones) to achieve correct module execution order. # [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO] ClearModuleList AddModule mod_env.c AddModule mod_log_config.c AddModule mod_log_agent.c AddModule mod_log_referer.c AddModule mod_mime_magic.c AddModule mod_mime.c AddModule mod_negotiation.c AddModule mod_status.c AddModule mod_info.c AddModule mod_include.c AddModule mod_autoindex.c AddModule mod_dir.c AddModule mod_cgi.c AddModule mod_asis.c AddModule mod_imap.c AddModule mod_actions.c AddModule mod_speling.c AddModule mod_userdir.c AddModule mod_alias.c AddModule mod_rewrite.c AddModule mod_access.c AddModule mod_auth.c AddModule mod_proxy.c AddModule mod_expires.c AddModule mod_usertrack.c AddModule mod_unique_id.c AddModule mod_so.c AddModule mod_setenvif.c IfDefine SSL AddModule mod_ssl.c /IfDefine AddModule mod_php4.c -- -_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_- LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Weird preg problem
A that's what that means. Thanks Tracker -Original Message- From: Tracker 1 [mailto:[EMAIL PROTECTED]] Sent: July 4, 2002 3:00 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: Weird preg problem the /i means case insensitive, remove the i, and it will work as intended. -- === Michael J. Ryan - tracker1[*at*]theroughnecks.com Roughneck BBS: http://www.theroughnecks.net telnet://theroughnecks.net === Y!: aztracker1 - aim: azTracker1 - icq: 4935386 - msn: see email One program for aim/icq/yahoo/msn/irc - http://www.trillian.cc/ Sp [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi I am trying to check if a word contains only capital letters. For some reason it's not working. The below example is checking the word weird to see if it's all capital letters but it's saying it's matches. I've tried checking for only lower case letters with WEIRD and it's not working there too. What am I doing wrong? $pattern = A-Z; $regexp = '/^['.$pattern.']*$/i'; if( preg_match($regexp, weird) ) echo matches; else echo does not match; -- 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] How to pass unknown number of variables to a function?
Hi everybody on this rainy morning! My problem: I give the user a form with a list of options with checkboxes. The list is long and not predictable - the values change always. I want to put the checked values (or all, that doesn't matter) in an array, to pass it to my function. How can I write those keys and values in an array? I suppose it will be best done with JS - but since I don't know JS ... Has anybody a ready solution? Thank's a lot! Uwe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to pass unknown number of variables to a function?
On Thursday 04 July 2002 16:52, Uwe Birkenhain wrote: Hi everybody on this rainy morning! My problem: I give the user a form with a list of options with checkboxes. The list is long and not predictable - the values change always. I want to put the checked values (or all, that doesn't matter) in an array, to pass it to my function. How can I write those keys and values in an array? I suppose it will be best done with JS - but since I don't know JS ... Has anybody a ready solution? Search archives for checkbox array -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* For your penance, say five Hail Marys and one loud BLAH! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to pass unknown number of variables to a function?
Uwe Birkenhain wrote: Hi everybody on this rainy morning! Rainy!? It's damn hot in Kiev :) My problem: I give the user a form with a list of options with checkboxes. The list is long and not predictable - the values change always. I want to put the checked values (or all, that doesn't matter) in an array, to pass it to my function. How can I write those keys and values in an array? Suppose you have a number of checkboxes. First, you name them sequentially (like active_0,active_1 and so on) and you assign it your value. Then you process posted data like this. BEWARE! you need at least an array of hidden variables to know exactly how many checkboxes you must process. Then you just rebuild it the structure and pass it thru. # put the received input into an ordered structure ## $count = 0; while ( isset($id[$count]) ) { # Build variable names; ### $w_active = active_.$count; # get actual form values $active[$count] = $$w_active; $count++; } Hope it solves the problem. I've been using this for ages and it never gave me problems. Alberto Kiev -- -_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_- LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Nothing will execute after calling imagejpeg.
This thread has been up before, but there was never sent a reply to it, and I'm having the same problem Anyone who knows what to do? Sincerely Victor -Original Message- From: Kris Johnson [mailto:[EMAIL PROTECTED]] Sent: Saturday, June 01, 2002 11:11 PM To: Leotta, Natalie (NCI/IMS) Subject: Nothing will execute after calling imagejpeg. Hello, My name is Kris Johnson. I 'm hoping you can give me some direction on a problem I am having. After calling imagejpeg nothing else will work. I have tried echoing html, echoing just a word in quotes, as well as a using a location header. I do not get any errors or warnings, but whatever command I use simply doesn't work. As a test I remarked imagejpeg out of the code and as soon as I did this the commands after worked fine. I tried changing the filetype to png but still get the same problem. Have a nice day Kris -- 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] extension problem
hi I have an extension problem. i have wrote this exemple #include... char* xx(){ return true; } it's a simple example. I have compiled it into .SO dynamic library. when I try to load it into PHP i get this message cannot include .(may be not php extension). CAN YOU HELP ME PLEASE. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Picture Cache
Hello, At the moment I have a PHP script which accesses a database, to get the data to return a picture. So the follwing url is actually a picture of type image/jpeg: getdata.php?id=6 So I can use: img src=getdata.php?id=6 Thats great and it works fine, but I feel that it does not cache the picture in the web browser? I don't know how the cache works but my friend says it asks the server for the data the file was generated and the size, so I suppose with this is dosent? Help! Thanks, Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql/php how to retrieve the right column with 2 columns of the same name
Hi all, I have to tables A and B. They boyh have a column with the same name. Now, I wrote this MySQL statement performing a left join. This results in a data set with rows consisting of 2 columns of the same name, in which the date is stored when the record was last altered. This column is called last_altered. Later on in my script I'm calling the value of this column with php. $query=select * from tblA LEFT JOIN ; $resultID=mysql_query($query); while ($result_row=mysql_fetch_array($resultID)) { echo $result_row[column with the same name]; } Well, this works without any php or mysql errors, but it is giving me the data back of that column wich I don't wanna have...It returns the last_altered date of tblB in stead of tblA. A solution might be te exclude the second column (the wrong one) from the select statement in the query. This is a MySQL adjustement. Anybody knows how this can be done?? Maybe there are also PHP solutions which I don't know of...? thx Wilbert Enserink - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
Re: [PHP] Re: Program executing in PHP. Please help (SOLVED)
Hello Richard, PHP, Well I did a typo here. Sorry about it. At that moment i was really nuts, and needed a rest. Now I solved that problem, but only after UPDATING PHP from 4.0.6 to 4.2.1 And shell_exec worked. Exec didn't :( I'm going to investigate this question in the future. Thank's for the help. And as usual if anyone will need it. Here is a working script: ? echo Test 2br; $output = shell_exec('uudeview -i /bla/bla.txt -p /bla/bla/'); echo pre; echo ($kick_my_ass); echo /pre; ? Thursday, July 4, 2002, 12:48:13 AM, you wrote: ? $output = shell_exec(uudeview -i /bla/bla.txt -p /bla/bla/); echo pre; echo $kick_my_ass; echo /pre; ? And I get nothing :(. Script like below: RL Well, no... RL Your data is in $output, and you are echo-ing out $kick_my_ass... Try echo RL $output ? $output = shell_exec(uudeview); echo pre; echo $kick_my_ass; echo /pre; ? Work fine outputting me command line parameters. What have I done wrong? RL It's also possible that you just made a typo here, but the real code has the RL right variables... RL In that case, try this: RL $command = uudeview -i /bal/bal.txt -p /bla/la; RL exec($command, $results, $errorcode); RL echo implode(BR\n, $results); RL if ($errorcode){ RL echo OS Error: $errorcode. Use 'man errno' to look it up, but it's RL probably path/permissions.BR\n); RL } RL -- RL Like Music? http://l-i-e.com/artists.htm -- Best regards, Latexmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] loop problem
Hi All, I'm currently working with a friends that want to use irc protocol at his work cause there is only http proxy. so it is very easy, i found phpIRC and everything works fine...He is very happy i've just seen that some process are always connected. this is really weird. so i started to watch that on details and it seems that the loop which dispatch messages don't stop when Apache client is away Am i wrong ? To sum up, i have a PHP script that loop and send messages to client but when client go away script continue to run. did i see some ghost that does not exist ? Thanks for your answer Manu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql/php how to retrieve the right column with 2 columns of the same name
On Thursday 04 July 2002 17:23, Wilbert Enserink wrote: Hi all, I have to tables A and B. They boyh have a column with the same name. Now, I wrote this MySQL statement performing a left join. This results in a data set with rows consisting of 2 columns of the same name, in which the date is stored when the record was last altered. This column is called last_altered. Later on in my script I'm calling the value of this column with php. $query=select * from tblA LEFT JOIN ; $resultID=mysql_query($query); while ($result_row=mysql_fetch_array($resultID)) { echo $result_row[column with the same name]; } Well, this works without any php or mysql errors, but it is giving me the data back of that column wich I don't wanna have...It returns the last_altered date of tblB in stead of tblA. A solution might be te exclude the second column (the wrong one) from the select statement in the query. This is a MySQL adjustement. Anybody knows how this can be done?? Try to limit your select statement, instead of SELECT *, use SELECT colA, colB, tablA.samenamecolA, tablB.samenamecolA, etc -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Love is the process of my leading you gently back to yourself. -- Saint Exupery */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to pass unknown number of variables to a function?
Hi Uwe, If you define the checkbox list as an array (OptionList[] in the example below), only the checked values will be returned as an array $OptionList when you post the form. You can then use this as an array or pass it as an array to a function in the script: ? $i = 0; while (isset($OptionList[$i])) { echo You have chosen option .$OptionList[$i].br; $i++; } ? html head titleUntitled Document/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body bgcolor=#FF text=#00 form name=form1 method=post action=test.php input type=checkbox name=OptionList[] value=something1Option 1/inputbr input type=checkbox name=OptionList[] value=something2Option 2/inputbr input type=checkbox name=OptionList[] value=something3Option 3/inputbr input type=submit name=Submit value=Test /form /body /html Regards Rudolf Visagie Principal Software Developer Digital Healthcare Solutions -Original Message- From: Uwe Birkenhain [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 04, 2002 10:53 AM To: [EMAIL PROTECTED] Subject: [PHP] How to pass unknown number of variables to a function? Hi everybody on this rainy morning! My problem: I give the user a form with a list of options with checkboxes. The list is long and not predictable - the values change always. I want to put the checked values (or all, that doesn't matter) in an array, to pass it to my function. How can I write those keys and values in an array? I suppose it will be best done with JS - but since I don't know JS ... Has anybody a ready solution? Thank's a lot! Uwe -- 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] Need Help with $_SESSION.
-Original Message- From: Scott Fletcher [mailto:[EMAIL PROTECTED]] Sent: 03 July 2002 20:58 Still working on the script. Here what I found out so far. Why does the example #1 work and example #2 doesn't? Example #1 Page 1 $_SESSION[0] = Zero; $_SESSION[1] = One; [snip] Actually, I'm amazed either of your examples work correctly, since numeric session variable names aren't supported (see bug report 17122 at http://bugs.php.net/bug.php?id=17122. As the $_SESSION indexes you use indeed have the potential to be actual variable names (if register_globals is turned on), they must themselves be valid PHP variable names. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql/php how to retrieve the right column with 2 columns of the same name
thx Jason, now I understand the use of aliases in select queries. Good ID:-) Wilbert - Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 04, 2002 11:38 AM Subject: Re: [PHP] mysql/php how to retrieve the right column with 2 columns of the same name On Thursday 04 July 2002 17:23, Wilbert Enserink wrote: Hi all, I have to tables A and B. They boyh have a column with the same name. Now, I wrote this MySQL statement performing a left join. This results in a data set with rows consisting of 2 columns of the same name, in which the date is stored when the record was last altered. This column is called last_altered. Later on in my script I'm calling the value of this column with php. $query=select * from tblA LEFT JOIN ; $resultID=mysql_query($query); while ($result_row=mysql_fetch_array($resultID)) { echo $result_row[column with the same name]; } Well, this works without any php or mysql errors, but it is giving me the data back of that column wich I don't wanna have...It returns the last_altered date of tblB in stead of tblA. A solution might be te exclude the second column (the wrong one) from the select statement in the query. This is a MySQL adjustement. Anybody knows how this can be done?? Try to limit your select statement, instead of SELECT *, use SELECT colA, colB, tablA.samenamecolA, tablB.samenamecolA, etc -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Love is the process of my leading you gently back to yourself. -- Saint Exupery */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Does Location: headers constantly
-Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED]] Sent: 03 July 2002 21:17 [...] It's a good idea to get in the habit of doing: header(Location: xxx); exit; There's no point in sending any more data after the Location: header anyway, I can't let this go unchallenged -- what happens if you're sending this to a browser which *doesn't* honour the Location: header, but *is* capable of displaying any attached page content? The poor user will be left with a completely blank screen, and no hint of why. In fact, the HTTP/1.1 spec (RFC 2616: http://www.w3.org/Protocols/rfc2616/rfc2616.html) even says: Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s). So at the very least you should do something like this: header(Location: xxx); ? HTML HEAD TITLEMoved to xxx/TITLE /HEAD BODY PThis page has moved to a href=xx/a. /BODY /HTML ?php exit; Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] adding a variable to a variable name
-Original Message- From: Tom Beidler [mailto:[EMAIL PROTECTED]] Sent: 03 July 2002 21:41 For the current issue I'm trying to unset some variables with common names and I would like to step through them with a loop. Here's where I'm at to give you an idea but the code doesn't work. for ($i = 2; $i = 4; $i++) { unset($level$iName); unset($level$iUrl); } [...] I guess I could create a variable before the unset like so $unsetA = level . $i . Name; This does the trick: unset(${level${i}Name}); but that seems cloogey. cloogey -- kludgy??? Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql/php how to retrieve the right column with 2 columnsof the same name
Wilbert Enserink wrote: Later on in my script I'm calling the value of this column with php. $query=select * from tblA LEFT JOIN ; it's been said over and over :) NEVER EVER write a select * query... use syntax Select a.column1, a.column2, b.column1 from tbl1 as a, tbl2 as b where . and you'll never get in trouble :)) Alberto Kiev -- -_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_- LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to pass unknown number of variables to a function?
This is a nice easy one :) It couldn't be simpler. Just put empty square brackets (as used in arrays) in front of your checkbox name. The example below assumes you have PHP 4.1 or greater (which uses $_POST to contain form posted data) notice how name=ck[] html head titleUntitled/title /head body ?php if(count($_POST)) { foreach ($_POST[ck] as $varval) { print(div.$varval./div); } } ? form action=test.php method=post input type=checkbox name=ck[] value=val1br input type=checkbox name=ck[] value=val2br input type=checkbox name=ck[] value=val3br input type=checkbox name=ck[] value=val4br input type=checkbox name=ck[] value=val5br input type=submit /form /body /html in earlier versions of PHP, $_POST[ck] would be equal to $ck (although, the former is safer) On Thu, 4 Jul 2002 10:52:37 +0200, Uwe Birkenhain [EMAIL PROTECTED] said: Hi everybody on this rainy morning! My problem: I give the user a form with a list of options with checkboxes. The list is long and not predictable - the values change always. I want to put the checked values (or all, that doesn't matter) in an array, to pass it to my function. How can I write those keys and values in an array? I suppose it will be best done with JS - but since I don't know JS ... Has anybody a ready solution? Thank's a lot! Uwe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php [TK] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HTML Java script doubt..
Hi friend, sorry for putting this question to php-list. Here I am getting the error as Object doesn't support this property or method in line number 22. html head script language=javascript function checkall() { var n=0,i=document.form1.OptionList.length; while(ni) { document.form1.OptionList[n].checked=true; n=n+1; } } /script /head body bgcolor=#FF text=#00 form name=form1 method=post input type=checkbox name=OptionList[] value=something1Option 1/inputbr input type=checkbox name=OptionList[] value=something2Option 2/inputbr input type=checkbox name=OptionList[] value=something3Option 3/inputbr input type=checkbox name=checkall OnClick=checkall() /This is error line /form /body /html == Thanks and Regards Balaji **Disclaimer Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] IIS unexpected error
I am setting up PHP on WinXP Pro with IIS 5.1. I tried to start the IIS server and I get an Unexpected error 0x8ffe2740 occured. error. Anyone know how to resolve this problem? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTML Java script doubt..
Hi Balaji Have re-written the code now works.. two problems: 1. checkall() appears to be a reserved function - have renamed function to checkitall 2. You didn't need to put [] after OptionList in checkbox name html head script language=javascript function checkitall() { var n=0,i=document.form1.OptionList.length; while(ni) { document.form1.OptionList[n].checked=true; n=n+1; } } /script /head body bgcolor=#FF text=#00 form name=form1 method=post input type=checkbox name=OptionList value=something1Option 1/inputbr input type=checkbox name=OptionList value=something2Option 2/inputbr input type=checkbox name=OptionList value=something3Option 3/inputbr input type=checkbox name=checkall OnClick=checkitall() /This is error line /form /body /html Regards John - Original Message - From: Balaji Ankem [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 04, 2002 12:04 PM Subject: [PHP] HTML Java script doubt.. Hi friend, sorry for putting this question to php-list. Here I am getting the error as Object doesn't support this property or method in line number 22. html head script language=javascript function checkall() { var n=0,i=document.form1.OptionList.length; while(ni) { document.form1.OptionList[n].checked=true; n=n+1; } } /script /head body bgcolor=#FF text=#00 form name=form1 method=post input type=checkbox name=OptionList[] value=something1Option 1/inputbr input type=checkbox name=OptionList[] value=something2Option 2/inputbr input type=checkbox name=OptionList[] value=something3Option 3/inputbr input type=checkbox name=checkall OnClick=checkall() /This is error line /form /body /html == Thanks and Regards Balaji -- 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] Content-Length
Hi I am currently having problems with a custom written web-authentication-proxy. The proxy works fine with standard html pages but not with php pages. After doing a bit of digging I have found that the proxy does a HEAD request and checks the Content-Length to see if the page if valid. I have been able to use Header( Content-Length: 100 ) to fool the proxy into loading the php page. My question is how do I go about calculating the correct Content-Length for each and every php page on my site. I have done some digging and presume I need to do Output buffering and calculate the strlen of the response the php returns, but how do I reference the result of a php page to get a strlen from it?? Any assistance would be welcome Thanks Grant -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sort with PHP or SQL?
Hey, I'm working on a way to pull menus/pages from a database. Currently I have this working on 2 levels - Topic headers actual page titles - it prints it out fairly nice doesn't take long to load. What I need to do is add a level between the 2, a sub-header. I'm running both the apache server mysql server on the same linux box as the current load isn't very high. I'm wondering whether it would be better/easier to Load all the topic headers into an array, then any possible sub-headers into a 2nd array, then the pages into a 3rd array (or even into a multidimensional array?). Then go through the arrays match the pages. Or would it be easier to write 1 huge SQL statement have the SQL server run the whole query? Currently the menu looks like - bWin Programs/b - Anti-Bot - Find Ascii - Game Pack bOnline Projects/b - Anti-Bot etc... I need something more like - bWin Programs/b Utils - Anti-Bot - Find Ascii Games - Game Pack bOnline Projects/b - Anti-Bot etc... Patrick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] AdRotator for PHP?
Hey, I'm wondering if anyone has found or ended up writing something similar to the MSWC AdRotator object in ASP, but for PHP? Or is there already a module on apache.org that I missed? Thanks for any help :) Patrick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Nothing will execute after calling imagejpeg.
This thread has been up before, but there was never sent a reply to it, and I'm having the same problem Just idea. If you doesn't have GD installed and php error reporting turned off this situation is possible. In other words php simply dies because of undeclared function and doesn't report about error. Maybe this helps -- Sincerely, val petruchek -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MySql_Error();
Please, How do I make to get all errors of MySql ? I'm making a function for translate all errors. Example: function TranslateErrors($err) { global $result; global $text; Switch ($err) { case 1045 : $text = User or Password invalid; Break; case 2005 : $text = Host not exists; Break; case 1049 : $text = Database not exists; Break; } result = $text; } Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Content-Length
On Thu, Jul 04, 2002 at 01:24:04PM +0200, Grant wrote: My question is how do I go about calculating the correct Content-Length for each and every php page on my site. I have done some digging and presume I need to do Output buffering and calculate the strlen of the response the php returns, but how do I reference the result of a php page to get a strlen from it?? You didn't dig far enough, since there is an example of exactly what you want on: http://www.php.net/manual/en/function.ob-get-length.php Isn't the online reference need? :) -- Daniel Tryba -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] AdRotator for PHP?
I'm pretty sure you'll find what you are looking for here: http://www.hotscripts.com/PHP/Scripts_and_Programs/Ad_Management/ /Joakim -Original Message- From: Patrick Teague [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 04, 2002 1:31 PM To: PHP-General Subject: [PHP] AdRotator for PHP? Hey, I'm wondering if anyone has found or ended up writing something similar to the MSWC AdRotator object in ASP, but for PHP? Or is there already a module on apache.org that I missed? Thanks for any help :) Patrick -- 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] Function imap_headers question.
Hello php-general, I've got a little question about imap_headers. I working on a project which must connect to local nntp server. I have no problems doing it, but as far as I know from documentation Imap_headers() fetches msg headers in to the arrey. So let's say I've got 5000 post in the box. When i try to open it it fetches all the headers. and then brings me them on the web page. I want to display sets of 50 headers per page. that makes 100 pages. and every page will connect to server fetch ALL headers and etc. Any possibility to limit headers fetch like mysql limit 0, 50 and so on? Also any ideas how to speed it up also are welcome -- Best regards, Latex mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] AdRotator for PHP?
Hello Patrick, Try to look at hotscripts.com there are lots of scripts there. Personally i prefer to write ones by myself. Thursday, July 4, 2002, 3:31:20 PM, you wrote: PT Hey, PT I'm wondering if anyone has found or ended up writing something similar to PT the MSWC AdRotator object in ASP, but for PHP? Or is there already a module PT on apache.org that I missed? PT Thanks for any help :) PT Patrick -- Best regards, Latexmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 4.2.1 - Apache 2.0.36 - Win98SE
Php 4.2.1 - Apache 2.0.36 -Win98SE This configuration works great, but when I try to upgrade to Apache 2.0.39 nothing works.Even when I try php 4.3.0 it wont work. My question is: Is there anybody out there who have tried to configure php 4.2.1 or 4.3.0 with Apache 2.039 and Win98SE? Please tell me how! Erik
Re: [PHP] Re: $this in an XML data handler ... in a class
I hadn't noticed that. My php.ini was set to on, changing it to off gave the warning. Having changed: xml_set_object($this-parser,$this); to: xml_set_object($this-parser,$this); Stops the warning and the parser works fine. This is the class I'm using and it works fine: class parse_words_xml { var $words; function parse_words_xml($xml_data) { $this-words = array(); $this-parser = xml_parser_create(); xml_parser_set_option($this-parser, XML_OPTION_CASE_FOLDING, false); xml_set_element_handler($this-parser,tag_open,tag_close); xml_set_character_data_handler($this-parser,cdata); $this-parse($xml_data); } function parse($xml_data) { xml_set_object($this-parser,$this); reset ($xml_data); while (list (, $data) = each ($xml_data)) { if (!xml_parse($this-parser, $data)) { die(sprintf( XML error: %s at line %d\n\n, xml_error_string(xml_get_error_code($this-parser)), xml_get_current_line_number($this-parser))); } } } function tag_open($parser,$tag,$attributes) { $this-current_tag = $tag; switch($tag){ case 'Word': $this-id = $attributes['id']; $this-words[$attributes['id']] = 1; break; default: break; } } function cdata($parser,$cdata) { $this-temp = $cdata; } function tag_close($parser,$tag) { switch($tag){ case 'Word': $this-words[$this-id] = $this-temp; $this-temp = ''; break; default: break; } } } Clay Loveless [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Unfortunately, the xml_set_object function does not work to solve this problem. I tried using it, and my results were the same as they were when I was not using it. [I found that the array($this, 'function_name') method instead of 'string function_name' for the xml_set_*_handler functions worked just as well, only without this Warning message one gets from PHP 4.2.1 upon using xml_set_object($this-parser, $this): PHP Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of xml_set_object(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer.] Still searching for an answer on this one ... Thanks, -Clay Peter Clarke [EMAIL PROTECTED] Have a look at: http://www.php.net/manual/en/function.xml-set-object.php xml_set_object($this-parser, $this); Clay Loveless [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Here's a brain-bender ... At least it is for me at the moment. : ) When I use an XML parser inside a class, the xml_*_handler functions aren't recognizing $this- variables. I can kind of see why ... But would like it to work anyway. : ) Here's an example: class Blah { var $xmlparser; var $current_element; // ... function _parseXML($data) { $this-xmlparser = xml_parser_create(); xml_set_element_handler( $this-xmlparser, array($this,_xml_start_element), array($this,_xml_end_element)); xml_set_character_data_handler( $this-xmlparser, array($this,_xml_character_data)); xml_parse($this-xmlparser, $data); xml_parser_free($this-xmlparser); } function _xml_start_element($p, $e_name, $e_attributes) { $this-current_element = $e_name; } function _xml_end_element($p, $e_name) { // ... } function _xml_character_data($p, $data) { echo element is: .$this-current_element.\n; echo data is: $data\n; } } // end of class Blah When this XML parser gets called from within the Blah class, the element is: portion of _xml_character_data comes out blank! This sort of makes sense, because the callback functions are children of the xml_parser_create parent ... But should that make the children ignorant of the grandparent variables referred to by $this-varname? I hope this makes sense ... Has anyone else encountered this sort of problem? I'm an old hat at PHP, but am relatively new to both XML parsing and writing my own classes. Thanks, Clay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Button can't see form!
I use the following line in some of my php scripts to navigate between pages: td align=left width=40pxinput type='button' class='bginput' value='New' onClick=this.form.action='newproduct.php?mode=new'; this.form.submit()/td The problem I have is with a page I build dynamically. The whole page is encased in form/form tags. In between these tags there are sections echoed as a result of a databasse query. Each of these sections is a form. After all of the sections have been created, there is a button at the bottom of the page that is similar to that above. The button is outwith the form tags of the sections but within the form tags of the whole page i.e. form name=addproduct table !-- loop round result set creating a form for each row -- form name=detail dynamic content /form form dynamic content /form form dynamic content /form /table td align=left width=40pxinput type='button' class='bginput' value='New' onClick=this.form.action='newproduct.php?mode=new'; this.form.submit()/td /form Clicking on the button has no effect. On all my other pages this button behaves as it should. Why? This e-mail is intended for the recipient only and may contain confidential information. If you are not the intended recipient then you should reply to the sender and take no further ation based upon the content of the message. Internet e-mails are not necessarily secure and CCM Limited does not accept any responsibility for changes made to this message. Although checks have been made to ensure this message and any attchments are free from viruses the recipient should ensure that this is the case. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Moving a file with 'rename'?
Hi people, I want to move a file from one location to another. I expect I can only do this with 'rename', because there's no 'move'-command (at least nog in the manual). Following situation: original file: /var/www/html/webfotos/tmp/thumb_phpibmGBF.jpg with /var/www/html/webfotos being a symlink to /home/cvd/sanbox/webfotos new location: /var/www/html/foto/0/0/0/0/.thumb.jpg syntax: rename($old_location, $new_location); Error: Warning: Rename failed (Invalid cross-device link) in /home/cvd/sandbox/webfotos/admin/save.php on line 95 When I 'su' to 'apache' (the user under which the httpd is running), I can do the following without any error: mv /var/www/html/webfotos/tmp/thumb_phpibmGBF.jpg /var/www/html/foto/0/0/0/0/.thumb.jpg Any ideas on why I get the error and how I can solve it? Tia! -- Kind regards, Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Microsoft Access PHP
Hi, I'm gleaning microsoft SQL from queries within a MS Access database, for insertion into my PHP pages. This has been working fine but the example below just refuses to work, SELECT ExamPapers.EPaperID, ExamPapers.EPapersText, ExamPapers.[Title of Paper], ExamPapers.Course, ExamPapers.School, ExamPapers.Year, ExamPapers.[Jan/Summer], ExamPapers.[Module Code], ExamPapers.Stage, ExamPapers.[Storage Location], ExamPapers.[Add to Webpage] FROM ExamPapers WHERE (((ExamPapers.School)=Colour and Imaging Institute) AND ((ExamPapers.[Add to Webpage])=True)); I want to pull records from 1 table (ExamPapers). The WHERE line is causing problems i.e if I remove it, my php pages actually show. Can anyone see what I'm doing wrong? Thanks, Daniel Owen-McGee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Moving a file with 'rename'?
Hello Tim, Tim why don't you try shell_exec ? Thursday, July 4, 2002, 5:03:34 PM, you wrote: TS Hi people, TS I want to move a file from one location to another. I expect I can only do TS this with 'rename', because there's no 'move'-command (at least nog in the TS manual). Following situation: TS original file: /var/www/html/webfotos/tmp/thumb_phpibmGBF.jpg TS with /var/www/html/webfotos being a symlink to /home/cvd/sanbox/webfotos TS new location: /var/www/html/foto/0/0/0/0/.thumb.jpg TS syntax: rename($old_location, $new_location); TS Error: Warning: Rename failed (Invalid cross-device link) in TS /home/cvd/sandbox/webfotos/admin/save.php on line 95 TS When I 'su' to 'apache' (the user under which the httpd is running), I can TS do the following without any error: TS mv /var/www/html/webfotos/tmp/thumb_phpibmGBF.jpg TS /var/www/html/foto/0/0/0/0/.thumb.jpg TS Any ideas on why I get the error and how I can solve it? Tia! TS -- TS Kind regards, TS Tim -- Best regards, Latexmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Moving a file with 'rename'?
rename can move the file only on the same partition, it is realy just _rename_, not full _move_ Marek Tim Stoop wrote: Hi people, I want to move a file from one location to another. I expect I can only do this with 'rename', because there's no 'move'-command (at least nog in the manual). Following situation: original file: /var/www/html/webfotos/tmp/thumb_phpibmGBF.jpg with /var/www/html/webfotos being a symlink to /home/cvd/sanbox/webfotos new location: /var/www/html/foto/0/0/0/0/.thumb.jpg syntax: rename($old_location, $new_location); Error: Warning: Rename failed (Invalid cross-device link) in /home/cvd/sandbox/webfotos/admin/save.php on line 95 When I 'su' to 'apache' (the user under which the httpd is running), I can do the following without any error: mv /var/www/html/webfotos/tmp/thumb_phpibmGBF.jpg /var/www/html/foto/0/0/0/0/.thumb.jpg Any ideas on why I get the error and how I can solve it? Tia! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Microsoft Access PHP
Hello Daniel, Try to use a query line like below: WHERE (((ExamPapers.School)=\Colour and Imaging Institute\) AND ((ExamPapers.[Add to Webpage])=True)); And let us know it it will work Thursday, July 4, 2002, 5:21:50 PM, you wrote: DJOM Hi, DJOM I'm gleaning microsoft SQL from queries within a MS Access database, for insertion into my PHP pages. This has been working fine but the example below just refuses to work, DJOM SELECT ExamPapers.EPaperID, ExamPapers.EPapersText, ExamPapers.[Title of Paper], ExamPapers.Course, ExamPapers.School, ExamPapers.Year, ExamPapers.[Jan/Summer], ExamPapers.[Module Code], DJOM ExamPapers.Stage, ExamPapers.[Storage Location], ExamPapers.[Add to Webpage] DJOM FROM ExamPapers DJOM WHERE (((ExamPapers.School)=Colour and Imaging Institute) AND ((ExamPapers.[Add to Webpage])=True)); DJOM I want to pull records from 1 table (ExamPapers). DJOM The WHERE line is causing problems i.e if I remove it, my php pages actually show. Can anyone see what I'm doing wrong? DJOM Thanks, DJOM Daniel Owen-McGee -- Best regards, Latexmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Other than substr
Thanks for all the responses. C. -Original Message- From: César Aracena [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 03, 2002 1:36 PM To: PHP General List Subject: [PHP] Other than substr Hi all. I need to show up some data from a DB which consist of phone numbers with area code. Theyre stored like () . What is the best approach to print them into some textboxes so they can be edited? Im using substr but area codes (inside parenthesis) goes from 3 to 5 numbers, so sometimes the closing parenthesis is showed and other times even the first number from the actual number is also showed. Can I use regex instead? How is it used? I tried to figure it out in the PHP manual, but it is NOT written in my level of English. Thanks in advance, mailto:[EMAIL PROTECTED] Cesar Aracena CE / MCSE+I Neuquen, Argentina +54.299.6356688 +54.299.4466621 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to trigger particular java script function?
Hi friend, I want to trigger one java script function ( time delay) every time. How can I achieve this? Here my questuion is: I want to play all song files from my database. Here what I do is initially I display one button PLAY and then call java script delay function and it has to come back to php script and play next one again trigger to timedelay function etc... Any inputs highly appreciable. Thanks in advance Balaji html head script language=javascript !-- function delay(timep) { setTimeout( ,timep); } // -- /script /head body ?php $i=0; while($i3) { //otherwise Just I want to print $i with some time delays //by calling javascript:delay(2000) } ? /body /html == Thanks in advance Balaji **Disclaimer Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] User generated Web pages?
I'm trying to develop a software package for end users with no knowledge of PHP. The package would allow these users to generate Web pages displaying a custom questionnaire to be used by consumers to answer questions online. I thought of writing a PHP script that asks the end users the type of questions to be displayed, the questions themselves to be displayed, and, if required, the responses to be displayed. This information would be stored in a MySQL database. I then would write another PHP script that would dynamically generate the questionnaire based on the information stored in the MySQL database. The types of questions include text fields, radio buttons, check boxes, menu selections, and text areas. Is this the right approach or is there another way? Thanks! Anthony Rodriguez ([EMAIL PROTECTED]) to be -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mySQL and phpMyAdmin
You need to install php-mysql* too. Jadiel Flores wrote: Hi, I installed php and mysql today and I'm trying to use phpMyAdmin but I'm receiving the error message: cannot load MySQL extension, please check PHP Configuration. I checked the php.ini and couldn't find anything related, my configure command says '--with-mysql=shared,/usr' and I have no idea why it's not working. I'm using redhat 7.3, Apache 1.3.23, php 4.1.2 and MySQL 3.23.51 Any idea or similar problem?? Thanks. Jadiel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] User generated Web pages?
It's the right approach, but since you're dealing with large amounts of user-contributed (untrusted, dangerous, suspicious, whatever) data both to create the forms AND to gather information from form submissions, I'd be very wary about security. Infact, I wouldn't recommend it for a first project unless you've got some form of programming experience in a simular web language. Good luck! Justin French on 04/07/02 10:51 PM, Anthony Rodriguez ([EMAIL PROTECTED]) wrote: I'm trying to develop a software package for end users with no knowledge of PHP. The package would allow these users to generate Web pages displaying a custom questionnaire to be used by consumers to answer questions online. I thought of writing a PHP script that asks the end users the type of questions to be displayed, the questions themselves to be displayed, and, if required, the responses to be displayed. This information would be stored in a MySQL database. I then would write another PHP script that would dynamically generate the questionnaire based on the information stored in the MySQL database. The types of questions include text fields, radio buttons, check boxes, menu selections, and text areas. Is this the right approach or is there another way? Thanks! Anthony Rodriguez ([EMAIL PROTECTED]) to be -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] eregi problems
I've got a form that's posted to a php page where I'm attempting to validate a field contains a valid email address. The eregi below seems to be totally ignored... if (eregi(^[a-z0-9\._-]+@[a-z0-9\._-]+$, $emp_email)) { echo centerplease enter a valid email address/center; exit; } $emp_email is being posted to the form. Any ideas why this is being ignored? dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] extension problem
Hi all I am working with php on linux. I want to create dynamic library and use it in php. For example: I have to built this #include iostream.h char* aa(){ return true; } I succeed to compile this into a dynamic library x.so. When I try to call this from php I get Cannot load x.so. may be not a php library. Can you help me please. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail atashments
HI, How to send atashments with mail() function? I have a form to mail page, and i want to atash and transmit files tx
Re: [PHP] Using fsockopen
Take a look at this class. I think thats what you want ! Help I'm a newbie to indepth PHP. I want to issue an fsockopen command to pass a POST data set to a remote server script. I understand the pricipals behind fsockopen, but I cannot figure out the string I need to pass to POST the data - I will be emulating the output from a Form element. In addition, how do I detect a successful operation? before closing the socket?. Any help greatfully received. thks Richard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Moving a file with 'rename'?
Marek Kilimajer wrote: rename can move the file only on the same partition, it is realy just _rename_, not full _move_ So there is no full-features move in PHP? -- Kind regards, Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Moving a file with 'rename'?
Latex Master wrote: Hello Tim, Tim why don't you try shell_exec ? As a last resort, I might, but I'd rather do it in PHP... Code-portability, y'know :) -- Kind regards, Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] eregi problems
Dan, I'll give you a little piece of advise that was given to me a little while back on this list: Go to http://www.killersoft.com/ and grab a copy of the validateEmailFormat program. QUOTE PHP4 translation of Jeffrey E.F. Friedl's definitive Email Regex Program from O'Reilly's Mastering Regular Expressions. This function is used to confirm if an e-mail address adheres to the RFC 822 specification for internet email addresses. /QUOTE Rather than trying re-invent the wheel, why not use something that conforms closely to specs, and is widely accepted by many development groups. All you'll have to do is something like (function names and filenames may not be right): ? include('inc/validEmailFormat.inc'); if(!validEmailFormat($emp_email)) { echo centerplease enter a valid email address/center; } ? Side topic: of course, you aren't checking for a valid email address at all, your checking to see if the email address LOOKS valid. You're not checking to see if the address is attached to an email box, or furthermore if there's anyone at the other end to open/read your email... you're just validating the appearance of the address to fall within RFC 822 specs. Subsequently [EMAIL PROTECTED] and [EMAIL PROTECTED] will both return valid. The only way to ensure an email address is truely valid is to send an email to it, and have them respond... indicating that the address is linked to an email box and furthermore, someone opened the email, read it, and responded. Even then, this could be done by a robot I guess. Justin French Creative Director http://Indent.com.au on 05/07/02 12:23 AM, dan radom ([EMAIL PROTECTED]) wrote: I've got a form that's posted to a php page where I'm attempting to validate a field contains a valid email address. The eregi below seems to be totally ignored... if (eregi(^[a-z0-9\._-]+@[a-z0-9\._-]+$, $emp_email)) { echo centerplease enter a valid email address/center; exit; } $emp_email is being posted to the form. Any ideas why this is being ignored? dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Broken Cookies
Hiyas :) I'm having a problem with the code copied below not creating the cookies that it should do; setcookie(loggedInUID,$_POST['uname'],ms_cookie_time((time()+120)),'/', $cookie_base); setcookie($_POST['site_id'],$_POST['ucaps'],ms_cookie_time((time()+120)),'/' , $cookie_base); Basically those two lines are part of a file on server X that's called by a file on server Y by a command similar to: header(Location: http://ServerX/connect.php?uname=usernamesite_id=siteiducaps=ucaps;); I'm at a complete loss as to why it's not creating the cookies properly. Any suggestions? Rob! x ;o)
Re: [PHP] eregi problems
My main cnocern at this point is that the eregi is being totally ignored. I just want to make sure the email address is in a valid format, not that it is a valid email address. I'll look at validEmailFormat as well, but I don't understand why it's not even being examined. dan * Justin French ([EMAIL PROTECTED]) wrote: Dan, I'll give you a little piece of advise that was given to me a little while back on this list: Go to http://www.killersoft.com/ and grab a copy of the validateEmailFormat program. QUOTE PHP4 translation of Jeffrey E.F. Friedl's definitive Email Regex Program from O'Reilly's Mastering Regular Expressions. This function is used to confirm if an e-mail address adheres to the RFC 822 specification for internet email addresses. /QUOTE Rather than trying re-invent the wheel, why not use something that conforms closely to specs, and is widely accepted by many development groups. All you'll have to do is something like (function names and filenames may not be right): ? include('inc/validEmailFormat.inc'); if(!validEmailFormat($emp_email)) { echo centerplease enter a valid email address/center; } ? Side topic: of course, you aren't checking for a valid email address at all, your checking to see if the email address LOOKS valid. You're not checking to see if the address is attached to an email box, or furthermore if there's anyone at the other end to open/read your email... you're just validating the appearance of the address to fall within RFC 822 specs. Subsequently [EMAIL PROTECTED] and [EMAIL PROTECTED] will both return valid. The only way to ensure an email address is truely valid is to send an email to it, and have them respond... indicating that the address is linked to an email box and furthermore, someone opened the email, read it, and responded. Even then, this could be done by a robot I guess. Justin French Creative Director http://Indent.com.au on 05/07/02 12:23 AM, dan radom ([EMAIL PROTECTED]) wrote: I've got a form that's posted to a php page where I'm attempting to validate a field contains a valid email address. The eregi below seems to be totally ignored... if (eregi(^[a-z0-9\._-]+@[a-z0-9\._-]+$, $emp_email)) { echo centerplease enter a valid email address/center; exit; } $emp_email is being posted to the form. Any ideas why this is being ignored? dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Does Location: headers constantly
On Thu, Jul 04, 2002 at 11:01:50AM +0100, Ford, Mike [LSS] wrote: I can't let this go unchallenged -- what happens if you're sending this to a browser which *doesn't* honour the Location: header, but *is* capable of displaying any attached page content? The poor user will be left with a completely blank screen, and no hint of why. In fact, the HTTP/1.1 spec But, which browser is incapable of handling location headers? (RFC 2616: http://www.w3.org/Protocols/rfc2616/rfc2616.html) even says: Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s). Oddly, I don't find that text you excerpted on the URI you provided. But, the thing is, I'm under the impression that PHP (and/or Apache?) doesn't send anything else from your script once a Location header is sent. I just confirmed this with two different tests. --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] extension problem
You probably shoul start here: http://www.php.net/manual/en/zend.php /Joakim -Original Message- From: adelpfephp [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 04, 2002 4:34 PM To: php-france; [EMAIL PROTECTED] Subject: [PHP] extension problem -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sort with PHP or SQL?
Patrick: Grouping and sorting is something databases specialize in. --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Microsoft Access PHP - Solved
Hi All, My query (below) has been solved. Thanks to all who responded so quickly! Putting single quote marks around 'Colour and Imaging Institute' did the trick. DAniel Hi, I'm gleaning microsoft SQL from queries within a MS Access database, for insertion into my PHP pages. This has been working fine but the example below just refuses to work, SELECT ExamPapers.EPaperID, ExamPapers.EPapersText, ExamPapers.[Title of Paper], ExamPapers.Course, ExamPapers.School, ExamPapers.Year, ExamPapers.[Jan/Summer], ExamPapers.[Module Code], ExamPapers.Stage, ExamPapers.[Storage Location], ExamPapers.[Add to Webpage] FROM ExamPapers WHERE (((ExamPapers.School)=Colour and Imaging Institute) AND ((ExamPapers.[Add to Webpage])=True)); I want to pull records from 1 table (ExamPapers). The WHERE line is causing problems i.e if I remove it, my php pages actually show. Can anyone see what I'm doing wrong? Thanks, Daniel Owen-McGee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySql_Error();
On Thu, Jul 04, 2002 at 08:48:26AM -0300, Skyhawk wrote: Please, How do I make to get all errors of MySql ? I'm making a function for translate all errors. Example: Uh, why? PHP's mysql_error() does the job for you. http://www.php.net/manual/en/function.mysql-error.php If you're hell bent on your project, I don't know of a particular location to find a list of all MySQL errors. First try a _well_ _defined_ search on Google. Second, do a search on http://groups.google.com/groups?hl=enlr=ie=UTF-8group=mailing.database As a LAST RESORT, ask the MySQL mailing list. --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Button can't see form!
On Thu, Jul 04, 2002 at 01:44:00PM +0100, Mark Colvin wrote: I use the following line in some of my php scripts to navigate between pages: td align=left width=40pxinput type='button' class='bginput' value='New' onClick=this.form.action='newproduct.php?mode=new'; this.form.submit()/td And then folks with Java'sCrap turned off won't use your site. Why people go to such lengths to destroy the elegance of HTML I just don't know... --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Paradox Tables with PHP (Still the Same old Question)...
Hallo Folks I have come across this problem many times... But still haven't seen anyone give a reasonably coherent solution... I am trying to get my script to read Paradox Tables... Its a no go so far... I do believe that this can be achieved via. odbc... I have tried the configurations but have fallen short each time... I keep getting the following Error: Warning: SQL error: [Microsoft][ODBC Paradox Driver] The Microsoft Jet database engine could not find the object 'Test.db'. Make sure the object exists and that you spell its name and the path name correctly., There has to be someone in this Forum who has successfully worked with Paradox Tables in conjunction with php... Do I have to download another version of ODBC... My Scripts have no issues reading MSAccess tables the problem is when it gets to Paradox... Please Help... Spike... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem uploading an image
Greetings. I have two pages where I upload images to a database. The first one is a capture, where I insert a record to the database, and the second is to edit the data. The problem: When I go to insert, the following code works flawlessly: ? if ($cmdOk == Save) { if (isset($imagen) $imagen != none) $data = addslashes(fread(fopen($image, r), filesize($image))); else $data = ; ? But, if I do in another page (the same darn snippet), it goes: Warning: fopen(C:\WINNT\Web\wuicon1.gif, r) - No such file or directory in /web/domain/adconsolutions/htdocs/conexionescolar/frmnoticiasedi.php on line 18 Warning: stat failed for C:\WINNT\Web\wuicon1.gif (errno=2 - No such file or directory) in /web/domain/adconsolutions/htdocs/conexionescolar/frmnoticiasedi.php on line 18 Warning: fread(): supplied argument is not a valid File-Handle resource in /web/domain/adconsolutions/htdocs/conexionescolar/frmnoticiasedi.php on line 18 Anybody knows why? It's the same vars, the same text boxes, etc. The only thing that changes comes after that condition... TIA. -- Un gran saludo/Big regards... Arturo Barajas Sistemas PPG SJR +52 (427) 271-9100, ext. 448 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] eregi problems
If the regexp matches, it is a valid email, so you need ! in front of it. dan radom wrote: I've got a form that's posted to a php page where I'm attempting to validate a field contains a valid email address. The eregi below seems to be totally ignored... if (eregi(^[a-z0-9\._-]+@[a-z0-9\._-]+$, $emp_email)) { echo centerplease enter a valid email address/center; exit; } $emp_email is being posted to the form. Any ideas why this is being ignored? dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Moving a file with 'rename'?
None that I know of. You need to use copy unlink Tim Stoop wrote: Marek Kilimajer wrote: rename can move the file only on the same partition, it is realy just _rename_, not full _move_ So there is no full-features move in PHP? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Button can't see form!
I dont think forms can be nested. In fact I'm pretty sure. Mark Colvin wrote: I use the following line in some of my php scripts to navigate between pages: td align=left width=40pxinput type='button' class='bginput' value='New' onClick=this.form.action='newproduct.php?mode=new'; this.form.submit()/td The problem I have is with a page I build dynamically. The whole page is encased in form/form tags. In between these tags there are sections echoed as a result of a databasse query. Each of these sections is a form. After all of the sections have been created, there is a button at the bottom of the page that is similar to that above. The button is outwith the form tags of the sections but within the form tags of the whole page i.e. form name=addproduct table !-- loop round result set creating a form for each row -- form name=detail dynamic content /form form dynamic content /form form dynamic content /form /table td align=left width=40pxinput type='button' class='bginput' value='New' onClick=this.form.action='newproduct.php?mode=new'; this.form.submit()/td /form Clicking on the button has no effect. On all my other pages this button behaves as it should. Why? This e-mail is intended for the recipient only and may contain confidential information. If you are not the intended recipient then you should reply to the sender and take no further ation based upon the content of the message. Internet e-mails are not necessarily secure and CCM Limited does not accept any responsibility for changes made to this message. Although checks have been made to ensure this message and any attchments are free from viruses the recipient should ensure that this is the case. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Exim sendmail faults
Are you able to do an nslookup of these domains from the server? Those, of course, were just example email addresses (I'd replaced them before sending out this email so it would be more clear). If I use a real email address I get the same error unrouteable mail domain I am able to nslookup the addresses before hand so I don't understand why the mail delivery is not working... thx, Liam -Original Message- From: Liam Gibbs [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 03, 2002 12:58 PM To: [EMAIL PROTECTED] Subject: [PHP] Exim sendmail faults I apologize; this may be more a question for the people in php-install. But I'm having some problems with my mail stuff in PHP. I have Exim version 3.12 installed, but I'm not getting any mails sent out by PHP. I *do* get this error mail, however: This is automatically emailed back to me: This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more of its recipients. The following address(es) failed: [EMAIL PROTECTED]: unrouteable mail domain theemailaddress.com This is in the error log files: 2002-07-02 03:26:13 17PI3B-0003sM-00 = [EMAIL PROTECTED] U=root P=local S=2 95 2002-07-02 03:26:13 17PI3B-0003sM-00 ** [EMAIL PROTECTED]: unrouteable mail d omain anotheremailaddress.com 2002-07-02 03:26:13 17PI3B-0003sO-00 = R=17PI3B-0003sM-00 U=mail P=local S=1 063 2002-07-02 03:26:13 17PI3B-0003sM-00 Error message sent to [EMAIL PROTECTED] 2002-07-02 03:26:13 17PI3B-0003sM-00 Completed 2002-07-02 03:26:13 17PI3B-0003sO-00 = root [EMAIL PROTECTED] D=localuser T=local_delivery 2002-07-02 03:26:13 17PI3B-0003sO-00 Completed Any thoughts? I know all these e-mail addresses and ip addresses are valid (they're either mine or of acquaintances), but the server seems to fight me on this one. __ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Button can't see form!
Folks: On Thu, Jul 04, 2002 at 11:05:38AM -0400, Analysis Solutions wrote: On Thu, Jul 04, 2002 at 01:44:00PM +0100, Mark Colvin wrote: td align=left width=40pxinput type='button' class='bginput' value='New' onClick=this.form.action='newproduct.php?mode=new'; this.form.submit()/td And then folks with Java'sCrap turned off won't use your site. Why people go to such lengths to destroy the elegance of HTML I just don't know... Mark asked me off list how to write that in HTML... td align=left width=40px form action=newproduct.php method=GET input type=submit class=bginput name=mode value=New / /form /td --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Exim sendmail faults
On Thursday 04 July 2002 23:47, Liam Gibbs wrote: Are you able to do an nslookup of these domains from the server? Those, of course, were just example email addresses (I'd replaced them before sending out this email so it would be more clear). If I use a real email address I get the same error unrouteable mail domain I am able to nslookup the addresses before hand so I don't understand why the mail delivery is not working... Generally, with email problems it is best to show the actual domains, makes troubleshooting easier. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Just because you like my stuff doesn't mean I owe you anything. -- Bob Dylan */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] resizing images comming out of blobs
From: andy [mailto:[EMAIL PROTECTED]] Hi there, Hey, Andy. I am wondering how to resize an image which is stored in a mysql blob field. With files this workes just fine, but how to do this with the image comming from blob? Has anybody done this already? Incidentally, I've done this just yesterday. First download the image, write it to the directory and then proceed as you will. It uses ImageMagick, 'cause my ISP still doesn't install GD 2.x. Here it goes (I use the ADODB library using MySQL), and in fact, if someone can optimize it, it would be welcome :^) $rsColegio = $conn-Execute(SELECT * FROM ConEsc_Colegio WHERE Colegio_Id=' . $rs-Fields(Colegio_Id) . ') or die(Algo paso en los colegios...); if (stristr($rsColegio-Fields(Colegio_Imagen_Tipo), gif) != ) $fileext = .gif; elseif (stristr($rsColegio-Fields(Colegio_Imagen_Tipo), jpeg) != ) $fileext = .jpg; elseif (stristr($rsColegio-Fields(Colegio_Imagen_Tipo), jpg) != ) $fileext = .jpg; else $fileext = ; if ($fileext != ) { $image_tmpfilename = images/tmp_ . $rsColegio-Fields(Colegio_Id) . $fileext; $image_filename = images/ . $rsColegio-Fields(Colegio_Id) . $fileext; $file = fopen($image_tmpfilename, w) or die(No fue posible abrir el archivo); if (!$file) echo tdNo se pudo abrir el archivo./td\n; else { fputs($file, $rsColegio-Fields(Colegio_Imagen)); fclose($file); } $aSize = getimagesize($image_tmpfilename); $iWidth = $aSize[0]; $iHeight = $aSize[1]; if (($iWidth = 120) || ($iHeight = 85)) { if ($iWidth $iHeight) $fPercent = $iWidth / 120; else $fPercent = $iHeight / 85; $newWidth = $iWidth / $fPercent; $newHeight = $iHeight / $fPercent; system(convert -antialias -sample . $newWidth . x . $newHeight . $image_tmpfilename $image_filename); } else copy($image_tmpfilename, $image_filename); unlink($image_tmpfilename); } else $image_filename = images/sinlogo.jpg; Hope that helps. -- Un gran saludo/Big regards... Arturo Barajas Sistemas PPG SJR +52 (427) 271-9100, ext. 448 -Original Message- Sent: Jueves, 04 de Julio de 2002 11:25 a.m. To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP] resizing images comming out of blobs Thank you for any help on that, andy -- 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] Exim sendmail faults
Jason Wong wrote: On Thursday 04 July 2002 23:47, Liam Gibbs wrote: Are you able to do an nslookup of these domains from the server? Those, of course, were just example email addresses (I'd replaced them before sending out this email so it would be more clear). If I use a real email address I get the same error unrouteable mail domain I am able to nslookup the addresses before hand so I don't understand why the mail delivery is not working... Generally, with email problems it is best to show the actual domains, makes troubleshooting easier. Ok, fair enough. Here are the full errors I get when I try to mail [EMAIL PROTECTED] (BTW, I'm doing it as root but I get the same errors no matter who I'm logged in as or if I do it through PHP): Returned email: From MAILER-DAEMON Thu Jul 04 06:57:34 2002 Envelope-to: [EMAIL PROTECTED] X-Failed-Recipients: [EMAIL PROTECTED] From: Mail Delivery System [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Mail delivery failed: returning message to sender Date: Thu, 04 Jul 2002 06:57:34 -0400 This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more of its recipients. The following address(es) failed: [EMAIL PROTECTED]: unrouteable mail domain sympatico.ca -- This is a copy of the message, including all the headers. -- Return-path: [EMAIL PROTECTED] Received: from root by www with local (Exim 3.12 #1 (Debian)) id 17Q4Io-0004Fx-00 for [EMAIL PROTECTED]; Thu, 04 Jul 2002 06:57:34 -0400 To: [EMAIL PROTECTED] Subject: test Message-Id: E17Q4Io-0004Fx-00@www From: root [EMAIL PROTECTED] Date: Thu, 04 Jul 2002 06:57:34 -0400 this is a test Exim log: 2002-07-04 06:57:34 17Q4Io-0004Fx-00 = [EMAIL PROTECTED] U=root P=local S=3 08 2002-07-04 06:57:34 17Q4Io-0004Fx-00 ** [EMAIL PROTECTED]: unrouteable mail d omain sympatico.ca 2002-07-04 06:57:34 17Q4Io-0004Fz-00 = R=17Q4Io-0004Fx-00 U=mail P=local S=1 076 2002-07-04 06:57:34 17Q4Io-0004Fx-00 Error message sent to [EMAIL PROTECTED] 2002-07-04 06:57:34 17Q4Io-0004Fx-00 Completed 2002-07-04 06:57:35 17Q4Io-0004Fz-00 = root [EMAIL PROTECTED] D=localuser T=local_delivery 2002-07-04 06:57:35 17Q4Io-0004Fz-00 Completed nslookup attempt: www:~# nslookup sympatico.ca Server: localhost Address: 127.0.0.1 Non-authoritative answer: Name:sympatico.ca Address: 206.47.72.104 www:~# -- Blessed are they who can laugh at themselves for they shall never cease to be amused. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] returning first paragraph from a string
I'm having difficulty returning the first paragraph of a string called $summary. (Usually this string will only be one paragraph, but it might contain more than one paragraph. Current data has one occurrence of a two-paragraph $summary.) Here's how I process when I want multiple paragraph display. This successfully generates the necessary HTML: $summary = trim($summary); $summary = ereg_replace(\r, , $summary); $summary = ereg_replace(\n\n, /pp, $summary); $summary = ereg_replace(\n, br/, $summary); Here's what I thought would work to give me the first paragraph only: $summary = trim($summary); $summary = ereg_replace(\r, , $summary); $summary = preg_replace(/^(.*)\n/, \1, $summary); But for occurrences of $summary with two paragraphs, the above returns the second paragraph (without the first). The only way I can return the first paragraph for a two paragraph $summary is with: $summary = trim($summary); $summary = ereg_replace(\r, , $summary); $summary = preg_replace(/(.*)$/, \1, $summary); This gives me the first paragraph as desired (although I don't understand why!), but returns nothing for occurrences of $summary having only one paragraph. I also tried this: $summary = trim($summary); $summary = ereg_replace(\r, , $summary); $summary = ereg_replace(\n\n, /pp, $summary); $summary = preg_replace(#(.*)/pp#, \1, $summary); This also returns only the second paragraph. Can anyone point out what I'm doing wrong, or suggest another approach? TIA -- Lowell Allen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] AdRotator for PHP?
I'm wondering if anyone has found or ended up writing something similar to the MSWC AdRotator object in ASP, but for PHP? Or is there already a module on apache.org that I missed? (Figre I should pull my weight on this list here.) Hmm. Not sure exactly what MSWC AdRotator is, but here's one I developed. Is it what you want? It checks a specific directory and grabs a random file from that directory, then displays it. if($file = GetRandomPicture($BannerAdsDirectory)) { $seriescode = substr($file, 0, 2); print( A HREF = \URL.html\IMG SRC = \$BannerDirectory/$file\ WIDTH = \$banneradswidth\ HEIGHT = \$banneradsheight\ BORDER = \0\/A\n); } function GetRandomPicture($sourcedirectory) { if($directory = opendir($sourcedirectory)) { while($file = readdir($directory)) { if(($file != .) ($file != ..)) $files[count($files)] = $file; } $randomfile = rand(0, count($files) - 1); $returnvalue = $files[$randomfile]; } else { $returnvalue = NULL; } return $returnvalue; } If anyone can improve on it, let me know. Thanks to the two guys who posted the links, though. I'll be sure to check them out once I get a couple of minutes of free time. Liam __ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Annoying syntax problem with RTRIM
echo rtrim($feat,, ); On my local Apache-OSX web server (PHP 4.1.2), this command works fine. (The reason I use it is that sometimes $feat contains a comma and a space at the end of the string, which I want to remove (if it's there) before echoing.) When this same script is run on my ISP (PHP 4.0.6), I get the following error message: bWarning/b: Wrong parameter count for rtrim() in b/u/htdocs/smarts/jupiter/callisto/include/create.inc/b on line b216/bbr Any ideas why? Thanks. ...Rene --- René Fournier, [EMAIL PROTECTED] Toll-free +1.888.886.2754 Tel +1.403.291.3601 Fax +1.403.250.5228 www.smartslitters.com SmartSlitters International #33, 1339 - 40th Ave NE Calgary AB T2E 8N6 Canada -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Annoying syntax problem with RTRIM
On Friday 05 July 2002 00:41, René Fournier wrote: echo rtrim($feat,, ); On my local Apache-OSX web server (PHP 4.1.2), this command works fine. (The reason I use it is that sometimes $feat contains a comma and a space at the end of the string, which I want to remove (if it's there) before echoing.) When this same script is run on my ISP (PHP 4.0.6), I get the following error message: bWarning/b: Wrong parameter count for rtrim() in b/u/htdocs/smarts/jupiter/callisto/include/create.inc/b on line b216/bbr Any ideas why? RTFM! -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* The heart is wiser than the intellect. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php