Re: [PHP] More on cleaning Windows characters...
Hi, Monday, November 4, 2002, 2:58:22 PM, you wrote: ahsb After considerable investigation into the form input of non-Latin 1 ahsb characters to be processed by PHP on a Linux box, I've been able to ahsb distill the issue down considerably, though a solution (and one oddity) ahsb remains confusing. ahsb I found a very helpful web page entitled On the use of some MS Windows ahsb characters in HTML that explains my problem rather well at ahsb http://www.cs.tut.fi/~jkorpela/www/windows-chars.html. Recommended ahsb reading for anyone displaying text that may have been entered by ahsb Windows users, especially text pasted in from word-processing apps. ahsb Basically, the problem is this: on a Windows machine using Windows 1252 ahsb (Windows Latin 1), a pair of smart quotes are ASCII characters 147 ahsb and 148. There are a number of other special characters that Windows ahsb maps onto ASCII 128-159, like em dashes and trademark symbols. ahsb Unfortunately, _true_ Latin 1 (iso-8859-1) reserves chars 128-159 for ahsb control characters. So, while you may type ALT-0147 to type a smart ahsb quote into your word processing app (or allow Word to create them ahsb automagically when you type a quote), when that very same character is ahsb pasted into a web page form set to accept iso-8859-1 or UTF-8 encoding, ahsb it DOES NOT MAP to chr(147) when processed by PHP on a Linux box. ahsb Strangely, pasting in a Word-created smart quote character into a web ahsb form and processing it with PHP produces VERY ODD results. Take the ahsb string ahsb == ahsb where the quotation mark is a curly-style quote. Tell PHP to step ahsb through the characters and print their ASCII value. The two equal signs ahsb are fine (char 61), but the curly quote comes across as THREE ahsb characters: (226)(128)(156). Where this comes from, I do not understand. ahsb I'm inclined to think that if I _don't_ try to specify the ahsb accept-charset parameter on the form, and _don't_ try to convert em ahsb dashes, curly quotes, etc that I'll probably end up with cleaner text ahsb than I do now. ahsb Still, if anyone has any really helpful input on this topic, please ahsb write me and let me know. We're getting into the ugly guts of page ahsb charset vs. form accept-charset vs. browser input charset vs. latin 1 ahsb vs. Windows latin 1 vs. MacRoman here, but I'm surprised that no one ahsb has chimed in on this. Does anyone else ever run into this problem, or ahsb does everyone else's forms just handle all of this magically without ahsb any intervention? ahsb spud. ahsb --- ahsb a.h.s. boy ahsb spud(at)nothingness.orgas yes is to if,love is to yes ahsb http://www.nothingness.org/ ahsb --- I ran into that problem inserting word tables into xml, i ran the stuff through iconv() to clean it up. $title = iconv(ISO-8859-1,UTF-8,$title); Not sure if that was the right way to do it but it worked :) -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Battling with highlighting search criteria
Hi there, My brain has just gone very fuzzy... I have a search string ($search) and a result ($result). I need to highlight every occurance of $search in $result. I know that it means that I need to change (for example) $result = This is a test, isn't it? $search = is Into $result = thspan class=highlightis/span span class=highlightis/span a test, span class=highlightis/span'nt it Now I can easily see how to change the FIRST occurrence of the word, but how can I change every occurance? Thanks David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com smime.p7s Description: application/pkcs7-signature
[PHP] Address array?
I want to display an address from my database based on an orderid. Where am I going wrong? I am still unsure how Php interacts with mySQL but am I right in assuming it should be an array? My code... function get_shipping_address($address_array) { $conn = db_connect(); $orderid = get_order_id($orderid); $query = SELECT * FROM orders WHERE orderid = '$orderid'; $row = mysql_fetch_array($query); foreach ($address_array as $row) { $ship_name = $row[ship_name]; $ship_address = $row[ship_address]; $ship_city = $row[ship_city]; $ship_zip = $row[ship_zip]; $ship_country = $row[ship_country]; } } Steve Jackson Web Developer Viola Systems Ltd. http://www.violasystems.com [EMAIL PROTECTED] Mobile +358 50 343 5159 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Address array?
Steve Jackson wrote: I want to display an address from my database based on an orderid. Where am I going wrong? I am still unsure how Php interacts with mySQL but am I right in assuming it should be an array? My code... function get_shipping_address($address_array) { $conn = db_connect(); $orderid = get_order_id($orderid); $query = SELECT * FROM orders WHERE orderid = '$orderid'; $row = mysql_fetch_array($query); foreach ($address_array as $row) { $ship_name = $row[ship_name]; $ship_address = $row[ship_address]; $ship_city = $row[ship_city]; $ship_zip = $row[ship_zip]; $ship_country = $row[ship_country]; } } Nope...that's not correct! PHP will put every column of ONE row in an array. You will have to loop trough your recordset to get all rows. function get_shipping_address($address_array) { $conn = db_connect(); $orderid = get_order_id($orderid); $query = SELECT * FROM orders WHERE orderid = '$orderid'; while( $row = mysql_fetch_array($query) ); { $ship_name = $row[ship_name]; $ship_address = $row[ship_address]; $ship_city = $row[ship_city]; $ship_zip = $row[ship_zip]; $ship_country = $row[ship_country]; // Do something... } } HTH Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Battling with highlighting search criteria
I have a search string ($search) and a result ($result). I need to highlight every occurance of $search in $result. I know that it means that I need to change (for example) $result = This is a test, isn't it? $search = is Into $result = thspan class=highlightis/span span class=highlightis/span a test, span class=highlightis/span'nt it Now I can easily see how to change the FIRST occurrence of the word, but how can I change every occurance? How about str_replace? $result = This is a test, isn't it?; $search = is; $replacement = 'span class=highlight' . $search . '/span'; $result = str_replace( $search, $replacement, $result ); HTH Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Images retrieved from MYSQL database using PHP becoming corrupted.
hello, Check the PHP-DB archives you'll find a code for the upload, and this one for viewing image : ? $mysql_hostname = ; $mysql_username = ; $mysql_passwd = ; $mysql_dbname = ; // Connecting, selecting database $link = @mysql_connect($mysql_hostname,$mysql_username, $mysql_passwd) or die(Could not connect); @mysql_select_db($mysql_dbname) or die(Could not select database); $query = select image_thumbnail,image_thumbnail_type from master_products where item_id=$id; $result = mysql_query( $query ) or die(Query failed); $num = musql_numrows($result); $data = @mysql_fetch_array($result); if ($id == 1) { // Output the MIME header $mime = $data[image_thumbnail_type]; header(Content-Type: $mime); echo $data[image_thumbnail]; } else { // not valid id image, you can send any other message } ? Hope this will help Hatem Darren McPhee [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] I have spent the last 3 days trying to figure this out. And will probably give up very soon. I have written 2 programs (which are very common PHP programs) that A) Allows me to upload image files into a MYSQL database using a simple form. And B) Allows me to retrieve and display the image using a PHP script. This is my problem:- I can upload the images ok. I store the binary code, image type, name, and size within the MYSQL database. On checking the database directly using DBTools, I can see that the files have uploaded. The file sizes reflect exactly what was originally on the hard disk of my PC (not sure if this is a correct gauge). When I run my PHP program to display the images, maybe only 1 out of 10 actually displays correctly. The rest are broken up or non displayable images. One image even made a prompt window appear and somehow now causes Windows paint to load the image instead of the browser. God only knows how that occurred !! Below are my (designed by others) 2 programs. The first program is the upload form. This seems to work ok. HTML HEADTITLEStore binary data into SQL Database/TITLE/HEAD BODY ?php // code that will be executed if the form has been submitted: if ($submit) { // connect to the database require_once('../../Connections/TestServer.php'); mysql_select_db($database_TestServer, $TestServer); $data = addslashes(fread(fopen($form_data, r), filesize($form_data))); $result=MYSQL_QUERY(INSERT INTO master_products (image_thumbnail,image_thumbnail_name,image_thumbnail_size,image_thumbnail_t ype) . VALUES ('$data','$form_data_name','$form_data_size','$form_data_type')); $id= mysql_insert_id(); print pThis file has the following Database ID: b$id/b; MYSQL_CLOSE(); } else { // else show the form to submit new data: ? form method=post action=?php echo $PHP_SELF; ? enctype=multipart/form-data INPUT TYPE=hidden name=MAX_FILE_SIZE value=100 brFile to upload/store in database:br input type=file name=form_data size=40 pinput type=submit name=submit value=submit /form ?php } ? /BODY /HTML Here is the code to display the image:- ?php if($id) { require_once('../Connections/TestServer.php'); mysql_select_db($database_TestServer, $TestServer); $query = select image_thumbnail,image_thumbnail_type from master_products where item_id=$id; $result = @MYSQL_QUERY($query); $data = @MYSQL_RESULT($result,0,image_thumbnail); $type = @MYSQL_RESULT($result,0,image_thumbnail_type); Header( Content-type: $type); echo $data; }; ? I run the above program in the following way: http://192.168.0.11/htdocs/displayimage2.php?id=9 The ID is the item_id primary key field for whichever record I want to display. I have tried these programs on a test server here in my room to a test Apache server and MYSQL test database, and also from my ISP to a MYSQL database at a server at my ISP. I get exactly the same problem. When I run the display image program, the images being displayed are always being displayed the same. Which points the problem towards the upload process (maybe). If anybody can tell me what the heck is wrong here, I'll give them a medal !! There is basically some kind of binary corruption going on (it looks like) For added information, below is my database table structure. At the moment, the only part I am actually using relates to the image_thumbnail sections. Darren. CREATE TABLE master_products ( item_id SMALLINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, item_code VARCHAR (10) UNIQUE, item_dateadded DATETIME DEFAULT '-00-00 00:00:00', item_datemodified DATETIME DEFAULT '-00-00 00:00:00', category ENUM (none,single herbs,general vitality,ageing,arthritis,eyesite,prostate,ahlzheimers, weight loss,menopause,depression,fatigue,headaches,insomnia,colds and flues,allergies, healthy heart,cancer prevention,aphrodisiacs,sexual herbs,for women,for
[PHP] Re: confirm subscribe to php-general@lists.php.net
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... On 2 Nov 2002 03:26:36 - [EMAIL PROTECTED] wrote: Hi! This is the ezmlm program. I'm managing the [EMAIL PROTECTED] mailing list. I'm working for my owner, who can be reached at [EMAIL PROTECTED] To confirm that you would like [EMAIL PROTECTED] added to the php-general mailing list, please send an empty reply to this address: [EMAIL PROTECTED] Usually, this happens when you just hit the reply button. If this does not work, simply copy the address and paste it into the To: field of a new message. or click here: mailto:php-general-sc.1036207596.kehogdkeclpnffkcijba-bryanc2000=insightbb.com;lists.php.net Brian Read the instructions above carefully, particularly the bit where it tells you what address to send to, and try again. -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Who can tell me where I can get the cracked Zend Encoder3.0 ?
Who can tell me where I can get the cracked Zend Encoder 3.0 ? By the way write do [EMAIL PROTECTED] for cracked Windows XP ;-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Battling with highlighting search criteria
Hey there I told you my brain was feeling fuzzy :) This works great. Only one problem... I would like it to be case insensitive... Any way? I assume that it would be a ereg/preg replace, but I have no clue with regexp at all. Anyone who could help?? David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com -Original Message- From: Erwin [mailto:erwin;isiz.com] Sent: 04 November 2002 10:42 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: Battling with highlighting search criteria I have a search string ($search) and a result ($result). I need to highlight every occurance of $search in $result. I know that it means that I need to change (for example) $result = This is a test, isn't it? $search = is Into $result = thspan class=highlightis/span span class=highlightis/span a test, span class=highlightis/span'nt it Now I can easily see how to change the FIRST occurrence of the word, but how can I change every occurance? How about str_replace? $result = This is a test, isn't it?; $search = is; $replacement = 'span class=highlight' . $search . '/span'; $result = str_replace( $search, $replacement, $result ); HTH Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php smime.p7s Description: application/pkcs7-signature
Re: [PHP] Battling with highlighting search criteria
how are you doing it for only the FIRST??? Anyhoo, a simple string replace should do it... I'd do this: $result = str_replace($search,span class=\highlight\{$search}/span,$result); Justin on 04/11/02 6:27 PM, David Russell ([EMAIL PROTECTED]) wrote: Hi there, My brain has just gone very fuzzy... I have a search string ($search) and a result ($result). I need to highlight every occurance of $search in $result. I know that it means that I need to change (for example) $result = This is a test, isn't it? $search = is Into $result = thspan class=highlightis/span span class=highlightis/span a test, span class=highlightis/span'nt it Now I can easily see how to change the FIRST occurrence of the word, but how can I change every occurance? Thanks David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Battling with highlighting search criteria
David Russell wrote: Hey there I told you my brain was feeling fuzzy :) This works great. Only one problem... I would like it to be case insensitive... Any way? I assume that it would be a ereg/preg replace, but I have no clue with regexp at all. Try the following one: $result = This is a test, isn't it?; $search = is; $result = preg_replace( '/(' . $search . ')/i', span class=\highlight\\$1/span, $result ); Grtz Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to use OCISaveLob OCILoadLob OCISaveLobFile
Hello, Who know how to use those functions:OCISaveLob, OCILoadLob, OCISaveFile? Where can I find documentation and sample about this general purpose: 'lob object manipulation with oracle Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Address array?
On Monday 04 November 2002 16:42, Steve Jackson wrote: I want to display an address from my database based on an orderid. Where am I going wrong? I am still unsure how Php interacts with mySQL but am I right in assuming it should be an array? My code... function get_shipping_address($address_array) { $conn = db_connect(); $orderid = get_order_id($orderid); $query = SELECT * FROM orders WHERE orderid = '$orderid'; $row = mysql_fetch_array($query); You don't need the foreach loop (and in fact you've mixed up its parameters so it wouldn't work anyway). foreach ($address_array as $row) { $ship_name = $row[ship_name]; $ship_address = $row[ship_address]; $ship_city = $row[ship_city]; $ship_zip = $row[ship_zip]; $ship_country = $row[ship_country]; } Just simply: $ship_name = $row[ship_name]; $ship_address = $row[ship_address]; $ship_city = $row[ship_city]; $ship_zip = $row[ship_zip]; $ship_country = $row[ship_country]; Here's how foreach can be used: foreach ($row as $field_name = $field_value) { echo $field_name contains $field_valuebr; } -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* QOTD: It's been Monday all week today. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Battling with highlighting search criteria
Hi Erwin, Yep, this does exactly what str_replace does. How can I make the whole thing case insensitive: $result= This Is A Test, Isn't It? $search= IS It will include the 'is' in 'This', and also the 'Is' and the 'is' in 'isn't'. cheers David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com -Original Message- From: Erwin [mailto:erwin;isiz.com] Sent: 04 November 2002 11:27 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: Battling with highlighting search criteria David Russell wrote: Hey there I told you my brain was feeling fuzzy :) This works great. Only one problem... I would like it to be case insensitive... Any way? I assume that it would be a ereg/preg replace, but I have no clue with regexp at all. Try the following one: $result = This is a test, isn't it?; $search = is; $result = preg_replace( '/(' . $search . ')/i', span class=\highlight\\$1/span, $result ); Grtz Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php smime.p7s Description: application/pkcs7-signature
RE: [PHP] Battling with highlighting search criteria
Ok, this works. Just one more thing, How can I get the return in the same case as it was originally? Ie if I have $string = Forward , and $search = for, I want spanForward/span, not span...forward/span. Thanks David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com -Original Message- From: Justin French [mailto:justin;indent.com.au] Sent: 04 November 2002 12:49 PM To: David Russell Subject: Re: [PHP] Battling with highlighting search criteria Yeap, you need a regexp... $result = eregi_replace($search,span class=\foo\$search/span,$result); This will be a little slower that str_replace, but it's the easiest way if you need case insensitivity... Justin on 04/11/02 7:27 PM, David Russell ([EMAIL PROTECTED]) wrote: Hmmm, old method: Find starting point of substring, and do a substr replace (not really elegant) But how can I make your method case insensitive? I presume ereg/preg replaces. My regexp knowledge is non-existent, however!! Cheers David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com -Original Message- From: Justin French [mailto:justin;indent.com.au] Sent: 04 November 2002 12:27 PM To: David Russell; [EMAIL PROTECTED] Subject: Re: [PHP] Battling with highlighting search criteria how are you doing it for only the FIRST??? Anyhoo, a simple string replace should do it... I'd do this: $result = str_replace($search,span class=\highlight\{$search}/span,$result); Justin on 04/11/02 6:27 PM, David Russell ([EMAIL PROTECTED]) wrote: Hi there, My brain has just gone very fuzzy... I have a search string ($search) and a result ($result). I need to highlight every occurance of $search in $result. I know that it means that I need to change (for example) $result = This is a test, isn't it? $search = is Into $result = thspan class=highlightis/span span class=highlightis/span a test, span class=highlightis/span'nt it Now I can easily see how to change the FIRST occurrence of the word, but how can I change every occurance? Thanks David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com smime.p7s Description: application/pkcs7-signature
RE: [PHP] Re: Battling with highlighting search criteria
Sorry, my mistake... This is what happens when you have 2 machines - one production and one development. You get confused between the two grin Just one more thing, How can I get the return in the same case as it was originally? Ie if I have $string = Forward , and $search = for, I want spanForward/span, not span...forward/span. David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com -Original Message- From: David Russell [mailto:DavidR;BarloworldOptimus.com] Sent: 04 November 2002 11:54 AM To: 'Erwin'; [EMAIL PROTECTED] Subject: RE: [PHP] Re: Battling with highlighting search criteria Hi Erwin, Yep, this does exactly what str_replace does. How can I make the whole thing case insensitive: $result= This Is A Test, Isn't It? $search= IS It will include the 'is' in 'This', and also the 'Is' and the 'is' in 'isn't'. cheers David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com -Original Message- From: Erwin [mailto:erwin;isiz.com] Sent: 04 November 2002 11:27 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: Battling with highlighting search criteria David Russell wrote: Hey there I told you my brain was feeling fuzzy :) This works great. Only one problem... I would like it to be case insensitive... Any way? I assume that it would be a ereg/preg replace, but I have no clue with regexp at all. Try the following one: $result = This is a test, isn't it?; $search = is; $result = preg_replace( '/(' . $search . ')/i', span class=\highlight\\$1/span, $result ); Grtz Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php smime.p7s Description: application/pkcs7-signature
Re: [PHP] Re: Battling with highlighting search criteria
Try the following one: $result = This is a test, isn't it?; $search = is; $result = preg_replace( '/(' . $search . ')/i', span class=\highlight\\$1/span, $result ); Grtz Erwin David Russell wrote: Hi Erwin, Yep, this does exactly what str_replace does. No, it doens't...this one is case insensitive. The pattern (which is /(is)/i in this example), has the i modifier (the last i), which means case insensitive. In fact, the above regexp even preserves case for you! How can I make the whole thing case insensitive: It already is, please try it again (I've doublechecked it by now) ;-)) Grtz Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Battling with highlighting search criteria
How can I get the return in the same case as it was originally? Ie if I have $string = Forward , and $search = for, I want spanForward/span, not span...forward/span. Read my reply to your previous reply ;-)) But...some more explanation: $result = preg_replace( '/(' . $search . ')/i', span class=\highlight\\$1/span, $result ); The first argument is the pattern, which is '/(for)/i' in the case of searching for for. That will match every occurence of for, For, fOr, and so on. The case insensitivy is reached by the i modifier at the end of the pattern. The second argument is the replace string. The $1 is an backward reference to the first item between brackets. That'll mean that the from the word Forward, the $1 parameter will contain For. So, the For -part from Forward will be replaced with span class=highlightFor/span and that's exactly what you want (right?)... Hope this clears your brain up ;-))) Grtz Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Battling with highlighting search criteria
With a more detailed regexp... unfortunately, I don't know enough about them. Justin on 04/11/02 7:59 PM, David Russell ([EMAIL PROTECTED]) wrote: Ok, this works. Just one more thing, How can I get the return in the same case as it was originally? Ie if I have $string = Forward , and $search = for, I want spanForward/span, not span...forward/span. Thanks David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com -Original Message- From: Justin French [mailto:justin;indent.com.au] Sent: 04 November 2002 12:49 PM To: David Russell Subject: Re: [PHP] Battling with highlighting search criteria Yeap, you need a regexp... $result = eregi_replace($search,span class=\foo\$search/span,$result); This will be a little slower that str_replace, but it's the easiest way if you need case insensitivity... Justin on 04/11/02 7:27 PM, David Russell ([EMAIL PROTECTED]) wrote: Hmmm, old method: Find starting point of substring, and do a substr replace (not really elegant) But how can I make your method case insensitive? I presume ereg/preg replaces. My regexp knowledge is non-existent, however!! Cheers David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com -Original Message- From: Justin French [mailto:justin;indent.com.au] Sent: 04 November 2002 12:27 PM To: David Russell; [EMAIL PROTECTED] Subject: Re: [PHP] Battling with highlighting search criteria how are you doing it for only the FIRST??? Anyhoo, a simple string replace should do it... I'd do this: $result = str_replace($search,span class=\highlight\{$search}/span,$result); Justin on 04/11/02 6:27 PM, David Russell ([EMAIL PROTECTED]) wrote: Hi there, My brain has just gone very fuzzy... I have a search string ($search) and a result ($result). I need to highlight every occurance of $search in $result. I know that it means that I need to change (for example) $result = This is a test, isn't it? $search = is Into $result = thspan class=highlightis/span span class=highlightis/span a test, span class=highlightis/span'nt it Now I can easily see how to change the FIRST occurrence of the word, but how can I change every occurance? Thanks David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Battling with highlighting search criteria -solution
I just had a look in the manual at the reg exp functions, and this was in the user notes: eregi_replace($search, b\\0/b, $text); so, try: $result = eregi_replace($search, span class=\foo\\\0/span, $result); Justin on 04/11/02 7:59 PM, David Russell ([EMAIL PROTECTED]) wrote: Ok, this works. Just one more thing, How can I get the return in the same case as it was originally? Ie if I have $string = Forward , and $search = for, I want spanForward/span, not span...forward/span. Thanks David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com -Original Message- From: Justin French [mailto:justin;indent.com.au] Sent: 04 November 2002 12:49 PM To: David Russell Subject: Re: [PHP] Battling with highlighting search criteria Yeap, you need a regexp... $result = eregi_replace($search,span class=\foo\$search/span,$result); This will be a little slower that str_replace, but it's the easiest way if you need case insensitivity... Justin on 04/11/02 7:27 PM, David Russell ([EMAIL PROTECTED]) wrote: Hmmm, old method: Find starting point of substring, and do a substr replace (not really elegant) But how can I make your method case insensitive? I presume ereg/preg replaces. My regexp knowledge is non-existent, however!! Cheers David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com -Original Message- From: Justin French [mailto:justin;indent.com.au] Sent: 04 November 2002 12:27 PM To: David Russell; [EMAIL PROTECTED] Subject: Re: [PHP] Battling with highlighting search criteria how are you doing it for only the FIRST??? Anyhoo, a simple string replace should do it... I'd do this: $result = str_replace($search,span class=\highlight\{$search}/span,$result); Justin on 04/11/02 6:27 PM, David Russell ([EMAIL PROTECTED]) wrote: Hi there, My brain has just gone very fuzzy... I have a search string ($search) and a result ($result). I need to highlight every occurance of $search in $result. I know that it means that I need to change (for example) $result = This is a test, isn't it? $search = is Into $result = thspan class=highlightis/span span class=highlightis/span a test, span class=highlightis/span'nt it Now I can easily see how to change the FIRST occurrence of the word, but how can I change every occurance? Thanks David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] trouble with maximum_execution_time and file upload
If you are running in safe mode, setting time limit has no effect Eduardo M. Bragatto wrote: I've send an e-mail with a doubt related with the maximum_execution_time variable but it has no answers, so, I'm submiting it again... I'm using a single php script to send files named upload.php, here is the source code: ?php set_time_limit(500); copy($userfile, log\\$userfile_name); echo htmlheadtitleUploading file.../titlemeta http-equiv=\refresh\ content=\0; url=http://test.com/file_sent.html\;/headbodycenterfont face=\Verdana\ size=\4\Uploading file.../font/center/body/html; ? I've tried to change the time limit because there's an error that doesn't stop when trying to send big files (when the duration of upload takes more than 20 seconds): Fatal error: Maximum execution time of 20 seconds exceeded in D:\dominios\E\escolas-es\spe\upload.php on line 2 As you can see, the time limit is exceeded before the set_time_limit is executed. I thing that's because the script begins only after the file is uploaded. My problem is that I can't change the maximum_execution_time in the configuration file. Does anyone knows how to solve that problem? Thank you, Eduardo M. Bragatto. PS: Sorry for my miserable english #) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Images retrieved from MYSQL database using PHP becomingcorrupted.
Works for me, tr putting some echo mysql_error on your page Darren McPhee wrote: I have spent the last 3 days trying to figure this out. And will probably give up very soon. I have written 2 programs (which are very common PHP programs) that A) Allows me to upload image files into a MYSQL database using a simple form. And B) Allows me to retrieve and display the image using a PHP script. This is my problem:- I can upload the images ok. I store the binary code, image type, name, and size within the MYSQL database. On checking the database directly using DBTools, I can see that the files have uploaded. The file sizes reflect exactly what was originally on the hard disk of my PC (not sure if this is a correct gauge). When I run my PHP program to display the images, maybe only 1 out of 10 actually displays correctly. The rest are broken up or non displayable images. One image even made a prompt window appear and somehow now causes Windows paint to load the image instead of the browser. God only knows how that occurred !! Below are my (designed by others) 2 programs. The first program is the upload form. This seems to work ok. HTML HEADTITLEStore binary data into SQL Database/TITLE/HEAD BODY ?php // code that will be executed if the form has been submitted: if ($submit) { // connect to the database require_once('../../Connections/TestServer.php'); mysql_select_db($database_TestServer, $TestServer); $data = addslashes(fread(fopen($form_data, r), filesize($form_data))); $result=MYSQL_QUERY(INSERT INTO master_products (image_thumbnail,image_thumbnail_name,image_thumbnail_size,image_thumbnail_t ype) . VALUES ('$data','$form_data_name','$form_data_size','$form_data_type')); $id= mysql_insert_id(); print pThis file has the following Database ID: b$id/b; MYSQL_CLOSE(); } else { // else show the form to submit new data: ? form method=post action=?php echo $PHP_SELF; ? enctype=multipart/form-data INPUT TYPE=hidden name=MAX_FILE_SIZE value=100 brFile to upload/store in database:br input type=file name=form_data size=40 pinput type=submit name=submit value=submit /form ?php } ? /BODY /HTML Here is the code to display the image:- ?php if($id) { require_once('../Connections/TestServer.php'); mysql_select_db($database_TestServer, $TestServer); $query = select image_thumbnail,image_thumbnail_type from master_products where item_id=$id; $result = MYSQL_QUERY($query); $data = MYSQL_RESULT($result,0,image_thumbnail); $type = MYSQL_RESULT($result,0,image_thumbnail_type); Header( Content-type: $type); echo $data; }; ? I run the above program in the following way: http://192.168.0.11/htdocs/displayimage2.php?id=9 The ID is the item_id primary key field for whichever record I want to display. I have tried these programs on a test server here in my room to a test Apache server and MYSQL test database, and also from my ISP to a MYSQL database at a server at my ISP. I get exactly the same problem. When I run the display image program, the images being displayed are always being displayed the same. Which points the problem towards the upload process (maybe). If anybody can tell me what the heck is wrong here, I'll give them a medal !! There is basically some kind of binary corruption going on (it looks like) For added information, below is my database table structure. At the moment, the only part I am actually using relates to the image_thumbnail sections. Darren. CREATE TABLE master_products ( item_id SMALLINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, item_code VARCHAR (10) UNIQUE, item_dateadded DATETIME DEFAULT '-00-00 00:00:00', item_datemodified DATETIME DEFAULT '-00-00 00:00:00', category ENUM (none,single herbs,general vitality,ageing,arthritis,eyesite,prostate,ahlzheimers, weight loss,menopause,depression,fatigue,headaches,insomnia,colds and flues,allergies, healthy heart,cancer prevention,aphrodisiacs,sexual herbs,for women,for men,books), name VARCHAR (30), name_dateadded DATETIME DEFAULT '-00-00 00:00:00', name_datemodified DATETIME DEFAULT '-00-00 00:00:00', INDEX idx_name (name), desc_brief VARCHAR (255), desc_brief_dateadded DATETIME DEFAULT '-00-00 00:00:00', desc_brief_datemodified DATETIME DEFAULT '-00-00 00:00:00', INDEX idx_desc_brief (desc_brief), desc_long TEXT, desc_long_dateadded DATETIME DEFAULT '-00-00 00:00:00', desc_long_datemodified DATETIME DEFAULT '-00-00 00:00:00', price DECIMAL (7,2), price_dateadded DATETIME DEFAULT '-00-00 00:00:00', price_datemodified DATETIME DEFAULT '-00-00 00:00:00', image LONGBLOB, image_name VARCHAR (50), image_size INT UNSIGNED, image_type VARCHAR (50), image_dateadded DATETIME DEFAULT '-00-00 00:00:00', image_datemodified DATETIME DEFAULT '-00-00 00:00:00', image_thumbnail LONGBLOB, image_thumbnail_name VARCHAR (50), image_thumbnail_size INT UNSIGNED, image_thumbnail_type VARCHAR (50),
[PHP] How to send mail with authentification?
Hello! Our SMTP-Server has changed to authentification. Now we cannot send mails anymore using mail(). How can I set the password in mail? Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Battling with highlighting search criteria
Hi Erwin, Great thanx, my brain is cleared grin. Well, a little more... Where would I be able to find more info about regexp's? TIA David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com -Original Message- From: Erwin [mailto:erwin;isiz.com] Sent: 04 November 2002 12:08 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: Battling with highlighting search criteria How can I get the return in the same case as it was originally? Ie if I have $string = Forward , and $search = for, I want spanForward/span, not span...forward/span. Read my reply to your previous reply ;-)) But...some more explanation: $result = preg_replace( '/(' . $search . ')/i', span class=\highlight\\$1/span, $result ); The first argument is the pattern, which is '/(for)/i' in the case of searching for for. That will match every occurence of for, For, fOr, and so on. The case insensitivy is reached by the i modifier at the end of the pattern. The second argument is the replace string. The $1 is an backward reference to the first item between brackets. That'll mean that the from the word Forward, the $1 parameter will contain For. So, the For -part from Forward will be replaced with span class=highlightFor/span and that's exactly what you want (right?)... Hope this clears your brain up ;-))) Grtz Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php smime.p7s Description: application/pkcs7-signature
[PHP] Re: How to send mail with authentification?
Hello, On 11/04/2002 09:54 AM, Martin Thoma wrote: Hello! Our SMTP-Server has changed to authentification. Now we cannot send mails anymore using mail(). How can I set the password in mail? Not with mail(). You may want to try this class that comes with a wrapper function named smtp_mail() that emulates the mail() function. It has some variables for setting the autentication credentials: http://www.phpclasses.org/mimemessage You also need this: http://www.phpclasses.org/smtpclass -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php's saxon:output equivalent
Has anybody an equivalent for java saxon:output in a php library ? The port I would make follow : xsl:template match=/ xsl:for-each select=*/INDI saxon:output file={$dir}/{@ID}.html xsl:apply-templates select=./ /saxon:output /xsl:for-each saxon:output file={$dir}/index.html xsl:call-template name=make-index/ /saxon:output /xsl:template Thanks for your help . Pierre Vaudrey email [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] finding a value in an array
I have a database table that holds the values of IDs in the format 1,2,3,4,5,67,x,x,x,x,x,x I am using a dynamic select list menu that displays a list of items from a 2nd table with the values set to their unique ids eg option vaue =1item 1/option option vaue =2item2/option option vaue =3item 3/option option vaue =4item 4/option option vaue =5item 5/option i am trying to use an array search that will highlight the item if the option value is in the array of the IDs, but with no luck, either all the ids are highlighted or none at all Does any one have any suggestions into how to do this Thanks Craig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: finding a value in an array
Craig wrote: I have a database table that holds the values of IDs in the format 1,2,3,4,5,67,x,x,x,x,x,x I am using a dynamic select list menu that displays a list of items from a 2nd table with the values set to their unique ids eg option vaue =1item 1/option option vaue =2item2/option option vaue =3item 3/option option vaue =4item 4/option option vaue =5item 5/option i am trying to use an array search that will highlight the item if the option value is in the array of the IDs, but with no luck, either all the ids are highlighted or none at all $ids = '1,2,3,4,5,6,7'; // This value represents the database value $array_ids = explode( ',', $ids ); // This will give you an array with all the id's $amount = 10; // Amount of options for ( $i = 0; $i $amount; $i++ ) { print 'option value=' . $i; if ( in_array( $i, $array_ids ) ) // If the value is in the id's array, then print selected print ' selected'; print '' . $i . '/option'; } Something like that? Grtz Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Session cookies
I don't use cookies when I use sessions.. Saves hassles Regards Chris Kay -Original Message- From: Erwin [mailto:erwin;isiz.com] Sent: Monday, 4 November 2002 6:50 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: Session cookies When the user logs in , i create a session with session varialbles, the session cookie is saved on clients computer. When i log off i say session_unset(); session_destroy(); setcookie(session_name()); The session in the tmp is deleted , but the cookie is still there , i know this because when i login , the same session id is used ! Why is that ? Because you use the same session to connect from client to server. You don't close your browser, don't wait 20 minutes (or something like that), so the webserver knows you are the same. The session between the client and server is not yet gone. It's also possible that you need to set your cookie in the past. You're just setting a cookie with setcookie(session_name()). If you want it destroyed, set it some time ago, like setcookie(session_name(),-3600). The session id changes when you close the browser , as the default is 0. Not because default is 0, but because there isn't any session yet. HTH Erwin -- 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] Add content thru e-mail
Could you not put a .forward to a php script? Correct me if I am wrong or even point me in the right direction Cause I am thinking of doing this soon. Regards Chris Kay -Original Message- From: Timothy Hitchens (HiTCHO) [mailto:phplists;hitcho.com.au] Sent: Monday, 4 November 2002 12:59 PM Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Add content thru e-mail The simplest way to do this to setup a pop3 account and have a php script check this account at intervals via cron. Or you could write a pipe script via aliases. Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] On Sun, 3 Nov 2002, Rodrigo de Oliveira Costa wrote: Hi people, i'd like to know if there is a way to add content to a database thru sending an e-mail, and if there is how it would be done. Thanks, Rodrigo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How to send mail with authentification?
Thanx, I will try this. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Php Ready-to-go
Hello! Is there a way to run a php-script on a pc/windows-computer which hasn't php-installed? I thought of somekind of compiler which creates an .exe, which embeds the script and the php-environment. Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Php Ready-to-go
Hello Martin, Monday, November 04, 2002, 2:53:48 PM, you wrote: MT Hello! MT Is there a way to run a php-script on a pc/windows-computer which hasn't MT php-installed? I thought of somekind of compiler which creates an .exe, MT which embeds the script and the php-environment. MT Martin On win32 I use PHP-GTK and I've solved this problem: php-gtk need php executable and some dlls all what I've done - I've created with Install Shield an instalation package which contains php executable and its own dlls and php-gtk files InstallShield during install my package copy some dlls and php.ini into %windir% and creates shortcut to my main programm file: php_gtk main.php if you don't need gtk - I think you should dig around a shortcut some like this php.exe your_script.php -- Best regards, Alexander Kuznetsov -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Add content thru e-mail
/etc/aliases foo: |/path/to/script.php script.php ? $fp = fopen(php://stdin,r) ; $buffer = ; while (!feof($fp)) { $buffer .= fgetc($fp); } $email_parts = explode(\n\n,preg_replace(/\r/,,$buffer)); $headers = $email_parts[0]; $body = $email_parts[1]; /* ...etc... */ ? Quoting Chris Kay [EMAIL PROTECTED]: Could you not put a .forward to a php script? Correct me if I am wrong or even point me in the right direction Cause I am thinking of doing this soon. Regards Chris Kay -Original Message- From: Timothy Hitchens (HiTCHO) [mailto:phplists;hitcho.com.au] Sent: Monday, 4 November 2002 12:59 PM Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Add content thru e-mail The simplest way to do this to setup a pop3 account and have a php script check this account at intervals via cron. Or you could write a pipe script via aliases. Timothy Hitchens (HiTCHO) [EMAIL PROTECTED] On Sun, 3 Nov 2002, Rodrigo de Oliveira Costa wrote: Hi people, i'd like to know if there is a way to add content to a database thru sending an e-mail, and if there is how it would be done. Thanks, Rodrigo -- 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 === Michael Geier CDM Sports, Inc. Systems Administration email: [EMAIL PROTECTED] phone: 314.991.1511 x 6505 --- This email sent using CDM Sports Webmail v3.1 [ http://webmail.cdmsports.com ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HELP COOKIES !
Hi, I tried some advice you gave , i tried to destroy the session cookie wiht setcookie(session_name()); and setcookie(session_name(),-3600); but the cookie is still there . Instead , there are now 2 cookies with the same name , the one has the session id , the other has no contents! HOW CAN I DELETE THESE THINGS !!! Thanks alot Shaun -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Your opinion on globals/reference
That is true. Didn't think about it like that. Thanks for your input.. rolf vreijdenberger wrote: but what if you decide later you want more objects or globals in your function?? your parameter list could get quit long! -- Rolf Vreijdenberger De Pannekoek en De Kale W: www.depannekoekendekale.nl Gerard Samuel [EMAIL PROTECTED] schreef in bericht news:3DC54436.2090803;trini0.org... Something I just thought of about using global in a function. Mostly I global objects in a function like - function foo() { global $bar_object; $bar_object-do_something(); } Is it better, more effiecient, if I pass it by reference, like - function foo($bar_object) { $bar_object-do_something(); } Thanks for your thoughts... -- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/ -- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fsockopen fails if port blocked by firewall - PHP 4.0.6 / Apache / Linux
Hello List - I am having a problem with fsockopen since my ISP upgraded their linux server. The same function works just fine on another linux server and PHP version (using a different ISP). This fsockopen function previously worked as expected, returning within the specified timeout (2 sec) if a socket connection attempt to client is rejected, eg by a firewall. For connection to port 1720, (then immediate close of socket if fsockopen returns true) I use : $fsock=fsockopen( $address, 1720 , $errno, $errmesg , 2); I have also tried 2.0 (float) rather than 2 as per PHP manual, this makes no difference. http://www.php.net/manual/en/function.fsockopen.php The specific symptoms : No listener on client port 1720 : Succeeds Listening client socket on port 1720 Succeeds Client firewall configured to allow connections Succeeds Client firewall configured to deny connections Fails The fail mode is that fsockopen does *not* return after the specified timeout, and the script itself eventually times out at the default 30 sec. Working configuration : PHP 4.1.2, Linux Redhat 2.2.20, Apache 1.3.22 Http Env vars :i386-redhat-linux-gnu Non-working configuration : PHP 4.0.6, Linux Redhat 2.4.9-21smp i686, Apache 1.3.27 Http Env vars : i386-slackware-linux-gnu Anybody able to offer any help or point me at a way to step round this problem ? I thought of setting up an XML feed by HTTP Post from one machine to another - they are on diffrent networks so I worry about latency. Thanks for any help or suggestions to fix this problem, or any anecdotal evidence I can use to fix it !! Neil Smith. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Been looking for a tutorial on how to create themes ingeneral
My way: take a theme that most suits your needs and change it Kevin Myrick wrote: Ok, like I stated in my last message, I am using PHPWebsite as my portal system. However, I would like to learn how to do custom themes, because like sooo many aspiring web designers/programmers, I got an imagination a mile long and deep. So, anyone want to point me in the right direction on a theme creation tutorial, seeing as Sourceforge doesn't want to help me out? Thanks, Kevin Myrick www.ultimatealchemy.com __ Do you Yahoo!? HotJobs - Search new jobs daily now http://hotjobs.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: HELP COOKIES !
Shaun wrote: Hi, I tried some advice you gave , i tried to destroy the session cookie wiht setcookie(session_name()); and setcookie(session_name(),-3600); but the cookie is still there . Instead , there are now 2 cookies with the same name , the one has the session id , the other has no contents! HOW CAN I DELETE THESE THINGS !!! Heh...LOL My mistake...at first you destroy the session, then you are using session_name(). The session_name() function will then (of course) return an empty string. Try setting the cookie (with -3600) before session_destroy(). First question: why are you using a cookie??? If you use session_start(), a cookie is automaticaly send to the client. Grtz Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] storing cc details in mysql
Hi, I know this is an old chestnut and i am going thru archives and googling as well. anyhoo, my small company recently decided that live cc processing was too expensive for our needs (this has to do with us being based in ireland where there is a problem with the banks -they only deal with one irish company to process and its too expensive for us - don't really know the details but thats what i was told). so we're going to store the cc numbers and process manually(we're a small company at present so we're not talking 1000's of numbers just yet). i'd appreciate anyones experience or advice regarding storing in a mysql db - articles etc.. i also have the option of using postgres (haven't used it before) if anyone thinks i should. as a side note - i notice that phpshop stores cc numbers in mysql.any thoughs on that - i.e. is it a good example of how it should be done. many thanx, adrian murphy
Re: [PHP] storing cc details in mysql
Sorry forgot to say we do have a secure server. - Original Message - From: adrian [EMAIL PROTECTED] [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 04, 2002 4:37 PM Subject: [PHP] storing cc details in mysql Hi, I know this is an old chestnut and i am going thru archives and googling as well. anyhoo, my small company recently decided that live cc processing was too expensive for our needs (this has to do with us being based in ireland where there is a problem with the banks -they only deal with one irish company to process and its too expensive for us - don't really know the details but thats what i was told). so we're going to store the cc numbers and process manually(we're a small company at present so we're not talking 1000's of numbers just yet). i'd appreciate anyones experience or advice regarding storing in a mysql db - articles etc.. i also have the option of using postgres (haven't used it before) if anyone thinks i should. as a side note - i notice that phpshop stores cc numbers in mysql.any thoughs on that - i.e. is it a good example of how it should be done. many thanx, adrian murphy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] storing cc details in mysql
Rule no. 1 = Never save the cc-numbers in an online database. Regards, Sumarlidi E. Dadason SED - Graphic Design _ Tel: 896-0376, 461-5501 E-mail: [EMAIL PROTECTED] website: www.sed.is -Original Message- From: adrian [EMAIL PROTECTED] [mailto:adrian.murphy;2020tourism.com] Sent: 4. nóvember 2002 16:41 To: adrian [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] storing cc details in mysql Sorry forgot to say we do have a secure server. - Original Message - From: adrian [EMAIL PROTECTED] [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 04, 2002 4:37 PM Subject: [PHP] storing cc details in mysql Hi, I know this is an old chestnut and i am going thru archives and googling as well. anyhoo, my small company recently decided that live cc processing was too expensive for our needs (this has to do with us being based in ireland where there is a problem with the banks -they only deal with one irish company to process and its too expensive for us - don't really know the details but thats what i was told). so we're going to store the cc numbers and process manually(we're a small company at present so we're not talking 1000's of numbers just yet). i'd appreciate anyones experience or advice regarding storing in a mysql db - articles etc.. i also have the option of using postgres (haven't used it before) if anyone thinks i should. as a side note - i notice that phpshop stores cc numbers in mysql.any thoughs on that - i.e. is it a good example of how it should be done. many thanx, adrian murphy -- 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] storing cc details in mysql
There are AES_Encrypt/Decrypt and DES_Encrypt/Decrypt functions in MySQL. Quote from Manual: AES_ENCRYPT() and AES_DECRYPT() were added in version 4.0.2, and can be considered the most cryptographically secure encryption functions currently available in MySQL. http://www.mysql.com/doc/en/Miscellaneous_functions.html You can also compile PHP with different encryption modules and use those. ---John Holmes... - Original Message - From: adrian [EMAIL PROTECTED] [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 04, 2002 11:37 AM Subject: [PHP] storing cc details in mysql Hi, I know this is an old chestnut and i am going thru archives and googling as well. anyhoo, my small company recently decided that live cc processing was too expensive for our needs (this has to do with us being based in ireland where there is a problem with the banks -they only deal with one irish company to process and its too expensive for us - don't really know the details but thats what i was told). so we're going to store the cc numbers and process manually(we're a small company at present so we're not talking 1000's of numbers just yet). i'd appreciate anyones experience or advice regarding storing in a mysql db - articles etc.. i also have the option of using postgres (haven't used it before) if anyone thinks i should. as a side note - i notice that phpshop stores cc numbers in mysql.any thoughs on that - i.e. is it a good example of how it should be done. many thanx, adrian murphy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] storing cc details in mysql
Really quick answer: 1. consider storing them OFF the server as soon as possible... having minimal (if any) numbers stored on the live (net connected server) will: a) make the server a less desireable hack b) result in less risk in case of a hack c) be more responsible to your customers 2. install the mcrypt library, do a heap of reading about how to store keys etc etc and encrypt anything that you store 3. yes, use SSL, but as you are aware, this only encrypts the data during transit from the user to the server... you need to consider a) how the numbers are stored b) where they are stored c) how the #'s are transferred from the server to you (SSL or encrypt again!) Cheers, J on 05/11/02 2:37 AM, adrian [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote: Hi, I know this is an old chestnut and i am going thru archives and googling as well. anyhoo, my small company recently decided that live cc processing was too expensive for our needs (this has to do with us being based in ireland where there is a problem with the banks -they only deal with one irish company to process and its too expensive for us - don't really know the details but thats what i was told). so we're going to store the cc numbers and process manually(we're a small company at present so we're not talking 1000's of numbers just yet). i'd appreciate anyones experience or advice regarding storing in a mysql db - articles etc.. i also have the option of using postgres (haven't used it before) if anyone thinks i should. as a side note - i notice that phpshop stores cc numbers in mysql.any thoughs on that - i.e. is it a good example of how it should be done. many thanx, adrian murphy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] image submit buttons
(isset($_POST[Submit])) is this the way to check a submission image to see if it's been set? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session on PHP 4.3.0
Hi, I'm having some problems with session on version 4.3.0. On 4.1.1 it was working perfectly. Here are the sources of login.php and logout.php: login.php session_start(); $GLOBALS[SID] = PHPSESSID=.session_id(); $GLOBALS[var1] = $HTTP_SESSION_VARS[var1]; logout.php session_start(); $GLOBALS[SID] = PHPSESSID=.session_id(); session_destroy(); setcookie(session_name(),,,/); When user clicks to logout.php, the session must be destroyed, with no need to close the browser. Thanks, -- Marcel Peruch Web Developer www.viaconnect.com.br [EMAIL PROTECTED] Linux User #271282 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] image submit buttons
(isset($_POST[Submit])) is this the way to check a submission image to see if it's been set? Nope. Try the manual: IMAGE SUBMIT variable names When submitting a form, it is possible to use an image instead of the standard submit button with a tag like: input type=image src=image.gif name=sub When the user clicks somewhere on the image, the accompanying form will be transmitted to the server with two additional variables, sub_x and sub_y. These contain the coordinates of the user click within the image. The experienced may note that the actual variable names sent by the browser contains a period rather than an underscore, but PHP converts the period to an underscore automatically. So you'll have $_POST['Submit_x'] and $_POST['Submit_y'] and you can check for either to see if the image was clicked. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and Apache Cocoon???
Hello experts, I am hoping to build a website to host a sizeable document and add functionality to allow readers to submit comments and general feedback. The main document is currently stored as a series of XML pages and I have succeeded in publishing these documents in HTML with Apache Cocoon. Now that I have the XML and XLST parts in place I am looking towards adding that comment functionality that I mentioned. My question for you is does anyone know how well PHP integrates with Cocoon as I was hoping to use that as the mechanism to accept and store user comments in a MySQL database. If anyone out there has any ideas (or even better, knows how this is done!) then any pointers would be much appreciated. Thanks in advance, Hai _ This email is confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of SchlumbergerSema. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. If you have received this email in error please notify the SchlumbergerSema Helpdesk by telephone on +44 (0) 121 627 5600. _ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Installation problem - httpd.conf issue?
Hi there, I recently upgraded from PHP version 4.0-ish to 4.2.3 on my Linux/Apache machine. AFAIK, Apache is setup correctly (it serves HTML) and PHP works, but only from the command line. If I type php -q php.php test.html the output of phpinfo() is stored in test.html. When I try and look at test.html running on localhost it display sfine, but when I try and view php.php, as save as window pops up. I am not too familar with Linux. If it was a Windows installation then I would make sure the Action application (path to php.exe) line was correct, but I can't find this in the Linux httpd.conf. Does this issue sound familar to anyone. Could anyone point me in the right direction? Thanks very much. - Best regards, Lee Reilly -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Does anyone know if this is possible?
Hi! I have made a website with a webshop and the orders are written down in txtfiles and a faxserver is scanning a directory for txtfiles and sends them as faxes. So I am trying to write the txtfile like I should have written the order in a table. Or you can say I am trying to make some columns in the txtfile. Something like this: 1pizzacheese, beef, tomato,5,- ham, bacon etc 2burgerscheese, bacon2,- Best regards Raymond -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Bizzare mime-type header() problem
Ok, so I've a script that outputs HTML. If a particular argument is passed to that script, it sends the following header commands before it echoes out any HTML: header( Content-Disposition: inline; filename=policy.doc ); header( Content-type: application/msword ); so that it opens up and displays the HTML in ms-word. That should be all I need to make it open up properly in Word. However, it's not working. One of the very first things that the script does is some validation and if it fails, echoes out some javascript to force the user back to the previous page - history.back(). The relevant code is: if( myValidationFunctionsFakeName()) { echo script language=\javascript\history.back();/script\n; exit(); } So unless that check fails, the javascript *never* gets echoed out. What's happening is that when I try to output the HTML to Word (by using the header() functions), the only thing in the document (after it opens up) is the javascript. I can remove the header calls and the HTML displays just fine in the browser. Add them back in, the javascript is the only thing that shows up in Word. But why? Why is PHP echoing out something it should not be echoing? The validation doesn't fail so as such, the text should never be sent to stdout (the browser). Or am I misunderstanding something? Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Been looking for a tutorial on how to create themes ingeneral
look at smarty (smarty.php.net) as it does templates, and i am accomplishing 'themes' on a current project by just changing the template directory. -js Marek Kilimajer wrote: My way: take a theme that most suits your needs and change it Kevin Myrick wrote: Ok, like I stated in my last message, I am using PHPWebsite as my portal system. However, I would like to learn how to do custom themes, because like sooo many aspiring web designers/programmers, I got an imagination a mile long and deep. So, anyone want to point me in the right direction on a theme creation tutorial, seeing as Sourceforge doesn't want to help me out? Thanks, Kevin Myrick www.ultimatealchemy.com __ Do you Yahoo!? HotJobs - Search new jobs daily now http://hotjobs.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Address array?
Stephen, after your line: $query = SELECT * FROM orders WHERE orderid = '$orderid'; you should add: mysql_query($query); in your code line you've just set your variable--you haven't asked mysql to do anything. Hope this helps. Hugh - Original Message - From: Steve Jackson [EMAIL PROTECTED] To: PHP General [EMAIL PROTECTED] Sent: Monday, November 04, 2002 12:42 AM Subject: [PHP] Address array? I want to display an address from my database based on an orderid. Where am I going wrong? I am still unsure how Php interacts with mySQL but am I right in assuming it should be an array? My code... function get_shipping_address($address_array) { $conn = db_connect(); $orderid = get_order_id($orderid); $query = SELECT * FROM orders WHERE orderid = '$orderid'; $row = mysql_fetch_array($query); foreach ($address_array as $row) { $ship_name = $row[ship_name]; $ship_address = $row[ship_address]; $ship_city = $row[ship_city]; $ship_zip = $row[ship_zip]; $ship_country = $row[ship_country]; } } Steve Jackson Web Developer Viola Systems Ltd. http://www.violasystems.com [EMAIL PROTECTED] Mobile +358 50 343 5159 -- 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] Strange error!
Hi guys, I have very weird problem. I have installed the PHP version 4.2.3 on the LINUX virtual server of my web project. Previously I had the PHP version 4.0.6. The error I get is very weird. When I insert a record with the phpMyAdmin, the first 4 characters of each field don't get saved. Same thing happened with some data entry interfaces I coded! The only difference I can see in the two installation (provided the php.ini file is in the same location): The old version 4.0.6 was installed by the server provider and my virtual server space I can only see the .so file. The new version 4.2.3 is actually inside my virtual server space. Hence, the path I provided in the php configuration is different (I don't have idea if this can influence something). NEW VERSION (4.2.3) configuration run by me './configure' '--with-apxs=/usr/local/apache/1.3/bin/apxs' '--prefix=/usr/home/rockit/usr/local' '--with-mysql=/usr/home/rockit/usr/local/mysql' '--with-xml' '--enable-xslt' '--with-xslt-sablot=/usr/home/rockit/usr/local' '--with-regex=system' '--with-expat-dir=/usr/home/rockit/usr/local' '--with-iconv=/usr/home/rockit/usr/local' '--enable-inline-optimization' '--disable-debug' '--enable-memory-limit' '--enable-sigchild' '--without-pear' '--enable-mbstring' '--enable-mbstr-enc-trans' '--with-gdbm=/usr/local' '--enable-sockets' '--enable-versioning' '--with-ttf=/usr/local' '--enable-ftp' '--with-gd=/usr/local' '--with-zlib' '--enable-gd-native-ttf' OLD VERSION (4.0.6) configuration run by the server provider './configure' '--enable-inline-optimization' '--with-apxs=/usr/local/apache/1.3/bin/apxs' '--with-config-file-path=/usr/local/lib' '--disable-debug' '--enable-memory-limit' '--enable-sigchild' '--with-gettext' '--without-pear' '--with-regex=system' '--enable-mbstring' '--enable-mbstr-enc-trans' '--with-iconv=/usr/local' '--with-gdbm=/usr/local' '--with-dbm=/usr/local' '--enable-sockets' '--enable-versioning' '--with-freetype-dir=/usr/local' '--with-ttf=/usr/local' '--enable-ftp' '--with-curl=/usr/local/curl' '--with-openssl=/usr/local/openssl' '--with-gd=/usr/local' '--with-freetype-dir=/usr/local' '--with-ttf=/usr/local' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local' '--with-t1lib=/usr/local' '--with-zlib' '--enable-gd-native-ttf' '--with-imap' '--with-mcrypt=/usr/local' '--with-mhash=/usr/local' '--with-dom=/usr/local' '--with-mysql=/usr/local/mysql' '--with-zlib' '--with-zlib' I must admit that I didn't not include all parameter as the old installation, as I didn't know most options and thought is not needed. In the new installation I instead provided additional XML parameter (after installing the correspond modules, which all seem to work fine). Hints on problem are very well welcome! Daniele -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Bizzare mime-type header() problem
But why? Why is PHP echoing out something it should not be echoing? The validation doesn't fail so as such, the text should never be sent to stdout (the browser). Or am I misunderstanding something? Ok, I figured out what my problem was and I'd very much appreciate if someone who was intimately knowledgable with the inner workings of PHP (Rasmus, Zeev..?) could let me know why it's doing this. One thing I didn't mention in my initial post (mainly because I didn't think it was relevant to my problem) was that I am using Sessions and my validation function uses the Session ID as part of it's validation. Now, in my validation function, it's declaring $PHPSESSID as global so it can use it's value. We have enable_trans_sid turned on and whatever other option (if there is one) so that if the session ID isn't passed via a GET, PHP pulls the ID from the cookie. And that's what happens on almost every page - the session ID is pulled from the cookie variable and it's working no problem. Ok, so the make up of the script that I'm having issues with looks like this: (pseudocode) - validation function { global $PHPSESSID; validate using $PHPSESSID; } process and define output switch( $action ) { case msword: word headers(); case html: echo output; break; } - Now, when $action is html, everything works fine. In the validation function, $PHPSESSID is pulled from the cookie variable, is checked against and validation passes. However, when $action is msword, in the validation function, $PHPSESSID isn't pulled from the cookie and as such, validation fails. The only difference between the two actions is the for msword, I'm sending the appropriate headers so that the output is opened up in Word. Now my question, with $PHPSESSID coming from a cookie as input, why would the output ( header() functions ) dictate whether or not that input is read correctly. IOW, why is the session ID not read from the cookie space when I use the header functions to specify that the browser should open up Word? That part of the code (reading PHPSESSID from the cookie) is executed and processed long before I send the header() function calls. It makes no sense to me and it must have something to do with how PHP parses and executes the script. Any ideas as to what exactly is going on would be very much appreciated! Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Php Ready-to-go
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 http://pear.php.net/bcompiler ? ~Paul On Monday 04 November 2002 08:09 am, Alexander Kuznetsov wrote: Hello Martin, Monday, November 04, 2002, 2:53:48 PM, you wrote: MT Hello! MT Is there a way to run a php-script on a pc/windows-computer which hasn't MT php-installed? I thought of somekind of compiler which creates an .exe, MT which embeds the script and the php-environment. MT Martin On win32 I use PHP-GTK and I've solved this problem: php-gtk need php executable and some dlls all what I've done - I've created with Install Shield an instalation package which contains php executable and its own dlls and php-gtk files InstallShield during install my package copy some dlls and php.ini into %windir% and creates shortcut to my main programm file: php_gtk main.php if you don't need gtk - I think you should dig around a shortcut some like this php.exe your_script.php - -- ~Paul Nicholson Design Specialist @ WebPower Design The webthe way you want it! [EMAIL PROTECTED] It said uses Windows 98 or better, so I loaded Linux! Registered Linux User #183202 using Register Linux System # 81891 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9xtHTDyXNIUN3+UQRAtxaAKCan2IXOu+irl0ti21jHDrhiqlvRQCePk86 FxH6Qm00KYpqhsES5okk9VY= =MdQC -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to send mail with authentification?
On 11/4/02 6:54 AM, Martin Thoma [EMAIL PROTECTED] tapped the keys: Hello! Our SMTP-Server has changed to authentification. Now we cannot send mails anymore using mail(). How can I set the password in mail? The built in mail command cannot handle authentication. There is a class on phpclasses, though, that can. I forget which one it is, but you can start your search here: http://phpclasses.php-start.de/browse.html/class/2.html Looks like you have a little re-coding ahead of you. -- Ed Marczak [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $_FILES
Hi, I hope somebody could help me with a problem I have with the $_FILES variable. I'm trying to make a PHP script which could have access to an uploaded remote file. The piece of HTML is: html body form action=ll.php method=post enctype=multipart/form-data input name=userfile size=48 type=file input type=submit name=attach value=Addbr /form /body /html and the ll.php script is: ?php printf(file=(%s)br, $_FILES['userfile']['name']); print_r(array_values($_FILES)); phpinfo(); ? but the variable $_FILES is not set at all, because the printf doesn't print the name of the uploaded file nor the second line, the print_r() print anything for that array variable. So the question is: what could be happening that the variable $_FILES is not set? The phpinfo() function returns PHP 4.2.3, and I compiled it with the following configure line: './configure' '--with-mysql' '--with-apxs=/server/www/apache-1.3.26/bin/apxs' '--with-imap' '--with-imap-ssl' '--enable-track-vars' '--enable-dbase' '--with-pgsql=/server/postgresql' over an apache 1.3.26. Any help will be very appreciated. Thanks in advance. ---sram Don't listen to what I say; listen to what I mean! --Feynman Salvador Ramirez FlandesPROFC, Universidad de Concepcion, CHILE http://www.profc.udec.cl/~srammailto:sram;profc.udec.cl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_FILES
How about just print_r($_FILES); Does that return anything? ---John Holmes... - Original Message - From: Salvador Ramirez [EMAIL PROTECTED] To: PHP General [EMAIL PROTECTED] Sent: Monday, November 04, 2002 3:50 PM Subject: [PHP] $_FILES Hi, I hope somebody could help me with a problem I have with the $_FILES variable. I'm trying to make a PHP script which could have access to an uploaded remote file. The piece of HTML is: html body form action=ll.php method=post enctype=multipart/form-data input name=userfile size=48 type=file input type=submit name=attach value=Addbr /form /body /html and the ll.php script is: ?php printf(file=(%s)br, $_FILES['userfile']['name']); print_r(array_values($_FILES)); phpinfo(); ? but the variable $_FILES is not set at all, because the printf doesn't print the name of the uploaded file nor the second line, the print_r() print anything for that array variable. So the question is: what could be happening that the variable $_FILES is not set? The phpinfo() function returns PHP 4.2.3, and I compiled it with the following configure line: './configure' '--with-mysql' '--with-apxs=/server/www/apache-1.3.26/bin/apxs' '--with-imap' '--with-imap-ssl' '--enable-track-vars' '--enable-dbase' '--with-pgsql=/server/postgresql' over an apache 1.3.26. Any help will be very appreciated. Thanks in advance. ---sram Don't listen to what I say; listen to what I mean! --Feynman Salvador Ramirez FlandesPROFC, Universidad de Concepcion, CHILE http://www.profc.udec.cl/~srammailto:sram;profc.udec.cl -- 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] $_FILES
On Mon, 4 Nov 2002, 1LT John W. Holmes wrote: How about just print_r($_FILES); Does that return anything? It just return the same as before, i.e. Array ( ) ---sram ---John Holmes... - Original Message - From: Salvador Ramirez [EMAIL PROTECTED] To: PHP General [EMAIL PROTECTED] Sent: Monday, November 04, 2002 3:50 PM Subject: [PHP] $_FILES Hi, I hope somebody could help me with a problem I have with the $_FILES variable. I'm trying to make a PHP script which could have access to an uploaded remote file. The piece of HTML is: html body form action=ll.php method=post enctype=multipart/form-data input name=userfile size=48 type=file input type=submit name=attach value=Addbr /form /body /html and the ll.php script is: ?php printf(file=(%s)br, $_FILES['userfile']['name']); print_r(array_values($_FILES)); phpinfo(); ? but the variable $_FILES is not set at all, because the printf doesn't print the name of the uploaded file nor the second line, the print_r() print anything for that array variable. So the question is: what could be happening that the variable $_FILES is not set? The phpinfo() function returns PHP 4.2.3, and I compiled it with the following configure line: './configure' '--with-mysql' '--with-apxs=/server/www/apache-1.3.26/bin/apxs' '--with-imap' '--with-imap-ssl' '--enable-track-vars' '--enable-dbase' '--with-pgsql=/server/postgresql' over an apache 1.3.26. Any help will be very appreciated. Thanks in advance. ---sram Don't listen to what I say; listen to what I mean! --Feynman Salvador Ramirez FlandesPROFC, Universidad de Concepcion, CHILE http://www.profc.udec.cl/~srammailto:sram;profc.udec.cl -- 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] mysql_query maximum size
Hi there, Just wondering if there is a maximum size to the sql that can be passed as a mysql_query, either from mysql itself or from the php side of things? I ask only cause I have a limiting clause on my select and I have no idea how big it will grow and I would prefer to write it in such a way that I don't have to worry about it. Thanks for any help Kevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_FILES
Do you have file uploads enabled in php.ini? ---John Holmes... - Original Message - From: Salvador Ramirez [EMAIL PROTECTED] To: 1LT John W. Holmes [EMAIL PROTECTED] Cc: PHP General [EMAIL PROTECTED] Sent: Monday, November 04, 2002 4:04 PM Subject: Re: [PHP] $_FILES On Mon, 4 Nov 2002, 1LT John W. Holmes wrote: How about just print_r($_FILES); Does that return anything? It just return the same as before, i.e. Array ( ) ---sram ---John Holmes... - Original Message - From: Salvador Ramirez [EMAIL PROTECTED] To: PHP General [EMAIL PROTECTED] Sent: Monday, November 04, 2002 3:50 PM Subject: [PHP] $_FILES Hi, I hope somebody could help me with a problem I have with the $_FILES variable. I'm trying to make a PHP script which could have access to an uploaded remote file. The piece of HTML is: html body form action=ll.php method=post enctype=multipart/form-data input name=userfile size=48 type=file input type=submit name=attach value=Addbr /form /body /html and the ll.php script is: ?php printf(file=(%s)br, $_FILES['userfile']['name']); print_r(array_values($_FILES)); phpinfo(); ? but the variable $_FILES is not set at all, because the printf doesn't print the name of the uploaded file nor the second line, the print_r() print anything for that array variable. So the question is: what could be happening that the variable $_FILES is not set? The phpinfo() function returns PHP 4.2.3, and I compiled it with the following configure line: './configure' '--with-mysql' '--with-apxs=/server/www/apache-1.3.26/bin/apxs' '--with-imap' '--with-imap-ssl' '--enable-track-vars' '--enable-dbase' '--with-pgsql=/server/postgresql' over an apache 1.3.26. Any help will be very appreciated. Thanks in advance. ---sram Don't listen to what I say; listen to what I mean! --Feynman Salvador Ramirez FlandesPROFC, Universidad de Concepcion, CHILE http://www.profc.udec.cl/~srammailto:sram;profc.udec.cl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_query maximum size
Just wondering if there is a maximum size to the sql that can be passed as a mysql_query, either from mysql itself or from the php side of things? I ask only cause I have a limiting clause on my select and I have no idea how big it will grow and I would prefer to write it in such a way that I don't have to worry about it. There's no practical limit, I imagine. If you're talking MB size queries, then you may run into some kind of problem, but then if you've got query strings that size, you've got other issues to worry about. ---John Holmes.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_FILES
On Mon, 4 Nov 2002, 1LT John W. Holmes wrote: Do you have file uploads enabled in php.ini? No, sorry. I changed that and all worked fine. I wonder why that is not mentioned on the section of uploads of the PHP documentation. Thanks a lot. ---sram ---John Holmes... - Original Message - From: Salvador Ramirez [EMAIL PROTECTED] To: 1LT John W. Holmes [EMAIL PROTECTED] Cc: PHP General [EMAIL PROTECTED] Sent: Monday, November 04, 2002 4:04 PM Subject: Re: [PHP] $_FILES On Mon, 4 Nov 2002, 1LT John W. Holmes wrote: How about just print_r($_FILES); Does that return anything? It just return the same as before, i.e. Array ( ) ---sram ---John Holmes... - Original Message - From: Salvador Ramirez [EMAIL PROTECTED] To: PHP General [EMAIL PROTECTED] Sent: Monday, November 04, 2002 3:50 PM Subject: [PHP] $_FILES Hi, I hope somebody could help me with a problem I have with the $_FILES variable. I'm trying to make a PHP script which could have access to an uploaded remote file. The piece of HTML is: html body form action=ll.php method=post enctype=multipart/form-data input name=userfile size=48 type=file input type=submit name=attach value=Addbr /form /body /html and the ll.php script is: ?php printf(file=(%s)br, $_FILES['userfile']['name']); print_r(array_values($_FILES)); phpinfo(); ? but the variable $_FILES is not set at all, because the printf doesn't print the name of the uploaded file nor the second line, the print_r() print anything for that array variable. So the question is: what could be happening that the variable $_FILES is not set? The phpinfo() function returns PHP 4.2.3, and I compiled it with the following configure line: './configure' '--with-mysql' '--with-apxs=/server/www/apache-1.3.26/bin/apxs' '--with-imap' '--with-imap-ssl' '--enable-track-vars' '--enable-dbase' '--with-pgsql=/server/postgresql' over an apache 1.3.26. Any help will be very appreciated. Thanks in advance. ---sram Don't listen to what I say; listen to what I mean! --Feynman Salvador Ramirez FlandesPROFC, Universidad de Concepcion, CHILE http://www.profc.udec.cl/~srammailto:sram;profc.udec.cl -- 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: Cookies disabled, new session ID each click!
What you describe is what SHOULD happen and does on that web site, that does NOT happen on my web site, with the exact same code I posted in the original message. So, the question remains, what would cause the SID to be blank every other click? Yes, I have also used Netscape on Linux to connect to the same machine without cookies, same result. Steve Jason Wong wrote: On Monday 04 November 2002 10:24, Steve Fatula wrote: If you want to see a site where the small program works (and be SURE and turn cookies off), click here: http://www.thewebmakerscorner.com/snapmods_new/default_test.php So, can anyone tell me why it does not work on MY site(s)? Any ideas? Surely this is a PHP configuration issue/bug perhaps? Logically, I don't see any settings that could possibly affect the outcome using this Have you tried any browsers other than IE 5.5? First time I go into that page, my URL shows this http://www.thewebmakerscorner.com/snapmods_new/default_test.php Clicking on the link appends the session id to the URL. As does clicking on the link again (same session id). Ad infinitum. So basically it works? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Am I blind? simple 15 line code producing error - SOLUTION FOUND! - tks
To those of you that helped me with this problem I have spent time eliminating lines of code.. the problem was in the following line: if ($_SESSION[first_name]) the line should be like this if (ISSET($_SESSION[first_name])) Seems like ISSET made a difference in eliminating warning: Cannot add header information. The code worked before but I guess it was broken once Global Vars were turned off in the resent version of PHP Thank you to all the replies Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Authentication with PHP and HTTP
I have a site that uses PHP/MySQL authentication for one section and Apache/HTTP authentication for another. Eventually I would like to use only PHP and MySQL for authenticating users, but in the meantime, I have to use both. First, users will log in to the main section of the site and I will use PHP session variables to maintain state for that section. What I would like to be able to do is allow users to click a link that would redirect them to the other section of the site and automatically log them in. The section of the site that users will be redirected to uses .htaccess and .htpassword files to enforce HTTP authentication. Is this possible? If so, how? = http://www.pverskine.com/ _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP crypto extension news
Since I just finished a pretty major source overhaul of the cryptopp-php extension, I figured I should make a little announcement, as this is oh-so-exciting news. Recently, Wei Dai released Crypto++ 5.0, which was pretty much a complete re-write of the public domain Crypto++ cryptography suite. In turn, I updated the cryptopp-php extension, hopefully for the better. The changes to this version, 0.0.9, are numerous, but the highlights are... - new padding schemes on block ciphers. In previous versions of cryptopp-php, you didn't get to choose your padding scheme -- you were stuck with whatever the default was for the block cipher mode. Now you can pick from PKCS#5, zeroes, one and zeroes or no padding at all. New functions to control this new ability were added: cryptopp_set_padding(), cryptopp_get_padding() and cryptopp_get_padding_name(). - keyed hash message authentication code algorithms were added. Basically, a HMAC is just a hash that uses a secret key. New HMAC algorithms include MD5-HMAC, RIPEMD-160-HMAC, etc. New functions to set HMAC keys were thusly added: cryptopp_set_hmac_key(), *get_hmac_key(), *set_hmac_key_length() and *get_hmac_key_length(). - a modified ARC4 algorithm was added. - the MD4 hash algorithm was added, although it should only be used when you really, really need it, such as for compatbility with other programs, as it is known to be cryptographically weak. - changes in the Crypto++ library itself have forced me to remove the Sapphire stream cipher and hash algorithms, but since I doubt they were used much, that shouldn't be much of a problem. - everything is for the most part backwardly and forwardly compatible with previous versions of cryptopp-php, with exceptions being noted in the manual. The only real differences you need to worry about are the block cipher padding schemes you're using and the SKIPJACK changes and SAFER-* changes. As always, cryptopp-php works on most UNIX-like systems as well as Microsoft Windows systems, and has been tested with Linux (kernel 2.4.18 and 2.4.9), Solaris 8 (SPARC) and Windows 2000 Professional. Source code and Windows DLLs are available under a BSD-like license at http://www.tutorbuddy.com/software/ This version should be considered somewhat unstable, so if you're worried about that, use version 0.0.8. There are a few known bugs in Crypto++ 5.0 that have been fixed in CVS -- they shouldn't affect cryptopp-php in any way, but there may be bugs in my code that haven't been weeded out yet, as this version hasn't been tested and is a near-total re-write from 0.0.8. Any bugs reports or comments would be appreciated. J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] randomly select file
Could someone suggest some php for randomly selecting a file from a directory and then displaying the contents of the file? Thanks in advance! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP/Flash
I have a small example of using Flash/PHP if anyone wants it.. Clint -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Need info about upload to a FTP
hi everyone. Who knows about to create a upload function to a ftp... I have a server with many Web_Users, I know that we can create a command that make a upload field on each folder of the ftp... Is is a .upload file or a php script? Please help! Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need info about upload to a FTP
Manual - FTP Functions Cyclone Médias wrote: hi everyone. Who knows about to create a upload function to a ftp... I have a server with many Web_Users, I know that we can create a command that make a upload field on each folder of the ftp... Is is a .upload file or a php script? Please help! Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Does anyone know if this is possible?
Hi Raymond, I have made a website with a webshop and the orders are written down in txtfiles and a faxserver is scanning a directory for txtfiles and sends them as faxes. So I am trying to write the txtfile like I should have written the order in a table. Or you can say I am trying to make some columns in the txtfile. Something like this: 1pizzacheese, beef, tomato,5,- ham, bacon etc 2burgerscheese, bacon2,- I *think* if you're committed to doing this in PHP, you'll need to look at the sprintf() or printf() functions: http://www.php.net/manual/en/function.sprintf.php You're given some level of control over the output of your program. I don't know if you can get what you describe above, though. If you're not adverse to looking to another language, Perl was built to do exactly this. Perl Formats do what you need -- they provide a method for generating simple, formatted reports and charts, according to the camel book. I know of no analagous capability of PHP (although I may very well be wrong). If you can't use perl for the whole thing, perhaps you could have PHP do all your logic, and then pass the data to a perl script to format and save it to a file. Or maybe sprintf() does everything you need... Joel (more on perl formats: http://www.perl.com/doc/manual/html/pod/perlform.html) -- [ joel boonstra | [EMAIL PROTECTED] ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] randomly select file
Dump the files in the directory into an array, then randomly select on from that. ROBERT MCPEAK wrote: Could someone suggest some php for randomly selecting a file from a directory and then displaying the contents of the file? Thanks in advance! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/Flash
Me :-) I wonder if you can post me these scripts - Original Message - From: Clint Tredway [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 05, 2002 8:46 AM Subject: [PHP] PHP/Flash I have a small example of using Flash/PHP if anyone wants it.. Clint -- 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] randomly select file
Why don't you cope with opendir / readdir () and array_rand () I tried it and I look ok- But, I wonder if there are noble another way to do it? - Original Message - From: ROBERT MCPEAK [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 05, 2002 8:40 AM Subject: [PHP] randomly select file Could someone suggest some php for randomly selecting a file from a directory and then displaying the contents of the file? Thanks in advance! -- 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] OSX compile problem (TSRM libs)
Hello, I'm trying to compile PHP4.2.3 for Mac OSX 10.2 (Jaguar). Has anyone else had this problem (see below)? #./configure --with-apxs=/usr/sbin/apxs #make ld: multiple definitions of symbol _virtual_stat TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_stat in sectio n (__TEXT,__text) TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_stat in sectio n (__TEXT,__text) ld: multiple definitions of symbol _virtual_unlink TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_unlink in sect ion (__TEXT,__text) TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_unlink in sect ion (__TEXT,__text) ld: multiple definitions of symbol _virtual_utime TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_utime in secti on (__TEXT,__text) TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_utime in secti on (__TEXT,__text) /usr/bin/libtool: internal link edit command failed make[1]: *** [libphp4.la] Error 1 make: *** [all-recursive] Error 1 I have done this countless times on i386 boxes under RedHat and FreeBSD. Unfortunately, I have never encountered this problem before, as this is my first attempt on OSX. Just FYI, before attempting to compile/install PHP, I successfully compiled/installed Apache 1.3.27, which seems to work as expected. I also upgraded to the latest Apple Developers Kit, and related update patches. Any ideas? Thanks, Kris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] 4.2.3 compile problem on OSX
Hello, I'm trying to compile PHP4.2.3 for Mac OSX 10.2 (Jaguar). Has anyone else had this problem (see below)? ./configure --with-apxs=/usr/sbin/apxs make ld: multiple definitions of symbol _virtual_stat TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_stat in sectio n (__TEXT,__text) TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_stat in sectio n (__TEXT,__text) ld: multiple definitions of symbol _virtual_unlink TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_unlink in sect ion (__TEXT,__text) TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_unlink in sect ion (__TEXT,__text) ld: multiple definitions of symbol _virtual_utime TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_utime in secti on (__TEXT,__text) TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_utime in secti on (__TEXT,__text) /usr/bin/libtool: internal link edit command failed make[1]: *** [libphp4.la] Error 1 make: *** [all-recursive] Error 1 Forgive my ignorance but HUH? WTF? I have done this countless times on i386 boxes under RedHat and FreeBSD. Unfortunately, I have never encountered this problem before. Just FYI, before attempting to compile/install PHP, I successfully compiled/installed Apache 1.3.27, which seems to work as expected. I also upgraded to the latest Apple Developers Kit, and related update patches. Any ideas? Thanks, Kris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Does anyone know if this is possible?
Ok! I think I will try a little more to get it work with php first, but it is a good idea you have here. Thanks! : ) Raymond Joel Boonstra [EMAIL PROTECTED] wrote in message news:Pine.LNX.4.44.0211041703230.11800-10;amos.gf.gospelcom.net... Hi Raymond, I have made a website with a webshop and the orders are written down in txtfiles and a faxserver is scanning a directory for txtfiles and sends them as faxes. So I am trying to write the txtfile like I should have written the order in a table. Or you can say I am trying to make some columns in the txtfile. Something like this: 1pizzacheese, beef, tomato,5,- ham, bacon etc 2burgerscheese, bacon2,- I *think* if you're committed to doing this in PHP, you'll need to look at the sprintf() or printf() functions: http://www.php.net/manual/en/function.sprintf.php You're given some level of control over the output of your program. I don't know if you can get what you describe above, though. If you're not adverse to looking to another language, Perl was built to do exactly this. Perl Formats do what you need -- they provide a method for generating simple, formatted reports and charts, according to the camel book. I know of no analagous capability of PHP (although I may very well be wrong). If you can't use perl for the whole thing, perhaps you could have PHP do all your logic, and then pass the data to a perl script to format and save it to a file. Or maybe sprintf() does everything you need... Joel (more on perl formats: http://www.perl.com/doc/manual/html/pod/perlform.html) -- [ joel boonstra | [EMAIL PROTECTED] ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Does anyone know if this is possible?
It depends on where the textfile are going to be store If you store them into unauthorized directory that php does not have the right (or permission) to write in, I think it cannot be done, but if you put down the file into allowed directory, why not? to make column into your text file I think \t is good- - Original Message - From: Raymond Lilleodegard [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 05, 2002 5:28 AM Subject: [PHP] Does anyone know if this is possible? Hi! I have made a website with a webshop and the orders are written down in txtfiles and a faxserver is scanning a directory for txtfiles and sends them as faxes. So I am trying to write the txtfile like I should have written the order in a table. Or you can say I am trying to make some columns in the txtfile. Something like this: 1pizzacheese, beef, tomato,5,- ham, bacon etc 2burgerscheese, bacon2,- Best regards Raymond -- 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] Am I blind? simple 15 line code producing error - SOLUTION FOUND! - tks
To those of you that helped me with this problem I have spent time eliminating lines of code.. the problem was in the following line: if ($_SESSION[first_name]) the line should be like this if (ISSET($_SESSION[first_name])) The change that would induce this error is likely to be related to error reporting. What you'll probably find if you delve into it is that in the first case above, if the var wasn't set there was an error notifying you of that. In the second case above, using isset() would avoid that error message being displayed. The error you were having was because your code was displaying an error message to the browser which would automatically mean that something had been sent to the browser and it would no longer be possible to add header information. If you couldn't see the error relating to checking the var it's likely something to do with display settings for your html - eg. displaying white text on a white background. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Battling with highlighting search criteria
$result = eregi_replace(($search),span class=hightlight\\0/span,$result) ; I use it, and I work fine for me. - Original Message - From: David Russell [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 04, 2002 7:27 PM Subject: [PHP] Battling with highlighting search criteria Hi there, My brain has just gone very fuzzy... I have a search string ($search) and a result ($result). I need to highlight every occurance of $search in $result. I know that it means that I need to change (for example) $result = This is a test, isn't it? $search = is Into $result = thspan class=highlightis/span span class=highlightis/span a test, span class=highlightis/span'nt it Now I can easily see how to change the FIRST occurrence of the word, but how can I change every occurance? Thanks David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Bizzare mime-type header() problem
Your pseudocode is incomplete, because you do not show us where you call this mysterious function that validates using $PHPSESSID. Also, if that is really all your switch consists of, you're not really gaining anything over using a simple if construct: if ($action == msword) { word_headers(); } echo $output; Chris Boget wrote: Ok, so the make up of the script that I'm having issues with looks like this: (pseudocode) - validation function { global $PHPSESSID; validate using $PHPSESSID; } process and define output switch( $action ) { case msword: word headers(); case html: echo output; break; } - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Authentication with PHP and HTTP
hi - I'm not quite sure if this will help you, but lets give it a try: you could use this URL syntax: http://user:password;www.site.com to automatically log your user in to the htaccess protected area. the bad thing about it is that user / password show up in the URL, but you could hide this information with using frames... are PHP/MySQL usernames + passwords the same like in Apache/HTTP? greets, _andi Phillip Erskine [EMAIL PROTECTED] schrieb im Newsbeitrag news:F13i7M4BAyxJMXehYSo4e46;hotmail.com... I have a site that uses PHP/MySQL authentication for one section and Apache/HTTP authentication for another. Eventually I would like to use only PHP and MySQL for authenticating users, but in the meantime, I have to use both. First, users will log in to the main section of the site and I will use PHP session variables to maintain state for that section. What I would like to be able to do is allow users to click a link that would redirect them to the other section of the site and automatically log them in. The section of the site that users will be redirected to uses .htaccess and .htpassword files to enforce HTTP authentication. Is this possible? If so, how? = http://www.pverskine.com/ _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fw: [PHP-DEV] When my PHP file opens, I want it to automaticallysubmit
This type of question should be addressed to [EMAIL PROTECTED] I am forwarding it there. Also, please correct your reply-to address. Chris Luke wrote: Hello, On my website, I have a php form which submits the global Ip address of the computer its on to a specific email address, I want it to automatically click the submit button on the website without questions, it already has an email address specified in it, but you have to open the document and click submit.. any ideas? Thanks, Luke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Radiator PHP
Anyone ever used PHP instead of Hooks in radiator, or even if it could be done... I have no idea just thought I would give it ago Before u tell me to goto ask on the radiator list I have I just thought I would get some comments from the PHP community. - Chris Kay (Systems Development) Techex Communications Website: www.techex.com.au Email: [EMAIL PROTECTED] Telephone: 1300 88 111 2 - Fax: (02) 9970 5788 - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Authentication with PHP and HTTP
You can hide URLs by fetching them with one of your own PHP scripts: base href=www.site.com ? readfile(http://user:password;www.site.com/); ? I think it might be at least better than frames. :-) Chris silver wrote: you could use this URL syntax: http://user:password;www.site.com to automatically log your user in to the htaccess protected area. the bad thing about it is that user / password show up in the URL, but you could hide this information with using frames... are PHP/MySQL usernames + passwords the same like in Apache/HTTP? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Upload permission on a web_user space...
Hello, I'm trying again to ask you that question because I was not understand. I have a unix server hosting service, my hosting service allow me to create web_server. Those are create for my client who have to upload differents things. So when people are connecting to my ftp (example on IE...) they can see any folder in their web_user space and can upload stuff in any folder of their level... So the set upload permission is not working... What can I do Is it possible to create a upload page (php) that allow user to see every folder of his web_user space?? Thanks! Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Battling with highlighting search criteria
On Mon, 4 Nov 2002 11:59:20 +0200, you wrote: Ok, this works. Just one more thing, How can I get the return in the same case as it was originally? Use backreferences to capture what matched and use that in the replace string. Example: ? $search = is; $str = This is a test, isn't it?; $str = preg_replace(/($search)/i, font color=\red\$1/font, $str); echo $str; echo br; $str = Is this also a test? Yes, it is!; $str = preg_replace(/($search)/i, font color=\red\$1/font, $str); echo $str; echo br; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: 4.2.3 compile problem on OSX
PHPmac (http://www.phpmac.com/) has some excellent articles on the subject. If all else fails, you can also grab a pre-compiled binary at http://www.entropy.ch/software/macosx/php/. On Mon Nov 4, 2002 5:12:38 PM, Kristopher Yates wrote: Hello, I'm trying to compile PHP4.2.3 for Mac OSX 10.2 (Jaguar). Has anyone else had this problem (see below)? ./configure --with-apxs=/usr/sbin/apxs make ld: multiple definitions of symbol _virtual_stat TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_stat in sectio n (__TEXT,__text) TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_stat in sectio n (__TEXT,__text) ld: multiple definitions of symbol _virtual_unlink TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_unlink in sect ion (__TEXT,__text) TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_unlink in sect ion (__TEXT,__text) ld: multiple definitions of symbol _virtual_utime TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_utime in secti on (__TEXT,__text) TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_utime in secti on (__TEXT,__text) /usr/bin/libtool: internal link edit command failed make[1]: *** [libphp4.la] Error 1 make: *** [all-recursive] Error 1 Forgive my ignorance but HUH? WTF? I have done this countless times on i386 boxes under RedHat and FreeBSD. Unfortunately, I have never encountered this problem before. Just FYI, before attempting to compile/install PHP, I successfully compiled/installed Apache 1.3.27, which seems to work as expected. I also upgraded to the latest Apple Developers Kit, and related update patches. Any ideas? Thanks, Kris -- Adam Atlas 640K of computer memory ought to be enough for anybody. - Bill Gates, 1981 (2001: What? Did I say 640K? I meant 640MB.) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] about @ in php
this day ,I read somebody else's program in php,found that in that one's page ,with such as if (!($recordnum=pg_numrows($rs))){ echo 'ÃüÁî´¦ÀíÍê±Ï£¡';using,I don't know how the refer to.somebody help me?thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] about @ in php
The symbol supresses error messages. Alex wrote: this day ,I read somebody else's program in php,found that in that one's page ,with such as if (!($recordnum=pg_numrows($rs))){ echo 'ÃüÁî´¦ÀíÍê±Ï£¡';using,I don't know how the refer to.somebody help me?thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Upload permission on a web_user space...
Hi Ben, I am not sure to understand exactly what do you want to do. But I am going to try to answer you about something, First, If you need to create your own ftp software using php, check out ftp library (http://www.faqs.org/rfcs/rfc959.html) there are several function about it, and you can allow visitors to upload, download, rename, delete, move files, create directory, rename directory chop directory etc... through 2 differents webservers using ftp parameters like domain (ip), username, password, int port etc... You can also create your own php software to allow user to view, upload, modify and delete files in your webserver from their browser, and you don't need activating ftp library, but you should set up (php.ini): file_uploads to on upload_tmp_dir to your upload directory upload_max_size = 2M or I don't know. -- check out the documentary (Documentary is also available in french.) If you want allow people to see some file from their browser and download it right_clicking and save target as to their computer, there are several possibility, first you can set it up through your webhosting setting (for example for IIS/Windows 2000) you can check on button browse directory- So when visitors write your directory URL, the browser shows every files in your webserver. Secondly, you can also use your own php file to do it using function such as dir(), opendir(), readdir()-- check out the documentary. and it is better to use HEADER() to download files into visitors browser. Well, I hope helping you as I can. - Original Message - From: Benjamin Trépanier [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 05, 2002 12:55 PM Subject: [PHP] Upload permission on a web_user space... Hello, I'm trying again to ask you that question because I was not understand. I have a unix server hosting service, my hosting service allow me to create web_server. Those are create for my client who have to upload differents things. So when people are connecting to my ftp (example on IE...) they can see any folder in their web_user space and can upload stuff in any folder of their level... So the set upload permission is not working... What can I do Is it possible to create a upload page (php) that allow user to see every folder of his web_user space?? Thanks! Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cookies disabled, new session ID each click!
On Tuesday 05 November 2002 05:15, Steve Fatula wrote: What you describe is what SHOULD happen and does on that web site, that does NOT happen on my web site, with the exact same code I posted in the original message. Presumably the test website and your website are on different servers -- try comparing php.ini. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* That's life. What's life? A magazine. How much does it cost? Two-fifty. I only have a dollar. That's life. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] checkboxes and selection lists
Hi, as a beginner I find the way you declare variables through HTML-forms quite straightforward. But the reverse, to put the same variables back into a form field is not so obvious for selection lists and checkboxes. Would for instance this be the best way: SELECT CLASS=select NAME=qual OPTION VALUE=A ?=if($qual=='A'){return 'SELECTED'}?A/OPTION OPTION VALUE=B ?=if($qual=='B'){return 'SELECTED'}?B/OPTION OPTION VALUE=C ?=if($qual=='C'){return 'SELECTED'}?C/OPTION /SELECT or would there be something more elegant? Thanks, Marco Internet wordt pas leuk als je mee kunt doen. Ga naar http://www.hetnet.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] checkboxes and selection lists
For something like this, instead of doing all the HTML, I would set up and array, and then loop through the array to output the HTML... SELECT CLASS=select NAME=qual ?php for ( $i = 0; $qual_array[$i]; $i++ ) { if ( $_POST['qual'] == $qual_array[$i] ) { echo ( OPTION VALUE=\ . $qual_array[$i] . \ SELECTED . $qual_array[$i] . /OPTION\n ); } else { echo ( OPTION VALUE=\ . $qual_array[$i] . \ . $qual_array[$i] . /OPTION\n ); } } ? /SELECT [EMAIL PROTECTED] wrote: Hi, as a beginner I find the way you declare variables through HTML-forms quite straightforward. But the reverse, to put the same variables back into a form field is not so obvious for selection lists and checkboxes. Would for instance this be the best way: SELECT CLASS=select NAME=qual OPTION VALUE=A ?=if($qual=='A'){return 'SELECTED'}?A/OPTION OPTION VALUE=B ?=if($qual=='B'){return 'SELECTED'}?B/OPTION OPTION VALUE=C ?=if($qual=='C'){return 'SELECTED'}?C/OPTION /SELECT or would there be something more elegant? Thanks, Marco Internet wordt pas leuk als je mee kunt doen. Ga naar http://www.hetnet.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] checkboxes and selection lists
If you have hundred thousand elements for example if you rob up for some country select within tierce code- I thinks doing like the following is better echo select optiona optionb ... optionzz option selected$value /option /select ; And I don't care if it could have 2 same value in the select case... And if there aren't many value, I think the following sounds better: echo SELECT CLASS=select NAME=qual OPTION .($qual==A? SELECTED:).A OPTION .($qual==B? SELECTED:).B OPTION .($qual==C? SELECTED:). C/OPTION /SELECT ; - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 05, 2002 5:06 PM Subject: [PHP] checkboxes and selection lists Hi, as a beginner I find the way you declare variables through HTML-forms quite straightforward. But the reverse, to put the same variables back into a form field is not so obvious for selection lists and checkboxes. Would for instance this be the best way: SELECT CLASS=select NAME=qual OPTION VALUE=A ?=if($qual=='A'){return 'SELECTED'}?A/OPTION OPTION VALUE=B ?=if($qual=='B'){return 'SELECTED'}?B/OPTION OPTION VALUE=C ?=if($qual=='C'){return 'SELECTED'}?C/OPTION /SELECT or would there be something more elegant? Thanks, Marco Internet wordt pas leuk als je mee kunt doen. Ga naar http://www.hetnet.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php help for project!!
Hello I need help with A project that I'm doing for a fantasy football league.. Where I'm doing auto add/delete of players of a roster With maintaing a salary cap of $40.000.00 I have done the mysql database.. I just need help with Code and forms I want to use check boxes to do the add and delete And show reports as well of players stats and other things. karl
RE: [PHP] checkboxes and selection lists
I use the following function for my check boxes in forms in PHP. Putting your form element creation into functions or even classes makes life so much easier when you have to validate / change code. you'll be glad you did it Cheers Brendon function fncwriteformcheckbox($strname, $strid, $strvalue, $varcheckedvalue) { /* fncWriteFormCheckbox Returns HTML for a checkbox element Accepts form element name as string Accepts form element ID as string Accepts form element value as string Accepts form element checked value as string or array. If checked value = default value then checked is written to the HTML stream Adapted from ASP functions by Ken Schaefer. */ define(PROC, fncwriteformcheckbox); $strtemp = input type=\checkbox\ name=\ . $strname . \ ID=\ . $strid . \ value=\ . $strvalue . \; if (is_Array($varcheckedvalue)) { foreach ($varcheckedvalue as $varcheckedvalueelement) { if ($varcheckedvalueelement == $strvalue) { $strtemp .= checked; break; } } } else { if ($varcheckedvalue == $strvalue) { $strtemp .= checked; } } $strtemp .= \n; return $strtemp; } - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 05, 2002 5:06 PM Subject: [PHP] checkboxes and selection lists Hi, as a beginner I find the way you declare variables through HTML-forms quite straightforward. But the reverse, to put the same variables back into a form field is not so obvious for selection lists and checkboxes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php / ldap
On Wed, Oct 30, 2002 at 09:28:00AM -0500, GC wrote: Hi, using php_ldapadd, I get this error in ldap.log: Oct 30 09:23:43 Lunar slapd[10714]: conn=202 op=1 RESULT tag=105 err=65 text=object class 'posixAccount' requires attribute 'uidNumber' How do I get the next available uid number from my ldap database and then use that number for uidnumber? This is a classic LDAP problem. If you have server side sorting you can ask for uidNumber in sorted order, and set sizelimit to 1. Not all servers support it though, and it's not easy to specify this in PHP. Another possibility might be to remember last max, and only search for larger values (of course you could search for all). Finally if you can control how data is updated, you could have a special attribute in a special object containing the highest uid, and update that whenever you add a higher one. Stig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php