[PHP] Re: creating a mailing list
Hello, On 04/29/2004 06:44 AM, Chris O'Shea wrote: I have a list of email addresses in mySQL from people who have signed up on my site and I want to use PHP to email out to the list. My initial thought was to go through the loop, sending an email to each person, but then I saw this somewhere: It is worth noting that the mail() function is not suitable for larger volumes of email in a loop. This function opens and closes an SMTP socket for each email... not very efficient. This is a myth. SMTP connections for queueing only happen with mail() under Windows. Under Unix/Linux you can always configure your local mailer, eventually in php.ini to just queue the message for later delivery. This is what is recommended for mass mailing with PHP mail function, unless your local mailer is qmail. In that case you do not need to configure anything because qmail never attempts to deliver message immediately. Does anybody know the best way of doing a mass mail through php? mail() function is just fine in most cases. Also, do you know how php mail() handles bounced emails? Ideally I'd like to either receive them or use a script to record then. It depends on your environment. For an OS independent solution, you may want to try this class that lets you specify the bounce address using the Return-Path header. Keep in mind that just specifying the Return-Path address to the mail() function does not do anything. This class just does some magic to figure how to set the bounce address depending on your environment. http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Installing sendmail in win9X/Me
Hello, On 04/30/2004 02:05 PM, Helmut Kemper wrote: I need install sendmail in windows 9X/Me for use mail() command. PHP work only in localhost which active site server (similar to apache) and send mail by proxy network. PHP never uses sendmail under Windows. Sendmail support is only available with PHP on Unix/Linux. You need to connfigure PHP to use your network SMTP server. You may also try for instance this class that comes with sub-class specialized in deliverying via SMTP. It comes with a wrapper function named smtp_mail() that works exactly as the mail() function but lets you configure additional parameters like SMTP authentication if you need it: http://www.phpclasses.org/mimemessage You will also need this: http://www.phpclasses.org/smtpclass -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: creating a mailing list
* Thus wrote Manuel Lemos ([EMAIL PROTECTED]): Hello, On 04/29/2004 06:44 AM, Chris O'Shea wrote: Does anybody know the best way of doing a mass mail through php? mail() function is just fine in most cases. imo, php should refuse mass mailing ;) Also, do you know how php mail() handles bounced emails? Ideally I'd like to either receive them or use a script to record then. It depends on your environment. For an OS independent solution, you may want to try this class that lets you specify the bounce address using the Return-Path header. Keep in mind that just specifying the Return-Path address to the mail() function does not do anything. This class just does some magic to figure how to set the bounce address depending on your environment. There is also the Errors-To: header that can be added, most smtp server will honor that header, if not they will look at the envelope address to send the errors to. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Batch/Prepared statements for Mysql in PHP
* Thus wrote electroteque ([EMAIL PROTECTED]): I was wondering if there is any current API for creating match/prepare statements, therefore say i have a script to insert, update and insert in the same post, is there a way to reduce to many queries to the database to do it all in one hit ? Although i usually return the last inc id then add it to the second query ? It sounds like you need procedural sql statements. you need to ask someone on the mysql list or use a database that already supports that. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] String Question
Hi List, How would I show 100 chars after finding the first instance of a searched word in a string. So I have a string of which I search for the first instance of hello and display from there 100 more chars. My output word then be something like: hello and show the next 100 chars... Thank you in advance for any help or advice given. Dave C --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.672 / Virus Database: 434 - Release Date: 28/04/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Frage
Hallo, ich hoffe mir kann jemand bei folgendem Problem helfen. Habe ein Formular erstellt und darin ist ein file field eingebettet zum Hochladen von Dateien (z.B. Word-Dokumente). Habe den Zusatz enctype=multipart/form-data in das form tag eingefügt und an ein php-Script zur Auswertung geschickt. Im php-Script habe ich die hochgeladene Datei aus dem temp-Verzeichnis des Server auf ein Verzeichnis innerhalb meiner Web site mit em Befehl move_uploaded_file (move_uploaded_file($_FILES['Dokument']['tmp_name'], $uploaddir . $_FILES['Dokument']['name']) umgeleitet. Wie kann ich die hochgeladene Datei direkt vom Formular aus als Attachment an meine Email senden wie es mit den restlichen Daten des Formulars passiert? Geht das auch über die mail() Funktion? Klaus Klaus Steinkuhl www.Draw-a-Line.com Web and Graphic Design -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [Newbie Guide] For the benefit of new members
=== This message is for the benefit of new subscribers and those new to PHP. Please feel free to add more points and send to the list. === 1. If you have any queries/problems about PHP try http://www.php.net/manual/en first. You can download a copy and use it offline also. Please also try http://www.php.net/manual/faq.php for answers to frequently answered questions about PHP (added by Christophe Chisogne). 2. Try http://www.google.com next. Searching for php YOUR QUERY may fetch you relevant information within the first 10 results. 3. There is a searchable archive of the mailing list discussion at http://phparch.com/mailinglists. Many of the common topics are discussed repeatedly, and you may get answer to your query from the earlier discussions. For example: One of the repeatedly discussed question in the list is Best PHP editor. Everyone has his/her favourite editor. You can get all the opinions by going through the list archives. If you want a chosen list try this link : http://phpeditors.linuxbackup.co.uk/ (contributed by Christophe Chisogne). 4. Not sure if PHP is working or you want find out what extensions are available to you? Just put the following code into a file with a .php extension and access it through your webserver: ?php phpinfo(); ? If PHP is installed you will see a page with a lot of information on it. If PHP is not installed (or not working correctly) your browser will try to download the file. (contributed by Teren and reworded by Chris W Parker) 5. If you are stuck with a script and do not understand what is wrong, instead of posting the whole script, try doing some research yourself. One useful trick is to print the variable/sql query using print or echo command and check whether you get what you expected. After diagnosing the problem, send the details of your efforts (following steps 1, 2 3) and ask for help. 6. PHP is a server side scripting language. Whatever processing PHP does takes place BEFORE the output reaches the client. Therefore, it is not possible to access users' computer related information (OS, screen size etc) using PHP. Nor can you modify any the user side settings. You need to go for JavaScript and ask the question in a JavaScript list. On the other hand, you can access the information that is SENT by the user's browser when a client requests a page from your server. You can find details about browser, OS etc as reported by this request. - contributed by Wouter van Vliet and reworded by Chris W Parker. 7. Provide a clear descriptive subject line. Avoid general subjects like Help!!, A Question etc. Especially avoid blank subjects. 8. When you want to start a new topic, open a new mail composer and enter the mailing list address [EMAIL PROTECTED] instead of replying to an existing thread and replacing the subject and body with your message. 9. It's always a good idea to post back to the list once you've solved your problem. People usually add [SOLVED] to the subject line of their email when posting solutions. By posting your solution you're helping the next person with the same question. [contribued by Chris W Parker] 10. Ask smart questions http://catb.org/~esr/faqs/smart-questions.html [contributed by Jay Blanchard) 11. Do not send your email to the list with attachments. If you don't have a place to upload your code, try the many pastebin websites (such as www.pastebin.com). [contributed by Burhan Khalid] Hope you have a good time programming with PHP. -- Integrated Management Tools for leather industry -- http://www.leatherlink.net Ma Siva Kumar, BSG LeatherLink (P) Ltd, Chennai - 600106 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Frage
Draw-A-Line wrote: Hallo, ich hoffe mir kann jemand bei folgendem Problem helfen. Habe ein Formular erstellt und darin ist ein file field eingebettet zum Hochladen von Dateien (z.B. Word-Dokumente). Habe den Zusatz enctype=multipart/form-data in das form tag eingefgt und an ein php-Script zur Auswertung geschickt. Im php-Script habe ich die hochgeladene Datei aus dem temp-Verzeichnis des Server auf ein Verzeichnis innerhalb meiner Web site mit em Befehl move_uploaded_file (move_uploaded_file($_FILES['Dokument']['tmp_name'], $uploaddir . $_FILES['Dokument']['name']) umgeleitet. Wie kann ich die hochgeladene Datei direkt vom Formular aus als Attachment an meine Email senden wie es mit den restlichen Daten des Formulars passiert? Geht das auch ber die mail() Funktion? Klaus Klaus Steinkuhl www.Draw-a-Line.com Web and Graphic Design Klaus, If you write in English, we will understand your question, and perhaps somebody could help you ... Regards, Jordi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: https sessions failing to persist
Luis Bernardo wrote: Apache or IIS? CGI or ISAPI module? Hi, Apache and, if possible, running on Linux or BSD. For me, Windows and IIS have to much security holes that we cannont solve (must wait that M$ want to release a security patch). Regards, Jordi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Numeric Index of an array
How can I get the numeric Index of an array when the index is a string? i.e $myArray = array (first = my first value, second = my second value, third = my third value); Lets say I want the Index of the my second one: this would be second or numerid 1 (because the numeric index starts at zero). How can I get the numeric index when I only have the string-index (so array_keys is a nono) without making a loop like: $i = 0; foreach ($myArray as $index = $value) { if ($index == 'second') { echo $i; } $i++; } Is there another way to get the numeric index? thanx, Natascha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 2 May 2004 10:48:04 -0000 Issue 2739
php-general Digest 2 May 2004 10:48:04 - Issue 2739 Topics (messages 185111 through 185135): Sorting text with multibyte characters 185111 by: Michal Migurski 185114 by: Red Wingate 185117 by: Michal Migurski - Delete records in an Access DB 185112 by: francesco.automationsoft.biz 185113 by: Torsten Roehr Re: Select from 24 tables 185115 by: Richard A. DeVenezia 185116 by: Michal Migurski 185119 by: Travis Low 185122 by: Michal Migurski 185124 by: Travis Low 185125 by: Curt Zirzow php user management functionality 185118 by: bruce 185121 by: Travis Low Re: reversing an IF statement 185120 by: Curt Zirzow Re: Php MySql selection question 185123 by: Curt Zirzow Re: creating a mailing list 185126 by: Manuel Lemos 185128 by: Curt Zirzow Re: Installing sendmail in win9X/Me 185127 by: Manuel Lemos Re: Batch/Prepared statements for Mysql in PHP 185129 by: Curt Zirzow String Question 185130 by: Dave Carrera Frage 185131 by: Draw-A-Line 185133 by: Jordi Canals [Newbie Guide] For the benefit of new members 185132 by: Ma Siva Kumar Re: https sessions failing to persist 185134 by: Jordi Canals Numeric Index of an array 185135 by: Natascha Chrobok Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- Hi, Does anyone have any thoughts on how to effectively sort text with multi byte characters? I am working on a project that uses lots of German text, and the letters with umlauts don't sort correctly. I'm using the mb_* functions in a few places (to adapt an ASCII-encoded database to XML output for flash, which is always expected to be in UTF-8), but none of them seems to be made for string comparison. thanks, -mike. - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html ---End Message--- ---BeginMessage--- Run into this before, PHP seams to do quite well when you set the locale right ( de_DE ) which will place AÄBCD instead of ABCDÄÖÜ. Hope this helps :-) -- red Michal Migurski wrote: Hi, Does anyone have any thoughts on how to effectively sort text with multi byte characters? I am working on a project that uses lots of German text, and the letters with umlauts don't sort correctly. I'm using the mb_* functions in a few places (to adapt an ASCII-encoded database to XML output for flash, which is always expected to be in UTF-8), but none of them seems to be made for string comparison. thanks, -mike. - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html ---End Message--- ---BeginMessage--- Run into this before, PHP seams to do quite well when you set the locale right ( de_DE ) which will place AÄBCD instead of ABCDÄÖÜ. Hope this helps :-) Thanks, I hadn't thought of that. - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html ---End Message--- ---BeginMessage--- Hi all, I have this problem: I want to delete records in an Access DB. I use this code: $query=DELETE FROM Test_Table WHERE name='franco';; // the connection parameters $path=d:/inetpub/webs/my_site/mdb-database/ ; $db_name=test.mdb ; $dsource=$path.$db_name ; $cn_string=Provider=Microsoft.Jet.OLEDB.4.0; ; $cn_string.=Data Source=$dsource; ; // connection $cn=new COM(ADODB.Connection); $cn-open($cn_string); // object Recordset and send query by Open() metod $rs=new COM(ADODB.Recordset) ; $rs-open($query,$cn) ; // clean Recordset object $rs-Release() ; $rs=null ; /* close connection */ $cn-Close() ; $cn-Release() ; $cn=null ; but I have this error message: Fatal error: Call to undefined function: open() in D:\Inetpub\webs\metagenonlinecom\canc.php on line 11 Where is the problem? Is this the correct way to delete records from an Access DB? If this is a bad tecnic, can you suggest me what is the correct way? Thanks in advance to all. (The server where this script run is a Microsoft server). Francesco ---End Message--- ---BeginMessage--- So the problem is not the delete statement but that you cannot even open a connection, right? Have you tried PHP's ODBC functions to connect to the Access DB?: http://de.php.net/manual/en/function.odbc-connect.php There are some user comments regarding Access - maybe this helps. Regards, Torsten [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all, I have this
Re: [PHP] Progress Bar
Craig Gardner wrote: I'm working on a script that will automatically download and burn an ISO to a CD, when passed the filename of the ISO and I want to use some sort of progress bar to show how much of the download/burn is complete. I was originally going to use wget to download the file, but I don't know how to get the progress of the download. Before the script processes, I have the filename and filesize. Does anyone know of a way to get the file to download and give me the percentage of the file downloaded or even the filesize of the local copy every couple seconds or so? http://pear.php.net/package/HTML_Progress -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] http username
If a user is logged in via http (authentification e.g. with .htaccess and .htpasswd file), how can i get the username of the current logged in user? Thanx Harry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] http username
If a user is logged in via http (authentification e.g. with .htaccess and .htpasswd file), how can i get the username of the current logged in user? Read the manual at: http://www.php.net/manual/en/features.http-auth.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] http username
If a user is logged in via http (authentification e.g. with .htaccess and .htpasswd file), how can i get the username of the current logged in user? Thanx Harry try $_SERVER['PHP_AUTH_USER'] rich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] String Question
Dave Carrera wrote: How would I show 100 chars after finding the first instance of a searched word in a string. $start = strpos('hello',$str); $hundredchars = substr($str,$start,100); -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Setting fopen timeout ?
Hi List, How can I set fopen to time out if a url is not reachable ? I have tried set_time_limit but that dose not seem to work. Thank you in advance for any help or pointers. Dave C --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.674 / Virus Database: 436 - Release Date: 02/05/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Results in array
Phpu wrote: I want to interogate the database and the results to be placed into array. For now i have: $query = SELECT product_id, brand_name, model_name FROM products WHERE product_id='$product_id'; $result = mysql_query($query) or die(error in query - $query - .mysql_error()); $results = mysql_num_rows($result); I want all athe results to be placed in an array named models and then i want to print all the results. How can i do that. PS. The results must be placed in an array. while($row = mysql_fetch_assoc($results)) { $models[] = $row; } echo pre; print_r($models); echo /pre; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Auth
Anton Krall wrote: Guys. Im doing a small php auth system and I was wondering, how can avoid having to do a form to pass the user and pw to the php scripts and just use the popup auth windows on IE and NS? do you remember the names of the vars that get passed thru that popup or how can I invoke it? http://www.zend.com/zend/tut/authentication.php (please don't ask for read reciepts in your emails to the list) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with Curl GZIP problem?
The following code used to work until i upgraded to 4.3.6 Code: --- // Get RSS feed $c = curl_init('http://www.vegguide.org/rss/feed.rss?all=1omit_hours=1'); curl_setopt($c, CURLOPT_ENCODING, 'gzip'); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); curl_setopt($c, CURLOPT_COOKIEFILE, $cookie_jar); // *** This next line is the problem! *** $data = curl_exec($c); curl_close($c); Expected result: $data should be text. xml_parse($xml, $data) should be able to handle it. Actual result: -- $data is compressed gzip binaray data. I can't use it in this format. What changed? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Frage
Draw-A-Line [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hallo, ich hoffe mir kann jemand bei folgendem Problem helfen. Habe ein Formular erstellt und darin ist ein file field eingebettet zum Hochladen von Dateien (z.B. Word-Dokumente). Habe den Zusatz enctype=multipart/form-data in das form tag eingefügt und an ein php-Script zur Auswertung geschickt. Im php-Script habe ich die hochgeladene Datei aus dem temp-Verzeichnis des Server auf ein Verzeichnis innerhalb meiner Web site mit em Befehl move_uploaded_file (move_uploaded_file($_FILES['Dokument']['tmp_name'], $uploaddir . $_FILES['Dokument']['name']) umgeleitet. Wie kann ich die hochgeladene Datei direkt vom Formular aus als Attachment an meine Email senden - wie es mit den restlichen Daten des Formulars passiert? Geht das auch über die mail() Funktion? Hi Klaus, you could use the PEAR class Mail_Mime to send a mail with an attachment: http://pear.php.net/manual/en/package.mail.mail-mime.php Just add $_FILES['Dokument']['tmp_name'] as an attachment and it should work. Regards, Torsten Klaus Klaus Steinkuhl www.Draw-a-Line.com Web and Graphic Design -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is Curl GZIP support broken?
The following code used to work until i upgraded to 4.3.6 Code: --- // Get RSS feed $c = curl_init('http://www.vegguide.org/rss/feed.rss?all=1omit_hours=1'); curl_setopt($c, CURLOPT_ENCODING, 'gzip'); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); curl_setopt($c, CURLOPT_COOKIEFILE, $cookie_jar); // *** This next line is the problem! *** $data = curl_exec($c); curl_close($c); Expected result: $data should be text. xml_parse($xml, $data) should be able to handle it. Actual result: -- $data is compressed gzip binaray data. I can't use it in this format. What changed? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is Curl GZIP support broken?
* Thus wrote Dac Chartrand ([EMAIL PROTECTED]): The following code used to work until i upgraded to 4.3.6 Code: --- // Get RSS feed $c = curl_init('http://www.vegguide.org/rss/feed.rss?all=1omit_hours=1'); curl_setopt($c, CURLOPT_ENCODING, 'gzip'); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); curl_setopt($c, CURLOPT_COOKIEFILE, $cookie_jar); // *** This next line is the problem! *** $data = curl_exec($c); curl_close($c); Check curl_errno() and curl_error(). it sounds like there is a problem with your libcurl Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is Curl GZIP support broken?
Check curl_errno() and curl_error(). it sounds like there is a problem with your libcurl I'm not getting any errors using the above functions. Sample PHP code is available at: http://www.vegguide.org/plain/rss-code/get_and_parse_vegguide_rss_feed-php (Requires an account to be able to download RSS data) It used to work, now it doesn't. The problem is the follwing line: $data = curl_exec($c); $data used to be a string. Now it's GZIP compressed binary data that i can't work with. The only thing that has changed is me upgrading to PHP 4.3.6 Any other ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Help with Curl GZIP problem?
Sorry, this is a dupe. See: Is Curl GZIP support broken? in this same newsgroup. Thank you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is Curl GZIP support broken?
PS: I'm using w2k with apache. http://www.php.net/get/php-4.3.6-Win32.zip/from/a/mirror Check curl_errno() and curl_error(). it sounds like there is a problem with your libcurl Curt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] looking for PHP/MYSQL developer in SW london,UK
Hello gang My company is looking for someone who can work freelance/part-time on some web projects we have. The right person must have experience in PHP/MYSQL in an e-commerce capacity. Graphics skills (Photoshop etc) are also required. C++/MFC experience would be handy but not essential. We would ideally like someone who is able to spend some time working at our HQ in Wimbledon, SW London. Please reply via email if you are able to help or can point us in the direction of finding someone who can? Best regards Scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Trouble setting include_path
Hi folks. I'm trying to use an .htaccess file to set my include path and for some reason it's not overriding the value in php.ini, but instead still shows and uses the original value from php.ini, not what is in the .htaccess file. I know that include_path is one of the values that can be set anywhere, so I'm confused as to why this is happening. I've placed the following .htaccess file in www.mysite.ca/test/: php_value include_path /home/pablo/foo And in www.mysite.ca/test/test.php I have one line: include_once 'foo.php'; which refers to the file /home/pablo/foo/foo.php However when I run test.php it does not include foo.php and the error message informs me that the include_path value being used is still the one from the php.ini file. Has anyone run into this before or got any idea why this is happening? Cheers and TIA. Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is Curl GZIP support broken?
* Thus wrote Dac Chartrand ([EMAIL PROTECTED]): Check curl_errno() and curl_error(). it sounds like there is a problem with your libcurl I'm not getting any errors using the above functions. Sample PHP code is available at: http://www.vegguide.org/plain/rss-code/get_and_parse_vegguide_rss_feed-php (Requires an account to be able to download RSS data) It used to work, now it doesn't. The problem is the follwing line: $data = curl_exec($c); $data used to be a string. Now it's GZIP compressed binary data that i can't work with. php simply calls the libcurl function and returns what libcurl came back with. There might be problem with the curl.dll your using. You might want to try setting CURLOPT_ENCODING to 'defalate'. otherwise dont set any compression requests. I've tested your code with php5 and libcurl 7.10 and gzip compression works fine. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Trouble setting include_path
* Thus wrote Pablo Gosse ([EMAIL PROTECTED]): Hi folks. I'm trying to use an .htaccess file to set my include path and for some reason it's not overriding the value in php.ini, but instead still shows and uses the original value from php.ini, not what is in the .htaccess file. Most default apache configurations now a days dont have .htaccess enabled by default (for performance reasons.) Or some hosting services implicitly turn this option off. So no matter what you put in the .htaccess file, it will be ignored. You can test this by putting in your .htaccess file something like: bogus_statment if you reload your page on your server and dont get a 500 server error, apache isn't even looking at the .htaccess file. You can set set the include_path using the php function ini_set(). Another possibility is that the hosting company had issued an apache command: php_admin_value include_path /path/for/include Then you can't modify the include_path at all. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Numeric Index of an array
Natascha Chrobok wrote: How can I get the numeric Index of an array when the index is a string? string indexes don't have numeric indexes. they are in order however, if you want to find the order of a value, use: echo array_search(array_search(my second value, $myArray), array_keys($myArray)); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Array Question
I am using the following array and function in the template for my website. It works great, but I want to to be better. I would to make it so the last item displayed looks differently than the others, but I have been unable to figure out how to distinguish the last item. When displayed, the crumbs look like: SITENAME » RANDOM » ITEM I would like ITEM to look differently. Can anyone tell me how to modify the select ITEM? // CRUMBS ARRAY $crumbs = array( array( RANDOM, RANDOM_URL ), array( ITEM, ITEM_URL ) ); // CRUMBS FUNCTION function breadCrumbs($crumbs) { if ( count($crumbs) 0 ) { $spacer = span style=\color:#94cf42;font-size:15px;font-weight:bold;\raquo;/span ; $breadCrumbs = a href=\URL/\SITE_NAME/a\n; foreach( $crumbs as $crumb ) { if ( count($crumb) == 2 ) { $breadCrumbs .= $spacera href=\$crumb[1]\$crumb[0]/a\n; } } echo !-- ### BREADCRUMBS STARTS HERE ### --\n; echo span class=\breadcrumbs\\n; echo $breadCrumbs; echo /span\n; echo !-- BREADCRUMBS ENDS HERE --\n; } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is Curl GZIP support broken?
php simply calls the libcurl function and returns what libcurl came back with. There might be problem with the curl.dll your using. The curl.dll i am using is packaged with the binary distribution of PHP (i'm on windows), so if there is a problem with it, there's a problem with the PHP distro. I filed a bug indicating this, but was marked as bogus. http://bugs.php.net/bug.php?id=28168 You might want to try setting CURLOPT_ENCODING to 'defalate'. otherwise dont set any compression requests. This seems to work (slowly?) under test conditions. I'll keep you posted if it works when the 'cron' job is executed several hours from now. Thank you for your help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Setting fopen timeout ?
Dave Carrera wrote: Hi List, How can I set fopen to time out if a url is not reachable ? I have tried set_time_limit but that dose not seem to work. Thank you in advance for any help or pointers. Dave C I'm not sure it will help but try ini_set('default_socket_timeout', XX); --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.674 / Virus Database: 436 - Release Date: 02/05/2004 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 2 May 2004 22:54:17 -0000 Issue 2740
php-general Digest 2 May 2004 22:54:17 - Issue 2740 Topics (messages 185136 through 185158): Re: Progress Bar 185136 by: Burhan Khalid http username 185137 by: Harry.de 185138 by: Matt 185139 by: rich Re: String Question 185140 by: John W. Holmes Setting fopen timeout ? 185141 by: Dave Carrera 185158 by: Marek Kilimajer Re: Results in array 185142 by: Burhan Khalid Re: PHP Auth 185143 by: Burhan Khalid Help with Curl GZIP problem? 185144 by: Dac Chartrand 185149 by: Dac Chartrand Re: Frage 185145 by: Torsten Roehr Is Curl GZIP support broken? 185146 by: Dac Chartrand 185147 by: Curt Zirzow 185148 by: Dac Chartrand 185150 by: Dac Chartrand 185153 by: Curt Zirzow 185157 by: Dac Chartrand looking for PHP/MYSQL developer in SW london,UK 185151 by: scott.broadcastwarehouse.com Trouble setting include_path 185152 by: Pablo Gosse 185154 by: Curt Zirzow Re: Numeric Index of an array 185155 by: Marek Kilimajer Array Question 185156 by: Jason Williard Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- Craig Gardner wrote: I'm working on a script that will automatically download and burn an ISO to a CD, when passed the filename of the ISO and I want to use some sort of progress bar to show how much of the download/burn is complete. I was originally going to use wget to download the file, but I don't know how to get the progress of the download. Before the script processes, I have the filename and filesize. Does anyone know of a way to get the file to download and give me the percentage of the file downloaded or even the filesize of the local copy every couple seconds or so? http://pear.php.net/package/HTML_Progress ---End Message--- ---BeginMessage--- If a user is logged in via http (authentification e.g. with .htaccess and .htpasswd file), how can i get the username of the current logged in user? Thanx Harry ---End Message--- ---BeginMessage--- If a user is logged in via http (authentification e.g. with .htaccess and .htpasswd file), how can i get the username of the current logged in user? Read the manual at: http://www.php.net/manual/en/features.http-auth.php ---End Message--- ---BeginMessage--- If a user is logged in via http (authentification e.g. with .htaccess and .htpasswd file), how can i get the username of the current logged in user? Thanx Harry try $_SERVER['PHP_AUTH_USER'] rich ---End Message--- ---BeginMessage--- Dave Carrera wrote: How would I show 100 chars after finding the first instance of a searched word in a string. $start = strpos('hello',$str); $hundredchars = substr($str,$start,100); -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com ---End Message--- ---BeginMessage--- Hi List, How can I set fopen to time out if a url is not reachable ? I have tried set_time_limit but that dose not seem to work. Thank you in advance for any help or pointers. Dave C --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.674 / Virus Database: 436 - Release Date: 02/05/2004 ---End Message--- ---BeginMessage--- Dave Carrera wrote: Hi List, How can I set fopen to time out if a url is not reachable ? I have tried set_time_limit but that dose not seem to work. Thank you in advance for any help or pointers. Dave C I'm not sure it will help but try ini_set('default_socket_timeout', XX); --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.674 / Virus Database: 436 - Release Date: 02/05/2004 ---End Message--- ---BeginMessage--- Phpu wrote: I want to interogate the database and the results to be placed into array. For now i have: $query = SELECT product_id, brand_name, model_name FROM products WHERE product_id='$product_id'; $result = mysql_query($query) or die(error in query - $query - .mysql_error()); $results = mysql_num_rows($result); I want all athe results to be placed in an array named models and then i want to print all the results. How can i do that. PS. The results must be placed in an array. while($row = mysql_fetch_assoc($results)) { $models[] = $row; } echo pre; print_r($models); echo /pre; ---End Message--- ---BeginMessage--- Anton Krall wrote: Guys. Im doing a small php auth system and I was wondering, how can avoid having to do a form to pass the user and pw to the php scripts and just use the popup auth windows on IE and NS? do you remember the names of the vars that get passed thru that popup or
RE: [PHP] Trouble setting include_path
snip Most default apache configurations now a days dont have .htaccess enabled by default (for performance reasons.) Or some hosting services implicitly turn this option off. So no matter what you put in the .htaccess file, it will be ignored. You can test this by putting in your .htaccess file something like: bogus_statment if you reload your page on your server and dont get a 500 server error, apache isn't even looking at the .htaccess file. You can set set the include_path using the php function ini_set(). /snip Thanks, Curt. That was indeed the problem. Cheers, Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sessions failing to persist
As I posted last week, I seem unable to have sessions persist. I have ruled out https as a problem, the following simple script, installed as xxx.php will generate a new session number every time the field is filled in and Submit is hit. Note that I am not using cookies, the relevant session variables are: Session Support enabled session.auto_start On session.use_cookies Off session.use_trans_sidOn When run, the session file appears to contain stage=1 but never is being read. I suspect I'm missing something obvious, any pointers? /\/\ \/\/ ? if (!session_is_registered(stage)) { $_SESSION[stage] = 0; $_POST['field'] = ; session_register(stage); } ? html headtitlePHP Test page/title/head body ? echo Stage:; echo $_SESSION[stage]; echo SessionID: ; echo session_id(); $_SESSION[stage] = 1; ? form method=post action=xxx.php input type=text maxlength=7 size=7 name=field value=?echo $_POST['field']? input type=submit value=Submit /form ? echo Stage:; echo $_SESSION[stage]; ? /body /html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions failing to persist
Michael R. Wayne wrote: As I posted last week, I seem unable to have sessions persist. I have ruled out https as a problem, the following simple script, installed as xxx.php will generate a new session number every time the field is filled in and Submit is hit. Note that I am not using cookies, the relevant session variables are: Session Support enabled session.auto_start On session.use_cookies Off session.use_trans_sidOn When run, the session file appears to contain stage=1 but never is being read. I suspect I'm missing something obvious, any pointers? I copy and pasted your code, and didn't get the results you described above. Basically, it all worked fine on my box (and now I have to go put my ini settings back to my normal values ;) Is this a *nix or Windows machine? Is your session directory writable by the webserver user? -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions failing to persist
On Mon, May 03, 2004 at 12:54:54AM -0400, John Nichel wrote: Michael R. Wayne wrote: As I posted last week, I seem unable to have sessions persist. I have ruled out https as a problem, the following simple script, installed as xxx.php will generate a new session number every time the field is filled in and Submit is hit. Note that I am not using cookies, the relevant session variables are: Session Support enabled session.auto_start On session.use_cookies Off session.use_trans_sidOn When run, the session file appears to contain stage=1 but never is being read. I suspect I'm missing something obvious, any pointers? I copy and pasted your code, and didn't get the results you described above. Basically, it all worked fine on my box (and now I have to go put my ini settings back to my normal values ;) Is this a *nix or Windows machine? Is your session directory writable by the webserver user? FreeBSD 4.8 Unix. Yes, the session directory is writable and the files are getting properly written to that directory - the problem is that they are never being read (so each time I click Submit, I get a new session ID). /\/\ \/\/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions failing to persist
If the sample of code is the whole page... where do you actually start your session? I didn't see a session_start() anywhere. AFAIK the $_SESSION var doesn't exist until you do just that. session_is_registered(): mabe I'm reading the documentation wrong, but I interpret this function as checking whether there is the global var (in this case $stage) ... and since register_globals is off there shouldn't be such a var automatically any more. .. In the user comments there's a good example of how to handle sessions. http://www.php.net/session_is_registered#26464 hth Richard Monday, May 3, 2004, 6:40:18 AM, thus was written: As I posted last week, I seem unable to have sessions persist. I have ruled out https as a problem, the following simple script, installed as xxx.php will generate a new session number every time the field is filled in and Submit is hit. Note that I am not using cookies, the relevant session variables are: Session Support enabled session.auto_start On session.use_cookies Off session.use_trans_sidOn When run, the session file appears to contain stage=1 but never is being read. I suspect I'm missing something obvious, any pointers? /\/\ \/\/ ? if (!session_is_registered(stage)) { $_SESSION[stage] = 0; $_POST['field'] = ; session_register(stage); } ? html headtitlePHP Test page/title/head body ? echo Stage:; echo $_SESSION[stage]; echo SessionID: ; echo session_id(); $_SESSION[stage] = 1; ? form method=post action=xxx.php input type=text maxlength=7 size=7 name=field value=?echo $_POST['field']? input type=submit value=Submit /form ? echo Stage:; echo $_SESSION[stage]; ? /body /html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions failing to persist
On Mon, May 03, 2004 at 06:55:25AM +0200, Richard Harb wrote: If the sample of code is the whole page... where do you actually start your session? I am using session.auto_start, which starts it for me. I added a session_start while testing and it made no difference. session_is_registered(): mabe I'm reading the documentation wrong, but I interpret this function as checking whether there is the global var (in this case $stage) ... and since register_globals is off there shouldn't be such a var automatically any more. In the user comments there's a good example of how to handle sessions. http://www.php.net/session_is_registered#26464 OK, replaced it with the following, no change in behaviour. I still get a new sessionID every time I hit Submit. ? if (!isset($_SESSION[stage])) { $_SESSION[stage] = 0; $_POST['field'] = ; session_register(stage); } ? html headtitlePHP Test page/title/head body ? echo Stage:; echo $_SESSION[stage]; echo SessionID: ; echo session_id(); $_SESSION[stage] = 1; ? form method=post action=xxx.php input type=text maxlength=7 size=7 name=field value=?echo $_POST['field']? input type=submit value=Submit /form ? echo Stage:; echo $_SESSION[stage]; ? /body /html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions failing to persist
Michael R. Wayne wrote: form method=post action=xxx.php input type=text maxlength=7 size=7 name=field value=?echo $_POST['field']? input type=submit value=Submit /form Try adding in a hidden element input type=hidden name=PHPSESSID value=?=session_id();? You're relying on PHP rewriting your forms, links, etc, to include the session id, but that doesn't seem to be happening. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions failing to persist
* Thus wrote Michael R. Wayne ([EMAIL PROTECTED]): I suspect I'm missing something obvious, any pointers? /\/\ \/\/ ? if (!session_is_registered(stage)) { $_SESSION[stage] = 0; $_POST['field'] = ; session_register(stage); } manual Caution If you are using $_SESSION (or $HTTP_SESSION_VARS), do not use session_register(), session_is_registered(), and session_unregister(). /manual Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions failing to persist
On Mon, May 03, 2004 at 01:13:11AM -0400, John W. Holmes wrote: Michael R. Wayne wrote: form method=post action=xxx.php input type=text maxlength=7 size=7 name=field value=?echo $_POST['field']? input type=submit value=Submit /form Try adding in a hidden element input type=hidden name=PHPSESSID value=?=session_id();? You're relying on PHP rewriting your forms, links, etc, to include the session id, but that doesn't seem to be happening. I pasted that line just before the /form and the behaviour remains unchanged. No SessionId is never showing up in the access.log /\/\ \/\/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php