Re: [PHP] ftp_nlist()
Hi, --- Jason Wong [EMAIL PROTECTED] wrote: Not sure why you would want to chdir first. Why not just: ftp_chdir is usefull on windows specially if directory name has a space in it. zareef ahmed = Zareef Ahmed :: A PHP Developer in Delhi ( India ). Homepage :: http://www.zasaifi.com/zareef_ahmed.php __ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help With PEAR::DB Connection
Jim, Thank you. Problem solved thanks to you. The moment you said that PEAR::DB is not finding the MySQL extention I realized that the extension in php.ini hasn't been commented out and the extension folder had not been recognized by PHP. I forgot we had to do that in PHP5. Everything is working like a charm now. I really appreciate your time and concern. Nilaab P.S. -- And sorry, I'm using Windows XP as the development environment and Linux as the server. The Windows OS is where I was having the problem. Thanks again... -Original Message- From: James Kaufman [mailto:[EMAIL PROTECTED] Sent: Saturday, September 11, 2004 7:50 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Help With PEAR::DB Connection On Sat, Sep 11, 2004 at 01:48:43AM -0500, [EMAIL PROTECTED] wrote: Hello everyone, I have a problem connecting to the Database. When I execute the code at the bottom, it gives me this message: DB Error: extension not found. It sees the DB file and the parameters are correct. I checked the include path and it was correct. Did I do something wrong? Any help would be greatly appreciated. Thank you. require_once 'DB.php'; $user = 'foo'; $pass = 'bar'; $host = 'localhost'; $db_name = 'clients_db'; $dsn = mysql://$user:[EMAIL PROTECTED]/$db_name; $db = DB::connect($dsn); if (DB::isError($db)) { die ($db-getMessage()); } -- Nilaab The message 'extension not found' means that PEAR couldn't find the mysql db extension. Hmm. In cases like this, create a phpinfo.php file as documented on this list and see what shows up. Or, you can type at the command prompt: php -i, then look for the MySQL extension in the output. Also, you neglected to tell us what OS you are running, etc. -- Jim Kaufman Linux Evangelist public key 0x6D802619 --- A dog teaches a boy fidelity, perseverance, and to turn around three times before lying down. -- Robert Benchley -- 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] gtk is working in php 5 ?
HI , --- Nicolae Serban [EMAIL PROTECTED] wrote: i'm new with php 5 and i whant to know if gtk it is still working with php 5 !! Thank you ! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php visit http://gtk.php.net ;) zareef ahmed = Zareef Ahmed :: A PHP Developer in Delhi ( India ). Homepage :: http://www.zasaifi.com/zareef_ahmed.php ___ Do you Yahoo!? Shop for Back-to-School deals on Yahoo! Shopping. http://shopping.yahoo.com/backtoschool -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Evaluating form posts
HI, A good article about magic quotes http://www.webmasterstop.com/tutorials/magic-quotes.shtml zareef ahmed --- Alexander Kleshchevnikov [EMAIL PROTECTED] wrote: You should chech for configuration of magic quotes gpc. Use get_magic_quotes_gpc() function: $foo = get_magic_quotes_gpc() ? stripslashes($_POST[foo]) : $_POST[foo]) ; Do it with all GET and POST variables. -- Alexander. Php Mailing List Account [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello everyone, I had an apache server running with php 5. Now I installed unix on that pc and apache and php 5. I am using some forms on web pages and get their values by writing $foo = $_POST[foo]; Since I 'upgraded' to unix i am getting a double backslash for each backslash entered on the form and '\' for every ''. Could someone please tell me what's going on? Did I miss a part of the FAQ? (The form looks like form method=post input type=text / input type=submit name=action value=submit / /form ) Thank you in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = Zareef Ahmed :: A PHP Developer in Delhi ( India ). Homepage :: http://www.zasaifi.com/zareef_ahmed.php __ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MS Outlook 2003 Mail listing
Check out the manual on the date function. It allows you to get names from dates. The PEAR date stuff will allow you to do date math. -Original Message- From: Rajesh [mailto:[EMAIL PROTECTED] Sent: Sunday, September 12, 2004 10:04 PM To: [EMAIL PROTECTED] Subject: [PHP] MS Outlook 2003 Mail listing Hai all i just saw MS Outlook 2003 in this applicatioin the mail are sorted in date and given names like Today Yesterday Last Week Two Weeks Ago ... Can anybody give me algorithm to get date in this string version . Thank you, Rajesh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: how to redirect ?
--- Paul Waring [EMAIL PROTECTED] wrote: I think you used header() after put out some data or php installed on server as CGI. Because send header possible only if php installed as apache module. Not so - I've used header('Location: http://www.xyz.com/'); with PHP as a CGI binary under both Apache 1 and Apahce 2 without problems. Yeah, I think he might have been thinking of this: Note: In PHP 3, this only works when PHP is compiled as an Apache module. You can achieve the same effect using the Status header. Aside from only being an issue a long time ago, it's also talking about the ability to change the response status code, not just a regular HTTP header. Chris = Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming December 2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Evaluating form posts
--- Alexander Kleshchevnikov [EMAIL PROTECTED] wrote: You should chech for configuration of magic quotes gpc. Use get_magic_quotes_gpc() function: $foo = get_magic_quotes_gpc() ? stripslashes($_POST[foo]) : $_POST[foo]); I agree. However, stripslashes() doesn't necessarily undo addslashes(). If you want to know why or see more discussion on that, search the PHP internals archive. I think it was within the last 3 months or so that this was discussed. The best option is to turn that stuff off, but if you can't, I bet the fix_magic_quotes() function will be helpful. It can be found here: http://education.nyphp.org/phundamentals/PH_storingretrieving.php That page also describes why it's best to not use magic_quotes. Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming December 2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Evaluating form posts
--- zareef ahmed [EMAIL PROTECTED] wrote: A good article about magic quotes http://www.webmasterstop.com/tutorials/magic-quotes.shtml That's a nice article, and boy is Harry funny: Magic Quotes are Evil! While you sleep, they whisper in your dreams - \'Use magic quotes. You know you want to. Go on. It\\'s just so easy\\\'. Brilliant. :-) Chris = Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming December 2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] group queries result
Hi all, I've to extract data from a mysql db using two different queries and I must have an unique output sorting them alphabetically. For istance, query1: select * from ads where guest='PK'; count the number of results, make the difference between a given number and the number of results (variable $num). query2: select from ads where guest='PK' limit $num; now I have to export all results together sorting them. How can I do that? Can anyone help me? Thanks in advance Barbara -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] group queries result
Hi all, I've to extract data from a mysql db using two different queries and I must have an unique output sorting them alphabetically. For istance, query1: select * from ads where guest='PK'; count the number of results, make the difference between a given number and the number of results (variable $num). query2: select from ads where guest='PK' limit $num; now I have to export all results together sorting them. How can I do that? Can anyone help me? Thanks in advance Barbara -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] group queries result
Hi all, I've to extract data from a mysql db using two different queries and I must have an unique output sorting them alphabetically. For istance, query1: select * from ads where guest='PK'; count the number of results, make the difference between a given number and the number of results (variable $num). query2: select from ads where guest='PK' limit $num; now I have to export all results together sorting them. How can I do that? Can anyone help me? Thanks in advance Barbara -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] group queries result
Hi all, I've to extract data from a mysql db using two different queries and I must have an unique output sorting them alphabetically. For istance, query1: select * from ads where guest='PK'; count the number of results, make the difference between a given number and the number of results (variable $num). query2: select from ads where guest='PK' limit $num; now I have to export all results together sorting them. How can I do that? Can anyone help me? Thanks in advance Barbara -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] group queries result
Barbara Picci wrote: I've to extract data from a mysql db using two different queries and I must have an unique output sorting them alphabetically. For istance, query1: select * from ads where guest='PK'; count the number of results, make the difference between a given number and the number of results (variable $num). query2: select from ads where guest='PK' limit $num; now I have to export all results together sorting them. Why not do SELECT FROM `ads` WHERE `guest`='PK' ORDER BY `sortfield` ASC LIMIT $num ? That would get you a sorted list. I don't understand why you are using $num, other than pagination. You also didn't mention how this is related to PHP, it seems to be a SQL issue. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg_replace question
Zoran Lorkovic wrote: Btw, where I can find patterns that are valid? (something like (\w+), (\d+)+i etc. http://www.php.net/manual/en/reference.pcre.pattern.syntax.php http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Delete Line from File?
Whats the easiest/best way to do that with php? just replace the line with ''? -- Nick W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Delete Line from File?
Hi, some function with whihc you can do this file(); foreach(); zareef ahmed --- Nick Wilson [EMAIL PROTECTED] wrote: Whats the easiest/best way to do that with php? just replace the line with ''? -- Nick W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = Zareef Ahmed :: A PHP Developer in Delhi ( India ). Homepage :: http://www.zasaifi.com/zareef_ahmed.php __ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] use xml_set_character_data_handler outside of scope
I've tried a couple of different ways to use this function to set a variable outside of the usual scope of my characterData function but I'm not having much luck. Heres some sample code: ?php $xml_repository = /var/www/html/mets/sample/; $depth = array(); $searchable_tags = array(MODS:TITLE); $current_data = ; $dir_array = array(); $hits = 0; $MAXHITS = 100; $search_term; $flag = false; function startElement($parser, $name, $attrs) { global $depth, $searchable_tags, $current_data, $hits, $colour, $flag; if (in_array($name,$searchable_tags)) { if (preg_match(/.$search_term./i,$current_data)) { $flag = true; echo div bgcolor=\#$colour\$current_data/divbr /; $hits++; } } $depth[$parser]++; } function characterData($parser, $data) { global $current_data; $current_data = $data; } function endElement($parser, $name) { global $depth, $flag; $depth[$parser]--; if ($flag) { $flag = false; } } function search_data($term,$data) { if (preg_match($term,$data)) { return true; } else { return false; } } // read all the xml files and parse through search engine if ($handle = opendir($xml_repository)) { $i = 0; while (false !== ($file = readdir($handle))) { $dir_array[$i] = $file; $i ++; } closedir($handle); } for ($i = 2; $i count($dir_array); $i++) { $xml_parser = xml_parser_create(UTF-8); xml_set_element_handler($xml_parser, startElement, endElement); xml_set_character_data_handler($xml_parser, characterData); if (!($fp = fopen($xml_repository.$dir_array[$i], r))) { die(could not open XML input); } while ($data = fread($fp, 4096)) { if ($hits = $MAXHITS) { echo pbover 100 hits!\n/b Stopping here./p; exit; } if (!xml_parse($xml_parser, $data, feof($fp))) { die(sprintf(XML error: %s at line %d, xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); } } xml_parser_free($xml_parser); } ? If I use $current_data = $data; I get nothing back at all, If I use $current_data .= $data; I get the concatenated response as expected but is not what I am after. All I want is the value of $data at that particular point in the parse. Any help much appreciated. -- Dan Field [EMAIL PROTECTED] Support Programmer: Cymru ar y we / Wales on the Web cy_GB: http://www.cymruarywe.org en_GB: http://www.walesontheweb.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php|works in Toronto - anyone going?
[snip] I'm giving a talk on PHP session security, so I'll be there. If anyone from the list is coming, please drop by and say hi. [/snip] I'd love to be there for that, but the company wouldn't help with expenses. Seems a lot of companies are dropping or eliminating their 'training' budgets -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php|works in Toronto - anyone going?
Chris Shiflett wrote: I'm giving a talk on PHP session security, so I'll be there. If anyone from the list is coming, please drop by and say hi. I've already got your session picked for that time slot. It'll be interesting to finally see some faces to go along with the names I've only seen on the net these last few years! It's too bad I'm one of the few on the list that's able to attend... -- Aaron Gould Parts Canada - Web Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php4 and php5 on the same apache server
How can I run both php4 and php5 on the same apache server? Could I do it like this: AddType application/x-httpd-php .php AddType application/x-httpd-php5 .php5 And somehow tell php5 to use application/x-httpd-php5 -- Best regards, Jacob Friis Larsen www.webcom.dk | www.journster.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Delete Line from File?
From: Nick Wilson [EMAIL PROTECTED] Whats the easiest/best way to do that with php? just replace the line with ''? Yes, basically. You have to read the file, replace the part you don't want with an empty string and then re-write the file. If the file is small and you're using file() to read it, you can just unset() the element you don't want, then join the array back together and write it. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php4 and php5 on the same apache server
Hello Jacob, i've been trying to achieve the very same result but without success. I tried even modifying sources of sapi/apache2(handler|filter)/sapi_apache2.c and relatives but without success. Mime type can be modified without any problem and it compiles fine but then when I tried to parse PHP5 file there is a segfault. I think some PHP developer could explain what is going on actually. lp B. On Monday 13 of September 2004 14:30, Jacob Friis Larsen wrote: How can I run both php4 and php5 on the same apache server? Could I do it like this: AddType application/x-httpd-php .php AddType application/x-httpd-php5 .php5 And somehow tell php5 to use application/x-httpd-php5 -- Best regards, Jacob Friis Larsen www.webcom.dk | www.journster.com -- Best regards, Bostjan Skufca system administrator Domenca d.o.o. Phone: +386 4 5835444 Fax: +386 4 5831999 http://www.domenca.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] group queries result
This is off topic and please don't send multiple copies of the same message. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Evaluating form posts
Thanks to you all, I decided to turn that stuff off since the stripslashes function returned not exactly the same I get when it's turned off. On Sun, Sep 12, 2004 at 11:44:40PM -0700, Chris Shiflett wrote: --- Alexander Kleshchevnikov [EMAIL PROTECTED] wrote: You should chech for configuration of magic quotes gpc. Use get_magic_quotes_gpc() function: $foo = get_magic_quotes_gpc() ? stripslashes($_POST[foo]) : $_POST[foo]); I agree. However, stripslashes() doesn't necessarily undo addslashes(). If you want to know why or see more discussion on that, search the PHP internals archive. I think it was within the last 3 months or so that this was discussed. The best option is to turn that stuff off, but if you can't, I bet the fix_magic_quotes() function will be helpful. It can be found here: http://education.nyphp.org/phundamentals/PH_storingretrieving.php That page also describes why it's best to not use magic_quotes. Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming December 2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ -- 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] Delete Line from File?
* and then John Holmes declared Whats the easiest/best way to do that with php? just replace the line with ''? Yes, basically. You have to read the file, replace the part you don't want with an empty string and then re-write the file. If the file is small and you're using file() to read it, you can just unset() the element you don't want, then join the array back together and write it. Great, it just seems a bit clumsy which was why i thought maybe i was looking at it the wrong way.. my thanks! -- Nick W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] URL encode/decode problem
Hi, I have follow problem: One form whitch send some text fields to my PHP script. But before send data, the form makes javascript command escape for text fields. The text fields may contain characters +, quotes, etc. The form post data with GET method. And then I can't get correctly posted data in my PHP script. How to unescape data with PHP? Can someone help me ? Thanks in advance, Rosen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL encode/decode problem
On Mon, 13 Sep 2004 16:51:59 +0300, Rosen [EMAIL PROTECTED] wrote: I have follow problem: One form whitch send some text fields to my PHP script. But before send data, the form makes javascript command escape for text fields. The text fields may contain characters +, quotes, etc. The form post data with GET method. And then I can't get correctly posted data in my PHP script. How to unescape data with PHP? Can someone help me ? stripslashes() perhaps? -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] multi dimension array
here is the code. ++ // end headers //$sql = SELECT * from orders WHERE status='10' and dealerid = '1'; $sql = select * from dealer, orders where orders.status='10' and orders.dealerid = dealer.dealerid order by orders.dealerid asc; $result = mysql_query($sql); $num_rows = mysql_num_rows($result); echo table join select statement - .$num_rows.\n; if (!$result) { die('Invalid query: ' . mysql_error()); } if ($num_rows!='0') { //$message =$num_rows Orders Waiting for the Dealer.\n\n; //$message .=--\n; while($row = mysql_fetch_array($result)) { $orderid = $row['orderid']; $dealerid = $row['dealerid']; /*$message .=\nOrder #: $orderid | Dealer ID: $dealerid | ; if ($dealerid != NULL $dealerid != '0') { $sql2 = SELECT * from dealer WHERE dealerid='.$dealerid.'; $result2 = mysql_query($sql2); if (!$result) { die('Invalid query: ' . mysql_error()); } $row2 = mysql_fetch_array($result2); $name = $row2['name']; $email = $row2['email']; $surname = $row2['surname']; $company = $row2['company']; $message .=Company: $company | Name: $name $surname | Email: $email\n; }*/ if ($dealerid != '0' || $dealerid != NULL) { $message .= $company (DID: $dealerid) has $number_orders waiting for them.\n; $message .=--\n; $message .= Contact. $name $surname at $email or $contactday \n; $message .= Order #: $orderid \n; $message .=--\n\n\n; } else { $message .=--\n; $message .= Order #: $orderid has no dealer information.\n; $message .=--\n\n\n; } } $message .=\n\n\n; //$message .=--\n; $datestamp=date(Y-m-d H:i:s); $message .=Sent on: .$datestamp.\n; $title=$num_rows Orders Waiting for the Dealer; mail($email_address,$title,$message,$headers); } else { $message =No Orders Waiting for the Dealer.\n\n; $message .=Sent on: .$datestamp.\n; $title=No Orders Waiting for the Dealer; //mail($email_address,$title,$message,$headers); } ? ?php function writelog ($logentry, $lgname) { $logfile = @fopen ($lgname, a+); if (!$logfile) { echo (\n\n ERROR: Failed to open $lgname\n\n); } else { fwrite ($logfile, [.date (D M d Y h:i:s).] [$logentry]\n); fclose ($logfile); } } ? +++ now as you can see I have a formatted message that I am try to create. what I am trying to do with it is this. Joe's Deli (DID: 123564) has 3 orders waiting for them. -- Contact. Joe Shmoe at [EMAIL PROTECTED] or 610.555.5151 Order #: 2013, 2124, 2158 -- any help? thoughts? --- Greg Donald [EMAIL PROTECTED] wrote: On Fri, 10 Sep 2004 13:33:37 -0700 (PDT), Dan McCullough [EMAIL PROTECTED] wrote: So I have orders and customers. I need to go through and list out the orders and then I need to use the customer to grab all the order associated with them, then list out their contact information. Anythough on how I can
Re: [PHP] URL encode/decode problem
It will not work - Javascript function escape() return string as unicode data - something like %u0431%u043E%u044F. And I don't know how to decode these data as normal chars. Greg Donald [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Mon, 13 Sep 2004 16:51:59 +0300, Rosen [EMAIL PROTECTED] wrote: I have follow problem: One form whitch send some text fields to my PHP script. But before send data, the form makes javascript command escape for text fields. The text fields may contain characters +, quotes, etc. The form post data with GET method. And then I can't get correctly posted data in my PHP script. How to unescape data with PHP? Can someone help me ? stripslashes() perhaps? -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] multi dimension array
On Mon, 13 Sep 2004 07:14:31 -0700 (PDT), Dan McCullough [EMAIL PROTECTED] wrote: here is the code. $sql = select * from dealer, orders where orders.status='10' and orders.dealerid = If you want to associate the orders with the dealer, you probably want to do a LEFT JOIN with the relevant field. SELECT * FROM dealer LEFT JOIN orders ON dealer.dealerid = order.dealerid WHERE order.status = '10' GROUP BY dealer.dealerid or something like that. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php|works in Toronto - anyone going?
Jay Blanchard wrote: [snip] I'm giving a talk on PHP session security, so I'll be there. If anyone from the list is coming, please drop by and say hi. [/snip] I'd love to be there for that, but the company wouldn't help with expenses. Seems a lot of companies are dropping or eliminating their 'training' budgets Yeah, my boss told me two weeks ago that he wasn't going to be able to send me, but Toronto is only a 1.5 - 2 hour drive for me (was just up there for RushCon a few weeks ago ;) so I'm probably still going to go at least one day. But I won't go see Chris' talk...I mean, if he knew enough about security, he'd write a book or something, right? :) -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] whois with php
Hi there, I'm trying to make a simple tool that make a simple check for the availability of a domain name in a certain top-level domain. I use gethostbyname and if it fails, it means the domain is probably not registered. It works great for domains.COM, domains.NET, domains.CA and all domains.[province].CA. However it does not work with biz, org, info or name since all unavailable domains (the ones that are not yet registered) are pointing automatically to some registrar. Anyone have an idea on how to go around this without having to reverse engineer the whois databases? (BTW, is it legal to do such reverse engineering?) Thanks, xm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL encode/decode problem
On Mon, 13 Sep 2004 17:21:48 +0300, Rosen [EMAIL PROTECTED] wrote: It will not work - Javascript function escape() return string as unicode data - something like %u0431%u043E%u044F. Well, normally I'd say urldecode() but I don't think it handles unicode, so you may wanna check out the multi-byte string functions: http://www.php.net/manual/en/ref.mbstring.php -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP include before or after Apache SSI?
In which order do the two execute? I'm trying to work out the best way to integrate PHP backend code with an HTML interface in the cleanest way possible - I don't really want to copy paste the PHP into the HTML because it will make maintaining both the PHP the HTML more complicated. What I'd really like is to save the PHP backend separatly and link them into the HTML at the appropriate place using SSI. Can someone offer some guidance on the best way to do this, I'm getting confused as to how's best to do it. There are lots of sites out there that have lush UI's and fairly complex PHP yet they must somehow manage the two separately - after all they're usually done by different teams so how do they do it? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php|works in Toronto - anyone going?
From: John Nichel [EMAIL PROTECTED] But I won't go see Chris' talk...I mean, if he knew enough about security, he'd write a book or something, right? :) lol that's a great idea! ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP include before or after Apache SSI?
In which order do the two execute? I'm trying to work out the best way to integrate PHP backend code with an HTML interface in the cleanest way possible - I don't really want to copy paste the PHP into the HTML because it will make maintaining both the PHP the HTML more complicated. What I'd really like is to save the PHP backend separatly and link them into the HTML at the appropriate place using SSI. Can someone offer some guidance on the best way to do this, I'm getting confused as to how's best to do it. There are lots of sites out there that have lush UI's and fairly complex PHP yet they must somehow manage the two separately - after all they're usually done by different teams so how do they do it? Thanks Have you considered a template engine? http://smarty.php.net/ - awesome http://sourceforge.net/projects/xitemplate - light-weight and easy Jim Grill -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] multi dimension array
okay I am working with this now. what I am seeing is that any information that I want to pull is not coming. $sql = SELECT dealer.dealerid as ddealerid, dealer.company as company, dealer.name as name, dealer.surname as surname, dealer.email as email, dealer.contactday as contactday, orders.orderid as oorderid FROM dealer LEFT JOIN orders ON dealer.dealerid = orders.dealerid WHERE orders.status = '10' GROUP BY dealer.dealerid; $result = mysql_query($sql); $num_rows = mysql_num_rows($result); echo table join select statement - .$num_rows.\n; if (!$result) { die('Invalid query: ' . mysql_error()); } if ($num_rows!='0') { //$message =$num_rows Orders Waiting for the Dealer.\n\n; //$message .=--\n; while($row = mysql_fetch_array($result)) { $orderid = $row['orderid']; $dealerid = $row['ddealerid']; echo dealer id - .$dealerid. | ; $dealerid = $row['email']; echo dealer email - .$email.\n; /*$message .=\nOrder #: $orderid | Dealer ID: $dealerid | ; if ($dealerid != NULL $dealerid != '0') { $sql2 = SELECT * from dealer WHERE dealerid='.$dealerid.'; $result2 = mysql_query($sql2); if (!$result) { die('Invalid query: ' . mysql_error()); } $row2 = mysql_fetch_array($result2); $name = $row2['name']; $email = $row2['email']; $surname = $row2['surname']; $company = $row2['company']; $message .=Company: $company | Name: $name $surname | Email: $email\n; }*/ //if ($dealerid != '0' || $dealerid != NULL) { $message .= $company (DID: $ddealerid) has $number_orders waiting for them.\n; $message .=--\n; $message .= Contact. $name $surname at $email or $contactday \n; $message .= Order #: $oorderid \n; $message .=--\n\n\n; //} else { //$message .=--\n; //$message .= Order #: $orderid has no dealer information.\n; //$message .=--\n\n\n; //} } $message .=\n\n\n; //$message .=--\n; $datestamp=date(Y-m-d H:i:s); $message .=Sent on: .$datestamp.\n; $title=$num_rows Orders Waiting for the Dealer; mail($email_address,$title,$message,$headers); } else { so I get (DID: ) has waiting for them. -- Contact.at or Order #: -- --- Greg Donald [EMAIL PROTECTED] wrote: On Mon, 13 Sep 2004 07:14:31 -0700 (PDT), Dan McCullough [EMAIL PROTECTED] wrote: here is the code. $sql = select * from dealer, orders where orders.status='10' and orders.dealerid = If you want to associate the orders with the dealer, you probably want to do a LEFT JOIN with the relevant field. SELECT * FROM dealer LEFT JOIN orders ON dealer.dealerid = order.dealerid WHERE order.status = '10' GROUP BY dealer.dealerid or something like that. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php =
[PHP] dynamical class variable definition
Hi, I have a class, but the problem is that its variables need to be defined dynamically. example: class class_myclass{ var $variable1; var $variable2; var $variable3; ... var $variableN how to initialize these $variableN class variables from a global array which contains the variable names and custom count of them? if that's not possible.. maybe there's a possibility to initialize class variables on the fly from constructor class but the whole point is that the names and number of variables each php script run is different any suggestions? thanks a lot! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL encode/decode problem
I changed the JScript to encode data not as unicode - now it code data as %20%2B%20. But when I get data with $_REQUEST[var] - I loose symbol + - with code %2B. Greg Donald [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Mon, 13 Sep 2004 17:21:48 +0300, Rosen [EMAIL PROTECTED] wrote: It will not work - Javascript function escape() return string as unicode data - something like %u0431%u043E%u044F. Well, normally I'd say urldecode() but I don't think it handles unicode, so you may wanna check out the multi-byte string functions: http://www.php.net/manual/en/ref.mbstring.php -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] multi dimension array
On Mon, 13 Sep 2004 08:04:41 -0700 (PDT), Dan McCullough [EMAIL PROTECTED] wrote: $sql = SELECT dealer.dealerid as ddealerid, dealer.company as company, dealer.name as name, dealer.surname as surname, dealer.email as email, dealer.contactday as contactday, orders.orderid as oorderid FROM dealer LEFT JOIN orders ON dealer.dealerid = orders.dealerid WHERE orders.status = '10' GROUP BY dealer.dealerid; Do you actually have any rows with status equal to 10 in the orders table? $result = mysql_query($sql); $num_rows = mysql_num_rows($result); echo table join select statement - .$num_rows.\n; if (!$result) { die('Invalid query: ' . mysql_error()); } if ($num_rows!='0') { I'd just say if($num_rows) here //$message =$num_rows Orders Waiting for the Dealer.\n\n; //$message .=--\n; while($row = mysql_fetch_array($result)) { $orderid = $row['orderid']; $dealerid = $row['ddealerid']; echo dealer id - .$dealerid. | ; $dealerid = $row['email']; echo dealer email - .$email.\n; /*$message .=\nOrder #: $orderid | Dealer ID: $dealerid | ; if ($dealerid != NULL $dealerid != '0') { You're joining dealers to orders, so you will always get rows from dealers, and orders will be the aggregate. I don't see any point in testing the dealerid here, you will always have one as far as I can tell. $sql2 = SELECT * from dealer WHERE dealerid='.$dealerid.'; $result2 = mysql_query($sql2); if (!$result) { die('Invalid query: ' . mysql_error()); } $row2 = mysql_fetch_array($result2); $name = $row2['name']; $email = $row2['email']; $surname = $row2['surname']; $company = $row2['company']; $message .=Company: $company | Name: $name $surname | Email: $email\n; }*/ //if ($dealerid != '0' || $dealerid != NULL) { $message .= $company (DID: $ddealerid) has $number_orders waiting for them.\n; $message .=--\n; $message .= Contact. $name $surname at $email or $contactday \n; $message .= Order #: $oorderid \n; $message .=--\n\n\n; //} else { //$message .=--\n; //$message .= Order #: $orderid has no dealer information.\n; //$message .=--\n\n\n; //} } $message .=\n\n\n; //$message .=--\n; $datestamp=date(Y-m-d H:i:s); $message .=Sent on: .$datestamp.\n; $title=$num_rows Orders Waiting for the Dealer; mail($email_address,$title,$message,$headers); } else { so I get (DID: ) has waiting for them. -- Contact.at or Order #: -- I don't see any point in using a second query, it appears as though you can get all the data with one query. What do your tables look like? Do: desc orders; desc dealers; Not that anything is wrong with the way it's coded, but you might wanna check out heredoc syntax, it'd make those text build-ups a lot cleaner. Something like this: $message .=
Re: [PHP] dynamical class variable definition
On Mon, 13 Sep 2004 18:26:56 +0300, Mario Lopez [EMAIL PROTECTED] wrote: Hi, I have a class, but the problem is that its variables need to be defined dynamically. example: class class_myclass{ var $variable1; var $variable2; var $variable3; ... var $variableN how to initialize these $variableN class variables from a global array which contains the variable names and custom count of them? if that's not possible.. maybe there's a possibility to initialize class variables on the fly from constructor class but the whole point is that the names and number of variables each php script run is different any suggestions? You can do array binding pretty easily: function bindArray($array, $obj){ is_array($array) or die(bindArray() failed: array expected); foreach($array as $k = $v){ $obj-$k = $array[$k]; } } -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL encode/decode problem
On Mon, 13 Sep 2004 18:35:58 +0300, Rosen [EMAIL PROTECTED] wrote: I changed the JScript to encode data not as unicode - now it code data as %20%2B%20. But when I get data with $_REQUEST[var] - I loose symbol + - with code %2B. Can you change it back before you decode it? Maybe with str_replace() ? -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamical class variable definition
Oh Thanks, I thought that only those variables that are defined with VAR will be accessible and trieted as class variables Mario -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL encode/decode problem
The sending form works with JavaScript. When enter on some field combination + plus sign and space - JScript encode it - I see it with alert - %2B%20 , but when new window opens on url bar shows +%20 - thath means space only. Greg Donald [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Mon, 13 Sep 2004 18:35:58 +0300, Rosen [EMAIL PROTECTED] wrote: I changed the JScript to encode data not as unicode - now it code data as %20%2B%20. But when I get data with $_REQUEST[var] - I loose symbol + - with code %2B. Can you change it back before you decode it? Maybe with str_replace() ? -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] database content searching
Hi all. I was wondering if any of you have experience with searching through a database for user provided search terms. I was hoping that maybe I could get some insight into how to better approach what I am doing. Are there any great articles or example classes that I could look at? Please let me know! As of right now, my architecture is to have a primary class, Search, which connects to the database, takes search terms, removes junk wordsand suffixes (s, ing, etc.) (both defined by an array). The class runs a query on each word for each field that the class is told to search, and based on the relevance of that field (as supplied to the class), points are awarded to returned items. If they come up again on searches for other words, they get more points. Using that base architecture, I then extend the class (e.g. class Faq extends Search) and define word groups in the subclass. Word groups act to broaden the search words in a thesarus like fashion (when the search term dvd comes up, movie, title, video, etc. are added to the SQL query via OR). This way each subclass can define it's own set of word groups applicable for that usage. The problem I am having is that far too many irrelevant items are coming up. When is my package coming? for example returns all kinds of junk because when is everywhere in a Faq. I am hoping that there is some internet resource that has a variety of tricks and rules to throw into a search architecture, but I am also interested to see if anyone can give me some of their personal experience and expertise. Thanks in advance! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamical class variable definition
On Mon, 13 Sep 2004 19:06:20 +0300, Mario Lopez [EMAIL PROTECTED] wrote: Oh Thanks, I thought that only those variables that are defined with VAR will be accessible and trieted as class variables Nope, it'll work: #!/usr/bin/php ?php function bindArray($array, $obj){ is_array($array) or die(bindArray failed: array expected); foreach($array as $k = $v){ $obj-$k = $array[$k]; } } class Obj { var $x = 1; function Obj(){} } $o = new Obj(); $a = array(1, 2, 3); bindArray($a, $o); print_r($o); ? Produces: obj Object ( [x] = 1 [0] = 1 [1] = 2 [2] = 3 ) You may want to prefix your key names with some text however. :) -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] if syntax using multiple conditions
What is the proper syndax in an if statement for containing multiple conditions? example: if ( condition1 condition2 ) { dothis; } if ( condition1 (condition2 || condition3) ) { dothis; } I am trying to translate this from asp to php: If WhichAction = 7 And (InStr(filename, \) Or InStr(filename, /) Or (Left(filename, 1) = chr(32)) Or InStr(filename, *) Or InStr(filename, ?) Or InStr(filename, |) Or InStr(filename, ) Or InStr(filename, ) Or InStr(filename, :) Or InStr(filename, ) Or InStr(filename, ')) Then messages = Bad filename filename = WhichAction = 0 End If -Brian
Re: [PHP] if syntax using multiple conditions
Brian Anderson wrote: What is the proper syndax in an if statement for containing multiple conditions? both examples you have given are valid but their logic is slightly different. example: if ( condition1 condition2 ) { dothis; } if ( condition1 (condition2 || condition3) ) { dothis; } I am trying to translate this from asp to php: how about using the asp2php program? -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] if syntax using multiple conditions
On Mon, 13 Sep 2004 11:32:00 -0500, Brian Anderson [EMAIL PROTECTED] wrote: What is the proper syndax in an if statement for containing multiple conditions? example: if ( condition1 condition2 ) { dothis; } if ( condition1 (condition2 || condition3) ) { dothis; } Looks good to me. I am trying to translate this from asp to php: If WhichAction = 7 And (InStr(filename, \) Or InStr(filename, /) Or (Left(filename, 1) = chr(32)) Or InStr(filename, *) Or InStr(filename, ?) Or InStr(filename, |) Or InStr(filename, ) Or InStr(filename, ) Or InStr(filename, :) Or InStr(filename, ) Or InStr(filename, ')) Then messages = Bad filename filename = WhichAction = 0 End If I'd use a regular expression so as to match all those symbols with one command. Check out eregi() or maybe strstr(). -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem creating a date before 1970 on Fedora
Howdy, I would assume this to be a common problem, but as I wrote to this list myself a couple of days ago I was only aware of it's existence on windows systems. Here's some sample code 1 ?php 2 $date = strtotime('12 feb 1950'); 3 print $date.': '.date('r', $date).\n; 4 $date = mktime(0,0,0,2,12,1950); 5 print $date.': '.date('r', $date).\n; 6 ? And this is it's output: -1: Thu, 1 Jan 1970 00:59:59 +0100 -3662: Wed, 31 Dec 1969 23:58:58 +0100 My search on google didn't help me out, the docs say that it should work and I can remember me having used such code and got it working. Please fella's, what am I missing? Wouter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] applying search terms
Hi all. I was wondering if any of you have experience with searching through a database for user provided search terms. I was hoping that maybe I could get some insight into how to better approach what I am doing. Are there any great articles or example classes that I could look at? Please let me know! As of right now, my architecture is to have a primary class, Search, which connects to the database, takes search terms, removes junk wordsand suffixes (s, ing, etc.) (both defined by an array). The class runs a query on each word for each field that the class is told to search, and based on the relevance of that field (as supplied to the class), points are awarded to returned items. If they come up again on searches for other words, they get more points. Using that base architecture, I then extend the class (e.g. class Faq extends Search) and define word groups in the subclass. Word groups act to broaden the search words in a thesarus like fashion (when the search term dvd comes up, movie, title, video, etc. are added to the SQL query via OR). This way each subclass can define it's own set of word groups applicable for that usage. The problem I am having is that far too many irrelevant items are coming up. When is my package coming? for example returns all kinds of junk because when is everywhere in a Faq. I am hoping that there is some internet resource that has a variety of tricks and rules to throw into a search architecture, but I am also interested to see if anyone can give me some of their personal experience and expertise. Thanks in advance! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: whois with php
However it does not work with biz, org, info or name since all unavailable domains (the ones that are not yet registered) are pointing automatically to some registrar. Ok, I found one way around, I simply use exec('host $domain'), which returns a string that is very simple to parse to find if the domain exists or not. I'm not sure about the integrity of the results though, they seem correct. Although, since I'm on dialup, it takes a very long time to verify the results with internic! If you have other suggestions, please tell us! Thanks, xm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php4 and php5 on the same apache server
[EMAIL PROTECTED] (Jacob Friis Larsen) writes: How can I run both php4 and php5 on the same apache server? You can't, the two modules are incompatible. What you can do, is to run two instances of the webserver on two different ports. This article describe the idea pretty well. http://www.schlitt.info/applications/blog/archives/83_How_to_run_PHP4_and_PHP_5_prallel.html -- ./mvh Christian Jul Jensen Frelance webprogrammer TYPO3 Typehead Denmark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Class Instance Inheritance
Is it possible for a class to extend the state of its parent class? In the example provided, I was hoping for the statement to say - I wish 10 equals to 10 If there is a solution, I would like it to work with php 4+ Thanks - class foo { var $foo = 0; } $foo = new foo; $foo-foo = 10; class bar extends foo { function bar() { echo I wish $this-foo equals to 10; } } $bar = new bar; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upgrade from 4.3.6 to 5; strategy
* Thus wrote [EMAIL PROTECTED]: Anyone have any good advice for an upgrade strategy from php4.3.6 to php5.0.1? I have a MAC OSX 10.3.5 system that I use for my test machine and an Open BSD system for my production machine. The production machine is also semi-managed hosting system (virtual server). Can I expect my current 4.3.6 code to run on php5? In most cases yes. PHP5 was designed to be as backward compatible to PHP4 as much as possible. You may need to make some minor adjustments but the upgrade should go rather smoothly. When testing the upgrade, make sure your error_reporting is E_ALL. And be sure to read this: http://php.net/migration5 Curt -- The above comments may offend you. flame at will. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Can I name a session variable using another variable?
Ok, assuming everything's working correctly except for the use of $prevtime in the SESSION, then here's one answer: Yes, you can name a session the way you described. If you're having trouble with doing the concatenation of values inside $_SESSION, then try combining them outside: $roomname=sampleroom; $sessionname = $roomname . $prevtime; $_SESSION[$sessionname]=time(); Secondly, looks like you forgot a $ on prevtime below: $_SESSION[$roomname . prevtime]=time(); Thirdly, you can store arrays in $_SESSION as well, so you could divide the rooms up that way: $_SESSION[$roomname][PrevTime] = $prevtime; -TG -Original Message- From: John Gostick [mailto:[EMAIL PROTECTED] Sent: Friday, September 10, 2004 5:47 PM To: PHP General Subject: [PHP] Can I name a session variable using another variable? Hi, I've encountered a problem I can't seem to find much reference to on the web, so I was wondering if anyone here could help me... Fisrt a brief background: I am building a fairly simple PHP/MySQL chat system with multiple rooms. Each room is loaded from the main chat page by clicking on a link that uses JavaScript to open and size a new window, and also passes the roomname as a variable to the new chat window. Messages sent from a room are tagged with the roomname, and the window refreshes periodically to look for new messages(rows) in the database that have that rooms name. In this way a room only recieves messages meant for it. So far so good. However, to determine what messages are new, a SESSION variable $prevtime is set each time the script checks for new messages, so that next time it checks, it will only download messages posted SINCE the time given in $prevtime. This was not a problem with a single room, but when multiple rooms are open they are sharing the same session variable $prevtime because they are all using the same session as they were all opened from the same window. This leads to 'skipping' of messages and not all messages being picked up by each room. I've stratched my head over this, and decided to try and generate a unique SESSION variable for each room, named using the string 'prevtime' prefixed with the value of the variable $roomname (the name of the current room). However I can't seem to get this to work. To summarise my problem: Can I name/create a session variable like this?: $roomname=sampleroom; $_SESSION[$roomname . prevtime]=time(); With the aim of making a session variable named 'sampleroomprevtime'. It is possible to use a variable in naming a session this way? I would really appreciate any help anyone could give me in making this work, or any suggestions of a better way from people with a much better knowledge of sessions than myself! Thanks in advance, John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_nlist()
* Thus wrote Karol Krizka: Hello, I have the following class for ftp: -- class FTP { function get_files($dir=/) { ftp_chdir($this-connection,$dir); $array=ftp_nlist($this-connection,ftp_pwd($this-connection)); var_dump($array); } } When I connect to ftp server for my website at ftp://kkrizka.mybesthost.com and try to use nlist function, it returns false. But when I used ftp_rawlist, it returned a list of files no problem. I tried to connect to a ftp server on my computer, and it worked normally. I am not sure what is wrong... You should really check the status of each of those commannds (ftp_chdir, ftp_pwd). They both can return false and can cause your get_files to return the wrong directory results as well. Curt -- The above comments may offend you. flame at will. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: CSS not picked up
probably a caching problem, but try looking for spelling errors (use W3C checker) PS this is a PHP list not CSS Jeff Swanberg [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have the following in my CSS (loaded on the main site page): /* FOOTER */ .footer { font-family: Tahoma, Trebuchet MS; font-size: 9px; color: #BFBFBF; text-decoration: none; border: none; line-height: 1.25em; font-weight: bold; } .footer a:link { font-family: Tahoma, Arial, Trebuchet MS; font-size: 9px; color: #BFBFBF; text-decoration: none; border: none; line-height: 1.25em; font-weight: bold; } .footer a:visited { font-family: Tahoma, Arial, Trebuchet MS; font-size: 9px; color: #BFBFBF; text-decoration: none; border: none; line-height: 1.25em; font-weight: bold; } .footer a:hover { font-family: Tahoma, Arial, Trebuchet MS; font-size: 9px; color: #BFBFBF; text-decoration: none; border: none; line-height: 1.25em; font-weight: bold; } and the following in my PHP script div class=footer style=position:absolute; top:680px; left:60px; width:500; height:2; vertical-align:bottom; z-index:1; copy; 2004 Keatley Photography - a href=mailto:[EMAIL PROTECTED][EMAIL PROTECTED]/a - 206 240-5543 /div/td/tr But, when I change the style.css file and upload it and then refresh the browser, any changes to the font, style, etc to the footer class are not picked up. What should I look for?? Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem creating a date before 1970 on Fedora
On Mon, 13 Sep 2004 19:03:09 +0200, Wouter van Vliet [EMAIL PROTECTED] wrote: Howdy, I would assume this to be a common problem, but as I wrote to this list myself a couple of days ago I was only aware of it's existence on windows systems. Here's some sample code 1 ?php 2 $date = strtotime('12 feb 1950'); 3 print $date.': '.date('r', $date).\n; 4 $date = mktime(0,0,0,2,12,1950); 5 print $date.': '.date('r', $date).\n; 6 ? And this is it's output: -1: Thu, 1 Jan 1970 00:59:59 +0100 -3662: Wed, 31 Dec 1969 23:58:58 +0100 My search on google didn't help me out, the docs say that it should work and I can remember me having used such code and got it working. Please fella's, what am I missing? The bottom of the strtotime() manual page where it says: Note: The valid range of a timestamp is typically from Fri, 13 Dec 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are the dates that correspond to the minimum and maximum values for a 32-bit signed integer.) Additionally, not all platforms support negative timestamps, therefore your date range may be limited to no earlier than the Unix epoch. This means that e.g. dates prior to Jan 1, 1970 will not work on Windows, some Linux distributions, and a few other operating systems. A couple years ago when upgrading some web servers we found RedHat 7 had this issue, strtotime() basically didn't work and always returned -1 on 'negative' unix timestamps. I have never used Fedora but it's probably the same issue all over again. I know this isn't the answer you were hoping for, but I wanted to share my experience. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] matching search terms
Hi all. I was wondering if any of you have experience with searching through a database for user provided search terms. I was hoping that maybe I could get some insight into how to better approach what I am doing. Are there any great articles or example classes that I could look at? Please let me know! As of right now, my architecture is to have a primary class, Search, which connects to the database, takes search terms, removes junk wordsand suffixes (s, ing, etc.) (both defined by an array). The class runs a query on each word for each field that the class is told to search, and based on the relevance of that field (as supplied to the class), points are awarded to returned items. If they come up again on searches for other words, they get more points. Using that base architecture, I then extend the class (e.g. class Faq extends Search) and define word groups in the subclass. Word groups act to broaden the search words in a thesarus like fashion (when the search term dvd comes up, movie, title, video, etc. are added to the SQL query via OR). This way each subclass can define it's own set of word groups applicable for that usage. The problem I am having is that far too many irrelevant items are coming up. When is my package coming? for example returns all kinds of junk because when is everywhere in a Faq. I am hoping that there is some internet resource that has a variety of tricks and rules to throw into a search architecture, but I am also interested to see if anyone can give me some of their personal experience and expertise. Thanks in advance! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Clear HTTP POST value
I don't see why that wouldn't work. It's not in a conditional or something where the unset command isn't being executed? If that fails still, maybe try: $_POST[var] = ; -TG -Original Message- From: Nicklas Bondesson [mailto:[EMAIL PROTECTED] Sent: Monday, August 23, 2004 5:36 AM To: [EMAIL PROTECTED] Subject: [PHP] Clear HTTP POST value Hi! Is there a smooth way to clear a posted value on a page? I have tried the following without sucess. unset($_POST[var]); unset($HTTP_POST_VARS[var]); Nicke -- 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] if syntax using multiple conditions
Brian Anderson wrote: What is the proper syndax in an if statement for containing multiple conditions? example: if ( condition1 condition2 ) { dothis; } if ( condition1 (condition2 || condition3) ) { dothis; } Both are valid. First example will validate if both condition1 and condition2 evaluate to true (they're set, and not null or false, etc.). Second example will validate if condition1 evaluates to true AND EITHER condition2 OR condition3 evaluate to true -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Class Instance Inheritance
Here's one way, but this may not be completely what you want because the value of variable foo doesn't change. -Ed Class foo { Static $foo; Function foo() { $this-foo = 10; } } -Original Message- From: Gerard Samuel [mailto:[EMAIL PROTECTED] Sent: Monday, September 13, 2004 10:15 AM To: php-general Subject: [PHP] Class Instance Inheritance Is it possible for a class to extend the state of its parent class? In the example provided, I was hoping for the statement to say - I wish 10 equals to 10 If there is a solution, I would like it to work with php 4+ Thanks - class foo { var $foo = 0; } $foo = new foo; $foo-foo = 10; class bar extends foo { function bar() { echo I wish $this-foo equals to 10; } } $bar = new bar; -- 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] php4 and php5 on the same apache server
Jacob Friis Larsen wrote: How can I run both php4 and php5 on the same apache server? Could I do it like this: AddType application/x-httpd-php .php AddType application/x-httpd-php5 .php5 And somehow tell php5 to use application/x-httpd-php5 The approach I use is as follows: On port 80 I run an Apache instance with PHP4 On port 81 I run an Apache instance with PHP5 Via an Apache rewriterule I rewrite all .php5 calls to the other webserver (by proxy), and therefore transparent. Like this (not sure, dont have the config at hand right now): RewriteEngine On RewriteRule (.*)\.php5$ http://%{HTTP_HOST}:81$1.php Erwin Kerk Webdeveloper -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Communicate with Outlook
If you have an Outlook client running on the same machine as PHP, you should be able to use COM calls to access the data. Here's MS's Outlook Object Model site for Outlook Item Objects including MeetingItem: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/off2000 /html/olmscOutlookItemObjects.asp I've done this in VBA and I've access MapPoint via PHP through a COM call, but havn't done Outlook via PHP yet. But that's probably how I'd do it if I could get it to work right and had to use PHP for it. It's probably 'cleaner' but maybe more difficult to access the server directly and/or parse a .PST file (which isn't going to be available if you have everything on the server side.. Unless you have Work Offline mode enabled). -TG -Original Message- From: Shaun [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 25, 2004 11:17 AM To: [EMAIL PROTECTED] Subject: [PHP] Communicate with Outlook Hi, Is it possible for a PHP application to communicate with an Outlook calendar? I would like to create a web based application that shows staff availability... Thanks for any advice offered. -- 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] Can I name a session variable using another variable?
Here's another option as well, in case it helps out: $var1 = Pizza; $var2 = var1; $var3 = $$var2; print var3 = $var3br; Output: var3 = Pizza -Original Message- Ok, assuming everything's working correctly except for the use of $prevtime in the SESSION, then here's one answer: Yes, you can name a session the way you described. If you're having trouble with doing the concatenation of values inside $_SESSION, then try combining them outside: $roomname=sampleroom; $sessionname = $roomname . $prevtime; $_SESSION[$sessionname]=time(); Secondly, looks like you forgot a $ on prevtime below: $_SESSION[$roomname . prevtime]=time(); Thirdly, you can store arrays in $_SESSION as well, so you could divide the rooms up that way: $_SESSION[$roomname][PrevTime] = $prevtime; -TG -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Class Instance Inheritance
From: Gerard Samuel [EMAIL PROTECTED] Is it possible for a class to extend the state of its parent class? In the example provided, I was hoping for the statement to say - I wish 10 equals to 10 If there is a solution, I would like it to work with php 4+ Thanks - class foo { var $foo = 0; } $foo = new foo; $foo-foo = 10; class bar extends foo { function bar() { echo I wish $this-foo equals to 10; } } $bar = new bar; Not going to happen. $foo is an object, not a class, so nothing can be extended from it. You could pass $foo-foo to the Bar class, though... class bar extends foo { function bar($val) { $this-foo = $val; echo I wish {$this-foo} equals 10; } } $bar = new bar($foo-foo); ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] convert degrees to heading
The cleanest looking multiple if scenario is to use a Switch statement. Unfortunately I don't believe PHP's switch will do varied conditions, only equality statements: $j = 5; switch ($j) { case 6: echo first; break; case 6: echo second; break; case 5: echo third; break; default: echo fourth; break; } This breaks at case 6. Removing the second condition, the switch statement echos third since $j == 5. In some other languages, you could put your range of values in the case statements, but not PHP I guess. I think in this case, you're stuck with a bunch of if/elseif statements. Only 16 of them though, right? :) -TG -Original Message- From: René Fournier [mailto:[EMAIL PROTECTED] Sent: Friday, July 16, 2004 6:20 PM To: php Subject: [PHP] convert degrees to heading I have to write a little function to convert a direction from degrees to a compass -type heading. 0 = West. 90 = North. E.g.: from: 135 degrees to: NW Now, I was planning to write a series of if statements to evaluate e.g., if ($heading_degrees 112.5 $heading_degrees 67.5) { $heading_compass = N; } The works, but it will require N, NNW, NNE, NE, NW, ENE, NWW... many IF statements. Can anyone think of a programatically more elegant and efficient way of converting this type of data? (I suppose this is not really a problem, just a curiosity.) ...Rene -- 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] Convert textarea post data from plain text to html using php..how?
Two options: 1. nl2br($posteddata) - This converts all the \r\n's to br's so that it comes out with the same carriage returns as the person who inputed it gave it 2. Use HTML pre tabs to do the same thing. I think that's the trickiest thing about using textarea to input then regurgitate the data. Everything else should come out pretty much the same. -TG -Original Message- From: Brent Clements [mailto:[EMAIL PROTECTED] Sent: Saturday, September 11, 2004 7:02 PM To: [EMAIL PROTECTED] Subject: [PHP] Convert textarea post data from plain text to html using php..how? Do you guys happen to have an easy easy to do this? I need to convert plain text submitted via a textarea form field to html formatted text. Is there a way to do this with php? Thanks, Brent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Convert textarea post data from plain text to html using php..how?
Trevor Gryffyn wrote: Two options: 1. nl2br($posteddata) - This converts all the \r\n's to br's so that it comes out with the same carriage returns as the person who inputed it gave it It doesn't change \r\n to br, it only changes \n to br / 2. Use HTML pre tabs to do the same thing. I think that's the trickiest thing about using textarea to input then regurgitate the data. Everything else should come out pretty much the same. -TG -Original Message- From: Brent Clements [mailto:[EMAIL PROTECTED] Sent: Saturday, September 11, 2004 7:02 PM To: [EMAIL PROTECTED] Subject: [PHP] Convert textarea post data from plain text to html using php..how? Do you guys happen to have an easy easy to do this? I need to convert plain text submitted via a textarea form field to html formatted text. Is there a way to do this with php? Thanks, Brent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: MSSQL, PHP and Linux
Still no luck with thismy host has asked: if someone has a (fedora core 2) RPM for us to install that has freetds support built in? Anyone have anything like this?? Thanks! On Thu, 02 Sep 2004 07:45:00 -0700, Jon Bertsch [EMAIL PROTECTED] wrote: I didn't see it mentioned but if you don't do a 'make clean' command php will not update the info used by php_info(), so you see the old information. I've recently set up access to mssql databases and as repeated by many you need to do the following: install freetds libraries (in my case to /usr/local/freetds) compile php with the --with-mssql=/usr/local/freetds flag setup the mssql DSN entry in the freetds conf file (under /usr/local/freetds/etc) Jon Bertsch -- 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] CSS not picked up
* Thus wrote Jeff Swanberg: I have the following in my CSS (loaded on the main site page): /* FOOTER */ ... picked up. What should I look for?? A book on writing proper css. Curt -- The above comments may offend you. flame at will. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php.net code samples grey boxes
Is it just me or are the styles for the grey code sample boxes on php.net messed up? I can't see any of the code, it's just solid grey boxes from here. I am trying with Mozilla 1.6-5 and Firefox 0.8 on Debian sarge. Anyone else seeing this issue? The copy of the PHP manual I downloaded a couple months back looks fine but the live site seems broken. TIA.. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Outputting HTML with PHP - Buffer Problem?
* Thus wrote M. Sokolewicz: Nick Wilson wrote: Hi all, Say i have a php script like this: ?php print(html_head()); // do loads of time taking stuff print(html_footer()); ? How come I dont see the html header (it's just a function that returns a string with the html up till body) before the entire script has run? This goes against my understanding, why might this be and what might i use to get some output before the script has finished executing? Much thanks... that's because it's all sent as 1 single big chunk of data. To get around this, you should set implicit_flush to 1 (it's in php.ini). Otherwise, you can also use the PHP ob_implicit_flush() to do this. Setting it to 1 will flush the output buffer everytime it's written to, if set to 0 it will do as normal, and buffer it all to send it together. Actually by default its sent in chunks of 4K. I wouldn't suggest implicit flushing, just a simple buffer flush after the head(). Curt -- The above comments may offend you. flame at will. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] matching search terms
[snip] I am hoping that there is some internet resource [/snip] Which begs the question, have you STFW? http://www.google.com/search?q=search+functionhl=enlr=ie=UTF-8start= 10sa=N -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: whois with php
On Mon, 13 Sep 2004 12:29:08 -0400, xm [EMAIL PROTECTED] wrote: However it does not work with biz, org, info or name since all unavailable domains (the ones that are not yet registered) are pointing automatically to some registrar. If you have other suggestions, please tell us! I'd suggest searching freshmeat.net for php whois. Chances are others have already invented a good wheel we can use. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php4 and php5 on the same apache server
It is possible if one is CGI. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php.net code samples grey boxes
Greg Donald wrote: Is it just me or are the styles for the grey code sample boxes on php.net messed up? I can't see any of the code, it's just solid grey boxes from here. I am trying with Mozilla 1.6-5 and Firefox 0.8 on Debian sarge. Anyone else seeing this issue? The copy of the PHP manual I downloaded a couple months back looks fine but the live site seems broken. TIA.. looks fine here, using Mozilla 1.7.2 (works aswell on FireFox 0.9.3) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: whois with php
If you have other suggestions, please tell us! Lots of people have written classes/functions to see whether domain names are available for pretty much every top level domain and country code. One that I've used in the past is: http://phpclasses.vextron.com/browse/package/360.html there are several others - Net::Whois in PEAR (http://pear.php.net/) is one that springs to mind. Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] convert degrees to heading
I have to write a little function to convert a direction from degrees to a compass -type heading. 0 = West. 90 = North. E.g.: Something like this... it'll account for 360 degrees, too. No different that a bunch of IF statements, though... ?php $dir = 378; switch($dir = $dir%360) { case 0 = $dir $dir 90: echo 'northeasterly'; break; case 90 = $dir $dir 180: echo 'southeasterly'; break; case 180 = $dir $dir 270: echo 'southwesterly'; break; case 270 = $dir $dir 360: echo 'northwesterly'; break; } ? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] convert degrees to heading
Nice! I didn't know you could do that with switch. I was wondering why conditionals were left out of PHP's switch statement, but hoped someone would prove me wrong. Thanks John! Very helpful! -TG -Original Message- From: John Holmes [mailto:[EMAIL PROTECTED] Sent: Monday, September 13, 2004 3:26 PM To: Gryffyn, Trevor; php Cc: René Fournier Subject: Re: [PHP] convert degrees to heading I have to write a little function to convert a direction from degrees to a compass -type heading. 0 = West. 90 = North. E.g.: Something like this... it'll account for 360 degrees, too. No different that a bunch of IF statements, though... ?php $dir = 378; switch($dir = $dir%360) { case 0 = $dir $dir 90: echo 'northeasterly'; break; case 90 = $dir $dir 180: echo 'southeasterly'; break; case 180 = $dir $dir 270: echo 'southwesterly'; break; case 270 = $dir $dir 360: echo 'northwesterly'; break; } ? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] convert degrees to heading
[snip] The cleanest looking multiple if scenario is to use a Switch statement. Unfortunately I don't believe PHP's switch will do varied conditions, only equality statements: $j = 5; switch ($j) { case 6: echo first; break; case 6: echo second; break; case 5: echo third; break; default: echo fourth; break; } [/snip] Hmmm, what about this...seems to work fine $j = 7; switch($j){ case $j 6: echo $j . is less than 6\n; break; } Alter the value of $j to see the results, the above example forgets to compare $j in each case. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] convert degrees to heading
On Tuesday 14 September 2004 02:18, Gryffyn, Trevor wrote: In some other languages, you could put your range of values in the case statements, but not PHP I guess. switch(true) { case (expr1) : //do something; break; case (expr2) : //do something else; break; } Season to taste. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Very few profundities can be expressed in less than 80 characters. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Convert textarea post data from plain text to html using php..how?
From: M. Sokolewicz [EMAIL PROTECTED] 1. nl2br($posteddata) - This converts all the \r\n's to br's so that it comes out with the same carriage returns as the person who inputed it gave it It doesn't change \r\n to br, it only changes \n to br / It doesn't change anything, actually. It just inserts the br /. ?php $str = asdf\nasdf\nasdf\nasdf; $n = nl2br($str); if(strstr($n,\n)) { echo 'Newlines present'; } else { echo 'Newlines not present'; } ? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] usage stats
hi people, i need to found usage stats for a paper in my work. i found some stats, but the method is not very strong. any link please -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php.net code samples grey boxes
[snip] Is it just me or are the styles for the grey code sample boxes on php.net messed up? I can't see any of the code, it's just solid grey boxes from here. I am trying with Mozilla 1.6-5 and Firefox 0.8 on Debian sarge. Anyone else seeing this issue? The copy of the PHP manual I downloaded a couple months back looks fine but the live site seems broken. [/snip] Nope, it all looks fine to me. Are you by any chance using a user defined stylesheet in your browser? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.net code samples grey boxes
From: Greg Donald [EMAIL PROTECTED] Is it just me or are the styles for the grey code sample boxes on php.net messed up? I can't see any of the code, it's just solid grey boxes from here. I am trying with Mozilla 1.6-5 and Firefox 0.8 on Debian sarge. Anyone else seeing this issue? The copy of the PHP manual I downloaded a couple months back looks fine but the live site seems broken. Drugs are bad, mmmkay? ---John Holmes... PS: No issues here... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: MSSQL, PHP and Linux
On Mon, 13 Sep 2004 06:33:15 -1200, blackwater dev [EMAIL PROTECTED] wrote: Still no luck with thismy host has asked: if someone has a (fedora core 2) RPM for us to install that has freetds support built in? Anyone have anything like this?? Just curious here.. Why are you hosting with someone who is using Fedora in the first place? Hope you're not paying for that. Fedora is a test platform for RedHat's non-free commercial distro. By it's very nature it will be broken. Quoted from: http://www.redhat.com/software/rhelorfedora/ the Fedora Project is for developers and high-tech enthusiasts using Linux in non-critical computing environments. Sorry, I don't mean to offend.. but I see no reason to help report and fix RedHat bugs for free when they no longer offer us a free public distro that isn't bleeding edge new and broken out of the starting gate. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: MSSQL, PHP and Linux
Nope, not paying for it. I think it is just a trial...he has tried for a few weeks to get the freetds library to work with redhat 9 with no luck so I think he just now wants to try fedora for the heck of it. We have no idea as to why it won't work with Red Hat 9...must me missing a small step or something but don't know...it can't be this hard. On Mon, 13 Sep 2004 14:46:51 -0500, Greg Donald [EMAIL PROTECTED] wrote: On Mon, 13 Sep 2004 06:33:15 -1200, blackwater dev [EMAIL PROTECTED] wrote: Still no luck with thismy host has asked: if someone has a (fedora core 2) RPM for us to install that has freetds support built in? Anyone have anything like this?? Just curious here.. Why are you hosting with someone who is using Fedora in the first place? Hope you're not paying for that. Fedora is a test platform for RedHat's non-free commercial distro. By it's very nature it will be broken. Quoted from: http://www.redhat.com/software/rhelorfedora/ the Fedora Project is for developers and high-tech enthusiasts using Linux in non-critical computing environments. Sorry, I don't mean to offend.. but I see no reason to help report and fix RedHat bugs for free when they no longer offer us a free public distro that isn't bleeding edge new and broken out of the starting gate. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: image size?
What if the values for x and y are not known? I have a function that returns a thumbnail of a larger image; it calculates the size of the created image based on the dimensions of the original. Paul Birnstihl wrote: Ed Lazor wrote: Is there a way to get the size of an image created using the imagecreate function? I'm guessing it would be xsize x ysize x colour depth = size in bits ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Weird numbers around HTTP response body
I noticed some numbers mixed with the response generated by my PHP code, and I can't figure out what's causing it. I've dumbed my PHP script down to just this (what could be simpler?): ?php echo testing; ? And I monitor the HTTP response coming from the server (apache), it looks like this: HTTP/1.1 200 OK Date: Mon, 13 Sep 2004 20:03:21 GMT Server: Apache/2.0.44 (Unix) PHP/4.3.1 Accept-Ranges: bytes X-Powered-By: PHP/4.3.1 Transfer-Encoding: chunked Content-Type: text/html; charset=ISO-8859-1 7 testing 0 Note the 7 and the 0. After some experimenting I believe the first number is the length of the body, then there's the body, and finally a 0 at the end. What gives? How to I get rid of these numbers? I'm running on linux. The software versions are in the HTTP headers but in case you missed them, apache 2.0.44 and PHP 4.3.1. And help is appreciated. Thanks. -Dave -- [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.net code samples grey boxes
On Mon, 13 Sep 2004 15:50:59 -0400, John Holmes [EMAIL PROTECTED] wrote: Drugs are bad, mmmkay? Usually drugs produce color, not take it away. *shrug* I think I got some bad updates this morning via apt-get. I'm forcing a specific proportional font. I can now see the colorful php source code again. Thanks to all you guys for checking. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Weird numbers around HTTP response body
Hello, On 09/13/2004 05:21 PM, [EMAIL PROTECTED] wrote: I noticed some numbers mixed with the response generated by my PHP code, and I can't figure out what's causing it. I've dumbed my PHP script down to just this (what could be simpler?): ?php echo testing; ? And I monitor the HTTP response coming from the server (apache), it looks like this: HTTP/1.1 200 OK Date: Mon, 13 Sep 2004 20:03:21 GMT Server: Apache/2.0.44 (Unix) PHP/4.3.1 Accept-Ranges: bytes X-Powered-By: PHP/4.3.1 Transfer-Encoding: chunked Content-Type: text/html; charset=ISO-8859-1 7 testing 0 Note the 7 and the 0. After some experimenting I believe the first number is the length of the body, then there's the body, and finally a 0 at the end. What gives? How to I get rid of these numbers? I'm running on linux. The software versions are in the HTTP headers but in case you missed them, apache 2.0.44 and PHP 4.3.1. Those numbers are part of the chunked transfer encoding of HTTP 1.1. You may want to take a look at this HTTP client class to see how they should be interpreted to read this kind of HTTP encoded response. http://www.phpclasses.org/httpclient -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] usage stats
On Mon, 13 Sep 2004 15:29:20 -0400, Victor Saldaña D. [EMAIL PROTECTED] wrote: i need to found usage stats for a paper in my work. i found some stats, but the method is not very strong. any link please I use it, and a bunch of guys named John use it. That's like 3 or 4 of us at least. :) Check out netcraft.com, they seem to be the defacto standard for stuff like this. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] extended class question
How come the output to this script is World Trade Center instead of Pizza Delivery? Thanks, Ed ?php class test { private $var1; function __construct() { $this-var1 = World Trade Center; } function get_var1() { return $this-var1; } function set_var1($data) { $this-var1 = $data; } } class testing extends test { function __construct() { parent::__construct(); $this-var1 = Pizza Delivery; } } $test2 = new testing(); print var1 = . $test2-get_var1() . br; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.net code samples grey boxes
* Thus wrote Greg Donald: Is it just me or are the styles for the grey code sample boxes on php.net messed up? I can't see any of the code, it's just solid grey boxes from here. I am trying with Mozilla 1.6-5 and Firefox 0.8 on Debian sarge. Anyone else seeing this issue? The copy of the PHP manual I downloaded a couple months back looks fine but the live site seems broken. which mirror (ie: us2.php.net, de.php.net) site are you looking at? Curt -- The above comments may offend you. flame at will. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: MSSQL, PHP and Linux
Greg Donald wrote: snip Just curious here.. Why are you hosting with someone who is using Fedora in the first place? Hope you're not paying for that. Fedora is a test platform for RedHat's non-free commercial distro. By it's very nature it will be broken. Quoted from: http://www.redhat.com/software/rhelorfedora/ the Fedora Project is for developers and high-tech enthusiasts using Linux in non-critical computing environments. Sorry, I don't mean to offend.. but I see no reason to help report and fix RedHat bugs for free when they no longer offer us a free public distro that isn't bleeding edge new and broken out of the starting gate. While I agree that one shouldn't use something like Fedora for production, I can't agree with the second part. Without rambling on off-topic, open source != free as in beer. -- This email was written on a non-broken Fedora Core 1 box. -- We only use recycled bits and bytes. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Regular Expression: Markup Code
Hello, would someone please help me with my regular expressions? They are so complex! Here is what I need to do. I have a string with contents similar to the following: BLOCK NAME=TOP (a bunch of markup code) /BLOCK BLOCK NAME=BOTTOM (a bunch of markup code) /BLOCK BLOCK NAME=WAYOVERHERE (a bunch of markup code) /BLOCK In other words, the name of the block is not known at runtime. They could be anything really! I need a way to parse through this string, and make new strings with names like $TOP, $BOTTOM, $WAYOVERHERE, that contain their markup code, but not the BLOCK tags. Any help would be greatly appreciated! -Samuel
RE: [PHP] Re: image size?
I think you'll have to use the imagex and imagey functions to get the dimensions of the thumbnail in order to calculate the size. -Original Message- What if the values for x and y are not known? I have a function that returns a thumbnail of a larger image; it calculates the size of the created image based on the dimensions of the original. Paul Birnstihl wrote: Ed Lazor wrote: Is there a way to get the size of an image created using the imagecreate function? I'm guessing it would be xsize x ysize x colour depth = size in bits ? -- 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] Weird numbers around HTTP response body
[EMAIL PROTECTED] wrote: I noticed some numbers mixed with the response generated by my PHP code, and I can't figure out what's causing it. I've dumbed my PHP script down to just this (what could be simpler?): ?php echo testing; ? And I monitor the HTTP response coming from the server (apache), it looks like this: HTTP/1.1 200 OK Date: Mon, 13 Sep 2004 20:03:21 GMT Server: Apache/2.0.44 (Unix) PHP/4.3.1 Accept-Ranges: bytes X-Powered-By: PHP/4.3.1 Transfer-Encoding: chunked ^^| this is the cause -+ http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.6.1 If you don't want the numbers there, don't specify that you accept chunked encoding in your request. Content-Type: text/html; charset=ISO-8859-1 7 testing 0 Note the 7 and the 0. After some experimenting I believe the first number is the length of the body, then there's the body, and finally a 0 at the end. What gives? How to I get rid of these numbers? I'm running on linux. The software versions are in the HTTP headers but in case you missed them, apache 2.0.44 and PHP 4.3.1. And help is appreciated. Thanks. -Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php