[PHP] CRLF in file
Hello, I'm having trouble with /r/n when I try to write to a file. Here's my code ; The array I want to write - $ch =array( $SQL_HOST= $SQL_HOST, SQL_USER= $SQL_USER, SQL_PWD=$SQL_PWD); and the code I'm using to write the file $fp = fopen (newfig.txt, w); if (!($fp)) { print (ERROR file not open!); exit; } { fputs($fp,$ch); foreach($ch as $key = $val) { fputs($fp,$$key = $val/r/n); } fclose ($fp); }; Here's a sample of the file this produces - $host = host/r/n$SQL_USER = user/r/n$SQL_PWD = dbpass/r/n What I want is to have crlf after each var like this - $host = host $SQL_USER = user $SQL_PWD = dbpass I must be doing /r/n wrong. My host is Apache on Sun OS. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CRLF in file
awww geeze ! Thank you sir. Again I embarass myself and slink away On Mon, 27 Jan 2003 00:35:01 +0800, [EMAIL PROTECTED] (Jason Wong) wrote: On Sunday 26 January 2003 22:13, Malcolm Brownell wrote: Hello, I'm having trouble with /r/n when I try to write to a file. It's \r\n that you want. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* If wishes were horses, then beggars would be thieves. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CRLF in file
Thank you Jason, If you'll bear with me for one more question -- The /\ fix did what I wanted but now the word Array appears before the first var -- the text file looks like this - Array$hostname = hostname $SQL_USER = username $SQL_PWD = dbpass I know this is php telling me the data is an array but can I supress this somehow so all I'll print is the keys and vals? thanks malcolm On Mon, 27 Jan 2003 00:35:01 +0800, [EMAIL PROTECTED] (Jason Wong) wrote: On Sunday 26 January 2003 22:13, Malcolm Brownell wrote: Hello, I'm having trouble with /r/n when I try to write to a file. It's \r\n that you want. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* If wishes were horses, then beggars would be thieves. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Version Upgrade on Apache/win
Hello all, I'm having trouble with upgrading my php 4.1.1 to 4.3. I have Apache 1.3.2 /php 4.1.1/Mysql 3.23.39 on winME. It has been running fine but I can't make php 4.3 work. I have installed 4.3 to a directory next to my current php. I put 4.3 in /php43 and have php 4.1.1 in /php in the same directory. When I switch the directory in httpd.conf to php43 and restart Apache it says it can't LoadModule php4_module /php43/sapi/php4apache.dll but if I switch back to /php it starts right up. All of the files in php exist in php43. The names are all the same anyway. The two installations of php appear almost identical but Apache doesn't like the new one. What am I missing ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Send PHP results in email
Thanks Jason, I saw this a while ago and it solved the problem perfectly. On Thu, 5 Dec 2002 06:11:40 +0800, [EMAIL PROTECTED] (Jason Wong) wrote: On Thursday 05 December 2002 05:58, Malcolm Brownell wrote: Hi, I have some database fields I want to select and email. I have lines like -- $result = mysql_query(SELECT * FROM adopt_main order by idform desc limit 1); while( $row = mysql_fetch_array ($result)) echo .$row[first].,; There are quite a few of these paragraphs in the page -- 15 fields. The page does just what I want. It echos the value, with commas and quotes, all ready to be inserted, but, I can'tseem to figure out how to mail it. I know I need to make all of this a variable to pass to my mail script, but how ? My mail script work fine if I define $body and send that but I can't seem to do that with this code. In your while loop, instead of (or as well as) using echo, assign your values to $body -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* If something has not yet gone wrong then it would ultimately have been beneficial for it to go wrong. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Configuration - Can't Change Post_Max_Size
I've got 4.1.1 and it's upload_max_filesizemine is default 2 M maybe you have a different version. hth m On Thu, 5 Dec 2002 10:32:44 -0800, [EMAIL PROTECTED] (Roger Lewis) wrote: This is further to my post yesterday on Max File Size. I was able to set upload_max_filesize to 790 and I can therefore upload files up to that size. I would now like to increase that limit, but I am limited by post_max_size which defaults to 8M. I can't seem to change the value of post_max_size. The post_max_size directive is not in my php.ini; however, I tried inserting it into php.ini and setting it to 1600 and to 16M. I inserted it just before the directive, gpc_order = GPC. The change is ignored by phpinfo(), that is, phpinfo() still shows post_max_size = 8M. Furthermore, I tried resetting it using ini_set(post_max_size, 16M), and ini_set(post_max_size, 1600), but neither of these had any effect. Any suggestion for how I might reset post_max_size. I'm using PHP 4.0.6. Thanks in advance. Roger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Send PHP results in email
Hi, I have some database fields I want to select and email. I have lines like -- $result = mysql_query(SELECT * FROM adopt_main order by idform desc limit 1); while( $row = mysql_fetch_array ($result)) echo .$row[first].,; There are quite a few of these paragraphs in the page -- 15 fields. The page does just what I want. It echos the value, with commas and quotes, all ready to be inserted, but, I can'tseem to figure out how to mail it. I know I need to make all of this a variable to pass to my mail script, but how ? My mail script work fine if I define $body and send that but I can't seem to do that with this code. If I do $body = $result = mysql_query(SELECT * FROM adopt_main order by idform desc limit 1); while( $row = mysql_fetch_array ($result)) echo .$row[first].,; ; I get parse errors every time. I have tried parens, curlys, brackets -- I have been trying for a long time but end up with a parse error. I think it's because of not using proper quotes or brackets or something but my patience is gone. Cloud someone help ? malcolm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: amp; in Query String
Looks fine in Opera 6.03 hth http://www.vogelsinger.at/test.php?par1=value1par2=value2par3=value3 Opera Version 6.03 Build 1107 Platform Win32 System Windows 98 Java Sun Java Runtime Environment 1.4 Testing the query string This is the full query string ($_SERVER['QUERY_STRING']): par1=value1par2=value2 par3=value3 This is a printout of $_GET: Array ( [par1] = value1 [par2] = value2 [par3] = value3 ) I will use this string for the link below: /test.php?par1=value1amp;par2=value2 amp;par3=value3 On Wed, 27 Nov 2002 00:09:35 +0100, [EMAIL PROTECTED] (Ernest E Vogelsinger) wrote: At 00:00 27.11.2002, Jonathan Rosenberg \(Tabby's Place\) said: [snip] Ok ... I take back what I said about amp; not working in a query string. It works just fine. [snip] Ahhh - and I just created a test page for all to check out... nevertheless, here it is: http://www.vogelsinger.at/test.php Simply provides a link using query parameters encoded with amp;, to check with different browsers. Maybe someone will check this outwith his browser anyway. -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php