Re: [PHP] Wrong parameter count for fgets
Warning: Wrong parameter count for fgets() in I had this error on of my scripts, any ideas on this part? Well, I typed fgets into the search for field on a page at php.net, left the in the field set to function list, and clicked the little non-descript arrow to the right of that, and I found this: http://www.php.net/manual/en/function.fgets.php From what it says on that page, I would guess that less than one or greater than two would be a wrong count. I note that the first argument would appear to be the file pointer fopen would return. The second is explained to be an optional limit to the number of bytes to be read. How come this error occur? My guess is that you tried to pass fgets either the wrong number or the wrong type of arguments. -- Joel Rees, programmer, Kansai Systems Group Altech Corporation (Alpsgiken), Osaka, Japan http://www.alpsgiken.co.jp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Storing large amounts of text in db
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I am working on some scripts that will allow for uploading of files that will then be stored in a database with the ability to be listed and searched. What im wondering, is if I have a user upload a file in txt, or doc format if there is an easy way to read that file, store the information in the database so it is easily accessable later. I thinkg that longtext would be the right mysql option for me. One problem I need to conquer is how to maintain formatting in the documents. Any suggestions and comments are welcome. Thanks. - --- Aaron Axelsen AIM: AAAK2 Email: [EMAIL PROTECTED] Want reliable web hosting at affordable prices? www.modevia.com Web Dev/Design Community/Zine www.developercube.com -BEGIN PGP SIGNATURE- Version: PGPfreeware 7.0.3 for non-commercial use http://www.pgp.com iQA/AwUBPwpi6brnDjSLw9ADEQLiBQCgmXYiAR5kMVUggxZv57w88ahtTigAoJp4 OjB7NpviuXTu3+c9s1czzRPl =l8OI -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] print vs heredoc
As to which is faster is does not really matter as the speed of echo print and heredoc is dictated by the connection speed to the requesting client. If this is a factor in your overall operation you can use output buffering to save the contents and output them at the end of your script. Although really, heredoc can't be compared to either echo or print, as it's just a string definition that eventually will be printed. So I guess you guys are really comparing vs heredoc? And I agree that any speed difference (if there is one) isn't a good reason to choose when readablity may suffer. So it all depends on the situation, and the programmer. btw what would be nice is a print_raw command that does no parsing just sends the stuff :) (Would be good for template systems where you know there is no php hidden in there.) ... might gain a couple of micro seconds I believe this is called breaking out of PHP mode and into HTML mode, which can be done anywhere, at any time. Regards, Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Storing large amounts of text in db
I am working on some scripts that will allow for uploading of files that will then be stored in a database with the ability to be listed and searched. What im wondering, is if I have a user upload a file in txt, or doc format if there is an easy way to read that file, store the information in the database so it is easily accessable later. If in doc format, no - MS word is a closed file format, and while you may be able to pick through the files, there is no guarantee as to the meaning of what you find there. Though you may be surprised to find all sorts of interesting things. Txt is just text - no conversion necessary, except perhaps to account for line endings. If you can, try to convert whatever incoming format you encounter to plaintext, and store /that/ in the db. If it's important to you that the original file format be preserverd, then store both: original in a BLOB field or in the filesystem with a pointer from the database, and plaintext version in the database. You might even want to store only keywords from the plaintext version to cut down on storage and processing requirements. - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] multiple select box not showing values
I have a select box that is filled with multiple values and when the user clicks submit, it hightlights all the values in the select box and then sends this to my PHP file. I did a simple: echo ($_POST[imgList]); to see what was happening and the only value being carried across is the last value selected, even though all values are selected. What might be causing only the last value to be chosen? I was thinking that it was some of the javascript that I use but I recall that it was working just fine with it. I've even tried removing the JS with the same results. Any ideas. thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: multiple select box not showing values
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... I have a select box that is filled with multiple values and when the user clicks submit, it hightlights all the values in the select box and then sends this to my PHP file. I did a simple: echo ($_POST[imgList]); to see what was happening and the only value being carried across is the last value selected, even though all values are selected. What might be causing only the last value to be chosen? I was thinking that it was some of the javascript that I use but I recall that it was working just fine with it. I've even tried removing the JS with the same results. Any ideas. thanks You need to name the SELECT as imgList[] which will pass an array of all the selected items to your script. -- Quod subigo farinam $email =~ s/oz$/au/o; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] print vs heredoc
Hi, btw what would be nice is a print_raw command that does no parsing just sends the stuff :) (Would be good for template systems where you know there is no php hidden in there.) ... might gain a couple of micro seconds PO I believe this is called breaking out of PHP mode PO and into HTML mode, which can be done anywhere, at PO any time. PO Regards, PO Philip No .. what I was talking about is echoing a variable that contains no php $test = 'Hi there'; echo $test; $test will get parsed (i believe) looking for stuff to interpolate. Could be a waste of time in some cases where $test is large. But again probably insignificant with regard to actual time to get it to the client. -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: multiple select box not showing values
I can't believe I totally overlooked that. Thanks. That solved the problem completely. David Robley [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... I have a select box that is filled with multiple values and when the user clicks submit, it hightlights all the values in the select box and then sends this to my PHP file. I did a simple: echo ($_POST[imgList]); to see what was happening and the only value being carried across is the last value selected, even though all values are selected. What might be causing only the last value to be chosen? I was thinking that it was some of the javascript that I use but I recall that it was working just fine with it. I've even tried removing the JS with the same results. Any ideas. thanks You need to name the SELECT as imgList[] which will pass an array of all the selected items to your script. -- Quod subigo farinam $email =~ s/oz$/au/o; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[3]: [PHP] print vs heredoc
Hi, Tuesday, July 8, 2003, 5:22:04 PM, you wrote: TR Hi, btw what would be nice is a print_raw command that does no parsing just sends the stuff :) (Would be good for template systems where you know there is no php hidden in there.) ... might gain a couple of micro seconds PO I believe this is called breaking out of PHP mode PO and into HTML mode, which can be done anywhere, at PO any time. PO Regards, PO Philip TR No .. what I was talking about is echoing a variable that contains no TR php TR $test = 'Hi there'; TR echo $test; TR $test will get parsed (i believe) looking for stuff to interpolate. TR Could be a waste of time in some cases where $test is large. TR But again probably insignificant with regard to actual time to get it TR to the client. TR -- TR regards, TR Tom Ok I think I have succeeded in confusing myself :) It seems the interpolation is done at the time of assignment and not the actual echo.. -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] (pas d'objet)
Hi everyone, I have a doubt, an existential question on the PHP... Yesterday I had an entrevue for a job and I was quite surprised by the technical director that told me that he prefers coding PL/SQL subroutines better than in PHP embedding. The Oracle database on which he works is about 100 Go. The application is on a web server. It is like a startup structure. I told him that I prefer doing all the things I can do with PHP better than in PL/SQL. He told me that all treatments couldn't be done in PHP because of the size of the database and memory limitation. I am writing you this mail to know your point of view on that point if you have time to answer me. What would be then the limit of the PHP coding ? For such a database what would be the right parametrization of the PHP.ini ? is there only a right parametrization for such database ? Does anyone have some information on that limitation of the PHP ? any article ? Thanks in advance for your answers and time. Sergio -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: problem with 4.3.2
Anyone?? Is this a bug or something else? [EMAIL PROTECTED] wrote: After upgrading from 4.2.3 to 4.3.2 apache fail to load with an error: Invalid command 'php_admin_value', perhaps mis-spelled... php_admin_flag also fails. I tried with and without php.ini. php was compile with --with-apxs --with-mysql --with-gd --with-xml --with-iconv --with-gettext --with-mcrypt --with-openssl --with-imap --with-kerberos --with-imap-ssl --with-curl I then tried the snapshot 200307070930 and had the same problem. Then I put IfModule mod_php4.c around php_admin_value and the problem disapear. That tald me that for some reason the new library is not being loaded by apache. I rechecked the path of LoadModule, it's fine. When I run ldd on libphp4.so, no library is missing. The only different in the configs between our current version and 4.3.2 is the LoadModule path in apache. I've run out of ideas, any help would be appriciated. Thank you -G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[3]: [PHP] print vs heredoc
Hi. I'm surprised you haven't been jumped on already for this one. Variables in double-quoted and heredoc-style strings are expanded; variables in single-quoted strings aren't. I refer you to the excellent PHP manual -- one of the first pages you should absorb... http://www.php.net/manual/en/language.types.string.php Hi, Tuesday, July 8, 2003, 5:22:04 PM, you wrote: TR Hi, btw what would be nice is a print_raw command that does no parsing just sends the stuff :) (Would be good for template systems where you know there is no php hidden in there.) ... might gain a couple of micro seconds PO I believe this is called breaking out of PHP mode PO and into HTML mode, which can be done anywhere, at PO any time. PO Regards, PO Philip TR No .. what I was talking about is echoing a variable that contains no TR php TR $test = 'Hi there'; TR echo $test; TR $test will get parsed (i believe) looking for stuff to interpolate. TR Could be a waste of time in some cases where $test is large. TR But again probably insignificant with regard to actual time to get it TR to the client. TR -- TR regards, TR Tom Ok I think I have succeeded in confusing myself :) It seems the interpolation is done at the time of assignment and not the actual echo.. -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] include like function
Hello, i need a function that gets a internal file say news.php, and follows the urls from its copied location, say if i am in /pages/ and i need a file from /pages/php/wow i put include('php/wow/news.php') But the news.php file needs a file in the /php/wow directory called news.inc.php how can the php copy every thing accross so a error is not shown so the script could read include('php/wow/news.php', point_links_to('php/wow/') Thank You, Sam George. ktcsc.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Regular Expression
I read your regex as -match start of line -followed by p, followed by o =followed by single space -followed by b,o,x -followed by end of line If someone puts in PO BOX 343, then your regex will not match. If someone puts in PO BOX 12, then your regex will not match. If you're saying that you think you are matching in strings that don't contain po box, I would be dubious of that claim. -Original Message- From: Ralph Guzman [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 9:59 PM To: PHP General Mailing List Subject: [PHP] Regular Expression I have a form where I have to check whether user is submitting a PO Box as an address. I wrote the following using eregi, but it returns true even when the field is not Po Box. How do I go about doing this properly? if(eregi(^Po Box$, $address)){ $error_message_custom = You cannot use a PO BOX for Bill To Address; } -- 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] include like function
On Tue, 8 Jul 2003 09:35:10 +0100, you wrote: Hello, i need a function that gets a internal file say news.php, and follows the urls from its copied location, say if i am in /pages/ and i need a file from /pages/php/wow i put include('php/wow/news.php') But the news.php file needs a file in the /php/wow directory called news.inc.php how can the php copy every thing accross so a error is not shown so the script could read include('php/wow/news.php', point_links_to('php/wow/') Wow. That was.. slightly confusing. I /think/ that the include_path directive in php.ini may help you. Also check out set_include_path() and it's brethren. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] (pas d'objet)
PHP is designed for rapid development of web applications. Manipulating relational database data is not its strong point. If I had a complicated database manipulation that could be done within and oracle stored procedure, and the database was large, or expected to get that way, I would strongly consider a stored proc, even if there was a simple alternative available via a short block of php, because the stored proc is going to be faster. This is no different than someone doing a select statement using a join, rather than selecting one table in php, iterating through the result set, and doing follow up select statements. In each case you would get the same data, but one method is intrinsically faster than the other. With that said... as the old saying goes to the man with a hammer, everything looks like a nail. It may be that the interviewer simply knows oracle better than anything else, and looks to solve all problems with pl/sql, and oracle does provide the capability to do relatively complete web applications completely in pl/sql. For many people the abilities of pl/sql are irrelevant, because they are not using oracle as the backend. -Original Message- From: RIVES Sergio SOFRECOM [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 12:44 AM To: phplist Subject: [PHP] (pas d'objet) Hi everyone, I have a doubt, an existential question on the PHP... Yesterday I had an entrevue for a job and I was quite surprised by the technical director that told me that he prefers coding PL/SQL subroutines better than in PHP embedding. The Oracle database on which he works is about 100 Go. The application is on a web server. It is like a startup structure. I told him that I prefer doing all the things I can do with PHP better than in PL/SQL. He told me that all treatments couldn't be done in PHP because of the size of the database and memory limitation. I am writing you this mail to know your point of view on that point if you have time to answer me. What would be then the limit of the PHP coding ? For such a database what would be the right parametrization of the PHP.ini ? is there only a right parametrization for such database ? Does anyone have some information on that limitation of the PHP ? any article ? Thanks in advance for your answers and time. Sergio -- 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] multiple select box not showing values
Is imgList an array, and did you specify it as such in the form? Are you foreach() through the array to get the contents? -Original Message- From: Micah Montoy [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 12:03 AM To: [EMAIL PROTECTED] Subject: [PHP] multiple select box not showing values I have a select box that is filled with multiple values and when the user clicks submit, it hightlights all the values in the select box and then sends this to my PHP file. I did a simple: echo ($_POST[imgList]); to see what was happening and the only value being carried across is the last value selected, even though all values are selected. What might be causing only the last value to be chosen? I was thinking that it was some of the javascript that I use but I recall that it was working just fine with it. I've even tried removing the JS with the same results. Any ideas. thanks -- 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] Retaining formatting problem
Hello everyone, I have a long running problem that i just want to get covered, I have a standard text box for people to insert long lengths of text. This text box is in a standard input type=text but when I insert it into the database the line returns dissapear, eg this little amount of text will enter like this little amount of text will enter like Please help me it is p!!$$!ng me right off :P Cheers in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Retaining formatting problem[Scanned]
I've experienced the same problem. It's not that the line returns disappear - they will still be retained but stored as /n or /r. You'll need to find a way of replacing the line breaks with a html paragraph break - assuming your required output is html. Perhaps some of the regexp functions will help in this - I haven't got the code I used for this to hand. HTH, Michael Egan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 08 July 2003 10:30 To: [EMAIL PROTECTED] Subject: [PHP] Retaining formatting problem[Scanned] Hello everyone, I have a long running problem that i just want to get covered, I have a standard text box for people to insert long lengths of text. This text box is in a standard input type=text but when I insert it into the database the line returns dissapear, eg this little amount of text will enter like this little amount of text will enter like Please help me it is p!!$$!ng me right off :P Cheers 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
Re: [PHP] include like function
on Tue, Jul 8, 2003, David Otton wrote: Hello, i need a function that gets a internal file say news.php, and follows the urls from its copied location, say if i am in /pages/ and i need a file from /pages/php/wow i put include('php/wow/news.php') But the news.php file needs a file in the /php/wow directory called news.inc.php how can the php copy every thing accross so a error is not shown so the script could read include('php/wow/news.php', point_links_to('php/wow/') Wow. That was.. slightly confusing. I /think/ that the include_path directive in php.ini may help you. You can set the include_path to have multiple directories by separating each path with a colon. If you are using Apache, you could also use .htaccess files to override the default config or you could add a directive in the htppd.conf file, such as : IfModule mod_php4.c php_value include_path /usr/local/lib/php/:/pages/php/wow/ /IfModule Ian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] error on array loop through foreach?
On Mon, 2003-07-07 at 21:31, Micah Montoy wrote: It did help and I altered the script a bit. It now reads as: [snip] Now I am receiving the error message of: Warning: Invalid argument supplied for foreach() in c:\inetpub\wwwroot\webpage10\example\u_images\act_load_imgs.php on line 43 Anyone have an idea of what may be causing this? thanks Are you 100% sure that $filename is an array when you give it to foreach? Check to make sure that $filename exists and is an array first. That should help. Good luck, Torben -- Torben Wilson [EMAIL PROTECTED]+1.604.709.0506 http://www.thebuttlesschaps.com http://www.inflatableeye.com http://www.hybrid17.com http://www.themainonmain.com - Boycott Starbucks! http://www.haidabuckscafe.com - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fputs problem
I don't know if this is possible but... I want to generate a PHP file on the fly. I am trying to use fputs but I have a problem in that it doesn't print a variable name in the string. Here is my code: Formid is being passed into the string great which is what I want but how do I get the string to write the variable names in this code? Are there any rules I need to follow to get the whole file to print out? If so what? And what should I be looking for in the manual? Fputs isn't helping much. function generate_page($formid, $pagename) { // Give the function the string to be generated including formid passed from // previous form $string = ?php $SECTION_NAME = \goldfish_cms.php\;\n //\n // Written by Steve Jackson. Copyright and all rights reserved Webpage 2003.//\n /functions here all included in output_fns.php\n //\n // include the files from output fns to get functions which design the page\n include ('output_fns.php');\n db_connect();\n $query = \select * from content where PageID='$formid'\;\n $result = mysql_query($query) or die(\Error: Query failure withBR$queryBR\.mysql_error());\n while ($array = mysql_fetch_array($result))\n {\n $HeadTitle = \{$array[HeadTitle]}\; \n $PageTitle = \{$array[Title]}\; \n $BodyText = \{$array[BodyText]}\;\n $Picture1 = \{$array[PictureOne]}\;\n $Picture2 = \{$array[PictureTwo]}\;\n $CatID = \{$array[CatID]}\;\n }\n // carry the variable head title in the page and do the page header\n do_html_header($HeadTitle);\n // carry variables into do_html_index() function in output_fns.\n // Page title = The headline of the page\n // Body text = The text body, can include html commands.\n // Picture 1 = picture or graphic that appears above the title if required.\n // Picture 2 = Picture that appears right hand side on the basic output_fns\n // CatID = Category which is used for determining which links appear on each page\n // Section name = Allows you to specify extra functions to output_fns.php to be unique to the page (requires hard coding)\n do_html_index($PageTitle, $BodyText, $Picture1, $Picture2, $CatID, $SECTION_NAME);\n // put the page footer in position\n do_html_footer();\n ?\n; $filename = 'test.txt'; $fp = fopen($filename, a); $write = fputs($fp, $string); fclose($fp); } generate_page($formid, $pagename); Steve Jackson Web Development and Marketing Manager 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] output compression and MSIE
Hello, I've found problem with MSIE showing sometimes blank page when compression is turned on (no matter using zlib.output_compression or gzip handler). I've found that happens when page is =4096 bytes long (output in HTML). And this suggested me to try to change buffer size for compression (for zlib, that I was using) cause it was set to exactly 4KB. But that didn't help at all :-( If I add space characters at the end of output to let page grow ower 4096 bytes - everything works fine, else MSIE shows blank page and user has to hit Refresh button to see correct page. With other browsers that problem doesn't happen. Do you have any idea how to solve that? BTW - changing browser or doing anything with user system is not good idea for me, cause I can't force users of my application to do anything - they use (and will use) windows+IE and so that's my problem to find solution. And output compression is a MUST for me cause I have to cut network traffic to lower users costs of using internet (GPRS transmission using mobile phones). Big thanks in advance for any help Sebastian Baran -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Fputs problem
You'll have to quote the $ like $string=blablabla \$myvariable blablabla\n; or you put your string in ' instead of then you only have to quote the ' if you want to use it in your string. For more information look http://www.php.net/manual/en/language.types.string.php#language.types.string .syntax.single Greetings Kristin Schesonka Steve Jackson [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] I don't know if this is possible but... I want to generate a PHP file on the fly. I am trying to use fputs but I have a problem in that it doesn't print a variable name in the string. Here is my code: Formid is being passed into the string great which is what I want but how do I get the string to write the variable names in this code? Are there any rules I need to follow to get the whole file to print out? If so what? And what should I be looking for in the manual? Fputs isn't helping much. function generate_page($formid, $pagename) { // Give the function the string to be generated including formid passed from // previous form $string = ?php $SECTION_NAME = \goldfish_cms.php\;\n //\n // Written by Steve Jackson. Copyright and all rights reserved Webpage 2003.//\n /functions here all included in output_fns.php\n //\n // include the files from output fns to get functions which design the page\n include ('output_fns.php');\n db_connect();\n $query = \select * from content where PageID='$formid'\;\n $result = mysql_query($query) or die(\Error: Query failure withBR$queryBR\.mysql_error());\n while ($array = mysql_fetch_array($result))\n {\n $HeadTitle = \{$array[HeadTitle]}\; \n $PageTitle = \{$array[Title]}\; \n $BodyText = \{$array[BodyText]}\;\n $Picture1 = \{$array[PictureOne]}\;\n $Picture2 = \{$array[PictureTwo]}\;\n $CatID = \{$array[CatID]}\;\n }\n // carry the variable head title in the page and do the page header\n do_html_header($HeadTitle);\n // carry variables into do_html_index() function in output_fns.\n // Page title = The headline of the page\n // Body text = The text body, can include html commands.\n // Picture 1 = picture or graphic that appears above the title if required.\n // Picture 2 = Picture that appears right hand side on the basic output_fns\n // CatID = Category which is used for determining which links appear on each page\n // Section name = Allows you to specify extra functions to output_fns.php to be unique to the page (requires hard coding)\n do_html_index($PageTitle, $BodyText, $Picture1, $Picture2, $CatID, $SECTION_NAME);\n // put the page footer in position\n do_html_footer();\n ?\n; $filename = 'test.txt'; $fp = fopen($filename, a); $write = fputs($fp, $string); fclose($fp); } generate_page($formid, $pagename); Steve Jackson Web Development and Marketing Manager 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] XML
Hi List Firstly, this question is arguable more about XML than PHP, but they are interlinked, so I hope it is topical for this list. Firstly, Where I come from: I am VERY comfortable with PHP/MySQL on Linux and understand all those concepts. Now I'm trying to see the benefits of XML, and quite frankly, I just cannot see why one would want to use it... Anyway, I don't want to start a discussion on that from. I have done extensive reading on XML/XSL(XSLT : XHTML), DTD and XML parsing on browser and server side. I arguable still don't have a 100% understanding of exactly how things fit together, but the little bit I think I got so far is: I would use an XML doc to package my data in a structure. This XML file is useless on it's own, and good for transporting data to another app or client. Should I need to do something with the data, I would look at XSL and in particular XSLT in order to convert the XML into XHTML so a browser can display the data ( so we can safely assume that I am only interested in the web applications of XML) This is where I'm starting to get a headache, because now it seems that there are browser issues wrt XSL, and one also have the added choice of parsing the XML with the browser or on server level. For me, parsing it on browser level must be a no-no, as I would assume that it's would take alot of effort to find out what type of browser the client has, then load the appropriate XSL file for that browser. So, I'm here, with the server side XML parsing in mind. Now on M$ systems, it seems that IIS has built in ActiveX XMLDOM parsing built in, and you can easily parse the XML document by using ASP etc. So can I assume that this is also true with PHP/Apache, ie, Apache has a built in XML parser and I can use PHP fnuctions to parse my XML file on the server side and thus pump out XHTML that is compatible with all past and future browsers? Also, what is the procedure that most of you (members of the PHP lists) follow when dealing with XML. ie, do you go for the client side parsing or do you do server side parsing. And how do you decide when to use XML and when to stick to trusty old PHP/MySQL? ( Sorry, know this is probably the dumbest question I can ask, but I really battle to see when to use it, or rather WHY I should use it seeing that the data is arguably static in nature ( I would either get the XML file from somewhere else, or I would generate it from some source and pass it on, effectively creating a little data island/snapshot of the actual data at a point in time?) Thanks for any input. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Retaining formatting problem
On Tue, 2003-07-08 at 02:29, [EMAIL PROTECTED] wrote: Hello everyone, I have a long running problem that i just want to get covered, I have a standard text box for people to insert long lengths of text. This text box is in a standard input type=text but when I insert it into the database the line returns dissapear, eg this little amount of text will enter like this little amount of text will enter like Please help me it is p!!$$!ng me right off :P Cheers in advance Try this: http://www.php.net/nl2br Good luck, Torben -- Torben Wilson [EMAIL PROTECTED]+1.604.709.0506 http://www.thebuttlesschaps.com http://www.inflatableeye.com http://www.hybrid17.com http://www.themainonmain.com - Boycott Starbucks! http://www.haidabuckscafe.com - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] include/require inside of function
-Original Message- From: Ow Mun Heng [mailto:[EMAIL PROTECTED] Sent: 07 July 2003 04:34 Here's My question, a variable is not actually global is not actually global until I make it global through global $make_this_global and then I can assess it using $GLOBAL[$make_this_global]. Not correct. Variables used in the global scope are global, and appear in the $GLOBALS array as soon as they come into existence. A global statement is used within a function merely to declare that you wish to use one of those variables in that function, where it would otherwise not be available. It's sort of equivalent to saying when I use variable $x in this function, I actually want it to be $GLOBALS['x'] -- or, in PHP terms, $x = $GLOBALS['x']. Another method would be to globalise it on demand by writing a little function. (like Rasmus) I did it like this -- ---create_globals.php function create_global($passed_variable) if (isset ($GLOBALS[$passed_variable])) { return $GLOBALS[$passed_variable]; } ---end- config.php-- $page_title = Page Title of Web Page -end --index.html require_once ('create_globals.php'); $local_variable = create_global( 'main_title') echo My Page Title is.$local_variable; --end- Hence This way I can make it global-on-demand. Maybe a better way to do it would be to ---config.php--- global $page_title = Alternative Way end- I'm really not sure what you're getting at here, but I think it may be based on a misunderstanding. If you could explain exactly what it is you're trying to do, someone might be able to offer some better help. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php pages without .php extension on linux and windows
-Original Message- From: Heiko Mundle [mailto:[EMAIL PROTECTED] Sent: 07 July 2003 11:08 I try to use PHP and Apache on both Linux (SuSE 8.1) and Windows (2K). On Linux I can access the PHP scripts without adding the .php extension. E.g. http://mydomain/myscript?para1=TRUE for http://mydomain/myscript.php?para1=TRUE But on Windows it doesn't work (page not found - HTTP 404) How do I switch on 'adding .php' on windows? Does it run on windows too? What is responsible for that functionality, Apache/PHP? Which module or directive? That's an Apache function -- and yes, it works on Windows because I've done it ;). I suggest you compare your httpd.conf (and .htaccess files if appropriate) to help locate what's responsible for this -- first off, I'd be looking for a ForceType or DefaultType directive, but there are also other ways this could be done. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Retaining formatting problem[Scanned]
input type=text cannot have multiple lines, use textarea name= name col= num of cols rows= num of rows this little amount of text/textarea Michael Egan wrote: I've experienced the same problem. It's not that the line returns disappear - they will still be retained but stored as /n or /r. You'll need to find a way of replacing the line breaks with a html paragraph break - assuming your required output is html. Perhaps some of the regexp functions will help in this - I haven't got the code I used for this to hand. HTH, Michael Egan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 08 July 2003 10:30 To: [EMAIL PROTECTED] Subject: [PHP] Retaining formatting problem[Scanned] Hello everyone, I have a long running problem that i just want to get covered, I have a standard text box for people to insert long lengths of text. This text box is in a standard input type=text but when I insert it into the database the line returns dissapear, eg this little amount of text will enter like this little amount of text will enter like Please help me it is p!!$$!ng me right off :P Cheers in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] New to PHP
-Original Message- From: Jeff Harris [mailto:[EMAIL PROTECTED] Sent: 07 July 2003 23:27 After coding for a while, I would suggest that while you're reading through coding excercises, you find a coding style that works for you and keep it consistant. One of the least fun parts of creating your php pages is reading some code that you coded months (years) ago, and it's totally out of style with everything else that you're doing. H'mm, yes -- reminds me of the following, which someone taught me in the dim-and-distant past and I'm constantly quoting to people who don't adequately comment code: Someone else's code: code written by someone else, or code written by you more than 6 months ago. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] serialize?
Hi. Im coding a poll system which stores information in MySQL. When a new poll is created a new row is inserted in the table polls. There I keep basic information such as the question, id etc. But should I keep the poll options in one field also? Then I would create an array from the poll options the user specifies, serialize it and then base64_encode it. Is this a good way of storing an array or should I make a database table named for example: polls_options? Any opinions and thougts on this appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Zend extensions license
Hi ! I'm an intern working as a developer for a company. I'm in charge of writing an extension to the Zend engine, much like the GD library. I was wondering what are the PHP license requirements for the code and binaries. Anyone enlighten me? Thanks. - Matthieu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regular Expression
On Mon, 07 Jul 2003 21:59:23 -0700, Ralph Guzman wrote: I have a form where I have to check whether user is submitting a PO Box as an address. I wrote the following using eregi, but it returns true even when the field is not Po Box. How do I go about doing this properly? if(eregi(^Po Box$, $address)){ $error_message_custom = You cannot use a PO BOX for Bill To Address; } I think this would do better... if( preg_match( /P[\. ]*O\.* +BOX/i, $address ) ) This will look for a P followed by a space, period or an O followed by a period and/or one or more spaces and the word BOX. It will also ignore case. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Zend extensions license
It depends on the number of options, if you only have a small number of options you could just hold them in a VARCHAR, then rebuild the options array from that Say you had four on/off options, you could store them in a VARCHAR(4) as yyny then rebuild the array with a simple for loop or just build a function to get the appropriate value etc. Ryan Gibson --- [EMAIL PROTECTED] On 8/7/03 12:28 pm, Sævar Öfjörð [EMAIL PROTECTED] wrote: Hi. Im coding a poll system which stores information in MySQL. When a new poll is created a new row is inserted in the table polls. There I keep basic information such as the question, id etc. But should I keep the poll options in one field also? Then I would create an array from the poll options the user specifies, serialize it and then base64_encode it. Is this a good way of storing an array or should I make a database table named for example: polls_options? Any opinions and thougts on this appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] another big, juicy, delicious bug
For a logging system that I've been writing I came up with a way to asign a unique id number to every IP address that visits the site. What I do is append every *new* IP to a new line in a file (ips.txt). Then when I have an IP and need the id I file() the ip log to put it in an array, array_flip() it to make the IP the key and the index the value. Then the ID is dataArray[$ip] + 1. The +1 is so there isn't an IP with the ID of 0. When I have the id and need the IP I do the same thing except no array_flip and subtract 1 from the ID before dataArray[$id]. This has been working fine throughout the site in testing except in one spot. What I have is the IP and what I need is the ID. This is what is done: // Use IP address to get id function getId ($ip) { $ipData = file('idData/ips.txt'); $ipData = array_flip($ipData); $id = $ipData[$ip] + 1; return $id; } But for some (and only some) IPs this won't work. So for debugging I printed the array, the flipped array, the ip, $ipData[$ip] and $id. The first IP will work fine, like this: Array ( [0] = 172.170.69.74 [1] = 172.141.183.231 [2] = 172.137.79.102 [3] = 172.151.144.242 [4] = 172.150.212.129 [5] = 172.158.154.92 ) // correct array Array ( [172.170.69.74 ] = 0 [172.141.183.231 ] = 1 [172.137.79.102 ] = 2 [172.151.144.242 ] = 3 [172.150.212.129 ] = 4 [172.158.154.92] = 5 ) // correct flipped 172.137.79.102 // correct ip 2 // correct $ipData[$ip] 3 // correct $id But then it will go and do something like this: Array ( [0] = 172.170.69.74 [1] = 172.141.183.231 [2] = 172.137.79.102 [3] = 172.151.144.242 [4] = 172.150.212.129 [5] = 172.158.154.92 ) // correct array Array ( [172.170.69.74 ] = 0 [172.141.183.231 ] = 1 [172.137.79.102 ] = 2 [172.151.144.242 ] = 3 [172.150.212.129 ] = 4 [172.158.154.92] = 5 ) // correct flipped 172.151.144.242 // correct ip // complete nothingness where $ipData[$ip] should equal 3 1 // wrong $id, should be 4 I have been trying to figure this out for three days and have come up with nothing. Where is the function going wrong? -- Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] serialize?
No, use another table, poll_options: poll_option_id, poll_id, option_text, vote_count hope the structure is self explanatory. Svar fjr wrote: Hi. Im coding a poll system which stores information in MySQL. When a new poll is created a new row is inserted in the table polls. There I keep basic information such as the question, id etc. But should I keep the poll options in one field also? Then I would create an array from the poll options the user specifies, serialize it and then base64_encode it. Is this a good way of storing an array or should I make a database table named for example: polls_options? Any opinions and thougts on this appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] serialize?
Because it is desirable to create many small tables over one very large table I usually allow PHP to create dynamic tables. For instance, you could have a table called polls, and use the row id to create a unique table: ?php $query = CREATE TABLE poll_number_{$poll_id]} ( . /*insert values here*/ '' . ); // note: i don't have time to write out a full example...this is // pseudocode, and definitely /not/ cut and pastable ? -Dan On Tue, 2003-07-08 at 07:28, Svar fjr wrote: Hi. Im coding a poll system which stores information in MySQL. When a new poll is created a new row is inserted in the table polls. There I keep basic information such as the question, id etc. But should I keep the poll options in one field also? Then I would create an array from the poll options the user specifies, serialize it and then base64_encode it. Is this a good way of storing an array or should I make a database table named for example: polls_options? Any opinions and thougts on this appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] output compression and MSIE
Hello, I've found problem with MSIE showing sometimes blank page when compression is turned on (no matter using zlib.output_compression or gzip handler). I've found that happens when page is =4096 bytes long (output in HTML). And this suggested me to try to change buffer size for compression (for zlib, that I was using) cause it was set to exactly 4KB. But that didn't help at all :-( If I add space characters at the end of output to let page grow ower 4096 bytes - everything works fine, else MSIE shows blank page and user has to hit Refresh button to see correct page. With other browsers that problem doesn't happen. Do you have any idea how to solve that? BTW - changing browser or doing anything with user system is not good idea for me, cause I can't force users of my application to do anything - they use (and will use) windows+IE and so that's my problem to find solution. And output compression is a MUST for me cause I have to cut network traffic to lower users costs of using internet (GPRS transmission using mobile phones). Big thanks in advance for any help Sebastian Baran heyho lucky one thought not anyone else would have that bug. it's a very nasty one (at least it was in my case) to figure out. i'd suggest looking for the content-type you are sending with. may it be it's a text/html or somewhat thislike? regards mario -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] (pas d'objet)
[snip] PHP is designed for rapid development of web applications. Manipulating relational database data is not its strong point. [/snip] At the risk of starting a flame war . I think a lot of folks would take exception to the above statements. PHP is being used for complex web-apps, command line processes, stand-alone (though not really mature, PHP-GTK) apps, and much much more. I find that the manipulation of a large relational databases with PHP to be one of the strengths of the language. When combined with the power available from the SQL you can derive many robust processes to support any type of function. I agree that many SQL derivatives (such as T-SQL and PL/SQL) have their own strengths and features and dependent upon what you are attempting to do you might rely on these strengths outside of, or in tandem with, PHP to construct applications. . off my soap box for the moment. Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using PHP to stream to Shoutcastserver
Hello World! I'm interested in starting a project to broadcast music via PHP to a ShoutCAST DNAS. I'm wondering, is it possible to do this? I've searched around for good tools to broadcast but none supports my needs. As for now I'm using PHP 4.3.2 under Linux and Windows. I want this to be a cross platform thing. I've been looking a bit at Java and C++ but so far I'm not very good with these languages. Any thougts/comments about this would be nice if you shared. //Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] (pas d'objet)
as always if PHP runs at even 10% of the speed of C++ (yes, i know it's faster), and most scripts would take several miliseconds in C++, the benefits of using a language with bounds checking, and ease of programming are immense. -dan On Tue, 2003-07-08 at 08:49, Jay Blanchard wrote: [snip] PHP is designed for rapid development of web applications. Manipulating relational database data is not its strong point. [/snip] At the risk of starting a flame war . I think a lot of folks would take exception to the above statements. PHP is being used for complex web-apps, command line processes, stand-alone (though not really mature, PHP-GTK) apps, and much much more. I find that the manipulation of a large relational databases with PHP to be one of the strengths of the language. When combined with the power available from the SQL you can derive many robust processes to support any type of function. I agree that many SQL derivatives (such as T-SQL and PL/SQL) have their own strengths and features and dependent upon what you are attempting to do you might rely on these strengths outside of, or in tandem with, PHP to construct applications. . off my soap box for the moment. Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] another big, juicy, delicious bug
[snip] But then it will go and do something like this: Array ( [0] = 172.170.69.74 [1] = 172.141.183.231 [2] = 172.137.79.102 [3] = 172.151.144.242 [4] = 172.150.212.129 [5] = 172.158.154.92 ) // correct array Array ( [172.170.69.74 ] = 0 [172.141.183.231 ] = 1 [172.137.79.102 ] = 2 [172.151.144.242 ] = 3 [172.150.212.129 ] = 4 [172.158.154.92] = 5 ) // correct flipped 172.151.144.242 // correct ip // complete nothingness where $ipData[$ip] should equal 3 1 // wrong $id, should be 4 [/snip] First of all this is probably not a bug. Second, where is the code that tests for the condition? Do the other IP's in the array output their id properly in this same set? This info will help us to solve the problem. Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using PHP to stream to Shoutcastserver
I fooled with this sort of thing a long time ago, I believe I found out it was completely possible so long as you get the song broken buffering according to what shoutcast expects to recieve or something similar to this. On Mon, 2003-07-07 at 23:51, Simon Fredriksson wrote: Hello World! I'm interested in starting a project to broadcast music via PHP to a ShoutCAST DNAS. I'm wondering, is it possible to do this? I've searched around for good tools to broadcast but none supports my needs. As for now I'm using PHP 4.3.2 under Linux and Windows. I want this to be a cross platform thing. I've been looking a bit at Java and C++ but so far I'm not very good with these languages. Any thougts/comments about this would be nice if you shared. //Simon -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Permissions on server
If I set permissions of my server root to chmod 777 that's a security risk right? How do I set my server to allow me to write a file to my web root from another directory using PHP? Or is it a Unix problem? I have a generator file writes a string to a text file and then renames the text file as a PHP file however it occurred to me while I was doing this that chmod 777 the root might not be a good idea. Anyone have a simple fix or idea for this? Kind regards, Steve Jackson Web Development and Marketing Manager 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: Zend extensions license
what specifically are you attempting to do ? do you wish to market the extension ? donate it to the PHP community ? if the former, then im fairly certain the license allows it. as for the latter, its best to license your code under a non-GPL, OSI approved license (BSD, LGPL, PHP, etc). makes sure you read the actual license FAQ here http://www.php.net/license/ l0t3k Matthieu Boyer Ei3 [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi ! I'm an intern working as a developer for a company. I'm in charge of writing an extension to the Zend engine, much like the GD library. I was wondering what are the PHP license requirements for the code and binaries. Anyone enlighten me? Thanks. - Matthieu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Retaining formatting problem
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Hello everyone, I have a long running problem that i just want to get covered, I have a standard text box for people to insert long lengths of text. This text box is in a standard input type=text but when I insert it into the database the line returns dissapear, eg this little amount of text will enter like this little amount of text will enter like Please help me it is p!!$$!ng me right off :P Cheers in advance Mate, newlines in HTML are treated as whitespace, so all the newlines will be faithfully stored in your database and faithfully ignored by your browser when you display the contents of the database :-) Look at 'View Source' and you will see the new lines in the source. You want to feed the output from your database to nl2br() to add some BR / tags so browsers will recognise the line breaks. May I recommend you tell Outhouse to wrap lines at around 74 characters for mail lists/newsgroups? [Lefevre - down in the direction of Semaphore or the Port?] Cheers -- Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Security-OTHER than safe mode?
Hello, I have many of my clients set up in 'safe_mode' mainly for security reasons. Well, as many of you know, that limits the way PHP functions. Especially on complex apps. Here is what I include in their httpd configs now... php_admin_flag safe_mode on php_admin_flag register_globals off php_admin_flag allow_url_fopen off php_admin_value doc_root /sites/site.com/www php_admin_value open_basedir /sites/site.com php_admin_value session.save_path /sites/site.com/sessiondata php_admin_value upload_tmp_dir /sites/site.com/uploadtemp php_value upload_max_filesize 1024000 Can anyone else give me some other options that will make things secure, but have safe_mode turned off? I mainly don't want them able to execute shell commands, view info not in their directory, etc.. Etc.. ANY help or insight would greatly be appreciated. TIA ++ Mike Yrabedra (President) 323 Incorporated Home of MacDock, MacAgent and MacSurfshop ++ W: http://www.323inc.com/ P: 770.382.1195 F: 734.448.5164 E: [EMAIL PROTECTED] I: ichatmacdock ++ Whatever you do, work at it with all your heart, as working for the Lord, not for men. ~Colossians 3:23 {{{ ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP to Excel Export
I like this: http://www.bettina-attack.de/jonny/view.php/projects/php_writeexcel/ Last time I've readed help there wasn't support for formulas. Anybody know sth which can output formulas? Mainly I need SUBTOTALS, which can show plus-minus to hide some rows. Or another tip how to do it. Thanx Emo Mika Tuupola [EMAIL PROTECTED] píse v diskusním príspevku news:[EMAIL PROTECTED] On Fri, 4 Jul 2003 [EMAIL PROTECTED] wrote: excel has a char limit of 255 , if you can find a work around for it please do let me know , also , check out the bifwriter , i think the pear packages just outputs csv right ? Spredsheet_Excel_Writer outputs an Excel binary, not csv. -- Mika Tuupola http://www.appelsiini.net/~tuupola/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] output compression and MSIE
Hello, Good to see someone else met that feature of MS Internet Exploder ;) At really I don't put any headers with content info. Only headers are: header ('Last-Modified: '.gmdate(D, d M Y H:i:s).' GMT'); header ('Expires: '.gmdate(D, d M Y H:i:s).' GMT'); header ('Cache-Control: no-cache, must-revalidate'); header ('Pragma: no-cache'); And output is simple HTML. What should I do so? Should I send any other header to fix that? And I also spent a lot of time wondering why the hell I get blank page sometimes?. Especially it was working good on one server and buggy on another (now I now, another server had compression turned off). -- Best regards, Sebastian Tuesday, July 8, 2003, 2:41:28 PM, you wrote: Hello, I've found problem with MSIE showing sometimes blank page when compression is turned on (no matter using zlib.output_compression or gzip handler). I've found that happens when page is =4096 bytes long (output in HTML). And this suggested me to try to change buffer size for compression (for zlib, that I was using) cause it was set to exactly 4KB. But that didn't help at all :-( If I add space characters at the end of output to let page grow ower 4096 bytes - everything works fine, else MSIE shows blank page and user has to hit Refresh button to see correct page. With other browsers that problem doesn't happen. Do you have any idea how to solve that? BTW - changing browser or doing anything with user system is not good idea for me, cause I can't force users of my application to do anything - they use (and will use) windows+IE and so that's my problem to find solution. And output compression is a MUST for me cause I have to cut network traffic to lower users costs of using internet (GPRS transmission using mobile phones). Big thanks in advance for any help Sebastian Baran MO heyho lucky one MO thought not anyone else would have that bug. it's a very nasty one (at MO least it was in my case) to figure out. i'd suggest looking for the MO content-type you are sending with. may it be it's a text/html or MO somewhat thislike? MO regards MO mario -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] about writing permissions
I noticed that in all versions before php5 (I haven't seen this one yet), a script cannot open a file for writing mode is the file's owner is different from php's owner. Eg when php's owner is apache and test.php's owner is user1, user1's script cannot write in test.php but it can write to test2.php which is owned by apache. Is there any solution to this problem? (except making apache own all files). Sorry if my question is kinda newbish or stupid and sorry for my poor english too. Thank you in advance. Arty2
RE: [PHP] PHP to Excel Export
fuk me this is much better than bifwriter -Original Message- From: [cz]Emo [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 11:33 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] PHP to Excel Export I like this: http://www.bettina-attack.de/jonny/view.php/projects/php_writeexcel/ Last time I've readed help there wasn't support for formulas. Anybody know sth which can output formulas? Mainly I need SUBTOTALS, which can show plus-minus to hide some rows. Or another tip how to do it. Thanx Emo Mika Tuupola [EMAIL PROTECTED] píse v diskusním príspevku news:[EMAIL PROTECTED] On Fri, 4 Jul 2003 [EMAIL PROTECTED] wrote: excel has a char limit of 255 , if you can find a work around for it please do let me know , also , check out the bifwriter , i think the pear packages just outputs csv right ? Spredsheet_Excel_Writer outputs an Excel binary, not csv. -- Mika Tuupola http://www.appelsiini.net/~tuupola/ -- 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[3]: [PHP] output compression and MSIE
Hello once more, Tuesday, July 8, 2003, 3:25:31 PM, you wrote: MO Hello too, MO Well yes, IE is not that wrong this time (though it changes nothing at all :)) MO Take a look into the head - section of your document, maybe there is MO some content-encoding sent or your apache config (maybe some default-encoding, MO not sure about, but's a hint). My head looks like that - nothing special.. head LINK href=/css/main.css rel=stylesheet type=text/css TITLESome title/TITLE meta http-equiv=Content-Type content=text/html; charset=iso-8859-2 script language=JavaScript src=/javascripts/date_picker/date_picker.js/script /head And nothing set in Apache.. :-/ MO As mentioned, the bug exactly is, that ie get's a wrong content-type and therefore MO can't decompress the g-zip stuff. i'd say sending correct g-zip headers may MO not be wrong at all, though i must say you have to relay on google on more MO info on that. don't sure about them. I tried to find something about that with google, but no effects so far.. MO but why the heck the ie-thingy can decode on a refresh-hit is not logical. ie is not logical at all ;) And more serious - ie shows correct page if user click the link to page being a problematic, but redirecting or moving to such page from form with action option doesn't work and we have blank page. MO The 4k-thing is becaus mod_gzip doesn't compress under this size. I can't agree with you here. I checked with telnet what I get. And I what I saw was surely zipped content. No matter less or more 4kB page was. But somehow over 4kB IE understands what to do. MO (don't get me wrong but in some way i'm happy about someone having the same bug - MO so the time to figure this one out isn't lost one :) - definitly nothing personal) Sure, I can say the same ;) Good to have someone to talk to about that problem. :) MO regards MO mario -- Best regards, Sebastian Tuesday, July 8, 2003, 3:37:27 PM, you wrote: sdcp Hello, sdcp Good to see someone else met that feature of MS Internet sdcp Exploder ;) sdcp At really I don't put any headers with content info. sdcp Only headers are: sdcp header ('Last-Modified: '.gmdate(D, d M Y H:i:s).' GMT'); sdcp header ('Expires: '.gmdate(D, d M Y H:i:s).' GMT'); sdcp header ('Cache-Control: no-cache, must-revalidate'); sdcp header ('Pragma: no-cache'); sdcp And output is simple HTML. What should I do so? Should I send any sdcp other header to fix that? sdcp And I also spent a lot of time wondering why the hell I get blank page sdcp sometimes?. Especially it was working good on one server and buggy sdcp on another (now I now, another server had compression turned off). sdcp -- sdcp Best regards, sdcp Sebastian sdcp Tuesday, July 8, 2003, 2:41:28 PM, you wrote: Hello, I've found problem with MSIE showing sometimes blank page when compression is turned on (no matter using zlib.output_compression or gzip handler). I've found that happens when page is =4096 bytes long (output in HTML). And this suggested me to try to change buffer size for compression (for zlib, that I was using) cause it was set to exactly 4KB. But that didn't help at all :-( If I add space characters at the end of output to let page grow ower 4096 bytes - everything works fine, else MSIE shows blank page and user has to hit Refresh button to see correct page. With other browsers that problem doesn't happen. Do you have any idea how to solve that? BTW - changing browser or doing anything with user system is not good idea for me, cause I can't force users of my application to do anything - they use (and will use) windows+IE and so that's my problem to find solution. And output compression is a MUST for me cause I have to cut network traffic to lower users costs of using internet (GPRS transmission using mobile phones). Big thanks in advance for any help Sebastian Baran MO heyho lucky one MO thought not anyone else would have that bug. it's a very nasty one (at MO least it was in my case) to figure out. i'd suggest looking for the MO content-type you are sending with. may it be it's a text/html or MO somewhat thislike? MO regards MO mario -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Zend extensions license
Well, this is proprietary back-end stuff, so in a way, it won't be marketed but it'll have to remain the propriety of the company and be closed-source. As far as I've understood the PHP license, all i'm required to do is not to make use of the name PHP. But I'm not a lawyer and I wanted to check with more experienced people. Thanks a lot for your answer, though. - Matthieu l0t3k wrote: what specifically are you attempting to do ? do you wish to market the extension ? donate it to the PHP community ? if the former, then im fairly certain the license allows it. as for the latter, its best to license your code under a non-GPL, OSI approved license (BSD, LGPL, PHP, etc). makes sure you read the actual license FAQ here http://www.php.net/license/ l0t3k -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Permissions on server
On Tue, 2003-07-08 at 07:21, Steve Jackson wrote: If I set permissions of my server root to chmod 777 that's a security risk right? How do I set my server to allow me to write a file to my web root from another directory using PHP? Or is it a Unix problem? I have a generator file writes a string to a text file and then renames the text file as a PHP file however it occurred to me while I was doing this that chmod 777 the root might not be a good idea. Anyone have a simple fix or idea for this? Change the ownership on the directory to whichever user apache is running as (this is the User directive in your httpd.conf file). Then you can restrict the permissions on that directory. You could probably make it 600 if you want. Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] output compression and MSIE
[snip] My head looks like that - nothing special.. head LINK href=/css/main.css rel=stylesheet type=text/css TITLESome title/TITLE meta http-equiv=Content-Type content=text/html; charset=iso-8859-2 script language=JavaScript src=/javascripts/date_picker/date_picker.js/script /head [/snip] sorry list for the mess in this thread. got somewhat wrong. try to take the following line out: meta http-equiv=Content-Type content=text/html; charset=iso-8859-2 (modifing to output correct type would be even better) regards mario -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Wrong parameter count for fgets
Without seeing any code, we can only guess. But do you have at least two, and no more than three parameters for the fputs() fuction? fputs (PHP 3, PHP 4 ) fputs -- Writes to a file pointer Description int fputs ( resource handle, string str [, int length]) fputs() is an alias to fwrite(), and is identical in every way. Note that the length parameter is optional and if not specified the entire string will be written. --- Miranda, Joel Louie M [EMAIL PROTECTED] wrote: Warning: Wrong parameter count for fgets() in I had this error on of my scripts, any ideas on this part? How come this error occur? -- Thank you, Louie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a right unless you are willing to fight to death to defend everyone else's right to the same thing. *** __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Refresh PHP
Hi people! Did anyone get this situation? I'm creating a Site that uses 3 session variables. One of them I always print at the top of the page, it's the name of the user. There is a link that calls the function session_destroy(). Everytime that I follow this link and log in with another user, that session variable printed doesn't change, but if I press F5 in IE or Netscape them it brings the right user. I can't make the page return the current user login, it always came with the last user logged. I tried to add some headers to set no cache in all php pages, but it doesn't work. Anyone can help me??? Thanks PS: Sorry about my poor english... Maurício Valente -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Retaining formatting problem[Scanned]
--- Michael Egan [EMAIL PROTECTED] wrote: I've experienced the same problem. It's not that the line returns disappear - they will still be retained but stored as /n or /r. You'll need to find a way of replacing the line breaks with a html paragraph break - assuming your required output is html. Perhaps some of the regexp functions will help in this - I haven't got the code I used for this to hand. You mean something like the nl2br() function? HTH, Michael Egan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 08 July 2003 10:30 To: [EMAIL PROTECTED] Subject: [PHP] Retaining formatting problem[Scanned] Hello everyone, I have a long running problem that i just want to get covered, I have a standard text box for people to insert long lengths of text. This text box is in a standard input type=text but when I insert it into the database the line returns dissapear, eg this little amount of text will enter like this little amount of text will enter like Please help me it is p!!$$!ng me right off :P Cheers 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 = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a right unless you are willing to fight to death to defend everyone else's right to the same thing. *** __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Refresh PHP
Try adding a random number to the end of your URL.index.php?$randomnumber -Original Message- From: Mauricio [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 10:02 AM To: PHP Subject: [PHP] Refresh PHP Hi people! Did anyone get this situation? I'm creating a Site that uses 3 session variables. One of them I always print at the top of the page, it's the name of the user. There is a link that calls the function session_destroy(). Everytime that I follow this link and log in with another user, that session variable printed doesn't change, but if I press F5 in IE or Netscape them it brings the right user. I can't make the page return the current user login, it always came with the last user logged. I tried to add some headers to set no cache in all php pages, but it doesn't work. Anyone can help me??? Thanks PS: Sorry about my poor english... Maurício Valente -- 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] Setting Cookie Going Nuts
Berber: Did you solve this issue? No, this issue was not resolved. What does $_SERVER[HTTP_HOST] return? It returns the IP address that is assigned to the website. There is no domain assigned, just the IP. When there is a domain assigned it would assign the domain... Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: Mike Morton [mailto:[EMAIL PROTECTED] Sent: Thursday, July 03, 2003 4:03 PM To: [PHP - GENERAL] Subject: [PHP] Setting Cookie Going Nuts I am trying to issue a cookie, using the set cookie directive, and it is not working for some reason. The code below I have used before with perfect success. The only difference between the other place that I am using it is that the other place has globals on, this server has globals off (tho I turned them on a and it made no difference), and the other server is running 4.3.2 where this one is 4.3.0 I am sure that it is something small that I missed when copying the code over, but I cannot for the life of me see what it is. The only other difference is the other server is using a domain name, while the server this code is on is an IP address only (that should not make a difference tho) Why is the cookie not being isseued? I am going nuts trying to figure this out! $ADMIN_COOKIE_NAME=scavengeradmin; //name of the issuing cookie $COOKIE_EXPIRY=1800; //time in seconds to expiry function adminCookie() { global $ADMIN_COOKIE_NAME,$COOKIE_EXPIRY; //check to see if a cookie exists already. $cookieid=$_COOKIE[$ADMIN_COOKIE_NAME]; //if there is no cookieid - then we are going to set a cookie. if(strlen($cookieid) 1) { //find a unique value. list($msec,$sec)=explode( ,microtime()); $cookiekey=ereg_replace(\.,,($msec+$sec)); //set expiry - 30 mins from now. $cookieexpiry=time()+$COOKIE_EXPIRY; setcookie($ADMIN_COOKIE_NAME,$cookiekey,$cookieexpiry,/,$_SERVER[HTTP _HOS T],0); $_COOKIE[$ADMIN_COOKIE_NAME]=$cookiekey; unset($cookiekey);unset($msec);unset($sec);unset($cookieexpiry); } else { //if the cookie has been set then we are just going to adjust the expiry date. //set expiry - 30 mins from now. $cookieexpiry=time()+$COOKIE_EXPIRY; setcookie($ADMIN_COOKIE_NAME,$cookieid,$cookieexpiry,/,$_SERVER[HTT P_HO ST],0); unset($cookieexpiry); } unset($cookieid); } adminCookie(); //issue the cookie -- Cheers Mike Morton * * Tel: 905-465-1263 * Email: [EMAIL PROTECTED] * Indeed, it would not be an exaggeration to describe the history of the computer industry for the past decade as a massive effort to keep up with Apple. - Byte Magazine Given infinite time, 100 monkeys could type out the complete works of Shakespeare. Win 98 source code? Eight monkeys, five minutes. -- NullGrey -- Cheers Mike Morton * * Tel: 905-465-1263 * Email: [EMAIL PROTECTED] * Indeed, it would not be an exaggeration to describe the history of the computer industry for the past decade as a massive effort to keep up with Apple. - Byte Magazine Given infinite time, 100 monkeys could type out the complete works of Shakespeare. Win 98 source code? Eight monkeys, five minutes. -- NullGrey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Setting Cookie Going Nuts
George: Thanks for getting back... Just a thought - are you outputting any HTML on the page where you are declaring your cookie? If not, then it won't work. I am outputting HTML on the page AFTER the cookie, and it does work, on other servers I got stuck a few months back with a filter script where someone logs in and depending on who they were were redirected to various pages. I was decalring their cookies in the redirect script and it didn't work until I started doing in on a 'written' page. Hmm, strange behaviour, I will have to check the other scripts to see if they were modified to a redirect, but I do not think that they were... Thanks George :) Hope this solves your problem. Cheers George in Oxford -Original Message- From: Boaz Yahav [mailto:[EMAIL PROTECTED] Sent: 04 July 2003 10:05 am To: Mike Morton; [PHP - GENERAL] Subject: RE: [PHP] Setting Cookie Going Nuts Did you solve this issue? What does $_SERVER[HTTP_HOST] return? Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: Mike Morton [mailto:[EMAIL PROTECTED] Sent: Thursday, July 03, 2003 4:03 PM To: [PHP - GENERAL] Subject: [PHP] Setting Cookie Going Nuts I am trying to issue a cookie, using the set cookie directive, and it is not working for some reason. The code below I have used before with perfect success. The only difference between the other place that I am using it is that the other place has globals on, this server has globals off (tho I turned them on a and it made no difference), and the other server is running 4.3.2 where this one is 4.3.0 I am sure that it is something small that I missed when copying the code over, but I cannot for the life of me see what it is. The only other difference is the other server is using a domain name, while the server this code is on is an IP address only (that should not make a difference tho) Why is the cookie not being isseued? I am going nuts trying to figure this out! $ADMIN_COOKIE_NAME=scavengeradmin; //name of the issuing cookie $COOKIE_EXPIRY=1800; //time in seconds to expiry function adminCookie() { global $ADMIN_COOKIE_NAME,$COOKIE_EXPIRY; //check to see if a cookie exists already. $cookieid=$_COOKIE[$ADMIN_COOKIE_NAME]; //if there is no cookieid - then we are going to set a cookie. if(strlen($cookieid) 1) { //find a unique value. list($msec,$sec)=explode( ,microtime()); $cookiekey=ereg_replace(\.,,($msec+$sec)); //set expiry - 30 mins from now. $cookieexpiry=time()+$COOKIE_EXPIRY; setcookie($ADMIN_COOKIE_NAME,$cookiekey,$cookieexpiry,/,$_SERVER[HTTP _HOS T],0); $_COOKIE[$ADMIN_COOKIE_NAME]=$cookiekey; unset($cookiekey);unset($msec);unset($sec);unset($cookieexpiry); } else { //if the cookie has been set then we are just going to adjust the expiry date. //set expiry - 30 mins from now. $cookieexpiry=time()+$COOKIE_EXPIRY; setcookie($ADMIN_COOKIE_NAME,$cookieid,$cookieexpiry,/,$_SERVER[HTT P_HO ST],0); unset($cookieexpiry); } unset($cookieid); } adminCookie(); //issue the cookie -- Cheers Mike Morton * * Tel: 905-465-1263 * Email: [EMAIL PROTECTED] * Indeed, it would not be an exaggeration to describe the history of the computer industry for the past decade as a massive effort to keep up with Apple. - Byte Magazine Given infinite time, 100 monkeys could type out the complete works of Shakespeare. Win 98 source code? Eight monkeys, five minutes. -- NullGrey -- 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 -- Cheers Mike Morton * * Tel: 905-465-1263 * Email: [EMAIL PROTECTED] * Indeed, it would not be an exaggeration to describe the history of the computer industry for the past decade as a massive effort to keep up with Apple. - Byte Magazine Given infinite time, 100 monkeys could type out the complete works of Shakespeare. Win 98 source code? Eight monkeys, five minutes. -- NullGrey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] about writing permissions
Hello, On Tuesday July 8 2003 15:42, George Papatheodorou wrote: I noticed that in all versions before php5 (I haven't seen this one yet), a script cannot open a file for writing mode is the file's owner is different from php's owner. if user2 other than owner is trying to write to file which does not have permission to write for group in which user2 is, or write for others, then write will fail like in rw-r--r-- user group file.txt only user has permission to write or in rw-rw-r-- user group file.txt only user and users attached to group have permission to write... Eg when php's owner is apache and test.php's owner is user1, user1's script cannot write in test.php but it can write to test2.php which is owned by apache. All scripts on webserver run with owner/uid of apache (like nobody, apache or such), therefore you have to set correct permissions to files if test.php is set to rw-r--r-- user1 group then only user1 is allowed to write to it test2.php is set to rw-r--r-- apache group... so apache can write there there any solution to this problem? (except making apache own all files). Sorry if my question is kinda newbish or stupid and sorry for my poor english too. Thank you in advance. solution is to set all files to be writable by group (rw-rw-r--) by chmod 664 and add apache owner/uid to group which is listed as ownergroup of that file (change group id of apache in its configuration file to group). like rw-rw-r-- user group test.php I hope I have explained it a bit to you. -- Martin Hudec :@: [EMAIL PROTECTED] :w: http://www.corwin.sk :m: +421.907.303.393 In google non est, ergo non est. - unknown IRC operator -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Regular Expression
Hello If you simply want to check if the fields contains Po BOX simply use the stripos function or one of the other string functions. They should be faster than reg ex. If you still want to use reg ex I suggest using preg_match since it is faster than ereg. About your regex: It will not find occurences of PO BOX in the field. You'd have to use something like ereg('PO BOX') without start anchor '^' or end anchor '$'. I think eregi would be better since it is case insensitive. It seems to me that you don't understand regular expressions so I suggest you do some reading up on them. A very good book about regex is Mastering Regular Expression by O'Reilly can't remember the author right now sorry. Regards Stefan Langer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Please Help !
Hi, I know this is really basic but i have a form for users to enter the date of an event that i would like to store in a mysql database how do i get the users input into the database in the right format.
Re: [PHP] Re: Zend extensions license
Check out the license at the source: http://www.php.net/license/ http://www.trolltech.com/products/qt/freelicense.html Quoting: Q. So, what's the point of the Zend license? When should I be concerned about it? A. You should be aware of the Zend license in two cases. First, if you publish patches to the Zend scripting engine library. The Zend license allows Zend Technologies, Ltd. to use those patches royalty-free (see the license for exact details). Second, the license prevents commercial use of the Zend scripting engine library to build commercial applications. note well If you want to use the Zend scripting engine library commercially (for example, as a macro language in a commercial word processor you're writing), you must contact Zend Technologies, Ltd. for licensing information. /note well -Dan On Tue, 2003-07-08 at 11:46, Matthieu Boyer EI3 wrote: Well, this is proprietary back-end stuff, so in a way, it won't be marketed but it'll have to remain the propriety of the company and be closed-source. As far as I've understood the PHP license, all i'm required to do is not to make use of the name PHP. But I'm not a lawyer and I wanted to check with more experienced people. Thanks a lot for your answer, though. - Matthieu l0t3k wrote: what specifically are you attempting to do ? do you wish to market the extension ? donate it to the PHP community ? if the former, then im fairly certain the license allows it. as for the latter, its best to license your code under a non-GPL, OSI approved license (BSD, LGPL, PHP, etc). makes sure you read the actual license FAQ here http://www.php.net/license/ l0t3k -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please Help !
I know this is really basic but i have a form for users to enter the date of an event that i would like to store in a mysql database how do i get the users input into the database in the right format. Read up in the manual of mySQL, and the parts of the PHP doc on mySQL. mySQL dates are stored -MM-DD. -Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] about writing permissions
The strange this is that user has writing access to the file, and so does his group. I even changed permissions to rw-rw-rw and the script could still not write in the file. The only solution came when I told the server manager to change the files owner to thttpd (not apache as mentioned above, it was only as an example) and then the script worked. I still wonder why this occurs and if there is any solution to it. Arty2 -Original Message- From: Martin Hudec [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 5:32 PM To: George Papatheodorou Cc: [EMAIL PROTECTED] Subject: Re: [PHP] about writing permissions Hello, On Tuesday July 8 2003 15:42, George Papatheodorou wrote: I noticed that in all versions before php5 (I haven't seen this one yet), a script cannot open a file for writing mode is the file's owner is different from php's owner. if user2 other than owner is trying to write to file which does not have permission to write for group in which user2 is, or write for others, then write will fail like in rw-r--r-- user group file.txt only user has permission to write or in rw-rw-r-- user group file.txt only user and users attached to group have permission to write... Eg when php's owner is apache and test.php's owner is user1, user1's script cannot write in test.php but it can write to test2.php which is owned by apache. All scripts on webserver run with owner/uid of apache (like nobody, apache or such), therefore you have to set correct permissions to files if test.php is set to rw-r--r-- user1 group then only user1 is allowed to write to it test2.php is set to rw-r--r-- apache group... so apache can write there there any solution to this problem? (except making apache own all files). Sorry if my question is kinda newbish or stupid and sorry for my poor english too. Thank you in advance. solution is to set all files to be writable by group (rw-rw-r--) by chmod 664 and add apache owner/uid to group which is listed as ownergroup of that file (change group id of apache in its configuration file to group). like rw-rw-r-- user group test.php I hope I have explained it a bit to you. -- Martin Hudec :@: [EMAIL PROTECTED] :w: http://www.corwin.sk :m: +421.907.303.393 In google non est, ergo non est. - unknown IRC operator -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] include/require inside of function
Hi Mike, Here's the thing.. I declared $page_title = My Page Title in a file called config.php which is included in the index.php page. when I tried to - echo $page_title - Nothing comes out. If I declared it as global $page_title , then My Page Title would be echoed out. That I think is the simplest way to explain it. Cheers, Mun Heng, Ow H/M Engineering Western Digital M'sia DID : 03-7870 5168 -Original Message- From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 7:11 PM To: Ow Mun Heng Cc: [EMAIL PROTECTED] Subject: RE: [PHP] include/require inside of function -Original Message- From: Ow Mun Heng [mailto:[EMAIL PROTECTED] Sent: 07 July 2003 04:34 Here's My question, a variable is not actually global is not actually global until I make it global through global $make_this_global and then I can assess it using $GLOBAL[$make_this_global]. Not correct. Variables used in the global scope are global, and appear in the $GLOBALS array as soon as they come into existence. A global statement is used within a function merely to declare that you wish to use one of those variables in that function, where it would otherwise not be available. It's sort of equivalent to saying when I use variable $x in this function, I actually want it to be $GLOBALS['x'] -- or, in PHP terms, $x = $GLOBALS['x']. Another method would be to globalise it on demand by writing a little function. (like Rasmus) I did it like this -- ---create_globals.php function create_global($passed_variable) if (isset ($GLOBALS[$passed_variable])) { return $GLOBALS[$passed_variable]; } ---end- config.php-- $page_title = Page Title of Web Page -end --index.html require_once ('create_globals.php'); $local_variable = create_global( 'main_title') echo My Page Title is.$local_variable; --end- Hence This way I can make it global-on-demand. Maybe a better way to do it would be to ---config.php--- global $page_title = Alternative Way end- I'm really not sure what you're getting at here, but I think it may be based on a misunderstanding. If you could explain exactly what it is you're trying to do, someone might be able to offer some better help. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] XML
On Tuesday, July 8, 2003, 1:26:43 PM, Petre wrote: [ snip ] PA Now on M$ systems, it seems that IIS has built in ActiveX XMLDOM parsing PA built in, and you can easily parse the XML document by using ASP etc. PA So can I assume that this is also true with PHP/Apache, ie, Apache has a PA built in XML parser and I can use PHP fnuctions to parse my XML file on PA the server side and thus pump out XHTML that is compatible with all PA past and future browsers? You are partly correct there. Just because you are parsing XML to create XHTML documents, does not guarantee that it is compatible with all past and future browsers. You still have to worry about browser specifics as far as compatibility goes, because in the end, what you are sending to the browser is XHTML. PA Also, what is the procedure that most of you (members of the PHP lists) PA follow when dealing with XML. ie, do you go for the client side parsing PA or do you do server side parsing. And how do you decide when to use XML PA and when to stick to trusty old PHP/MySQL? ( Sorry, know this is PA probably the dumbest question I can ask, but I really battle to see when PA to use it, or rather WHY I should use it seeing that the data is PA arguably static in nature ( I would either get the XML file from PA somewhere else, or I would generate it from some source and pass it on, PA effectively creating a little data island/snapshot of the actual data at PA a point in time?) XML is one of those things that if someone explains it to you (atleast for me) it seems like a waste of time, but once you start using it, you'll see why its great. I can only give you a personal example. I thought XML was nice and worth knowing, but not mission critical for me .. that is, untill I found a free XML weather feed that I wanted to parsewhich led to me writing my own PHP XML parser class for that feed. Anyhow, the point of XML is not data storage (like a database), rather, its to facilitate data translation and trasportation. XML is best for transferring data when you are not sure that a native format is compatible with your target platform or application. The best uses of XML that I have seen involve open streaming (like the weather feed example), data description (a few CMS programs allow the configuration files to be stored in XML format), legacy application conversion (for example, MSSQL 2000 can now work with XML data (import, export, etc.)). If you are struggling with the is XML best for type questions, then what you should really be asking is ... what can I gain by making my application/system/etc. XML compatible? Most of the times you will find that it is easier to implement XML compatibility in an application, even if you are not sure of its immediate use. A lot of major application vendors (like SAP) have now specified open XML standards that allow third party applications to communicate with their apps (as far as the enterprise level goes). Anyhow, just my $0.02 -- Regards, Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please Help !
Hi, I know this is really basic but i have a form for users to enter the date of an event that i would like to store in a mysql database how do i get the users input into the database in the right format. For date validation I always use a javascript calendar thingy available from http://students.infoiasi.ro/~mishoo/site/calendar.epl It really is very good. Regards Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] XML
XML is a way to store data in a structure format that is correct and is platform independent; meaning u can share data with anything that understands xml format. For web applications xml allows you to send data to the client and have the browser do the parsing for you. (I would suggest ie5.5 and ns6.0 browsers if you are doing client-side parsing). If you are doing server-side php parsing then i would suggest using domxml+domxslt or using xslt (sablotron). Then you can parse the xml doc, get xhtml(html) and send that to the user. The benefits are seperation of logic and presentation in your php. All presentation code should be in your xslt style sheets and all logic should create a data document (xml). This allow you to change the presentation with out changing logic. -- BigDog On Tue, 2003-07-08 at 04:26, Petre Agenbag wrote: Hi List Firstly, this question is arguable more about XML than PHP, but they are interlinked, so I hope it is topical for this list. Firstly, Where I come from: I am VERY comfortable with PHP/MySQL on Linux and understand all those concepts. Now I'm trying to see the benefits of XML, and quite frankly, I just cannot see why one would want to use it... Anyway, I don't want to start a discussion on that from. I have done extensive reading on XML/XSL(XSLT : XHTML), DTD and XML parsing on browser and server side. I arguable still don't have a 100% understanding of exactly how things fit together, but the little bit I think I got so far is: I would use an XML doc to package my data in a structure. This XML file is useless on it's own, and good for transporting data to another app or client. Should I need to do something with the data, I would look at XSL and in particular XSLT in order to convert the XML into XHTML so a browser can display the data ( so we can safely assume that I am only interested in the web applications of XML) This is where I'm starting to get a headache, because now it seems that there are browser issues wrt XSL, and one also have the added choice of parsing the XML with the browser or on server level. For me, parsing it on browser level must be a no-no, as I would assume that it's would take alot of effort to find out what type of browser the client has, then load the appropriate XSL file for that browser. So, I'm here, with the server side XML parsing in mind. Now on M$ systems, it seems that IIS has built in ActiveX XMLDOM parsing built in, and you can easily parse the XML document by using ASP etc. So can I assume that this is also true with PHP/Apache, ie, Apache has a built in XML parser and I can use PHP fnuctions to parse my XML file on the server side and thus pump out XHTML that is compatible with all past and future browsers? Also, what is the procedure that most of you (members of the PHP lists) follow when dealing with XML. ie, do you go for the client side parsing or do you do server side parsing. And how do you decide when to use XML and when to stick to trusty old PHP/MySQL? ( Sorry, know this is probably the dumbest question I can ask, but I really battle to see when to use it, or rather WHY I should use it seeing that the data is arguably static in nature ( I would either get the XML file from somewhere else, or I would generate it from some source and pass it on, effectively creating a little data island/snapshot of the actual data at a point in time?) Thanks for any input. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Read a file
Hi, I need to read a whole file and then look for an info on it, i want to know with which function is better, fopen(), fpasstrhu()...fseek() Thanks, Carlos A. Castillo. Ingeniero de desarrollo [EMAIL PROTECTED] Su Aliado Efectivo en Internet www.imagine.com.co (57 1)2182064 - (57 1)6163218 Bogotá - Colombia - Soluciones web para Internet e Intranet - Soluciones para redes - Licenciamiento de Software - Asesoría y Soporte Técnico
Re: [PHP] New to PHP
Mike Ford wrote: -Original Message- From: Jeff Harris [mailto:[EMAIL PROTECTED] Sent: 07 July 2003 23:27 After coding for a while, I would suggest that while you're reading through coding excercises, you find a coding style that works for you and keep it consistant. One of the least fun parts of creating your php pages is reading some code that you coded months (years) ago, and it's totally out of style with everything else that you're doing. H'mm, yes -- reminds me of the following, which someone taught me in the dim-and-distant past and I'm constantly quoting to people who don't adequately comment code: Someone else's code: code written by someone else, or code written by you more than 6 months ago. And the corollary to is: Most of what constitutes value in commented code is the code itself, which exhibits well-named variables, methods, etc. and well-structured, well-encapsulated algorithms. When code is structured appropriately, then the only actual comments needed are to explain unusual logic or business rules that cannot be easily deciphered from reading the code. Steve -- Steve Magruder Consulting - http://consulting.stevemagruder.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Re: Movie
Thank you for e-mailing Tesco. Your e-mail has successfully reached us and we will deal with your enquiry as soon as possible. Kind regards Tesco Customer Services TRACKING NUMBER: A2381222-00010838003 -Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Movie Please see the attached zip file for details. File: your_det.zip Disclaimer This is a confidential email. Tesco may monitor and record all emails. The views expressed in this email are those of the sender and not Tesco. Tesco Stores Limited, Tesco House, Delamare Road, Cheshunt, Herts, EN8 9SL: company number 519500. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] what's wrong with this?????
I keep getting Parse error: parse error, unexpected T_LNUMBER in /usr/local/psa/home/create.php on line 9 This is line 9, which should just create a table. $result = mysql_query('CREATE TABLE members (userid INT(25) NOT NULL AUTO_INCREMENT, first_name VARCHAR(30) NOT NULL, last_name VARCHAR(50) NOT NULL, email_address VARCHAR(255) NOT NULL, username VARCHAR(30) NOT NULL, password VARCHAR(30) NOT NULL, activated ENUM('0','1') DEFAULT '0' NOT NULL, date_joined DATETIME NULL, last_login DATETIME NULL);')or die(Create table Error: .mysql_error()); What's that error mean and is that CREATE TABLE query correct? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Anchor Collector
http://192.168.0.1/index.php?DSE=matrixaccess=31337#herd 1. Grab the Anchor reference herd from the fake URL above and store it as a variable using PHP. You already know the facts... QUERY_STRING: DSE=matrixaccess=31337 REQUEST_URI=/index.php?DSE=matrixaccess=31337 HTTP Request: Get /index.php?DSE=matrixaccess=31337 PHP_SELF=/index.php _REQUEST[DSE]: matrix _REQUEST[access]: 31337 and same for _SERVER vars per normal PHP operation. So, does anyone have any ideas? I was just going to ereg and parse it out to a variable but PHP cant 'grab' the anchor passed as part of the URI requested. According to what I have found, browsers dont send the anchor in the URI but use the anchor locally within the page. This is okay, except when the index.php dynamically generates frames containing references to dynamically generated pages. I want to pass the anchor in one of the frames. So far, my conclusion deems #1 impossible. I am hoping someone can prove me wrong. Kristophari -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] what's wrong with this?????
Umm quotes. Anywhere in your actual SQL that you are using a single quote, you need to put a backslash before it, example: activated ENUM('0','1') DEFAULT '0' Becomes: activated ENUM(\'0\',\'1\') DEFAULT \'0\' On Tue, 2003-07-08 at 11:26, Artoo wrote: I keep getting Parse error: parse error, unexpected T_LNUMBER in /usr/local/psa/home/create.php on line 9 This is line 9, which should just create a table. $result = mysql_query('CREATE TABLE members (userid INT(25) NOT NULL AUTO_INCREMENT, first_name VARCHAR(30) NOT NULL, last_name VARCHAR(50) NOT NULL, email_address VARCHAR(255) NOT NULL, username VARCHAR(30) NOT NULL, password VARCHAR(30) NOT NULL, activated ENUM('0','1') DEFAULT '0' NOT NULL, date_joined DATETIME NULL, last_login DATETIME NULL);')or die(Create table Error: .mysql_error()); What's that error mean and is that CREATE TABLE query correct? Thanks -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] what's wrong with this?????
Thanks. - Original Message - From: Adam Voigt [EMAIL PROTECTED] To: Artoo [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 11:31 AM Subject: Re: [PHP] what's wrong with this? Umm quotes. Anywhere in your actual SQL that you are using a single quote, you need to put a backslash before it, example: activated ENUM('0','1') DEFAULT '0' Becomes: activated ENUM(\'0\',\'1\') DEFAULT \'0\' On Tue, 2003-07-08 at 11:26, Artoo wrote: I keep getting Parse error: parse error, unexpected T_LNUMBER in /usr/local/psa/home/create.php on line 9 This is line 9, which should just create a table. $result = mysql_query('CREATE TABLE members (userid INT(25) NOT NULL AUTO_INCREMENT, first_name VARCHAR(30) NOT NULL, last_name VARCHAR(50) NOT NULL, email_address VARCHAR(255) NOT NULL, username VARCHAR(30) NOT NULL, password VARCHAR(30) NOT NULL, activated ENUM('0','1') DEFAULT '0' NOT NULL, date_joined DATETIME NULL, last_login DATETIME NULL);')or die(Create table Error: .mysql_error()); What's that error mean and is that CREATE TABLE query correct? Thanks -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] include/require inside of function
-Original Message- From: Ow Mun Heng [mailto:[EMAIL PROTECTED] Sent: 08 July 2003 15:53 Here's the thing.. I declared $page_title = My Page Title in a file called config.php which is included in the index.php page. when I tried to - echo $page_title - Nothing comes out. If I declared it as global $page_title , then My Page Title would be echoed out. And is the assignment in the included file inside a function? If so, the usual rules about variables within functions apply. If not, please post the relevant code from both files so we can try to figure out your problem. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: what's wrong with this?????
On Tue, Jul 08, 2003 at 11:26:52AM -0400, Artoo wrote: I keep getting Parse error: parse error, unexpected T_LNUMBER in /usr/local/psa/home/create.php on line 9 This is line 9, which should just create a table. $result = mysql_query('CREATE TABLE members (userid INT(25) NOT NULL AUTO_INCREMENT, first_name VARCHAR(30) NOT NULL, last_name VARCHAR(50) NOT NULL, email_address VARCHAR(255) NOT NULL, username VARCHAR(30) NOT NULL, password VARCHAR(30) NOT NULL, activated ENUM('0','1') DEFAULT '0' NOT NULL, date_joined DATETIME NULL, last_login DATETIME NULL);')or die(Create table Error: .mysql_error()); What's that error mean and is that CREATE TABLE query correct? The CREATE TABLE is correct, but look at your ENUM values and DEFAULT. What kind of quotes are you using? How do you think they should be interpreted? For easier reading, let's split up the query $q = 'CREATE TABLE members (userid INT() NOT NULL AUTO_INCREMENT, ' . 'first_name VARCHAR(30) NOT NULL, ' . 'last_name VARCHAR(50) NOT NULL, ' . 'email_address VARCHAR(255) NOT NULL, ' . 'username VARCHAR(30) NOT NULL, ' . 'password VARCHAR(30) NOT NULL, ' . 'activated ENUM(0,1) DEFAULT 0 NOT NULL, ' . 'date_joined DATETIME NULL, ' . 'last_login DATETIME NULL)'; $result = mysql_query($q) or die(Create table Error: .mysql_error()); It's a heck of alot easier to see errors when you space things out a bit. The investment of the extra CPU time for PHP to glue the pieces together probably makes sense in the long run. -- Paul Chvostek [EMAIL PROTECTED] it.canadahttp://www.it.ca/ Free PHP web hosting!http://www.it.ca/web/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Please Help !
look up two functions in the online manual. strtotime() and date() strtotime will give you a unix timestamp for just about any date possable, date will format it the way you need. to get it into a mySQL date field, basicaly, you do this: date(y-m-d, strtotime($_POST['date'])) where $_POST['date'] is whatever variable you used. - Anthony Sean O'Reilly [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I know this is really basic but i have a form for users to enter the date of an event that i would like to store in a mysql database how do i get the users input into the database in the right format. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Read a file
But them how i can look for the tag i need if i have the file in an array, i need to read an xml file and extract the info between tags password x and /password. Thanks, Carlos A. Castillo. Ingeniero de desarrollo [EMAIL PROTECTED] Su Aliado Efectivo en Internet www.imagine.com.co (57 1)2182064 - (57 1)6163218 Bogotá - Colombia - Soluciones web para Internet e Intranet - Soluciones para redes - Licenciamiento de Software - Asesoría y Soporte Técnico -Mensaje original- De: Burhan Khalid [mailto:[EMAIL PROTECTED] Enviado el: martes, 08 de julio de 2003 10:15 Para: Carlos Castillo Asunto: Re: [PHP] Read a file On Tuesday, July 8, 2003, 6:08:20 PM, Carlos wrote: CC I need to read a whole file and then look for an info on it, i want to know CC with which function is better, fopen(), fpasstrhu()...fseek() The function that will be best will depend on what kind of file you are wanting to read. For simple text files, this works well : $contents = file(somefile.txt); Which puts all the information in the file in an array. http://www.php.net/file -- Regards, Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Spammer! Re: [PHP] ANNOUNCING: Rekall V2.0.0 for Linux/UNIX....
With all due respect to everyone, including the alleged spammer, this has been my rule since '84. If you are in a discussion group, dont advertise something unless someone posts a question where a product would act as a specific solution to their specific need. The advertiser would then be expected to mention how exactly the product advertised affects the output of the question, or solves the problem posed by said question. Obviously, this thread should be either moved to another list or else just killed since spam has no direct links to PHP, nor did Rekall have any direct link to any question posed on the PHP general list. Ultimately, it is the list moderators responsibility to establish a set of core rules for interaction inside this 'virtual world' we all use to help others learn PHP. I do not know that this list has any core rules defined. On my lists, where rules are not defined, I just delete spammers without warning or notice, and furthermore ban that email address from the list permenantly. But then again, I am just oldschool BOFH from the eighties. I say let us allow this thread to die and/or let the owners/moderators handle it as they see fit. What if the alleged spammer is friends with Rasmus Lerdorf? Would that affect your opinion? Not mine, but just something to ponder as we allow the dead [posts] to rest in peace. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fwd: Re: [PHP] Read a file
This is a forwarded message From: Burhan Khalid [EMAIL PROTECTED] To: Carlos Castillo [EMAIL PROTECTED] Date: Tuesday, July 8, 2003, 6:14:45 PM Subject: [PHP] Read a file ===8==Original message text=== On Tuesday, July 8, 2003, 6:08:20 PM, Carlos wrote: CC I need to read a whole file and then look for an info on it, i want to know CC with which function is better, fopen(), fpasstrhu()...fseek() The function that will be best will depend on what kind of file you are wanting to read. For simple text files, this works well : $contents = file(somefile.txt); Which puts all the information in the file in an array. http://www.php.net/file -- Regards, Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com ===8===End of original message text=== -- Best regards, Burhanmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Read a file
implode the array and explode it when you're done... -dan On Tue, 2003-07-08 at 11:52, carlos castillo wrote: But them how i can look for the tag i need if i have the file in an array, i need to read an xml file and extract the info between tags password x and /password. Thanks, Carlos A. Castillo. Ingeniero de desarrollo [EMAIL PROTECTED] Su Aliado Efectivo en Internet www.imagine.com.co (57 1)2182064 - (57 1)6163218 Bogot - Colombia - Soluciones web para Internet e Intranet - Soluciones para redes - Licenciamiento de Software - Asesora y Soporte Tcnico -Mensaje original- De: Burhan Khalid [mailto:[EMAIL PROTECTED] Enviado el: martes, 08 de julio de 2003 10:15 Para: Carlos Castillo Asunto: Re: [PHP] Read a file On Tuesday, July 8, 2003, 6:08:20 PM, Carlos wrote: CC I need to read a whole file and then look for an info on it, i want to know CC with which function is better, fopen(), fpasstrhu()...fseek() The function that will be best will depend on what kind of file you are wanting to read. For simple text files, this works well : $contents = file(somefile.txt); Which puts all the information in the file in an array. http://www.php.net/file -- Regards, Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Read a file
On Tuesday, July 8, 2003, 6:52:56 PM, carlos wrote: cc But them how i can look for the tag i need if i have the file in an cc array, i need to read an xml file and extract the info between tags cc password x and /password. Well, I wish you would have said that earlier. Parsing XML files is different than parsing text (or other files). PHP has XML parsing built-in thanks to expat. More information on XML support in PHP is at http://www.php.net/xml I have written a tutorial at my website plughttp://www.meidomus.com/archives/75.php/plug that shows an example of parsing XML files in PHP. It does not use the XMLDOM extension. It might be of help to you. -- Regards, Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sessions
Hi All, I'm struggling with a session problem and I'm not sure where I should be looking for the answer. Most of my pages begin like this: include_once('cfheader.php'); $feedback = cfHeader(Main Page); //Start of page code The cfheader.php file begins like this: ?PHP session_start(); function cfHeader($Title,$Protect=false) { $feedback=; //IF we're loggin on then destory and get new session if (IsSet($_POST['login'])) { include_once('userreg.inc'); session_destroy(); //Destroy current session before continuing $feedback =do_login(); } if ($Protect==true !IsSet($_SESSION['name'])) { //No Session. echo META HTTP-EQUIV='refresh' content='2;URL=mypage.php'; //Redirect exit; } This works fine on my development PC, (PHP v 4.3.1) and on my primary test site (PHP v4.2.2). However when I try it on the target site (PHP v4.1.2) then I find that immediately after starting the session everything works fine, however when I move to any other page the session information is lost and I'm redirected to log in again. I was looking over the PHPInfo but to be honest I can't see what it is that's different. All help is gratefully appreciated. regards, Dave --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.497 / Virus Database: 296 - Release Date: 04/07/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Anchor Collector
The anchor is not send but rather implemented in the browser. Clientside javascript does have the ability - window.location.hash Kris Yates wrote: http://192.168.0.1/index.php?DSE=matrixaccess=31337#herd 1. Grab the Anchor reference herd from the fake URL above and store it as a variable using PHP. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions
You need to make sure that when you are being directed to the other pages that the session name and session id are being passed. Check session.use_trans_sid in the sessions section of phpinfo(). The session name and id are available globally after a session has been started as the constant SID. If you are posting form data, make sure there is an input for the session name with a value of the session id, etc. Hope that helps. -- Jason k Larson Dave Alger wrote: Hi All, I'm struggling with a session problem and I'm not sure where I should be looking for the answer. Most of my pages begin like this: include_once('cfheader.php'); $feedback = cfHeader(Main Page); //Start of page code The cfheader.php file begins like this: ?PHP session_start(); function cfHeader($Title,$Protect=false) { $feedback=; //IF we're loggin on then destory and get new session if (IsSet($_POST['login'])) { include_once('userreg.inc'); session_destroy(); //Destroy current session before continuing $feedback =do_login(); } if ($Protect==true !IsSet($_SESSION['name'])) { //No Session. echo META HTTP-EQUIV='refresh' content='2;URL=mypage.php'; //Redirect exit; } This works fine on my development PC, (PHP v 4.3.1) and on my primary test site (PHP v4.2.2). However when I try it on the target site (PHP v4.1.2) then I find that immediately after starting the session everything works fine, however when I move to any other page the session information is lost and I'm redirected to log in again. I was looking over the PHPInfo but to be honest I can't see what it is that's different. All help is gratefully appreciated. regards, Dave --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.497 / Virus Database: 296 - Release Date: 04/07/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sessions
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Here is a good session tutorial, maybe it will help you see something your missing. http://www.sitepoint.com/article/319 - --- Aaron Axelsen AIM: AAAK2 Email: [EMAIL PROTECTED] Want reliable web hosting at affordable prices? www.modevia.com Web Dev/Design Community/Zine www.developercube.com - -Original Message- From: Jason k Larson [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 11:15 AM To: Dave Alger Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Sessions You need to make sure that when you are being directed to the other pages that the session name and session id are being passed. Check session.use_trans_sid in the sessions section of phpinfo(). The session name and id are available globally after a session has been started as the constant SID. If you are posting form data, make sure there is an input for the session name with a value of the session id, etc. Hope that helps. - -- Jason k Larson Dave Alger wrote: Hi All, I'm struggling with a session problem and I'm not sure where I should be looking for the answer. Most of my pages begin like this: include_once('cfheader.php'); $feedback = cfHeader(Main Page); //Start of page code The cfheader.php file begins like this: ?PHP session_start(); function cfHeader($Title,$Protect=false) { $feedback=; //IF we're loggin on then destory and get new session if (IsSet($_POST['login'])) { include_once('userreg.inc'); session_destroy(); //Destroy current session before continuing $feedback =do_login(); } if ($Protect==true !IsSet($_SESSION['name'])) { //No Session. echo META HTTP-EQUIV='refresh' content='2;URL=mypage.php'; //Redirect exit; } This works fine on my development PC, (PHP v 4.3.1) and on my primary test site (PHP v4.2.2). However when I try it on the target site (PHP v4.1.2) then I find that immediately after starting the session everything works fine, however when I move to any other page the session information is lost and I'm redirected to log in again. I was looking over the PHPInfo but to be honest I can't see what it is that's different. All help is gratefully appreciated. regards, Dave --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.497 / Virus Database: 296 - Release Date: 04/07/2003 - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -BEGIN PGP SIGNATURE- Version: PGPfreeware 7.0.3 for non-commercial use http://www.pgp.com iQA/AwUBPwru1rrnDjSLw9ADEQJ1BACdHrNZ0thj/W4eCgEhc800ufxhsTQAoLlm TyX4yM46n8VgUMQNQtbwHKC8 =E8V5 -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sessions
This works fine on my development PC, (PHP v 4.3.1) and on my primary test site (PHP v4.2.2). However when I try it on the target site (PHP v4.1.2) then I find that immediately after starting the session everything works fine, however when I move to any other page the session information is lost and I'm redirected to log in again. Also check the register_globals setting in the various php.ini files. It is probably set to off on your dev and test sites, but may be set to on on the target site. Kirk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re[2]: [PHP] Read a file
Thanks, i already solve that problem, but now i have another...sorry...jejejeje. Look I need to change the permissions for the files, I use $cmd = chmod 644 $archivo; system($cmd); but I can do it, only the root can do thatyou have an idea how I can do it? Thanks, Carlos A. Castillo. Ingeniero de desarrollo [EMAIL PROTECTED] Su Aliado Efectivo en Internet www.imagine.com.co (57 1)2182064 - (57 1)6163218 Bogotá - Colombia - Soluciones web para Internet e Intranet - Soluciones para redes - Licenciamiento de Software - Asesoría y Soporte Técnico -Mensaje original- De: Burhan Khalid [mailto:[EMAIL PROTECTED] Enviado el: martes, 08 de julio de 2003 11:03 Para: carlos castillo; [EMAIL PROTECTED] Asunto: Re[2]: [PHP] Read a file On Tuesday, July 8, 2003, 6:52:56 PM, carlos wrote: cc But them how i can look for the tag i need if i have the file in an cc array, i need to read an xml file and extract the info between tags cc password x and /password. Well, I wish you would have said that earlier. Parsing XML files is different than parsing text (or other files). PHP has XML parsing built-in thanks to expat. More information on XML support in PHP is at http://www.php.net/xml I have written a tutorial at my website plughttp://www.meidomus.com/archives/75.php/plug that shows an example of parsing XML files in PHP. It does not use the XMLDOM extension. It might be of help to you. -- Regards, Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com -- 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] imap_header timing out
I've a script reading a mailbox using $InBox = imap_open($Host,$User,$Pass); $NumMsgs=imap_num_msg($InBox); for ($i=1; $i = $NumMsgs; $i++) { $Header=imap_header($InBox,$i); # this is line 154 . . . and so on. With 12 messages in the mailbox this works fine, but with 15 it comes back as timed out... [08-Jul-2003 12:32:46] PHP Fatal error: Maximum execution time of 30 seconds exceeded in g:\httpd\public\readmail\readmail.php on line 154 I'm running this at home (W2K/Apache/PHP 4.3.2) on a dialup account. Can someone shed some light on why it may be timing out, and where do I increase the timeout if needed? Or optimize the code if possible? -- /* All outgoing email scanned by AVG Antivirus /* Amer Neely, Softouch Information Services W: www.softouch.on.ca E: [EMAIL PROTECTED] Perl | PHP | MySQL | CGI programming for all data entry forms. We make web sites work! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re[2]: [PHP] Read a file
Umm, sudo? On Tue, 2003-07-08 at 12:49, carlos castillo wrote: Thanks, i already solve that problem, but now i have another...sorry...jejejeje. Look I need to change the permissions for the files, I use $cmd = chmod 644 $archivo; system($cmd); but I can do it, only the root can do thatyou have an idea how I can do it? Thanks, Carlos A. Castillo. Ingeniero de desarrollo [EMAIL PROTECTED] Su Aliado Efectivo en Internet www.imagine.com.co (57 1)2182064 - (57 1)6163218 Bogot - Colombia - Soluciones web para Internet e Intranet - Soluciones para redes - Licenciamiento de Software - Asesora y Soporte Tcnico -Mensaje original- De: Burhan Khalid [mailto:[EMAIL PROTECTED] Enviado el: martes, 08 de julio de 2003 11:03 Para: carlos castillo; [EMAIL PROTECTED] Asunto: Re[2]: [PHP] Read a file On Tuesday, July 8, 2003, 6:52:56 PM, carlos wrote: cc But them how i can look for the tag i need if i have the file in an cc array, i need to read an xml file and extract the info between tags cc password x and /password. Well, I wish you would have said that earlier. Parsing XML files is different than parsing text (or other files). PHP has XML parsing built-in thanks to expat. More information on XML support in PHP is at http://www.php.net/xml I have written a tutorial at my website plughttp://www.meidomus.com/archives/75.php/plug that shows an example of parsing XML files in PHP. It does not use the XMLDOM extension. It might be of help to you. -- Regards, Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imap_header timing out
Put: set_time_limit(0); At the top of your script. On Tue, 2003-07-08 at 12:45, Amer Neely wrote: I've a script reading a mailbox using $InBox = imap_open($Host,$User,$Pass); $NumMsgs=imap_num_msg($InBox); for ($i=1; $i = $NumMsgs; $i++) { $Header=imap_header($InBox,$i); # this is line 154 . . . and so on. With 12 messages in the mailbox this works fine, but with 15 it comes back as timed out... [08-Jul-2003 12:32:46] PHP Fatal error: Maximum execution time of 30 seconds exceeded in g:\httpd\public\readmail\readmail.php on line 154 I'm running this at home (W2K/Apache/PHP 4.3.2) on a dialup account. Can someone shed some light on why it may be timing out, and where do I increase the timeout if needed? Or optimize the code if possible? -- /* All outgoing email scanned by AVG Antivirus /* Amer Neely, Softouch Information Services W: www.softouch.on.ca E: [EMAIL PROTECTED] Perl | PHP | MySQL | CGI programming for all data entry forms. We make web sites work! -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Read a file
You might want to look at patConfiguration: http://www.php-tools.de/ It can read/write text and xml files. -Original Message- From: carlos castillo [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 8:53 AM To: 'PHP List' Subject: RE: [PHP] Read a file But them how i can look for the tag i need if i have the file in an array, i need to read an xml file and extract the info between tags password x and /password. Thanks, Carlos A. Castillo. Ingeniero de desarrollo [EMAIL PROTECTED] Su Aliado Efectivo en Internet www.imagine.com.co (57 1)2182064 - (57 1)6163218 Bogotá - Colombia - Soluciones web para Internet e Intranet - Soluciones para redes - Licenciamiento de Software - Asesoría y Soporte Técnico -Mensaje original- De: Burhan Khalid [mailto:[EMAIL PROTECTED] Enviado el: martes, 08 de julio de 2003 10:15 Para: Carlos Castillo Asunto: Re: [PHP] Read a file On Tuesday, July 8, 2003, 6:08:20 PM, Carlos wrote: CC I need to read a whole file and then look for an info on it, i want to know CC with which function is better, fopen(), fpasstrhu()...fseek() The function that will be best will depend on what kind of file you are wanting to read. For simple text files, this works well : $contents = file(somefile.txt); Which puts all the information in the file in an array. http://www.php.net/file -- Regards, Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com -- 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: imap_header timing out
see the set_time_limit(); function http://uk2.php.net/manual/en/function.set-time-limit.php increase to around a minute or make the mailbox read them back in pages with 10 at a time for example Pete Amer Neely wrote: I've a script reading a mailbox using $InBox = imap_open($Host,$User,$Pass); $NumMsgs=imap_num_msg($InBox); for ($i=1; $i = $NumMsgs; $i++) { $Header=imap_header($InBox,$i); # this is line 154 . . . and so on. With 12 messages in the mailbox this works fine, but with 15 it comes back as timed out... [08-Jul-2003 12:32:46] PHP Fatal error: Maximum execution time of 30 seconds exceeded in g:\httpd\public\readmail\readmail.php on line 154 I'm running this at home (W2K/Apache/PHP 4.3.2) on a dialup account. Can someone shed some light on why it may be timing out, and where do I increase the timeout if needed? Or optimize the code if possible? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mail Header/Return Receipt
Ok, I have an interesting one here. I'm trying to send an e-mail from Server A, through Server B, and to a recipient using PHP on Server A. Server B relays the e-mail because Server A does not have an internet connection. Now, I want to request a read/delivery receipt for the user sending the mail but if I specify the Disposition-Notification-To: Header the mail fails to deliver because the username/domain that Server A is executing the script with comes through. I don't know if this makes any sense but here is some stuff from the logs This is from the server the mail is being sent to(Recipient Server) Jul 8 13:32:13 www sendmail[26808]: h68HWCY26808: ruleset=check_mail, arg1=[EMAIL PROTECTED], relay=ServerB.myDomain.com [64.113.42.5], reject=501 5.1.8 [EMAIL PROTECTED]... Domain of sender address [EMAIL PROTECTED] does not exist Jul 8 13:32:13 www sendmail[26808]: h68HWCY26808: from=[EMAIL PROTECTED], size=256213, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=ServerB.myDomain.com [64.113.42.5] This is from Server A: Jul 8 12:43:48 ServerA sendmail[31361]: MAA31361: from=uucp, size=256011, class=0, pri=286011, nrcpts=1, msgid=[EMAIL PROTECTED], [EMAIL PROTECTED] Jul 8 12:43:49 ServerA sendmail[31363]: MAA31361: [EMAIL PROTECTED], ctladdr=uucp (10/14), delay=00:00:01, xdelay=00:00:01, mailer=smtp, relay=ServerB.myDomain.com. [206.162.111.100], stat=Sent (2.0.0 h68GhoQ18448 Message acc epted for delivery) This is from Server B: Jul 8 12:43:56 ServerB sendmail[18450]: h68GhoQ18448: to=[EMAIL PROTECTED], delay=00:00:06, xdelay=00:00:05, mailer=esmtp, pri=286213, relay=mail.recipient.com. [64.113.39.156], dsn=5.6.0, stat=Data format error Jul 8 12:43:56 ServerB sendmail[18450]: h68GhoQ18448: h68GhuQ18450: DSN: Data format error Jul 8 12:43:57 ServerB sendmail[18450]: h68GhuQ18450: to=[EMAIL PROTECTED], delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=286313, relay=ServerA.myDomain.com. [206.162.111.97], dsn=2.0.0, stat=Sent (MAA31368 Message accepted for delivery) Any help would be greatly appreciated.Thanks in advance! Brian Here is my code also: (I'm using PEAR Mail and MIME) $FullName=$r[FullName]; $Email=$r[Email]; $ConfirmVia=$r[ConfirmVia]; $ConfirmTo=$r[ConfirmTo]; if($ConfirmVia==Email || $ConfirmVia==EMail) { $file=/tmp/Quote.$Theresult..pdf; system(ps2pdf $filename $file); //This is the part that actually sends the mail include('Mail.php'); include('Mail/mime.php'); $text = 'The quote that you requested is attached. Thank you for the opportunity to quote your enclosure needs!\n\n'.$FullName.'\n'.$Email; $html = 'htmlbodyfont face=\Arial\The quote that you requested is attached. Thank you for the opportunity to quote your enclosure needs!brbr'.$FullName.'br'.$Email.'/font/body/html'; $crlf = \r\n; $hdrs = array( 'From'= $Email, 'Subject' = 'Your Quote # '.$Theresult, 'Disposition-Notification-To' = $Email, 'Return-Path' = $Email ); $mime = new Mail_mime($crlf); $mime-setTXTBody($text); $mime-setHTMLBody($html); //$mime-addAttachment($file, 'text/plain'); $mime-addAttachment($file); $body = $mime-get(); $hdrs = $mime-headers($hdrs); $mail = Mail::factory('mail'); $mail-send($ConfirmTo, $hdrs, $body); //End mail part system(rm -f $file); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imap_header timing out
Put: set_time_limit(0); At the top of your script. Excellent! That worked, thank you. Now I'm getting .. [08-Jul-2003 12:32:46] PHP Notice: (null)(): Unexpected characters at end of address: (errflg=3) in Unknown on line 0 And the output is a blank html page, but the source code shows no messages are being grabbed! I haven't been able to find a reference to 'errflg=3' anywhere. I suspect there are some bad characters lying in wait in one of the headers. A perl script that reads the mailbox has no problems with any of the headers, but it uses external modules for some of the header parsing. I may have to do my own with PHP. -- /* All outgoing email scanned by AVG Antivirus /* Amer Neely, Softouch Information Services W: www.softouch.on.ca E: [EMAIL PROTECTED] V: 519.438.5887 Perl | PHP | MySQL | CGI programming for all data entry forms. We make web sites work! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imap_header timing out
Is error_reporting in your php.ini set to E_ALL ~E_NOTICE ? On Tue, 2003-07-08 at 13:09, Amer Neely wrote: Put: set_time_limit(0); At the top of your script. Excellent! That worked, thank you. Now I'm getting .. [08-Jul-2003 12:32:46] PHP Notice: (null)(): Unexpected characters at end of address: (errflg=3) in Unknown on line 0 And the output is a blank html page, but the source code shows no messages are being grabbed! I haven't been able to find a reference to 'errflg=3' anywhere. I suspect there are some bad characters lying in wait in one of the headers. A perl script that reads the mailbox has no problems with any of the headers, but it uses external modules for some of the header parsing. I may have to do my own with PHP. -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php