Re: [PHP] in the meantime___is their a jobs mailing list?
in the meantime you could may be use my PHP forum at : http://www.cyberdistributeur.com/yabbse/index.php as the gathering place for php job posting, just an offer... up to you to use it or not, i still have some bandwith left Roger Garin-Michaud from Saint-Priest near Lyon, France http://www.cyberdistributeur.com - Original Message - From: "Brian McGarvie" <[EMAIL PROTECTED]> To: "PHP General List" <[EMAIL PROTECTED]> Sent: Monday, July 08, 2002 10:37 AM Subject: RE: [PHP] is their a jobs mailing list? I think a job's list would be good too so people can target only those who wish to undertake a contract/new position, and also for people to post that they are available... that or have an 'independant' site or get one of us to do a subsite on php .net :) I'll do it if it's something that'd be of interest to people... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Max File Size
Hi, I'm having a problem uploading files greater than 2mb, but I believe the problem is related to php.ini. UPLOAD_MAX_FILESIZE in my submit form is set to 1000. Also, I set upload_max_filesize = 1000 in php.ini. After changing php.ini, I stopped and then started httpd. I thought this was enough to be able to upload files greater than the default 2mb. Even though php.ini has been changed, when I check phpinfo.php, I see that upload_max_filesize is still 2mb and my file is not being uploaded. Can anyone tell me what I am missing here. Thanks, Roger Lewis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Max File Size
Yep, Mine is in /etc/httpd/php.ini and that's what phpinfo gives me Roger -Original Message- From: Marco Tabini [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 04, 2002 3:19 PM To: Roger Lewis Cc: PHP-General Subject: Re: [PHP] Max File Size Are you sure you're looking at the right php.ini? Try calling phpinfo() and check where PHP is looking for the ini file. Marco -- php|architect - The magazine for PHP Professionals The monthly worldwide magazine dedicated to PHP programmers Come visit us at http://www.phparch.com! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Max File Size
On Wednesday, December 04, 2002 3:03 PM, I wrote Hi, I'm having a problem uploading files greater than 2mb, but I believe the problem is related to php.ini. UPLOAD_MAX_FILESIZE in my submit form is set to 1000. Also, I set upload_max_filesize = 1000 in php.ini. After changing php.ini, I stopped and then started httpd. I thought this was enough to be able to upload files greater than the default 2mb. Even though php.ini has been changed, when I check phpinfo.php, I see that upload_max_filesize is still 2mb and my file is not being uploaded. Can anyone tell me what I am missing here. Thanks, Roger Lewis Further to my original post, to check if my php.ini was being recognized I temporarily changed some other configuration options, i.e. register_globals and include_path, and reloaded phpinfo.php. All options, except for upload_max_filesize, were changed per my input. Does anyone know why upload_max_filesize is not being reset? The following is from my php.ini showing upload_max_filesize = 750: ; ; Paths and Directories ; ; include_path= ".:/home/sites/home/users/demo/phpinclude" ; UNIX: "/path1:/path2" Windows: "\path1;\path2" doc_root= ; the root of the php pages, used only if nonempty user_dir= ; the directory under which php opens the script using /~username, used only if nonempty ;upload_tmp_dir = ; temporary directory for HTTP uploaded files (will use system default if not specified) upload_max_filesize = 750 ; 2 Meg default limit on file uploads extension_dir = /usr/lib/apache/php ; directory in which the loadable extensions (modules) reside Thanks for any help on this, Roger -- 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] Max File Size
>From phpinfo.php I see that post_max_size is 8M; however, I don't find a setting for this in php.ini. Although I can live with 8M, can you tell me how to change this setting. I am using php 4.0.6 Also I understand that memory_limit may be affecting things, but I don't seem to have access to this setting. Roger -Original Message- From: David Banks [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 04, 2002 5:22 PM To: 'Roger Lewis' Subject: RE: [PHP] Max File Size Don't forget to increase post_max_size as well See also http://www.php.net/manual/en/features.file-upload.php >-----Original Message- >From: Roger Lewis [mailto:[EMAIL PROTECTED]] >Sent: Wednesday, December 04, 2002 5:00 PM >To: Php-General >Cc: [EMAIL PROTECTED] >Subject: RE: [PHP] Max File Size > > >On Wednesday, December 04, 2002 3:03 PM, I wrote > >Hi, > >I'm having a problem uploading files greater than 2mb, but I >believe the >problem is related to php.ini. > >UPLOAD_MAX_FILESIZE in my submit form is set to 1000. Also, I set >upload_max_filesize = 1000 in php.ini. After changing php.ini, I >stopped and then started httpd. I thought this was enough to >be able to >upload files greater than the default 2mb. > >Even though php.ini has been changed, when I check >phpinfo.php, I see that >upload_max_filesize is still 2mb and my file is not being uploaded. > >Can anyone tell me what I am missing here. > >Thanks, > >Roger Lewis > > > >Further to my original post, to check if my php.ini was being >recognized I >temporarily changed some other configuration options, i.e. >register_globals >and include_path, and reloaded phpinfo.php. All options, except for >upload_max_filesize, were changed per my input. Does anyone know why >upload_max_filesize is not being reset? >The following is from my php.ini showing upload_max_filesize = 750: >; >; Paths and Directories ; >; > >include_path = ".:/home/sites/home/users/demo/phpinclude" > ; UNIX: >"/path1:/path2" Windows: "\path1;\path2" > >doc_root = >; the root of the php pages, used only if nonempty > >user_dir = >; the directory under which php opens the script using >/~username, used only if nonempty > >;upload_tmp_dir= ; temporary >directory for HTTP uploaded >files (will use system default if not specified) > >upload_max_filesize = 750 ; 2 Meg default limit on >file uploads > >extension_dir = /usr/lib/apache/php > ; directory in which the loadable >extensions (modules) reside > >Thanks for any help on this, >Roger > > > >-- >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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re[2]: [PHP] Max File Size
Hi, Thursday, December 5, 2002, 11:00:14 AM, you wrote: RL> On Wednesday, December 04, 2002 3:03 PM, I wrote RL> Hi, RL> Further to my original post, to check if my php.ini was being recognized I RL> temporarily changed some other configuration options, i.e. register_globals RL> and include_path, and reloaded phpinfo.php. All options, except for RL> upload_max_filesize, were changed per my input. Does anyone know why RL> upload_max_filesize is not being reset? RL> The following is from my php.ini showing upload_max_filesize = 750: RL> ; RL> ; Paths and Directories ; RL> ; RL> include_path= ".:/home/sites/home/users/demo/phpinclude" ; UNIX: RL> "/path1:/path2" Windows: "\path1;\path2" RL> doc_root= ; the root of the php pages, used only if nonempty RL> user_dir= ; the directory under which php opens the script using RL> /~username, used only if nonempty RL> ;upload_tmp_dir = ; temporary directory for HTTP uploaded RL> files (will use system default if not specified) RL> upload_max_filesize = 750 ; 2 Meg default limit on file uploads RL> extension_dir = /usr/lib/apache/php ; directory in which the loadable RL> extensions (modules) reside RL> Thanks for any help on this, RL> Roger TR> Tom Rogers wrote, Wednesday, December 04, 2002 5:24 PM TR>Sounds like php.ini is being overridden by a .htaccess file or httpd.conf TR>-- TR>regards, TR>Tom Tom, Thanks for your response. If this is so, can you tell me how I check it out and fix things. Roger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Max File Size
Thanks for the suggestion. I'll try ini_set although I'm not yet certain of how to use it. It still seems odd that I can't simply set upload_max_filesize to whatever value I want. I checked again and post_max_size is not in my php.ini, but perhaps I should just add it. Also, I was wrong before - I do have a directive for memory_limit. It is 8M Regardless, this doesn't explain why I can't upload a file that exceeds 2M, except that I don't seem to be able to reset upload_max_filesize to greater than 2M. If you have any other thoughts, they are much appreciated. Roger -Original Message- From: David Banks [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 04, 2002 5:57 PM To: 'Roger Lewis' Subject: RE: [PHP] Max File Size post_max_size *should* be in php.ini, I think I ususally leave these things up to our sysop ;) Checking back to when I was coding for file uploading, I see that there were 4 settings to ensure were 'high enough' max_execution_time memory_limit post_max_size upload_max_filesize I *think* that ini_set may be used to change these settings, but I could be wrong. Cheers Dave >-Original Message- >From: Roger Lewis [mailto:[EMAIL PROTECTED]] >Sent: Wednesday, December 04, 2002 5:48 PM >To: David Banks >Cc: Php-General >Subject: RE: [PHP] Max File Size > > >From phpinfo.php I see that post_max_size is 8M; however, I >don't find a >setting for this in php.ini. Although I can live with 8M, can >you tell me >how to change this setting. I am using php 4.0.6 > >Also I understand that memory_limit may be affecting things, >but I don't >seem to have access to this setting. > >Roger > >-Original Message- >From: David Banks [mailto:[EMAIL PROTECTED]] >Sent: Wednesday, December 04, 2002 5:22 PM >To: 'Roger Lewis' >Subject: RE: [PHP] Max File Size > >Don't forget to increase post_max_size as well > >See also http://www.php.net/manual/en/features.file-upload.php > > > >>-Original Message- >>From: Roger Lewis [mailto:[EMAIL PROTECTED]] >>Sent: Wednesday, December 04, 2002 5:00 PM >>To: Php-General >>Cc: [EMAIL PROTECTED] >>Subject: RE: [PHP] Max File Size >> >> >>On Wednesday, December 04, 2002 3:03 PM, I wrote >> >>Hi, >> >>I'm having a problem uploading files greater than 2mb, but I >>believe the >>problem is related to php.ini. >> >>UPLOAD_MAX_FILESIZE in my submit form is set to 1000. Also, I set >>upload_max_filesize = 1000 in php.ini. After changing php.ini, I >>stopped and then started httpd. I thought this was enough to >>be able to >>upload files greater than the default 2mb. >> >>Even though php.ini has been changed, when I check >>phpinfo.php, I see that >>upload_max_filesize is still 2mb and my file is not being uploaded. >> >>Can anyone tell me what I am missing here. >> >>Thanks, >> >>Roger Lewis >> >> >> >>Further to my original post, to check if my php.ini was being >>recognized I >>temporarily changed some other configuration options, i.e. >>register_globals >>and include_path, and reloaded phpinfo.php. All options, except for >>upload_max_filesize, were changed per my input. Does anyone know why >>upload_max_filesize is not being reset? >>The following is from my php.ini showing upload_max_filesize >= 750: >>; >>; Paths and Directories ; >>; >> >>include_path = ".:/home/sites/home/users/demo/phpinclude" >> ; UNIX: >>"/path1:/path2" Windows: "\path1;\path2" >> >>doc_root = >>; the root of the php pages, used only if nonempty >> >>user_dir = >>; the directory under which php opens the script using >>/~username, used only if nonempty >> >>;upload_tmp_dir= ; temporary >>directory for HTTP uploaded >>files (will use system default if not specified) >> >>upload_max_filesize = 750 ; 2 Meg default limit on >>file uploads >> >>extension_dir = /usr/lib/apache/php >> ; directory in which the loadable >>extensions (modules) reside >> >>Thanks for any help on this, >>Roger >> >> >> >>-- >>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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Max File Size
Tom Rogers responded on Wednesday, December 04, 2002 6:11 PM Hi, Thursday, December 5, 2002, 11:54:08 AM, you wrote: RL> Tom, RL> Thanks for your response. If this is so, can you tell me how I check it out RL> and fix things. RL> Roger TR> Unless you have set it yourself that is probably not the reason. TR> Try setting it like this TR> upload_max_filesize = 8M TR> maybe there are too many digits for php to cope :) TR> -- TR> regards, TR> Tom I tried using 8M, but no difference. The original setting was 200, and that didn't seem to be too many digits. I'm going to check out ini_set as suggested by David Banks and will post the outcome in due course. Thanks, Roger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Max File Size
Jason Wong responded Wednesday, December 04, 2002 10:24 PM < On Thursday 05 December 2002 10:14, Roger Lewis wrote: < > Thanks for the suggestion. I'll try ini_set although I'm not yet certain < > of how to use it. < As has already been pointed out, the uploads take place *before* your script < is run. The manual has table which shows what you can and cannot change using < ini_set(). < THE place to change it is in php.ini. < > I checked again and post_max_size is not in my php.ini, but perhaps I < > should just add it. < Perhaps you should indeed. I think it defaults to 2M, so if you haven't set it < 2MB is your limit. < > Also, I was wrong before - I do have a directive for memory_limit. It is < > 8M < I think this only has effect if php was compiled with "--enable-memory-limit". < > Regardless, this doesn't explain why I can't upload a file that exceeds 2M, < > except that I don't seem to be able to reset upload_max_filesize to greater < > than 2M. < You mean you set it in php.ini and phpinfo() reports something different? < -- < Jason Wong -> Gremlins That's what I've been trying to say, Jason. I set upload_max_filesize in php.ini to 8M, 800, or any other number, restart Apache, and the reset seems to be ignored. When looking at phpinfo, upload_max_filesize is *always* 2M. Adding the directive post_max_size = 16M to my php.ini did nothing except change my include_path settings ?%!?!*. (I can see in phpinfo that the default is 8M, but there is no setting in my php.ini) In reply to Tom's comment, there is no difference between master and local settings; however, there are no separate settings in my php.ini either. Do you have any other thoughts on this? Regards, Roger -- 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: Re[2]: [PHP] Max File Size
Hi, Thursday, December 5, 2002, 5:11:16 PM, you wrote: RL> Jason Wong responded Wednesday, December 04, 2002 10:24 PM RL> < On Thursday 05 December 2002 10:14, Roger Lewis wrote: RL> < > Thanks for the suggestion. I'll try ini_set although I'm not yet RL> certain RL> < > of how to use it. RL> < As has already been pointed out, the uploads take place *before* your RL> script RL> < is run. The manual has table which shows what you can and cannot change RL> using RL> < ini_set(). RL> < THE place to change it is in php.ini. RL> < > I checked again and post_max_size is not in my php.ini, but perhaps I RL> < > should just add it. RL> < Perhaps you should indeed. I think it defaults to 2M, so if you haven't RL> set it RL> < 2MB is your limit. RL> < > Also, I was wrong before - I do have a directive for memory_limit. It RL> is RL> < > 8M RL> < I think this only has effect if php was compiled with RL> "--enable-memory-limit". RL> < > Regardless, this doesn't explain why I can't upload a file that exceeds RL> 2M, RL> < > except that I don't seem to be able to reset upload_max_filesize to RL> greater RL> < > than 2M. RL> < You mean you set it in php.ini and phpinfo() reports something different? RL> < -- RL> < Jason Wong -> Gremlins RL> That's what I've been trying to say, Jason. I set upload_max_filesize in RL> php.ini to 8M, 800, or any other number, restart Apache, and the reset RL> seems to be ignored. When looking at phpinfo, upload_max_filesize is RL> *always* 2M. RL> Adding the directive post_max_size = 16M to my php.ini did nothing except RL> change my include_path settings ?%!?!*. (I can see in phpinfo that the RL> default is 8M, but there is no setting in my php.ini) RL> In reply to Tom's comment, there is no difference between master and local RL> settings; however, there are no separate settings in my php.ini either. RL> Do you have any other thoughts on this? RL> Regards, RL> Roger TR> A shot in the dark check for: TR> file_uploads = On TR> -- TR> regards, TR> Tom file_uploads = 1. I presume this is means "on", right? Roger 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] Max File Size
Hi, Thursday, December 5, 2002, 5:11:16 PM, you wrote: RL> Jason Wong responded Wednesday, December 04, 2002 10:24 PM RL> < On Thursday 05 December 2002 10:14, Roger Lewis wrote: RL> < > Thanks for the suggestion. I'll try ini_set although I'm not yet RL> certain RL> < > of how to use it. RL> < As has already been pointed out, the uploads take place *before* your RL> script RL> < is run. The manual has table which shows what you can and cannot change RL> using RL> < ini_set(). RL> < THE place to change it is in php.ini. RL> < > I checked again and post_max_size is not in my php.ini, but perhaps I RL> < > should just add it. RL> < Perhaps you should indeed. I think it defaults to 2M, so if you haven't RL> set it RL> < 2MB is your limit. RL> < > Also, I was wrong before - I do have a directive for memory_limit. It RL> is RL> < > 8M RL> < I think this only has effect if php was compiled with RL> "--enable-memory-limit". RL> < > Regardless, this doesn't explain why I can't upload a file that exceeds RL> 2M, RL> < > except that I don't seem to be able to reset upload_max_filesize to RL> greater RL> < > than 2M. RL> < You mean you set it in php.ini and phpinfo() reports something different? RL> < -- RL> < Jason Wong -> Gremlins RL> That's what I've been trying to say, Jason. I set upload_max_filesize in RL> php.ini to 8M, 800, or any other number, restart Apache, and the reset RL> seems to be ignored. When looking at phpinfo, upload_max_filesize is RL> *always* 2M. RL> Adding the directive post_max_size = 16M to my php.ini did nothing except RL> change my include_path settings ?%!?!*. (I can see in phpinfo that the RL> default is 8M, but there is no setting in my php.ini) RL> In reply to Tom's comment, there is no difference between master and local RL> settings; however, there are no separate settings in my php.ini either. RL> Do you have any other thoughts on this? RL> Regards, RL> Roger TR> A shot in the dark check for: TR> file_uploads = On TR> -- TR> regards, TR> Tom file_uploads = 1. I presume this is means "on", right? Roger I think I figured it out. The clue was that phpinfo() would show changes that I wasn't making. I concluded that it might be a syntax error in my php.ini due to some weird line wrapping that was going on. (I can't see the entire text on my telnet screen). I deleted my entire section on "Paths and Directories" and replaced with a clean section. Then reset upload_max_filesize and restarted Apache. Wadda you know! It worked. Thanks for all the comments and suggestions. Roger 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Configuration - Can't Change Post_Max_Size
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
RE: [PHP] Need Redirection Trick...
Nilaab, This sounds similar to what I was trying to do recently, i.e creating dependent dropdown boxes. Here's a link to a demo of the code that might be of interest to you. http://www.onlinetools.org/tools/easyselectdata/index.html Cheers. Roger -Original Message- From: @ Nilaab [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 05, 2002 7:36 PM To: Php-General Subject: [PHP] Need Redirection Trick... Hello Everyone, I have a simple problem that, I think, might require a little trick to be used. I have a list of products in a database that is organized by categories and subcategories. Categories can have as many subcategories as it wants, but some categories don't need to have a subcategory at all. In the following code "cat" refers to category and "subcat" refers to subcategory. cat_data and subcat_data refers to a multi-dimentional array, pulled from the DB, with values of an id and a name. example: cat_data[row_number][name_of_category] and cat_data[row_number][id]. Ok, before I ask the question, here's the code: [-- snip --] get_cat_data(); for ($i=0; $i < count($cat_data); $i++) { echo '' . $cat_data[$i]["name"] . "\n"; if ($cat_id) { $subcat_data = $db->get_subcat_data($cat_id); if ($subcat_data != 0 && ($cat_id == $cat_data[$i]["id"])) { for ($j=0; $j < count($subcat_data); $j++) { echo '- ' . $subcat_data[$j]["name"] . "\n"; } } elseif ($subcat_data == 0 && ($cat_id == $cat_data[$i]["id"])) { $subcat_id = 0; header("Location: $PHP_SELF?cat_id=$cat_id&subcat_id=$subcat_id"); } } } ?> [-- snip --] What this does is it lists all the categories in the database, initially. When the user clicks on a category, the script will check if the category has any subcategories associated with it. One of two things should happen after this. First, it should list all the subcategories directly below the category it is associated with, with a little indention to specify that they are subcategories. The subcategories listed will be a link that passes over the cat_id and subcat_id GET variables to the same page. example:category 1 category 2 - subcategory 1 - subcategory 2 - subcategory 3 category 3 . . . This part of the script works fine. The second thing that should happen is that if there are actually no subcategories for the selected category then subcat_id should equal 0 and the script should redirect back to the same page with the GET variables of cat_id and subcat_id (which is equal to zero at this point). The problem is that I cannot redirect with a header() function because content is already sent to the browser at the beginning of the script (the list of categories). Is there any other way that I can redirect and send the variables of cat_id and subcat_id to the page in the second situation mentioned earlier? Register Globals is on. - Nilaab -- 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] Apache dumps core when using php with mm
I want to use mm for session handling and as I haven't enabled it before my first action was to try to enable mm in php. apache configure: LD_SHLIB=ld ./configure --with-layout=OpenBSD --enable-module=rewrite --enable-module=so --enable-module=info --server-uid=www --server-g id=www php configure: EXTRA_LIBS='-ljpeg -lmm' LD_SHLIB=ld ./configure --prefix=/web/php --with-mysql --with-config-file-path=/web/php/lib --enable-trans-sid --enable-force-cgi-redirect --with-gd=/usr/local --with-jpeg-dir=/usr/local --with-xpm-dir=/usr/X11R6 --with-ttf --with-t1lib --enable-track-vars --enable-sockets --with-png-dir=/usr/local --with-zlib --with-zlib-dir=/usr --with-xmlrpc --with-expat-dir=/usr/local --with-mm=/usr/local --with-apxs The mm used is 1.1.3 installed from ports and when I installed it I ran 'make test' which gave +-MM-Library-Test-Suite-Summary--- | Library Version : MM 1.1.3 (01-Jul-2000) | Platform : i386-unknown-openbsd3.1 | Memory Page Size Type : MM_VMPS_SYSCONF | Shared Memory Type: MM_SHMT_MMANON | Semaphore Type: MM_SEMT_FCNTL | Maximum Segment Size : 67108864 | Test Suite: Ok +- I only rebuilt and installed php (simple make distclean && configure ... && make && sudo make install ). When attempting to start apache, apache dumped core and php logged this "PHP Fatal error: Unable to start session mm module in Unknown on line 0". Setting session.save_handler = files or mm doesn't change the result. My set up is Apache 1.3.27 with PHP 4.2.3 on OpenBSD 3.1. What should I do to get mm into a working php? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: mysql_num_rows
I found the problem! It was a space before $ in ' $name' in line two of the query. Sorry for the trouble. Roger -Original Message----- From: Roger Lewis [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 4:00 PM To: Php-General Subject: mysql_num_rows Would someone be kind enough to explain why I'm not getting the correct result from the following query. If I select a valid member no. and name, the following query should return 1 row. This is not the case, however. It returns zero rows. $sql = "SELECT * FROM users WHERE member_no = '$member_no' and name = ' $name' "; $result = mysql_query($sql) or die ("Cannot verify the member"); $rows = mysql_num_rows($result); echo "rows = $rows"; Furthermore when trying the following query where the table "users" contains 13 rows, the query returns only 12 rows. $sql = "SELECT * FROM users"; $result = mysql_query($sql) or die ("Cannot verify the member"); $rows = mysql_num_rows($result); echo "rows = $rows"; Conclusion: mysql_num_rows seems to be returning one less row than exists. Is this correct? Thanks in advance Roger Lewis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_num_rows
Would someone be kind enough to explain why I'm not getting the correct result from the following query. If I select a valid member no. and name, the following query should return 1 row. This is not the case, however. It returns zero rows. $sql = "SELECT * FROM users WHERE member_no = '$member_no' and name = ' $name' "; $result = mysql_query($sql) or die ("Cannot verify the member"); $rows = mysql_num_rows($result); echo "rows = $rows"; Furthermore when trying the following query where the table "users" contains 13 rows, the query returns only 12 rows. $sql = "SELECT * FROM users"; $result = mysql_query($sql) or die ("Cannot verify the member"); $rows = mysql_num_rows($result); echo "rows = $rows"; Conclusion: mysql_num_rows seems to be returning one less row than exists. Is this correct? Thanks in advance Roger Lewis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] test
This is a test. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] test
But it did! Otherwise I wouldn't have received your comment. Why did I get this message from Mailer-Daemon: Sorry. Your message could not be delivered to: php-list,emc (The name was not found at the remote site. Check that the name has been entered correctly.) -Original Message- From: Martin Towell [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:02 PM To: Php-General Subject: RE: [PHP] test na! didn't work :) -Original Message----- From: Roger Lewis [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 18, 2002 4:59 PM To: Php-General Subject: [PHP] test This is a test. -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] test
John, I'm emailing. And it looks like each time I send something, I get the same message in return. Roger John Taylor wrote: Roger, Are you emailing or posting to the news group? John -- 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] test
So what the h... is going on? Roger < Lookee there, I'm getting it now and I'm sending to the newsgroup. < Subject: <NDN: [PHP] Re: mysql_num_rows < Date: <Wed, 18 Dec 2002 14:18:28 +0800 < From: <"Mailer-Daemon" <[EMAIL PROTECTED]> < To: <[EMAIL PROTECTED] < < Sorry. Your message could not be delivered to: < < php-list,emc (The name was not found at the remote site. Check < that the name has been entered correctly.) < -- 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] test
Martin, I'm sending too [EMAIL PROTECTED] also. Never seen anything like this before Roger Martin Towell wrote: < actually, I get the same error. I've been putting it down to someone < subscribing and now their email is invalid. << < BTW: I'm emailing to [EMAIL PROTECTED] - if that helps -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] imap_set_quota function
an excerpt from php man pages says that: "This function requires the imap_stream to have been opened as the mail administrator account. It will not work if opened as any other user. ... ... $mbox = imap_open ("{your.imap.host:143}", "mailadmin", "password"); " my question is, where do i set this admin called 'mailadmin' with password 'password'. do i set it in courier/uw for example? -- __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] 2 servers for mail implementation
dear all, i have 2 servers that were *given* to me to setup and implement webmail solution for our client. i have done some groundwork in terms of the backend applications that are needed to do this. what i wanted to know is, how best can i distribute the backend applications between those 2 servers to achieve a balance and fast response. can i go like this: server A ldap courier-imap server B apache php qmail for mysql, i have an existing server that i will use for database queries. appreciate your kind advice. best rgds. roger __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] imap quota
i am referring to imap_get_quota manpages at http://www.php.net/manual/en/function.imap-get-quota.php it gave a short script (see bottom). question: in a qmail-ldap/courier-imap environment, who is that mailadmin ? -- script start -- $mbox = imap_open("{your.imap.host}","mailadmin","password",OP_HALFOPEN) or die("can't connect: ".imap_last_error()); $quota_values = imap_get_quota($mbox, "user.kalowsky"); if(is_array($quota_values)) { $storage = $quota_values['STORAGE']; print "STORAGE usage level is: " . $storage['usage']; print "STORAGE limit level is: " . $storage['limit']; $message = $quota_values['MESSAGE']; print "MESSAGE usage level is: " . $message['usage']; print "MESSAGE usage level is: " . $message['limit']; /* ... */ } imap_close($mbox); -- script endz -- -- roger __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] --with-mcal=/usr/local/mcal compilation issue
php-4.3 libmcal-0.5 (i intend to use Horde's Kronolith and the README said it cannot work with libmcal-0.6) configure gave this error: checking for MCAL support... yes configure: error: Unable to locate your libmcal header files - cal_misc.h should be in the directory you specify or in the include/ subdirectory below it - default search location is /usr/local please advise. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] LDAP next prev howto
is it possible to retrieve a bunch of records from an ldap tree and do a next-prev navigation on those records ? example script pls. -- __ Do you Yahoo!? Yahoo! Shopping - Send Flowers for Valentine's Day http://shopping.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] LDAP next prev howto
is it possible to retrieve a bunch of records from an ldap tree and do a next-prev navigation on those records ? example script pls. -- roger __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] imap_get_quota
on the php.net manpage for imap_get_quota, http://www.php.net/manual/en/function.imap-get-quota.php , the imap stream is opened as: $mbox = imap_open("{your.imap.host}","mailadmin","password",OP_HALFOPEN) or die("can't connect: ".imap_last_error()); i am really confused as to how to setup the mailadmin account. i am running php-4.3, courier-imap and qmail-ldap appreciate any help. -- roger __ Do you Yahoo!? Yahoo! Web Hosting - establish your business online http://webhosting.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Test Please Delete
test, please delete -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] overriding upload_tmp_dir
for an application, i would like to have the temporary upload file directory under the webroot of this application. how can i override the php.ini directive of upload_tmp_dir ? -- roger __ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How do you make a directory
I'm trying to learn to create a directory in php, and from everything I've read I created this simple test that I put into the file add_user_dir.php. Unfortunately I can't get it to work. I am getting the error message: Warning: MkDir failed (Permission denied) in /home/sites/home/users/demo/web/Admin/add_user_dir.php on line 20. Obviously, it has something to do with permissions. I have chmod for the directory 'userforum' set to 0777. I tried playing around with umask, and changing the chmod, but I can't get anything to work. I am using PHP 4.0.6 with Apache 1.3.20 Here is the script: User Name Can anyone see what I am doing wrong? Thanks. Roger Lewis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How do you make a directory
On Wednesday 24 July 2002 11:12, Roger Lewis wrote: > I'm trying to learn to create a directory in php, and from everything I've > read I created this simple test that I put into the file add_user_dir.php. > Unfortunately I can't get it to work. I am getting the error message: > > Warning: MkDir failed (Permission denied) in > /home/sites/home/users/demo/web/Admin/add_user_dir.php on line 20. > > Obviously, it has something to do with permissions. I have chmod for the > directory 'userforum' set to 0777. I tried playing around with umask, and > changing the chmod, but I can't get anything to work. [snip] > $dirpath = "/home/sites/home/users/demodocs/web/userforum" . $username; > mkdir($dirpath, 0777); > ?> Assuming $username is 'tom', are you trying to create: a) /home/sites/home/users/demodocs/web/userforumtom or: b) /home/sites/home/users/demodocs/web/userforum/tom Your code is trying to do (a). In any case whatever you're trying to do, you need both the following: i) Have execute permissions ('x') on all the directories in the path leading down to where you wish to create your directory ii) Have write permission ('w') on the directory in which you are creating your directory Jason and TechSupport, Jeeze, do I feel stupid. One slash and that's all it took. Thanks much. Re the permissions, I have userforum set to 0777. php creates the new directory as 0775. Presumably this is because of the effect of umask, right? When I upload files to the new directory using php uploading script, they go in as 0600, with owner - httpd, and group - root. (The owner/group on my machine is httpd/httpd). I can link to and read the files on the browser OK so I'm happy. Are there any security issues I should be concerned with here. Thanks again, Roger Lewis -- 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] New way to make select boxes auto select
i used the same techniqu a while back when i worked with Fast Template. scenario: - present a user with a form to input - there are several text fields and several select options - if there is/are error(s) upon form submission, we will call the same template file and insert proper error messages at appropriate places, normally close to the input field. - we would also luv to make the select option field to DEFAULT to the PREVIOUS value that WAS selected. with the technique that Nathan describe below, you can do just that. At present i have dropped this technique as I have switched to Smarty. Smarty can do all this with its {html_optios blah blah blah}. Recently I made frequent use of Webreference javascript to make select boxes that are related to each other. ie changing(selecting) a left select box would make a right select box change accordingly. I am trying to apply Smarty to this but my javascript knowledge is too shallow. after submitting a form with errors, the 2 select boxes will default back when the script starts. which is NOT what i want. if nebody have done this, appreciate your help. -- roger --- Nathan Cook <[EMAIL PROTECTED]> wrote: > You may already be doing it like this, but I think I found a new way to > make select boxes auto-select (what data they put in) a lot easier. All you > have to do is put a variable in each select tag that is equal to the value > of the select option i.e.: -- then all you > have to do is base the variable on that $$interest = > "selected"; quick and easy with out having to loop through an if elseif > statement. Let me know if you like that method or have any objections. > > Full example below. > > print("\n"); > // creates a variable with a name based on > // the value of interest with a value of "selected" > $$interest = "selected"; > print("- Select One -\n"); > print("Teacher\n"); > print("Lego Enthusiast\n"); > print("Student\n"); > print("Homeschool Parent\n"); > print("Browsing\n"); > print("Afterschool\n"); > print("Boys & Girls Club\n"); > print("YMCA\n"); > print(" \n"); > > [ Nathan Cook | [EMAIL PROTECTED] ] > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fruity arrays
i have these arrays: $A_fruit_list = array('A1' => 'Fruit A1', 'A2' => 'Fruit A2', ); $B_fruit_list = array('B1' => 'Fruit B1', 'B2' => 'Fruit B2', ); then i do these: $var = "B"; $var_list = $var."_fruit_list"; //Note: variable variable below $fruit_array_of_choice = ${$var_list}; $FRUIT_code => array_keys($fruit_array), $FRUIT_name => array_values($fruit_array), which generates these warnings: Warning: First argument to array_keys() should be an array in /home/httpd/vhost/home/fruits.php on line 14 Warning: Argument to array_values() should be an array in /home/httpd/vhost/home/ureg/fruits.php on line 15 how do i script around that ? -- roger __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] no HTML in a form textarea field
i presented my visitor to fill up some description about themselves via HTML's textarea FORM element. how do i block them from entering unwanted HTML tags into the textarea field? -- roger __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] howto disable cron output
i wrote an ecard script and added 'send at a future date' feature. this feature is implemented via cron that runs daily at 1200 hours $> crontab -l looks like: 00 00 * * * wget http://ecard.domain.com/futuresend.php 2&1> /dev/null it works great but everyday there will be a file being written to my ecard directory. this file is named futuresend.php.1 the next day there will be another file called futuresend.php.2 so on and so forth. how do i stop Solaris/Linux from spitting this file out ? -- roger __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: howto disable cron output
yes, you are rite. and i know that. it could have *accidently happened* due my haste in between pulling my hair trying to figure out / solve my scripting. my apology to Jean-Christian and the list. rgds. roger --- Jean-Christian Imbeault <[EMAIL PROTECTED]> wrote: > Hey Roger, when you want to write a new email to this list don't reply > to an existing posting and just change the subject line. It ruins it for > people who follow messages using threading. > > You did that with my message and now both of our "message threads" will > appear mixed up together. > > Just a friendly reminder. Please don't do it again. > > Jc > > Roger Thomas wrote: > > i wrote an ecard script and added 'send at a future date' feature. > > this feature is implemented via cron that runs daily at 1200 hours > > > > $> crontab -l looks like: > > 00 00 * * * wget http://ecard.domain.com/futuresend.php 2&1> /dev/null > > > > it works great but everyday there will be a file being written to my ecard > > directory. > > > > this file is named futuresend.php.1 > > the next day there will be another file called futuresend.php.2 > > so on and so forth. > > > > how do i stop Solaris/Linux from spitting this file out ? > > > > -- > > roger > > > > > > __ > > Do You Yahoo!? > > HotJobs - Search Thousands of New Jobs > > http://www.hotjobs.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ldap_rename refused to work
built: php-4.2.2 with openldap 2.0.25 i tried using the ldap_rename function to modify the dn of my ldap db but nothing seems to happen. the record was not change at all. i have followed closely the code-snippet that was given by Mr Stig Venaas at: http://marc.theaimsgroup.com/?l=php-general&m=100949195224325&w=2 following is my short code to do this: "; exit(); } if (!ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) { echo "Failed to set protocol version"; exit; } //we bind to ldap server AFTER the ldap_set_option is successfull //this is an authenticated bind $r=ldap_bind($ds,"cn=admin,o=Administrators,dc=mydomain,dc=net", "secret"); if (!$r) { echo "LDAP bind failed"; exit(); } // we want to transfer user roger from Civil Engineering to Credit section in Finance $r=ldap_rename($ds, "uid=roger,ou=People,ou=Civil,o=Engineering,dc=mydomain,dc=net", "uid=roger,ou=People,ou=Credit,o=Finance,dc=mydomain,dc=net", "dc=mydomain,dc=net",TRUE); //Close the LDAP connection. ldap_close($ds); print "modification done"; ?> please advise. -- roger __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ldap_rename refused to work
--- Stig Venaas <[EMAIL PROTECTED]> wrote: > > But you're not doing what I wrote... :) or else i won't be asking hehehe > > The third parameter should be the new rdn (which is the same as the old), > and the fourth should be new parent. So it should look like this: > > $r=ldap_rename($ds, > "uid=roger,ou=People,ou=Civil,o=Engineering,dc=mydomain,dc=net", > "uid=roger", > "ou=People,ou=Credit,o=Finance,dc=mydomain,dc=net", TRUE); > > Stig Great, it works. Stig, you saved my day. I owe you my eternal gratitude. -- roger __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Captcha wrapper
wonder if anyone has developed a wrapper around captcha. or is there an alternative way ? -- roger __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How Can I Generate an Email List from a MySQL Table
I have a MySQL table named "users" in which there is a column named "email_address" and another named "is_subscribed". I would like to send an email to all of the addresses for which "is_subscribed" is true. I think I know how to send the email, i.e., mail($to, $subject, $message, $headers); I tested this out and it works fine when, for instance, $to = "[EMAIL PROTECTED], [EMAIL PROTECTED]" or some such collection of addresses. My problem is how do you create the variable, $to, from the MySQL table so that it contains all of the addresses separated by commas. Thanks for your help, Roger Lewis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How Can I Generate an Email List from a MySQL Table
Thanks for the quick responses from Chris, Daren, and Kevin. I didn't know so many would be up Sat night. This looks like it might do the trick since I only have 20 to 30 recipients and I have a dedicated server. I'll check it out and let you know. Thanks again, Roger -Original Message- From: Chris Knipe [mailto:[EMAIL PROTECTED]] Sent: Saturday, August 17, 2002 8:37 PM To: Roger Lewis; Php-General Subject: Re: [PHP] How Can I Generate an Email List from a MySQL Table $to = ''; while ($blah = mysql_fetch_row($ref)) { $to =+ $blah['address']; }; Be careful however. Most SMTP servers has a limit on the number of recipients you can send one email to. It's a very easy way to trigger spam alerts and stuff. -- me - Original Message - From: "Roger Lewis" <[EMAIL PROTECTED]> To: "Php-General" <[EMAIL PROTECTED]> Sent: Sunday, August 18, 2002 5:10 AM Subject: [PHP] How Can I Generate an Email List from a MySQL Table > I have a MySQL table named "users" in which there is a column named > "email_address" and another named "is_subscribed". I would like to send an > email to all of the addresses for which "is_subscribed" is true. I think I > know how to send the email, i.e., > > mail($to, $subject, $message, $headers); > > I tested this out and it works fine when, for instance, $to = > "[EMAIL PROTECTED], [EMAIL PROTECTED]" or some such collection of > addresses. > > My problem is how do you create the variable, $to, from the MySQL table so > that it contains all of the addresses separated by commas. > > Thanks for your help, > > Roger Lewis > > > -- > 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] How Can I Generate an Email List from a MySQL Table
On Sat, 17 Aug 2002 20:10:02 -0700 "Roger Lewis" <[EMAIL PROTECTED]> wrote: > My problem is how do you create the variable, $to, from the MySQL table so > that it contains all of the addresses separated by commas. Daren Cotter [mailto:[EMAIL PROTECTED]] responded Saturday, August 17, 2002 8:42 PM > // Query database > $result = mysql_query("SELECT email_address FROM users > WHERE is_subscribed = 'Y'", $link); > while ($row = mysql_fetch_array($result)) { > mail($row["email_address"], $SUBJECT, $BODY, > $HEADER); > } > mysql_free_result($result); Darren, Thanks a lot. This works fine. Please have a virtual beer on me! :) To Chris Knipe [mailto:[EMAIL PROTECTED]] who responded > $to = ''; > while ($blah = mysql_fetch_row($ref)) { > $to =+ $blah['address']; > }; I tried this, but I got an index error. It doesn't understand 'address' and I couldn't figure out what was going on. To Kevin Waterson who responded > simply create your array and use implode. > There is an example of comma seperated lists in the manual > http://www.php.net/manual/en/function.implode.php I like this method because it seems more elegant than above, but I don't seem to be able to create the array properly. I tried the following as well as many other combinations, but couldn't get anything to work: $sql = "SELECT email_address FROM users WHERE is_subscribed = 1"; $result = mysql_query($sql); $to = implode(",", mysql_fetch_array($result)); Thanks again everyone for your help Roger Lewis > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How Do You Protect Individual Files
I haven't been able to find much on this subject in the archives. Using sessions I have been able to have the server validate the user's access level before serving him a page. I put include files on each page that I want authenticated. This is all well and good, except on my pages there are links to non-html, and non-php files that are stored in document directories on the server. How, on a file-by-file basis, do I ensure that the user is authorized to download these files? If he gets to them through the link I provide, this is acceptable because he is already authorized to view the page that the link is on. However, if he somehow knows the full path to the file, he can get to it directly, bypassing the link and overriding the authentication system. Thanks for any help on this question. Roger Lewis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How Do You Protect Individual Files
On Wednesday 21 August 2002 08:59, Roger Lewis wrote: > I haven't been able to find much on this subject in the archives. > > Using sessions I have been able to have the server validate the user's > access level before serving him a page. I put include files on each page > that I want authenticated. This is all well and good, except on my pages > there are links to non-html, and non-php files that are stored in document > directories on the server. > > How, on a file-by-file basis, do I ensure that the user is authorized to > download these files? If he gets to them through the link I provide, this > is acceptable because he is already authorized to view the page that the > link is on. However, if he somehow knows the full path to the file, he can > get to it directly, bypassing the link and overriding the authentication > system. On Tuesday, August 20, 2002 7:24 PM, Jason Wong wrote: < Try searching the archives. It has been discussed many times before. Jason, I did, but like I said, I couldn't find much. Maybe I wasn't using the correct key words. There is a lot about protecting php and html files but not much on other, non-php files in external directories. There is some discussion about .htaccess, but I know nothing about this. Is that the way to do it, or can it be done with php. Roger -- 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] How Do You Protect Individual Files
On Wednesday 21 August 2002 10:54, Roger Lewis wrote: > I did, but like I said, I couldn't find much. Maybe I wasn't using the > correct key words. There is a lot about protecting php and html files but > not much on other, non-php files in external directories. There is some > discussion about .htaccess, but I know nothing about this. Is that the way > to do it, or can it be done with php. Justin French, Tuesday, August 20, 2002 10:40 PM > In real short, you want to store the files outside your htdocs root (so they > can't be served by http), OR restrict them from being served by using a > htaccess file (try an apache list, the apache site, or your ISP sys admin). > Then, you want to serve those files THROUGH a PHP script. Usually these > scripts will: > - authenticate a user > - set the right mime-type header for the file type using header() > - parse the requested file though the PHP script to the browser > There were a few recent threads on this... search for the following subject > lines in the archives: > - Authenticate files downloads > - secure files acess > Finally, there is a decent script/article/tutorial on the Zend site (another > place you should have looked), which is the basis for my code at the moment. > http://www.zend.com/zend/trick/tricks-august-2001.php Well, I originally searched for "protect file downloads". I also searched "protect individual files", "protect files", "authenticate files", and on and on. There are thousands of messages, but very few with relevant titles or content. One point to consider: I have no control over the files themselves. They are being uploaded to the document directories by end users, so I do not know the file names. What I am trying to do is prevent someone who knows the path to the file from being able to gain access to it without authorization. One of the best ideas I saw was to put the files outside the web root directory. That sounded pretty good until I discovered that then I couldn't access the files. Now you've again pointed out that solution, so I'm sure it will work. I've just got to study up on the subject. I ran across the Zend article a couple of weeks ago, but it's going to take me awhile to understand it. I'm pretty new at this game, and my programming skills are very limited. I'm going to research .htaccess also. 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] Multiple File Uploads With a Single Input
Is anyone aware of any recent developments that would allow you to upload multiple files from a single . Many of the messages in the archives say that this is impossible; however, these messages are more that a year old. I would like to be able to click a browse button, select multiple files, and upload them to a directory all at one time. Can it be done? Roger Lewis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Web Site
On Wednesday, August 21, 2002 6:41 PM Peter Goggin wrote < 2. I need to set up credit card payments. Has anyone any experience with < PayPal? Are there any other providers I should consider. Nothing but good to say about PayPal Roger -- 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] How Do You Protect Individual Files
Justin, Thanks again. I've been doing some more research on .htaccess. The problem I see is that it is high maintenance, i.e. I've already got a MySQL table of users with username and password. To use .htaccess, you have to have a htpasswd file containing duplicate usernames and passwords, and this would have to be in sync with the MySQL table. I have found that there is an Apache module, mod_auth_mysql, that allows .htaccess to access a MySQL database for the information it needs. This module is available at http://www.diegonet.com/support/mod_auth_mysql.shtml. Problem is you have to install the mod and recompile Apache, I think. And I don't know how to do that yet. However, if everything works in accordance with my interpretation, you should be able to put an .htascess file into the directory you wish to protect and Mod_auth_mysql will communicate with the database to authenticate the users. Roger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: set filename of file open/download
Richard Lynch wrote On Saturday, August 24, 2002 4:52 PM To: David Buerer > >I'm using a php script to stream a microsoft word file to a browser. > > > >I'm sending header("Content-type: {$mimetype[DOC]} \n"); to set the mime > >type to application/msword so that the browser knows how to open the file. > > > > > >However, some users systems are configured to allow the choice of open or > >saveas. The problem is that when the user selects saveas the filename it > >uses is the name of the php script which streams the file, not the actual > >filename of the file. How do I set this filename? > Alas, different browsers do this differently... > The *BEST* way to do it is to make your link be named the filename you want > them to download: > Example: > http://uncommonground.com/events.pdf > This is *really* a PHP script that happens to have a filename of > 'events.pdf' > I've put this into my .htaccess file to force Apache to parse events.pdf as > PHP: > > ForceType application/x-httpd-php > > So Apache "knows" it's a PHP file and PHP spews out valid PDF content and > the browser never even "sees" .php anywhere, so the browser thinks it's just > getting a static PDF file. > If you have a zillion files to link to, you might want to consider: > Creating "broken" links to http://example.com/index/nonexistent.doc *BUT* > you have a file named 'index' and a ForceType like above to make Apache > parse it as PHP, and inside 'index' you do: > # Use $path_info to determine what file they wish to download. > # NOTE: It's going to be $_ENV['path_info'] or $_SERVER['path_info'] or > something like that now... > # Use phpinfo() to figure out what it is... >?> > Or, if that sounds too "tricky" just put the filename into the link, even > though it looks "bogus": > http://example.com/download.php/whatever.doc?filename=whatever.doc > Even though your PHP file is really 'download.php', Apache and PHP don't > care about that extra crap in there '/whatever.doc' and the browsers are so > stupid they think you've got an actual file with that name in it. > You can also dink with headers involving Content-disposition and something > else I forgot, since IE and Netscape and different versions of each look at > different headers to "decide" what to use for "Save As..." *BUT* there will > always be some minor version of IE or Netscape that doesn't follow their own > rules, and the headers won't work for it. Thus I usually go with the first > option, and don't even give the browser any way to "know" that it's not a > plain old static URL. I have been struggling with this problem for the last several days. (See my recent post, "Trouble Downloading Files, 8.24.02". The problem I had was mostly with IE. Here is how I solved it. I used the code from the following as the basis of my code: http://www.zend.com/zend/trick/tricks-august-2001.php To make it work in IE, I had to add two lines to the section on "send headers" (See commented lines below). //send headers if(($pc > 1) AND isset($mimetype[$p[$pc - 1]])) { //display file inside browser header("Content-type: " . $mimetype[$p[$pc - 1]] . "\n"); header("Content-disposition: attachment; filename=\"$file\"\n"); // THIS LINE IS ADDED TO GIVE A CHOICE TO OPEN, OR SAVE AS FILENAME. } else { //force download dialog header("Content-type: application/octet-stream\n"); header("Content-disposition: attachment; filename=\"$file\"\n"); } header('Cache-Control: public');// THIS LINE IS ADDED TO MAKE MSIE WORK AT ALL header("Content-transfer-encoding: binary\n"); header("Content-length: " . filesize($path) . "\n"); //send file contents $fp=fopen($path, "r"); fpassthru($fp); The Cache-Control header came from comments by [EMAIL PROTECTED], 04-Apr-2002 12:25, in http://www.php.net/manual/en/function.fpassthru.php I'm not sure why these additions fixed the problem, but they did. Maybe someone out there with a better understanding than I can explain. Hope this helps. Roger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Trouble Downloading Files
Richard Lynch responded Monday, August 26, 2002 3:28 PM to Roger Lewis >I'm not certain this is the right place to ask, but here goes. For security > >reasons I have placed certain document files in a directory outside my web > >root. There are many types of files included (e.g. jpg, gif, txt, pdf, xls, > >doc, mdb, ppt, and dwg). Clicking links on my web page will download the > >files through a php script (getdocfile.php) into a new pop-up window. The > >following is how I have coded the link: > > > > >onclick="window.open('../getdocfile.php?file= >$DrawingGroups->Value("filename")?>', > >'_blank','resizable=yes,scrollbars=yes,width=700,height=500');return > >false">Value("is_viewable")?> > > > > > >Problem: The download fails with IE5.5 when trying to retrieve files other > >than jpg, gif, txt, and pdf. One of the following happens depending on > >whether or not I force the download dialog box for the file to appear: > >(Note: I force the download dialog by commenting out the appropriate mime > >types in the code below) > > IE is stupid. > > Really, really stupid. > > Not that Netscape is any smarter, or anything, but IE is really really > really stupid. > > In particular, their hack to have embedded documents in a browser and stuff > rely on the URL of the thing being downloaded and when you start crossing > that with your .php URL and JavaScript's popup windows, all hell breaks > loose, as you've noted. > > Things you *might* try: > 1. Rename the getdocfile.php to getdocfile.htm and force Apache to make it a > PHP file. > > 2. Get rid of the ?file= part, and just use > /Value('filename')?> and then use $path_info in your > getdocfile.htm script instead of $_GET['file'] > > 3. Whoops. 2. conflicts with 3. You maybe be "stuck" with something really > stupid like using: > /Value('filename')?>.htm and then > inside of getdocfile.htm you'll need to de-construct the foo_pdf.htm back > into foo.pdf to get the file you actually want. > Yes, your URLs will now look very strange, but remember how stupid IE is? > It's really stupid. > > 4. You may even need to go so far as to have the popup window have a META > tag to re-locate to the actual document you want, so that only an HTML > document is the first thing to appear in the popup window. Again, IE is > really stupid, and as soon as you cross a popup with a non-HTML document (of > certain types you have begun to discover empirically) it screws up. > > I never have figured out which/why/when IE screws up popups with non-HTML > content and don't really care cuz I hate popups... But it's a known issue, > and there's not much you can do about it other than make IE happy by > following the adage: "Don't do that." Richard, Did you see my reply to your recent response to David Buerer in "Re: set filename of file open/download"? After searching everything I could find on the subject, and hours of trying as many combinations of headers as I could think of, I got everything to work the way I wanted in "both" IE and NN. The pop-up pops up. The jpg and pdf, etc. files open in the windows. If it's an xls or some such file, the dialog asks if I want to save or open. Whatever my response, it knows the filename and behaves as requested. Hard to believe. :) I believe the key was to add: header('Cache-Control: public'); Any thoughts as to why this is needed for MSIE. Roger -- 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_gt_quota is not defined ?
php-4.2.2 Linux rh7.1 I run this on my browser ... and I get: Fatal error: Call to undefined function: imap_get_quota() in /home/httpd/vhost/home/horde/q.php on line 5 I quickly look inside php-4.2.2/ext/imap/php_imap.c and can see that the function name is there. What's wrong with *me* ? -- roger __ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Any netscape users out there?
Ctrl r worked for me -Original Message- From: Peter Janett [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 03, 2002 10:00 AM To: Robert Cummings; [EMAIL PROTECTED] Cc: Dan Ostrowski; [PHP GENERAL] Subject: Re: [PHP] Any netscape users out there? Simply hold down the control key and then push the "r" key while looking at the source code window. That will cause the page source to repost, and you will see the resulting source code. HTH, Peter Janett New Media One Web Services New Upgrades Are Now Live!!! Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1 Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25, Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43 PostgreSQL coming soon! http://www.newmediaone.net [EMAIL PROTECTED] (303)828-9882 - Original Message - From: "Robert Cummings" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: "Dan Ostrowski" <[EMAIL PROTECTED]>; "[PHP GENERAL]" <[EMAIL PROTECTED]> Sent: Tuesday, September 03, 2002 10:40 AM Subject: Re: [PHP] Any netscape users out there? > Netscape 4.xx series is notorious for caching issues. When you post data and then > try to view the source code netscape thinks it has expired and thus gone. Another > issue is when you resize the view source window, netscape reloads the page *ack*. > On my site at http://www.wocmud.org I think my no cache headers even cause netscape > to choke since I can't get page source on any of my pages in the 4.xx series. My > solution is to use Mozilla/Netscape 7 to view the source when I need to and just > use the 4.xx brokwser when I want to make sure it looks ok visually. > > HTH, > Rob. > -- - > > "Ashley M. Kirchner" wrote: > > > > Dan Ostrowski wrote: > > > > > Post data makes Netscape REFUSE to show the underlying source code! It's virtually impossible to design form handling stuff when I can't see the code that's generated when i send post data. Is this a bug and how do you fix it?? > > > > i've never seen this problem in ns, at least not with the stuff i've designed in the past. do you have a page/form somewhere we could look at? > > -- > .-. > | Robert Cummings | > :-`. > | Webdeployer - Chief PHP and Java Programmer | > :--: > | Mail : mailto:[EMAIL PROTECTED] | > | Phone : (613) 731-4046 x.109 | > :--: > | Website : http://www.webmotion.com | > | Fax : (613) 260-9545 | > `--' > > -- > 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dependent Dropdown Boxes
The Situation: I'm trying to create a pair of dynamic dropdown boxes where the options in the second box are dependent on the selection in the first box. I call the first box "categories" and the second, "subcategories". I want to store the categories and subcategories in a mysql table(s) so that a user can dynamically update them. Currently, I have a single table called categories, with columns: id, category, and subcategory. The primary code for selecting the options for the second box is in javascript. This code makes use of the following datasets for storing the various categories and subcategories. If I can get php to generate this text, then the dependent boxes will work. datasets=new Array(); datasets[0]="Category1,subCategory1_1,subCategory1_2,subCategory1_3,subCateg ory1_4".split(","); datasets[1]="Category2,subCategory2_1,subCategory2_2,subCategory2_3".split(" ,"); datasets[2]="Category3,subCategory3_1, subCategory3_2, subCategory3_3,subCategory3_4,subCategory3_5".split(","); datasets[3]="Category4,subCategory4_1,subCategory4_2,subCategory4_3,subCateg ory4_4".split(","); datasets[4]="Category5,subCategory5_1,subCategory5_2,subCategory5_3,subCateg ory5_4,subCategory5_5,subCategory5_6".split(","); etc The Problem: Using the following code I can get php to print the results, but only in a line-by-line, category/subcategory format. Of course, this is NOT what is needed. Each subcategory name should be on the same line as its associated category. datasets[$count]=\""; print "$row[1],"; print "$row[2]\""; } ?> datasets[0]="Category1,subCategory1_1 datasets[1]="Category1,subCategory1_2 datasets[2]="Category1,subCategory1_3 datasets[3]="Category1,subCategory1_4 datasets[4]="Category2,subCategory2_1 datasets[5]="Category2,subCategory2_2 etc Can someone explain how to write the php code to output the category and subcategory names from the mysql table to match the javascript format above. Thanks in advance for any help or suggestions. Roger Lewis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Dependent Dropdown Boxes
Thanks Elias, I took a look at the code and there are indeed many things to learn; however, it's all in js. I'm trying to have php write the js, but I don't know enough about arrays and manipulating their elements. Roger -Original Message- From: lallous [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 11, 2002 2:02 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: Dependent Dropdown Boxes Hi, Try to learn many things from the test code i created below: http://lgwm.org/ozone/dynatable.htm Good luck, Elias "Roger Lewis" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > The Situation: > > I'm trying to create a pair of dynamic dropdown boxes where the options in > the second box are dependent on the selection in the first box. I call the > first box "categories" and the second, "subcategories". I want to store the > categories and subcategories in a mysql table(s) so that a user can > dynamically update them. Currently, I have a single table called > categories, with columns: id, category, and subcategory. > > The primary code for selecting the options for the second box is in > javascript. This code makes use of the following datasets for storing the > various categories and subcategories. If I can get php to generate this > text, then the dependent boxes will work. > > datasets=new Array(); > datasets[0]="Category1,subCategory1_1,subCategory1_2,subCategory1_3,subCateg > ory1_4".split(","); > datasets[1]="Category2,subCategory2_1,subCategory2_2,subCategory2_3".split(" > ,"); > datasets[2]="Category3,subCategory3_1, subCategory3_2, > subCategory3_3,subCategory3_4,subCategory3_5".split(","); > datasets[3]="Category4,subCategory4_1,subCategory4_2,subCategory4_3,subCateg > ory4_4".split(","); > datasets[4]="Category5,subCategory5_1,subCategory5_2,subCategory5_3,subCateg > ory5_4,subCategory5_5,subCategory5_6".split(","); > etc. > > The Problem: > > Using the following code I can get php to print the results, but only in a > line-by-line, category/subcategory format. Of course, this is NOT what is > needed. Each subcategory name should be on the same line as its associated > category. > > $dbConnect = mysql_connect("localhost", "root", "pwd"); > mysql_select_db("new_kb",$dbConnect); > $sql = "SELECT * from categories"; > $result = mysql_query($sql); > for ($count = 1; $row = mysql_fetch_row ($result); ++$count) > { > print "datasets[$count]=\""; > print "$row[1],"; > print "$row[2]\""; > } > ?> > > > datasets[0]="Category1,subCategory1_1 > datasets[1]="Category1,subCategory1_2 > datasets[2]="Category1,subCategory1_3 > datasets[3]="Category1,subCategory1_4 > datasets[4]="Category2,subCategory2_1 > datasets[5]="Category2,subCategory2_2 > etc. > > Can someone explain how to write the php code to output the category and > subcategory names from the mysql table to match the javascript format above. > > Thanks in advance for any help or suggestions. > > Roger Lewis > > > -- 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] cookies from cgi script
Dear all, I have a cgi script that create cookie with the cookie path set to /cgi-bin/ How do I access the value of that cookie from a php-script ? I have tried $_COOKIE["cookiename"] but the value is blank. From my NS cookie manager, I know that there is value associated with that cookie. Please advise. -- roger __ Do you Yahoo!? New DSL Internet Access from SBC & Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Confirm a Deletion
I know this should be very simple, but I just don't get it. I want to delete a record from a mysql table, but prior to deleting the record I want to receive an option to confirm the deletion. On page one (kb_areas_add.php) I have a form for inputting the field (area_todelete) for the record I want to delete. The form action goes to page two (kb_areas_delete) on which I am asked to confirm the deletion. I want to be able to press the delete button to delete the record, or the cancel button to cancel the operation. The way the code is written, the record gets deleted immediately upon clicking the submit button on page one. Is there some way I can keep the script on page two from executing until after I press the confirmation button? Thanks for any suggestions. /* FORM FOR SELECTING AREA TO DELETE */ Area: /* FORM TO CONFIRM DELETION */ Confirm Deletion Are you sure you wish to delete the general area, Cancel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Confirm a Deletion
Jay Blanchard wrote: < One of two ways, an intermediary PHP page that asks "Are you sure?" while < carrying the information forward, or a JavaScript pop-up confirmation dialog < box. < HTH! < Jay < And John Holmes wrote: < Just create a middle page that stores the value of $area_todelete in a < hidden field. < < You "YES" button would submit it to the delete code you already have, < the "NO" confirmation button would send the user somewhere else, maybe < back to the choose area page. < I hope that's not too confusing. < ---John Holmes... Thanks guys. The intermediate page scheme worked. I added the hidden field like so because I couldn't get "htmlentities" to work: I appreciate the help. Roger > -Original Message- > From: Roger Lewis [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, October 01, 2002 2:51 PM > To: Php-General > Subject: [PHP] Confirm a Deletion > > I know this should be very simple, but I just don't get it. > > I want to delete a record from a mysql table, but prior to deleting the > record I want to receive an option to confirm the deletion. On page one > (kb_areas_add.php) I have a form for inputting the field (area_todelete) > for > the record I want to delete. The form action goes to page two > (kb_areas_delete) on which I am asked to confirm the deletion. I want to > be > able to press the delete button to delete the record, or the cancel button > to cancel the operation. > > The way the code is written, the record gets deleted immediately upon > clicking the submit button on page one. Is there some way I can keep the > script on page two from executing until after I press the confirmation > button? > > Thanks for any suggestions. > > > /* FORM FOR SELECTING AREA TO DELETE */ > > > > Area: > > > > /* FORM TO CONFIRM DELETION */ > > //Delete Areas and All Subjects for the Area > $host = "localhost"; > $user = "root"; > $pass = "pwd"; > $database = "new_kb"; > > // Connecting to the Database > $connect = mysql_connect($host, $user, $pass) or die("could not connect to > server"); > $db_select = mysql_select_db($database) or die("could not select the > database"); > > // Get Area ID > $sql = "SELECT id FROM kb_areas WHERE area = '$area_todelete' "; > $result = mysql_query($sql) or die("could not complete your query for Area > ID"); > $area_id = mysql_result($result, 0, "id"); > ?> > > Confirm Deletion > Are you sure you wish to delete the general area, $area_todelete?> > > > href="kb_areas_add_test.php">Cancel > > > //Delete area from kb_areas > $sql2 = "DELETE FROM kb_areas WHERE id = $area_id"; > $result2 = mysql_query($sql2) or die("couldn't complete your query to > delete > the areas"); > ?> > > //Delete subjects from kb > $sql3 = "DELETE FROM kb WHERE area_id = $area_id"; > $result3 = mysql_query($sql3) or die("couldn't complete your query to > delete > the subjects"); > ?> > > > > > -- > 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] html form array
try this (noticed that I've changed $foo to $_POST["foo"]. after all we're livin in globals off rite? ) "; for($i=0;$i"; } } else { ?> " method="post"> One Two Three -- roger --- "John W. Holmes" <[EMAIL PROTECTED]> wrote: > > dear all, > > i ran my code below on ie and it works. but when i use netscape 4.76 > under > > linux, i only get the > > message "submitted" even though i've checked some fields. > > The code is running on the same box, right? Just accessing it with > different browsers? > > > what do i need to add to make it work with netscape under linux? > > code follows: > > > > > if ($_POST["submit"]) { > > print "submitted"; > > for($i=0;$i > print "$foo[$i]"; > > } > > } > > else { > > ?> > > method=post> > > One > > Two > > Three > > > > > > Try putting quotes (") around your types, names, and values in your > input elements. Netscape may not recognize foo[] as a proper name > without the quotes and send the data incorrectly. > > ---John Holmes... > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > __ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with is_dir function
I'm having a problem with the is_dir function, or maybe I don't understand how it supposed to work. I'm using the following code to check whether or not a directory called $user_dir exists. If it exists, I am returned the proper message. But if it doesn't exist, I get the following error message that says that it doesn't exist. (I already knew that!) http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem with is_dir function
I believe the path is of the correct format. So for example, if $user_dir = /home/sites/home/users/demodocs/web/userforum/user and $user_dir exists, then is_dir($user_dir) should = 1 however, if $user_dir doesn't exist, then is_dir($user_dir) should = 0 Isn't this the correct logic? Roger -Original Message- From: Andrew Brampton [mailto:andrew@;bramp.freeserve.co.uk] Sent: Saturday, November 02, 2002 11:24 AM To: Roger Lewis; [EMAIL PROTECTED] Subject: Re: [PHP] Problem with is_dir function what values of $user_dir are you passing to is_dir? echo them out before the test, you might be sending paths which are most certainly not directories... for example: c:\windows /home/blah would be valid, but c:\windows\win.com /home/blah/myfile http://somesite/somepath ftp://someftpserver/incoming are invalid Hope this helps Andrew - Original Message ----- From: "Roger Lewis" <[EMAIL PROTECTED]> To: "Php-General" <[EMAIL PROTECTED]> Sent: Saturday, November 02, 2002 7:06 PM Subject: [PHP] Problem with is_dir function > I'm having a problem with the is_dir function, or maybe I don't understand > how it supposed to work. I'm using the following code to check whether or > not a directory called $user_dir exists. If it exists, I am returned the > proper message. But if it doesn't exist, I get the following error message > that says that it doesn't exist. (I already knew that!) > > > > > Can someone please explain what I am doing wrong here, and how to return a > usable value if the directory doesn't exist. > > > $test = is_dir($user_dir); > if($test){echo "You have a user directory. It is $user_dir";} > else{echo "Your user directory doesn't exist"; > return;} > > > Thanks a lot. > > Roger Lewis > > > > > -- > 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem with is_dir function
On Saturday, November 02, 2002 11:07 AM, I wrote * > I'm having a problem with the is_dir function, or maybe I don't understand > how it supposed to work. I'm using the following code to check whether or > not a directory called $user_dir exists. If it exists, I am returned the > proper message. But if it doesn't exist, I get the following error message > that says that it doesn't exist. (I already knew that!) > Can someone please explain what I am doing wrong here, and how to return a > usable value if the directory doesn't exist. > $test = is_dir($user_dir); > if($test){echo "You have a user directory. It is $user_dir";} > else{echo "Your user directory doesn't exist"; > return;} > Thanks a lot. > Roger Lewis This is a follow-up to my original posting. * I did not get an answer as to why is_dir does not return a "false" value; however, file_exists does the job nicely. Thanks for all the suggestions. * Roger -- 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] publishing php > mysql website on cd-rom
Personally, I like the idea of a static site. I have a dynamic, database-driven site that handles documentation for an engineering project. When the project is over, I would like to archive the entire site, including the database and all document directories, onto a static, html-only, CD. Has anyone done this? Can it be done other than by separately displaying and saving each page as an html page, and then manually creating the links? Roger Lewis On Wednesday, November 06, 2002 1:51 AM, BigDog replied To: ROBERT MCPEAK BD> That is going to be very hard to do...you might want to look at doing it BD> all static...however, what are u going to do about the database BD> connections... BD> IMHO, i would take the php site and make it static and then put it on a BD> CD-ROM...it might be out of date, however, it might be the fastest way BD> for ya. BD> Do you want them to access your site from the CD-ROM pages? BD> You could create special pages on your site that the CD-ROM pages call. BD> But that would require the user of the disc to have internet access. BD> But running PHP from a cd-rom will probably not work unless you are BD> doing some commandline cgi stuff...and i dont even want to think how BD> that would work for ya... BD> i would probably do something where static html pages pull data from BD> your site... BD> HTH... On Wed, 2002-11-06 at 16:44, ROBERT MCPEAK wrote: > My organization has a need to publish some of our web content on a CD-ROM. I'm in search of suggestions on how to publish our dynamic content (php/mysql templates) in some sort of "runtime" configuration that would let users browse the site from cd. > > What's involved with this? Is there such a thing as runtime mySQL? What would it take to serve PHP from a CD? > > Help! I don't know where to begin and am looking for advice. > > Thanks, > > Bob > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- .: B i g D o g :. -- 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] publishing php > mysql website on cd-rom
This sounds pretty good, but I know absolutely nothing about xml or xsl. Any literature, articles, links, or other resources you know of that could point me in the right direction. This would be worth researching. Roger -Original Message- From: .: B i g D o g :. [mailto:bigdog@;venticon.com] Sent: Thursday, November 07, 2002 5:15 AM To: Roger Lewis Cc: [EMAIL PROTECTED] Subject: RE: [PHP] publishing php > mysql website on cd-rom This is where xml and xsl come in handy...you could have all the pages outputed to xml format and then use xslt to transform to html. Then you could do it all on the fly, and each month create a new cd with all the html files... On Thu, 2002-11-07 at 18:29, Roger Lewis wrote: > Personally, I like the idea of a static site. I have a dynamic, > database-driven site that handles documentation for an engineering project. > When the project is over, I would like to archive the entire site, including > the database and all document directories, onto a static, html-only, CD. > Has anyone done this? Can it be done other than by separately displaying > and saving each page as an html page, and then manually creating the links? > > Roger Lewis > > > > On Wednesday, November 06, 2002 1:51 AM, BigDog replied > To: ROBERT MCPEAK > > BD> That is going to be very hard to do...you might want to look at doing it > BD> all static...however, what are u going to do about the database > BD> connections... > > BD> IMHO, i would take the php site and make it static and then put it on a > BD> CD-ROM...it might be out of date, however, it might be the fastest way > BD> for ya. > > BD> Do you want them to access your site from the CD-ROM pages? > > BD> You could create special pages on your site that the CD-ROM pages call. > BD> But that would require the user of the disc to have internet access. > > BD> But running PHP from a cd-rom will probably not work unless you are > BD> doing some commandline cgi stuff...and i dont even want to think how > BD> that would work for ya... > > BD> i would probably do something where static html pages pull data from > BD> your site... > > BD> HTH... > > > On Wed, 2002-11-06 at 16:44, ROBERT MCPEAK wrote: > > My organization has a need to publish some of our web content on a CD-ROM. > I'm in search of suggestions on how to publish our dynamic content > (php/mysql templates) in some sort of "runtime" configuration that would let > users browse the site from cd. > > > > What's involved with this? Is there such a thing as runtime mySQL? What > would it take to serve PHP from a CD? > > > > Help! I don't know where to begin and am looking for advice. > > > > Thanks, > > > > Bob > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > -- > .: B i g D o g :. > > > > -- > 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 -- .: B i g D o g :. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] regex for emoticon codes
i have something like $str = "sometext sometext [emoticon01] sometext [emoticon23] sometext"; i would like to use regex to replace those codes into: sometext sometext /images/emot/01.gif sometext /images/emot/23.gif sometext all numerics after the code "emoticon" consisted of exactly 2 digits; and they are in the range from emoticon01 to emoticon30. i have spent the whole day starring at my crt and reading manpages plus examples. i achieved nothing but sore eyes. i would GREATLY-GREATLY appreciate if someone could gimme a code snippet on how to this sorta thing. best rgds. roger __ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] regex for emoticon codes
yeeaHAH ! great. Thanks John. think i'll never regret joining the list. -- roger --- John Legg <[EMAIL PROTECTED]> wrote: > Hi Roger > > Try this: > > $str = "sometext sometext [emoticon01] sometext [emoticon23] sometext"; > > $new_str = preg_replace("/\[emoticon(\d\d)\]/", "/image/emot/\\1.gif", > $str); > > print $new_str; > > Seems to work? > > Rgds > > John > > - Original Message - > From: "Roger Thomas" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, July 08, 2002 11:41 AM > Subject: [PHP] regex for emoticon codes > > > > i have something like > > $str = "sometext sometext [emoticon01] sometext [emoticon23] sometext"; > > > > i would like to use regex to replace those codes into: > > sometext sometext /images/emot/01.gif sometext /images/emot/23.gif > sometext > > > > all numerics after the code "emoticon" consisted of exactly 2 digits; and > they > > are in the range from emoticon01 to emoticon30. > > > > i have spent the whole day starring at my crt and reading manpages plus > > examples. i achieved nothing but sore eyes. > > > > i would GREATLY-GREATLY appreciate if someone could gimme a code snippet > on how > > to this sorta thing. > > > > best rgds. > > roger > > > > > > > > __ > > Do You Yahoo!? > > Sign up for SBC Yahoo! Dial - First Month Free > > http://sbc.yahoo.com > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > __ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] caching dynamic thumbnail
just would like to confirm here whether thumbnail images that i generated dynamically with gd is cached by browsers. a) i have a html frontend to call the php script that does that thumbnail. this html file, say, view.htm contains these lines: b) the thumbnailing works perfectly. but is this thumbnail cached inside my browser. how do i find this out ? c) if the answer to question b) above is 'No', is it a good idea to generate thumbnails dynamically but PHYSICALLY writing it to disk (with extra checking of course; is the thumb previously was available, is it the desired size etc etc) please advise. -- roger __ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] 'while' not picking up on first DB record
Hello, Can anyone from the lists please tell me why this bit of code is not picking up on the first record in the database? If the 'id' I'm looking for is '1' it doesn't populate the _SESSION variables. Any 'id' greater then '1' will populate the _SESSION variables. $q = "SELECT * FROM employee"; $r = mysql_query($q); $row = mysql_fetch_array($r); while ($row = mysql_fetch_array($r)) { if ($employee == $row["id"]) { $_SESSION['dear'] = $row["last_name"]; $_SESSION['to_email'] = $row["email"]; } } Thanks, Roger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SOLVED=> 'while' not picking up on first DB record
I'm sorry for the double post. Other then letting both lists know this was solved, it won't happen again. Sorry. Thank you for the solution! I new it was simple. I've been staring at it too long. Fresh eyes always helps! Thanks again, Roger You are making the fetch twice, and not using the first fetch. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] email receipts
and please, could we turn off the "email receipt requested" before sending messages to this list??? I find them most annoying and time consuming for a list this large. Thanks, R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Logged Out of Seesion, Then use back button
Hello, I've googled to try to find an answer to this. I've also checked the php.net site. Perhaps I'm not using the correct search parameters. The only suggestion I've found is the following code: But this doesn't seem to solve my problems. My problem/question is as follows. I have an email script that works in the following steps: 1) Login (if success then "FROM" and a personal email signature are properly populated) 2) Choose specifics for the email (this populates the "TO" variable and the other "BODY" variables) 3) Then click on preview (this creates the email with all the current variables, on the screen for viewing) 4) Then send the email 5) Prompted to create another or logout (if create another, then some session variables are unset) (if logout then session is destroyed) Everything works as intended. One user, however, has created a glitch. He/she logged out and later returned to their still opened browser and used the "back" button to return to step 2 in the process. Every email they created after using the back button has the following problems: 1) The reply to address and the from address are both default server address's and not the users personal email address. 2) Their is no personal signature. Here's my questions 1) How can I prevent the use of the browser "back" button after someone logs out? 2) If, after a user has attained step 3, they use their back button to change a variables value in step 2, the new value is never saved by the session and their original entry is used in the email. How can I adjust for people using their "back" buttons during the individual steps of the script? 3) Should the header calls appear before the session_start or after? Thanks in advance, Roger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Logged Out of Seesion, Then use back button
Sorry Didier, your suggestion did not solve the problem. I appreciate the information though! I'm still having the "back" button problem in the middle of using the script. Thanks, Roger Didier McGillis wrote: http://www.php.net/manual/en/function.header.php // always modified header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // HTTP/1.1 header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); // HTTP/1.0 header("Pragma: no-cache"); ?> From: Roger Spears <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: [PHP] Logged Out of Seesion, Then use back button Date: Tue, 23 Sep 2003 11:51:40 -0400 Hello, I've googled to try to find an answer to this. I've also checked the php.net site. Perhaps I'm not using the correct search parameters. The only suggestion I've found is the following code: But this doesn't seem to solve my problems. My problem/question is as follows. I have an email script that works in the following steps: 1) Login (if success then "FROM" and a personal email signature are properly populated) 2) Choose specifics for the email (this populates the "TO" variable and the other "BODY" variables) 3) Then click on preview (this creates the email with all the current variables, on the screen for viewing) 4) Then send the email 5) Prompted to create another or logout (if create another, then some session variables are unset) (if logout then session is destroyed) Everything works as intended. One user, however, has created a glitch. He/she logged out and later returned to their still opened browser and used the "back" button to return to step 2 in the process. Every email they created after using the back button has the following problems: 1) The reply to address and the from address are both default server address's and not the users personal email address. 2) Their is no personal signature. Here's my questions 1) How can I prevent the use of the browser "back" button after someone logs out? 2) If, after a user has attained step 3, they use their back button to change a variables value in step 2, the new value is never saved by the session and their original entry is used in the email. How can I adjust for people using their "back" buttons during the individual steps of the script? 3) Should the header calls appear before the session_start or after? Thanks in advance, Roger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus -- Roger Spears Technology Project Coordinator College of Arts and Sciences Bowling Green State University 205 Administration Bldg. Bowling Green, OH 43403 419-372-2015 419-372-8548 fax "The best accelerator available for a Mac is one that causes it to go at 9.81 m/s2." (The rate at which objects fall to earth) "It would be just like programmers to shorten 'the year 2000 problem' to 'Y2K'... exactly the kind of thinking that created this situation in the first place." - Steven C. Meyer "The significant problems we face cannot be solved at the same level of thinking we were at when we created them." - Albert Einstein "If a cluttered desk is a sign of a cluttered mind, of what then, is an empty desk?" - Albert Einstein "It is well to remember that the entire universe, with one trifling exception, is composed of others." - John Andrew Holmes "The only thing more dangerous than a hardware guy with a code patch is a programmer with a soldering iron." "3 Biggest Computer Room Lies: 1) As long as you remember to 'SAVE' your input, you'll never lose any files. 2) We run the stuff through as fast as it comes in the door. 3) The new machines are in order." Murphy's Laws of Computing -- 1. When computing, whatever happens, behave as though you meant it to happen. 2. When you get to the point where you really understand your computer, it's probably obsolete. 3. The first place to look for information is in the section of the manual where you least expect to find it. 4. When the going gets tough, upgrade. 5. For every action, there is an equal and opposite malfunction. 6. To err is human... to blame your computer for your mistakes is even more human, it is downright natural. 7. He who laughs last probably made a back-up. 8. If at first you do not succeed, blame your computer. 9. A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine. 10. The number one cause of computer problems is computer solutions. 11. A computer program will always do what you tell it to do, but rarely what you want to do. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Printer Functions
Hello, I was wondering if anyone has had any level of success with printer functions. I'm trying to get the following code to work: I get the following error: "printer_open() is an undefined function". I'm guessing that the printer functions were never installed with my version of PHP?.?.?.? I'm currently running PHP Version 4.3.3 Thanks, Roger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PDFlib Page Dimensions and Word Wrap
Hello, I have read the http://us4.php.net/manual/en/ref.pdf.php and am unable to find a solution for what I'm trying to do. I've also tried googling for what I'm trying to do. No luck there either. I've also downloaded the PDFlib docs but no luck there. When using PDFlib you specify page dimensions. Why then, does it not automatically wrap words/texts/sentences to the next line? Is there something I'm missing to have PDFlib automatically do this? No matter the amount of text in the variable I'm trying to print in the pdf, it just runs off the right side of the pdf document. Thanks, Roger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PDFlib Page Dimensions and Word Wrap
Tried that. Unless I overlooked something, the PDFlib.com docs were of no help. Thanks, Roger Curt Zirzow wrote: * Thus wrote Roger Spears ([EMAIL PROTECTED]): Hello, I have read the http://us4.php.net/manual/en/ref.pdf.php and am unable to find a solution for what I'm trying to do. I've also tried googling for what I'm trying to do. No luck there either. I've also downloaded the PDFlib docs but no luck there. When using PDFlib you specify page dimensions. Why then, does it not automatically wrap words/texts/sentences to the next line? Is there something I'm missing to have PDFlib automatically do this? No matter the amount of text in the variable I'm trying to print in the pdf, it just runs off the right side of the pdf document. You might want to refer to the API documentation at: http://www.pdflib.com/ It seems that the pdflib documentation on the php site needs some work :) Curt -- Roger Spears Technology Project Coordinator College of Arts and Sciences Bowling Green State University Bowling Green, Ohio 43403 VOICE: (419) 372-2015 FAX: (419) 372-8548
[PHP] PHP Contest/Marathon at geek.org
Sorry if this is a double post or if it's already been talked about. I just found out a few moments ago that http://www.dotgeek.org/ is having a php programming contest/marathon in November. Here's the link: http://www.dotgeek.org/?q=node/view/9 Thanks, Roger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Maeler Deamon Problem with PHP-DB list
WTF does all this mean? Hi. This is the qmail-send program at pb1.pair.com. I'm afraid I wasn't able to deliver your message to the following addresses. This is a permanent error; I've given up. Sorry it didn't work out. <[EMAIL PROTECTED]>: This message is looping: it already has my Delivered-To line. (#5.4.6) Everytime I try to post to the PHP-DB list, I get this email Thanks, R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [Stats] PHP Net List: October 2003
That is funny stuff..I often wonder why no one ever cracks jokes or makes a connection... John W. Holmes wrote: John Nichel wrote: Hey, I beat John Holmes You mean you're bigger than 14 inc... err, nevermind, you're talking about something else... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] preserving blank space padding when using fgetcsv
Hello, I've been researching this for most of the day and am unable to find an answer. I'm using fgetcsv to read a comma delimited file (Microsoft Excel CSV). I'm trying to create a PHP application which will read a csv file line by line, remove the commas and preserve the padding that is in each column. That means if a column is a fixed length of 15 characters and the actual text in that column is only 5 characters long, the application will preserve the extra 10 blank spaces. I'm able to open and read the csv using fgetcsv: $handle = fopen ($filename, "r"); while ($mpt_line = fgetcsv ($handle, filesize ($filename), ",")) { Then I check each member of that array to make sure it is the proper length for that column: if (strlen($mpt_line[0])<4) { str_pad($mpt_line[0], 4, " ", STR_PAD_RIGHT); } When all of the length checks are finished I remove the commas and then print out the finished product: } $no_commas = str_replace(",", "", $mpt_line); print "aa/".$no_commas[0]."/aa"; For output all I get is the actual text and no blank space padding. Meaning that if the field contains two characters of data it should still appear 4 characters in length. I was hoping to achieve aa/hi /aa instead all I get is aa/hi/aa. Thanks, Roger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] preserving blank space padding when using fgetcsv
The first time I sent this message to the list, this is what bounced back... "Hi. This is the qmail-send program at pb1.pair.com. I'm afraid I wasn't able to deliver your message to the following addresses. This is a permanent error; I've given up. Sorry it didn't work out. <[EMAIL PROTECTED]>: This message is looping: it already has my Delivered-To line. (#5.4.6)" So I am resending it. I apologize if anyone is getting this message twice.. Hello, I've been researching this for most of the day and am unable to find an answer. I'm using fgetcsv to read a comma delimited file (Microsoft Excel CSV). I'm trying to create a PHP application which will read a csv file line by line, remove the commas and preserve the padding that is in each column. That means if a column is a fixed length of 15 characters and the actual text in that column is only 5 characters long, the application will preserve the extra 10 blank spaces. I'm able to open and read the csv using fgetcsv: $handle = fopen ($filename, "r"); while ($mpt_line = fgetcsv ($handle, filesize ($filename), ",")) { Then I check each member of that array to make sure it is the proper length for that column: if (strlen($mpt_line[0])<4) { str_pad($mpt_line[0], 4, " ", STR_PAD_RIGHT); } When all of the length checks are finished I remove the commas and then print out the finished product: } $no_commas = str_replace(",", "", $mpt_line); print "aa/".$no_commas[0]."/aa"; For output all I get is the actual text and no blank space padding. Meaning that if the field contains two characters of data it should still appear 4 characters in length. I was hoping to achieve aa/hi /aa instead all I get is aa/hi/aa. Thanks, Roger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FW: errors using iis,soap,php
-Original Message- From: Roger Schweppe [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 09, 2003 9:55 AM To: [EMAIL PROTECTED] Subject: FW: errors using iis,soap,php Hi, Arnaud Limbourg suggested that I might find an answer to the question below from someone at this e-mail address: Thanks for any help you can give me!! Roger Schweppe > I downloaded "soap-0.8rc2.tgz" and installed soap with it's > dependencies. I am using 4.3.3 php on a iis 5 windows 2000 computer. > > Now I am getting the errors below. I was wondering if I needed to do > anything different with the soap install? > > > With the Windows > version of PHP, I am under the impression that OpenSSL comes with the > precompiled binaries. These done with extensions for support of > Openssl, by enabling said extension, php_openssl.dll, in the php.ini. > Of course, before enabling said extenstion, the two dlls /libeay32.dll > /and ssleay32.dll were copied to the C:\WINNT\SYSTEM32 directory. > After > this failed, I was refered to > http://ftp.proventum.net/pub/php/win32/misc/openssl/ to install a > patch > that patches SSL support directly into php4ts.dll. Before the patch, > we > were getting: > > Warning: fsockopen(): No SSL support for this build in > C:\PHP\pear\Net\Socket.php on line 108 > > After the patch we got: > > Warning: fread(): SSL: fatal protocol error in > C:\PHP\pear\Net\Socket.php on > line 243 > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Rename generates level 2 warning but works
Hello, I have this magical script which uses rename. A visitor to the site uploads a file and I want to rename it to a timestamp. Oddly enough, the rename() function actually works, it renames the file AND then generates a level 2 warning: Error code: 2 Error message: rename() failed (No such file or directory) Why does it work AND create a warning? Here's the snippet of code: $rename = time(); $old_name = $_FILES['uploadedFile']['name']; $read_extension = explode(".", $old_name); $ext = $read_extension[1]; $new_name = $rename.".".$ext; rename($old_name, $new_name); I know I can suppress the the warning with @, but I'm more interested in WHY this warning gets generated. I'm using PHP 4.2.2 on a Linux box. Any hints or suggestions are greatly appreciated... Thanks, Roger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Rename generates level 2 warning but works
Lowell Allen wrote: Try using $HTTP_POST_FILES['uploadedFile']['name'] instead. I wasted a bunch of time yesterday with an upload script that did not recognize files when using "$_FILES", but worked fine with "$HTTP_POST_FILES" -- PHP 4.3.4 on Linux. Thank you for the suggestion. Unfortunately, it didn't resolve the issue. Still getting the warning AND the rename function works. Odd indeed... Thanks, Roger
[PHP] SOLVED: [PHP] Rename generates level 2 warning but works
Lowell Allen wrote So, I think you need to pass rename parameters that are file locations. HTH -- Lowell Allen Thank you!!! I was not in tune to what was happening. You are correct. You must pass file locations and not just file namesonce I passed the locations, the warning went away. Thanks, Roger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Not working?
Jas wrote: > I think I must be missing something but this command isn't renaming the > file specified... Pointers, tips appreciated! > > system("rename('/path/to/new.sh', '/path/to/old.$today')"); > > /to directory has permissions set to current user and is also owned by > the current user (test_user)... I can write files into the directory and > delete files form the directory using the 'unlink()' command but the > rename function I am having problems with. > Jas > remove the " from around the rename function: You have this: system("rename('/path/to/new.sh', '/path/to/old.$today')"); Try this: system(rename('/path/to/new.sh', '/path/to/old.$today')); HTH, Roger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] is ' or " different in MS-Word then ascII?
Hello, This question may border on OT... I have a web form where visitors must enter large amounts of text at one time (text area). Once submitted, the large amount of text is stored as a CLOB in an Oracle database. Some of my visitors create their text in Ms-Word and then cut and paste it into the text area and then submit the form. When I retrieve it from the database, I do a stripslahses, htmlentities and nl2br in that order to preserve the format of the submitted test. When I view this text, single or double quotes show up as little white square blocks. I've tested this out with MS-Word on a windows machine and a mac machine. Same thing happens with either OS. This only happens when they cut and paste from MS-Word into the text area. If they type text into the text area directly, everything is fine... I know I can search through their submitted text and swap out the unrecognized character and insert the proper one. I just don't know what to look for as being the unrecognized character. I've googled all over looking at ascII charts and keyboard maps. Nothing mentions MS-Word specific information though. Anyone out there dealt with this before? Thanks, R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is ' or " different in MS-Word then ascII?
Marek Kilimajer wrote: > I don't know what the character is but if you paste it into the > textarea, ord() will tell you. > I have done some further testing. I created a form with a text area. When you hit submit, it just redisplays what ever you typed. Now, using this new test script if I cut and paste from MS-Word, there is no problem. So that leads me to believe that it has something to do with either writing the CLOB onto the Oracel database or retrieving the CLOB from the Oracle database. In either of those two actions, the data is becoming corrupted of sorts I'm currently playing around with my arrangment of stripslashes, htmlentities and nl2br. Trying to arrange them either before placing onto the database or after retrieval. I'm also creating a test where I just cut and paste " into the area and use ord() to find out what it's returning... Thanks for the tip(s)! R Roger Spears wrote: Hello, This question may border on OT... I have a web form where visitors must enter large amounts of text at one time (text area). Once submitted, the large amount of text is stored as a CLOB in an Oracle database. Some of my visitors create their text in Ms-Word and then cut and paste it into the text area and then submit the form. When I retrieve it from the database, I do a stripslahses, htmlentities and nl2br in that order to preserve the format of the submitted test. When I view this text, single or double quotes show up as little white square blocks. I've tested this out with MS-Word on a windows machine and a mac machine. Same thing happens with either OS. This only happens when they cut and paste from MS-Word into the text area. If they type text into the text area directly, everything is fine... I know I can search through their submitted text and swap out the unrecognized character and insert the proper one. I just don't know what to look for as being the unrecognized character. I've googled all over looking at ascII charts and keyboard maps. Nothing mentions MS-Word specific information though. Anyone out there dealt with this before? Thanks, R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is ' or " different in MS-Word then ascII?
Marek Kilimajer wrote: > I don't know what the character is but if you paste it into the > textarea, ord() will tell you. > When I run ord(), it returns the value of 19. I'm guessing that is a hex value. And when I look that up on the ascII table, it says: 19 DC3 (Device Control 3) For some reason when it retrieves the CLOB from the database it is converting any " that were created with MS-Word into this DC3 character. Strange indeed Thanks, R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SOLVED=> is ' or " different in MS-Word then ascII?
Hello Everybody, I have found a solution and/or the root of the problem. I googled on the topic of "MS-Word" + "smart quotes". That lead me to this site: http://www.rpgtimes.net/rpgtimes/guide.php?guide=1 It seems that the default for Word is to have smart quotes to "on". When you have smart quotes "on" it replaces the ordinary straight quotes with a left specific and right specific quote. To correct this: Go into TOOLS>AUTO-CORRECT>AUTO-FORMAT>remove checkmark from "replace straight quotes with smart quotes". Also in TOOLS>AUTO-CORRECT you must remove the line in AUTO-REPLACE about replacing ... with three dots that are closer together. Once I did that, my problem was solved Thanks to all who have helped today. I appreaciate it!! BEFORE I changed these two Word settings, when writing to the database, the ord() (ordinate) value for the left quote was 147 and the right quote was 148. When being retrieved from the database, the ord() (ordinate) value for the left quote was 17 and the right quote was 19. Thanks again to everyone who offered help! Roger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SOLVED => is ' or " different in MS-Word then ascII?
Here is a real code solution instead of my original posted client solution My original problem involved text submitted via the good old fashion in a web form. If a visitor created their text in MS-Word and then cut and paste their text over to the web form and submitted, any place within their text that they used ' or " would be turned into little white boxes. After spending a day researching this problem, I realized I could just inform the visitors to turn off Smart Quotes in their word processor application. Overcome with frustration and exhaustion, I posted this to the list as SOLVED and provided my client solution. As many of you pointed out (thank you), it's not a valid solution for a large user base. And as some pointed out (thank you), it's not a solution by any means... Tom Rogers explained the problem and provided a code solution: The problem is that Microsoft uses a non standard Latin-1 code for their "smart" quotes and a lot of programs don't know what to do with them as a few are actually control codes in other languages. function clean_ms_word($text){ $crap = array( chr(0x82),chr(0x83),chr(0x84),chr(0x85),chr(0x86),chr(0x87),chr(0x88),chr(0x89), chr(0x8a),chr(0x8b),chr(0x8c),chr(0x91),chr(0x92),chr(0x93),chr(0x94),chr(0x95), chr(0x96),chr(0x97),chr(0x98),chr(0x99),chr(0x9a),chr(0x9b),chr(0x9c),chr(0x9f) ); $clean = array( '‚','ƒ','„','&ldots;','†','‡','','‰', 'Š','‹','Œ','‘','’','“','”','•', '–','—','˜','™','š','›','œ','Ÿ' ); $content = str_replace($crap,$clean,$text); return $content; } $string = chr(0x93).'Test'.chr(0x94); echo clean_ms_word($string).''; Thanks Tom! Works like a charm!! Also, thanks to everyone who offered tips, suggestions, and solutions... R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why we love Microsoft (0t) - JELLO
Another big one is Jello It's a brand if I'm not mistakenthe product is gelatin Jello brand gelatin but all forms of pudding and gelatin are sometimes referred to as Jello... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Creating Graphs
Check out Leon Atkinsons Core PHP Programming. He has a couple good examples on using pie charts and bar charts. - Original Message - From: "Mike Mike" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, April 30, 2001 11:39 AM Subject: [PHP] Creating Graphs > Hello, > I was wonder if anyone knows of a place where I can > get a good tutorial about making graphs for beginners > using php. > If so please let me know. > Thank you > --Mike > > __ > Do You Yahoo!? > Yahoo! Auctions - buy the things you want at great prices > http://auctions.yahoo.com/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] array_search
Hi, Can anybody explain why the output of this script is not found Found! Here is the script... $legalfields = array("reasonForRepair"); if (array_search("reasonForRepair", $legalfields) == TRUE) { echo "Found!"; } else { echo "not found"; } $legalfields = array("foo", "reasonForRepair"); if (array_search("reasonForRepair", $legalfields) == TRUE) { echo "Found!"; } else { echo "not found"; } ?> Thanks in advance, Roger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Popup Window Problems & Refresh
All, I am opening a popup window using the following code: My popup window then runs some PHP code and finally displays a status message with a close window button. When the close window button is clicked I need to close the popup window and refresh the parent window or alternatively (preferably) just recalling the PHP script. Here is the HTML for my popup window: The file [08lg.jpg]Has been Successfully uploaded to the SouthLondonKidz Website The action for the form is only fired if the onClick="window.close() is removed. My question is how can I close the window and refresh or reload the specified window. TIA, Roger
[PHP] Recompile PHP-4.0.6 on MandrakeLinux 8.0
How do you (re)compile PHP on Mandrake??? I need it to be a module in Apache, but --with-apache gives me the error cannot find httpd.h ( the file is not on the system) PHP works fine the way it sits, but I need mssql support and attempted to upgrade to 4.0.6 with dbx support.. but have no luck. Roger
Re: [PHP] PHP Books
On Thu, 5 Jul 2001, Bernie Kruger wrote: > Hi, > > I know this may be a previously discussed topic, but I want to be sure I get > the right books. I need a good book on intermediate PHP programming. I am > looking to buy PHP 4 Bible, but is that the best I can get? > > I looked through the list on the PHP website, but it does not rate the books > so I don't know which is best to start off with. Untill now I have used the > manual, but I need more everyday examples. I like Professional PHP Programming from WROX press. I've never read through the PHP4 Bible but I usually hear good things about the bible series books. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Downloading Images
All, I have searched high and low through the lists to find a solution to this problem but none of the suggestions appear to work for me. I have added a download button to a web-site that enables users to download images to their local drives. (I'm using a button as I want to wrap some logic round this function) I have the following (simplified code )that will be called from the web-site when the button is clicked. header("Content-type: application/octet-stream"); header( "Content-Disposition: attachment; filename=01lg.jpg"); $filename= "c:/program files/apache group/apache/kidz/gallery/download/01lg.jpg"; include($filename); The result is the SaveAs box appears and the image is being downloaded with the correct name however when I try and re-open the image i get the message invalid header. Does anyone have any ideas? Vesrions are PHP 3,IE6, Windows ME. Thanks very much in advance, Roger __ Do You Yahoo!? NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Downloading Images
Hi Dave, Thanks for you prompt response. The Image is indeed a different length, (3k as opposed to the original 9k) I originally did have an error message appended to the downloaded image but that no longer appears to be the case. However the image is definitely truncated. Any ideas why this may be happening? Please find attached downloaded image. Thanks, Roger --- David Otton <[EMAIL PROTECTED]> wrote: > On Thu, 4 Oct 2001 07:32:17 -0700 (PDT), you wrote: > > >I have added a download button to a web-site that > >enables users to download images to their local > >drives. (I'm using a button as I want to wrap some > >logic round this function) I have the following > >(simplified code )that will be called from the > >web-site when the button is clicked. > > > >header("Content-type: application/octet-stream"); > >header( "Content-Disposition: attachment; > >filename=01lg.jpg"); > >$filename= "c:/program files/apache > >group/apache/kidz/gallery/download/01lg.jpg"; > > include($filename); > > > >The result is the SaveAs box appears and the image > is > >being downloaded with the correct name however when > I > >try and re-open the image i get the message invalid > >header. Does anyone have any ideas? > > What does the downloaded file look like internally? > Open it in a hex > editor (or even just Notepad). Check the > file-lengths of the original > and copy. My guess is you're saving an error message > with a .jpeg > extension. > > djo > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > __ Do You Yahoo!? NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 <> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Upload File Path Problem
All, I am putting together a simple upload program where an HTML form calls a php script passing a file which is then used to upload. I am running this locally currently, prior to rolling out to a test server. My problem is this. The variable $filename I am passing from the form to the php script is having the path corrupted. In the php script if I echo $filename_name the file name is being passed correctly (test.txt) but when I echo the $filename variable it contains a value of \\php2 when infact the correct value should be c:\test.txt. I include below my sample code. If anyone has any ideas I would be most grateful. Thanks in advance, Roger upload.html == Upload file : Image Description : First Name : Last Name: Location: Dagenham Romford Other Age : Email Address : uploadrjb.php3 == echo "File=" . "$userfile"; echo "File=" . $userfile_name; //echo "Description=" . $description; //echo "Age= " . $age; //echo "First Name = " . $firstname; //echo "Last Name = " . $lastname; //echo "Location = ". $location; //echo "Email = ". $email; if ( isset($userfile) ) { if ( copy("c:\\" . "$userfile_name", "c:\\bollocks.txt") ) { echo("File Successfully copied"); } else { echo("Error: Failed to copy file..."); } } ?> __ Do You Yahoo!? NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] captcha lib
What's the most popular/usable captcha library that is currently available. I frequent PEAR website but couldnt find any. Pls advise. -- roger --- Sign Up for free Email at http://ureg.home.net.my/ --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php