[PHP] MySQL question
Sorry, MySQL question. Any takers? If I search for 'margaret atwood', I get results in no real structured heirachy. Any thoughts? SELECT ST,BT,AT FROM ccl_main WHERE MATCH (ST,BT,AT) AGAINST ('margaret atwood' IN BOOLEAN MODE);h1Search font color=blueccl.ccl_main/font For: font color=blueimargaret atwood/i/font - 275 record(s) found/h1 John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: MySQL question
I would have at least expected it give me 'margaret atwood' before it gives me 'margaret' and then 'atwood'. Sorry, MySQL question. Any takers? If I search for 'margaret atwood', I get results in no real structured heirachy. Any thoughts? SELECT ST,BT,AT FROM ccl_main WHERE MATCH (ST,BT,AT) AGAINST ('margaret atwood' IN BOOLEAN MODE);h1Search font color=blueccl.ccl_main/font For: font color=blueimargaret atwood/i/font - 275 record(s) found/h1 John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] OT? Getting peer reviews for an entire application
I have a netiquette question here. I haven't finished it yet (nor am I even at a prototype level) but eventually I'd like some people to review something that I'm working on. After all isn't this what open source is all about? :) However, I wasn't sure if this list would be an appropriate place to ask people to do this. I'm not really looking for people to help me accomplish task X as much as I'm looking for people to just make suggestions for general code improvement. So, where else might I find people that are willing to give general reviews of code? Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OT? Getting peer reviews for an entire application
On Wed, 23 Jun 2004 01:22:40 -0500, Jason Barnett [EMAIL PROTECTED] wrote: I have a netiquette question here. I haven't finished it yet (nor am I even at a prototype level) but eventually I'd like some people to review something that I'm working on. After all isn't this what open source is all about? :) However, I wasn't sure if this list would be an appropriate place to ask people to do this. I'm not really looking for people to help me accomplish task X as much as I'm looking for people to just make suggestions for general code improvement. So, where else might I find people that are willing to give general reviews of code? Release it on Freshmeat.net. The reviews (and bug reports) will arrive shortly. You can also do all sorts of developer networking on Sourceforge.net. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How to add carriage returns??
nl2br I think is what you wnat. http://www.php.net/manual/en/function.nl2br.php Brent Clements wrote: Ok I have a general problem. I have a textarea on an html form. Well when the user get's to the end of the textarea, it wrap's around. The problem with this is that unless they do a carriage return, the text entered into the textarea is a very long line. So when ever they submit the form, the string in the textarea is just one long line without newlines or carriage returns. How do I add linefeeds every few words? Thanks, Brent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] printing out messages while processing a file
Hi there, I am writing a backup_restore file which creates directories and picture files with different resolutions out of an original file. After each process completes I would like to print out a [ok] message, but unfortunatelly it prints those msg out only when the script is completely through and done. How can I echo out status messages? The script is run by console php. ( I also noticed that \n or br does not work for the console?!) Thank you for any help, Merlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] printing out messages while processing a file
On Wed, 23 Jun 2004 08:34:17 +0200, Merlin [EMAIL PROTECTED] wrote: I am writing a backup_restore file which creates directories and picture files with different resolutions out of an original file. After each process completes I would like to print out a [ok] message, but unfortunatelly it prints those msg out only when the script is completely through and done. How can I echo out status messages? The script is run by console php. ( I also noticed that \n or br does not work for the console?!) $stdout = fopen('php://stdout', 'w'); fwrite($stdout, status message goes here\r\n); Why would you want to print br tags in a console? The console isn't HTML aware. You probably just want \r\n as line delimiters. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: MySQL question
John Taylor-Johnston wrote: Sorry, MySQL question. Any takers? If I search for 'margaret atwood', I get results in no real structured heirachy. Any thoughts? SELECT ST,BT,AT FROM ccl_main WHERE MATCH (ST,BT,AT) AGAINST ('margaret atwood' IN BOOLEAN MODE);h1Search font color=blueccl.ccl_main/font For: font color=blueimargaret atwood/i/font - 275 record(s) found/h1 John The results from IN BOOLEAN MODE are not sorted in order of relevance, from what I can see in the docs. More info can be found at http://dev.mysql.com/doc/mysql/en/Fulltext_Boolean.html Depending on what you are trying to achieve, BOOLAEN MODE may not be what you want. David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How to add carriage returns??
Brent Clements wrote: Ok I have a general problem. I have a textarea on an html form. Well when the user get's to the end of the textarea, it wrap's around. The problem with this is that unless they do a carriage return, the text entered into the textarea is a very long line. So when ever they submit the form, the string in the textarea is just one long line without newlines or carriage returns. How do I add linefeeds every few words? Thanks, Brent set wrap=hard in the textarea. -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Benchmarking a script
Hello, I have a script I am optimizing and want to compare the before and after in speed. So I wrote a few lines to loop this script but I have a problem. In the script I'm optimizing there's some function definitions and when the script starts the second iteration it throws an error because the function already exists. How can I modify my benchmark code to make it work? This is what I have: ?php $bench_n = 1000; for($bench_i=$bench_n; --$bench_i=0; ){ ob_start(); $bench_time1 = array_sum(explode(' ', microtime())); // script start // script... // script end ** $bench_time0 += array_sum(explode(' ', microtime())) - $bench_time1; while(@ob_end_clean()); } echo 'preTot Time: ' , $bench_time0 , 'br /Loops:' , $bench_n , 'br /Avg Time: ' , ($bench_time0 / $bench_n) , '/pre'; ? Thank you very much in advance. Cristian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ISAPI vs CGI
Hi, I have a script that need to run on ISAPI module on one server and on CGI on anther server. I would like my code to be able to react differently depending on the CGI/ISAPI mode. How can I detect the running mode of PHP?? is there a $_SERVER variable or anything?? vincent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] printing out messages while processing a file
On Wednesday 23 June 2004 14:41, Greg Donald wrote: On Wed, 23 Jun 2004 08:34:17 +0200, Merlin [EMAIL PROTECTED] wrote: I am writing a backup_restore file which creates directories and picture files with different resolutions out of an original file. After each process completes I would like to print out a [ok] message, but unfortunatelly it prints those msg out only when the script is completely through and done. How can I echo out status messages? The script is run by console php. ( I also noticed that \n or br does not work for the console?!) $stdout = fopen('php://stdout', 'w'); fwrite($stdout, status message goes here\r\n); Alternatively you can set 'output_buffering = Off' in php.ini and just carry on using echo/print. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Be both a speaker of words and a doer of deeds. -- Homer */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ISAPI vs CGI
On Wednesday 23 June 2004 16:42, Vincent DUPONT wrote: I have a script that need to run on ISAPI module on one server and on CGI on anther server. I would like my code to be able to react differently depending on the CGI/ISAPI mode. How can I detect the running mode of PHP?? is there a $_SERVER variable or anything?? I don't know. But you've asked the right question. Take it a step further by doing print_r($_SERVER); on both servers and see if there's something you can use to differentiate the two. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* A man is only a man, but a good bicycle is a ride -- Murphy's Laws on Sex n50 */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Benchmarking a script
Well you could put all of your function definitions into a separate file. Then, just include the function file before you loop through the code that uses the functions. Or as an alternative you could also do: ?php if (!function_exists('name_of_function')) { function name_of_function() { // do something } } ? But this really isn't a good idea. Try to put the function definitions into a separate file if that's feasible. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] session_is_registered gets session values only after doing some output first !?
I try to check if a session is registered. This works fine if I first do some output echo abc; if (!session_is_registered('userid')) { do_something(); } else { redirect_to_somewhere(); } and I can't redirect to another page ... If I comment out the echo statement I get always false and $_SESSION is empty, but I could redirect somewhere... I tried php 4.3.1 and 4.3.7 with apache 2.0.45 both the same. On a Windows box the same program runs fine. Can anybody help? _ Frank Rust, Technische Universität, Institut für Theoretische Informatik Tel.: +49 531 391 9525Postfach 3329, D-38023 Braunschweig Fax.: +49 531 391 9529 Mühlenpfordtstr. 22-23, D-38106 Braunschweig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Benchmarking a script
Jason Barnett wrote: Well you could put all of your function definitions into a separate file. Then, just include the function file before you loop through the code that uses the functions. Or as an alternative you could also do: ?php if (!function_exists('name_of_function')) { function name_of_function() { // do something } } ? But this really isn't a good idea. Try to put the function definitions into a separate file if that's feasible. Jason Thank you Jason. The problem I'm having is that part of what I'm benchmarking is having to define the functions compared to having not to. Basically part of the speed improvement is taking big parts of the code out of functions, so I need the definitions there :/ Cristian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: session_is_registered gets session values only after doing some output first !?
Frank Rust wrote: I try to check if a session is registered. This works fine if I first do some output echo abc; if (!session_is_registered('userid')) { do_something(); } else { redirect_to_somewhere(); } and I can't redirect to another page ... If I comment out the echo statement I get always false and $_SESSION is empty, but I could redirect somewhere... I tried php 4.3.1 and 4.3.7 with apache 2.0.45 both the same. On a Windows box the same program runs fine. Can anybody help? _ Frank Rust, Technische Universität, Institut für Theoretische Informatik Tel.: +49 531 391 9525Postfach 3329, D-38023 Braunschweig Fax.: +49 531 391 9529 Mühlenpfordtstr. 22-23, D-38106 Braunschweig You ought to make sure that the session was already started before trying to work with it. Either start the session implicitly via session.auto_start = 1 in your php.ini so a session is always started automatically or explicitly start it via session_start(). As long as the session is not started the session-array ($_SESSION, HTTP_SESSION_VARS) is not set. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: I don't want to use include
Dear sirs, Actually I am using virtual server and I think I have no write to use crontab/ But this methods become to me interesting. I will try to learn more about how to use crontab and where can I find that in my virtual server? If I use include in my script, I need to wait result of included script and it takes some time because included script should connect one of the my other server and write some data there for backup reason. Actually this backup reason is not so important to slow my main script. Thats why I don't want to result of the backup writing. Jason Barnett [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Qt wrote: Dear Sirs, When I use include, my script is waiting included script results. But I just want to run another local script without wait result. Which command I should to use? Best Regards Are you hoping to set up a task as part of a batch for later processing? There are several ways you could do this. You can set up crontab / scheduled tasks to run a script every so often. Then just make sure the script has a datafile / directory that can run all of the tasks at the scheduled time. If this isn't what you're trying to do, leave a message here and give us a better idea of why you want to run the script without waiting and what you intend to do with the result of the included script. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: session_is_registered gets session values only after doing some output first !?
Frank Rust wrote: I try to check if a session is registered. This works fine if I first do some output echo abc; if (!session_is_registered('userid')) { do_something(); } else { redirect_to_somewhere(); } and I can't redirect to another page ... If I comment out the echo statement I get always false and $_SESSION is empty, but I could redirect somewhere... If memory serves, you shouldn't use the $_SESSION variables in the same script that will use session_is_registered. I just checked the online documentation and yep, that's the case. Are you trying to see if a session has been started? See this: http://www.php.net/manual/en/function.session-start.php Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Solaris - IPlanet - Initialized PHP Module frequently
Ok, i got an Backtrace bash-2.03# gdb /netscape/server4/bin/https/bin/ns-httpd core.ns-httpd.22451.5.60001.60001.1087980112 GNU gdb 6.1 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type show copying to see the conditions. There is absolutely no warranty for GDB. Type show warranty for details. This GDB was configured as sparc-sun-solaris2.8...(no debugging symbols found)... Core was generated by `ns-httpd -d /netscape/server4/https-home/config'. Program terminated with signal 11, Segmentation fault. Reading symbols ... (gdb) bt #0 0xfd74a510 in nnciunm () from /oracle/8.1.7/lib/libclntsh.so.8.0 #1 0xfd76f2e0 in nnfcmcal () from /oracle/8.1.7/lib/libclntsh.so.8.0 #2 0xfd6044b8 in nnfgsrdp () from /oracle/8.1.7/lib/libclntsh.so.8.0 #3 0xfd603200 in nnfgfrm () from /oracle/8.1.7/lib/libclntsh.so.8.0 #4 0xfd78d2b4 in nlifigbl () from /oracle/8.1.7/lib/libclntsh.so.8.0 #5 0xfd601644 in nnfgiinit () from /oracle/8.1.7/lib/libclntsh.so.8.0 #6 0xfd6012bc in nnfgiinit () from /oracle/8.1.7/lib/libclntsh.so.8.0 #7 0xfd5fe0ac in nigconcbs () from /oracle/8.1.7/lib/libclntsh.so.8.0 #8 0xfd5fee90 in nlnvmsc () from /oracle/8.1.7/lib/libclntsh.so.8.0 #9 0xfd506e58 in upicon () from /oracle/8.1.7/lib/libclntsh.so.8.0 #10 0xfd51b370 in kpuValidateSvc () from /oracle/8.1.7/lib/libclntsh.so.8.0 #11 0xfd50c14c in upinblc () from /oracle/8.1.7/lib/libclntsh.so.8.0 #12 0xfd51bdd0 in kpudtch () from /oracle/8.1.7/lib/libclntsh.so.8.0 #13 0xfd5797bc in OCILobRead () from /oracle/8.1.7/lib/libclntsh.so.8.0 #14 0xfde689f4 in _oci_open_server (dbname=0x1 Address 0x1 out of bounds, persistent=-33583640) at /php-4.3.7/ext/oci8/oci8.c:2531 #15 0xfde68fb0 in oci_do_connect (ht=3, return_value=0x1e94f00, this_ptr=0x0, return_value_used=1, tsrm_ls=0xbf95a0, persistent=0, exclusive=0) at /php-4.3.7/ext/oci8/oci8.c:2701 #16 0xfde6d5cc in zif_ocilogon (ht=3, return_value=0x1e94f00, this_ptr=0x0, return_value_used=1, tsrm_ls=0xbf95a0) at /php-4.3.7/ext/oci8/oci8.c:4340 #17 0xfdf64bb4 in execute (op_array=0x1f477a8, tsrm_ls=0xbf95a0) ---Type return to continue, or q return to quit--- at /php-4.3.7/Zend/zend_execute.c:1635 #18 0xfdf648c0 in execute (op_array=0x1eeaf08, tsrm_ls=0xbf95a0) at /php-4.3.7/Zend/zend_execute.c:1679 #19 0xfdf648c0 in execute (op_array=0x1a221e8, tsrm_ls=0xbf95a0) at /php-4.3.7/Zend/zend_execute.c:1679 #20 0xfdf648c0 in execute (op_array=0x1652358, tsrm_ls=0xbf95a0) at /php-4.3.7/Zend/zend_execute.c:1679 #21 0xfdf53700 in zend_execute_scripts (type=8, tsrm_ls=0xbf95a0, retval=0x0, file_count=3) at /php-4.3.7/Zend/zend.c:891 #22 0xfdf198e8 in php_execute_script (primary_file=0xfce31548, tsrm_ls=0xbf95a0) at /php-4.3.7/main/main.c:1731 #23 0xfdf6b8bc in php4_execute (pb=0x114770, sn=0x85e35c, rq=0x85e394) at /php-4.3.7/sapi/nsapi/nsapi.c:954 #24 0xff256dac in __0Fafunc_native_pool_wait_workPFP6GpblockP6HSessionP6HRequest_iUiP6GpblockP6HSessionP6HRequest () from /netscape/server4/bin/https/lib/libns-httpd40.so #25 0xff2563cc in __0FNfunc_exec_strP6KFuncStructP6GpblockP6HSessionP6HRequest () from /netscape/server4/bin/https/lib/libns-httpd40.so #26 0xff257364 in INTobject_execute () from /netscape/server4/bin/https/lib/libns-httpd40.so #27 0xff25bfd8 in __0FQ_perform_serviceP6HSessionP6HRequestP6Mhttpd_object () from /netscape/server4/bin/https/lib/libns-httpd40.so #28 0xff25c094 in INTservact_service () from /netscape/server4/bin/https/lib/libns-httpd40.so #29 0xff25c3ac in INTservact_handle_processed () from /netscape/server4/bin/https/lib/libns-httpd40.so #30 0xff28ac1c in __0fLHttpRequestUUnacceleratedRespondPCcPcTC () from /netscape/server4/bin/https/lib/libns-httpd40.so #31 0xff2899f8 in __0fLHttpRequestNHandleRequestP6Gnetbuf () from /netscape/server4/bin/https/lib/libns-httpd40.so #32 0xff28621c in __0fNDaemonSessionHRespondv () from /netscape/server4/bin/https/lib/libns-httpd40.so #33 0xff2860a0 in __0fNDaemonSessionKThreadMainv () from /netscape/server4/bin/https/lib/libns-httpd40.so #34 0xff285b24 in CThreadMain () from /netscape/server4/bin/https/lib/libns-httpd40.so #35 0xfef42ad8 in _pt_root () from /netscape/server4/bin/https/lib/libnspr3.so #36 0xfed2b73c in .L1240 () from /lib/libthread.so.1 #37 0xfed2b73c in .L1240 () from /lib/libthread.so.1 any Ideas ? Regards Christian Quoting [EMAIL PROTECTED]: Hi all, Produktion System: SunOS su6-5 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Fire-280R IPlanet 4.1 sp 14 gcc version 3.1 ist not possible to create a Backtrace, weve also more then one Problem i think, ok Step by Step: Our Problem: Iplanet Webserver is terminated with Signal SIGBUS und SIGSEGV watchdog is restarting it It may be a Problem with OCI8 requests and PHP but were not sure. Weve tried to reproduce the errors
[PHP] How to create doc file.
Please help me. I need create *.doc file in php script. In this file, will be data from mysql database. Is it possible ? Thanks you roman -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Parsing entities in XML attributes
Hello! I've got an XML file that has the following tag: customtext text=first linelt;br /gt;second line / I parse it with the following handler (simplified a bit): function start_tag($parser, $name, $attrs) { global $text; if($name == CUSTOMTEXT) $text = $attrs['TEXT']; // more tags here .. } When I echo $text in a HTML page, I see a linebreak - just as I intended. One of our customers has the script installed on his server and he doesn't see a linebreak but sees br / printed out. He has to write the tag like this: customtext text=first line br /second line / Now I've got two questions: 1. Which tag is correct XML? 2. What is the cause of this? I'm running the script with PHP 4.1.2 and EXPAT Version 1.95.2 Don't know what our customer has running. With best regards Gabriel Birke -- KONTOR4_Neue Medien Plathnerstraße 5 30175 Hannover Fax: +49 51184 48 98 99 mailto:[EMAIL PROTECTED] http://www.kontor4.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to create doc file.
[snip] Please help me. I need create *.doc file in php script. In this file, will be data from mysql database. Is it possible ? [/snip] http://catb.org/~esr/faqs/smart-questions.html Yes it is possible. It requires that you have COM and a way to search the internet for the answers. Google, being your friend and mine turned up this little snippet of code. ?php $word = new COM(word.application) or die(Unable to start Ms Word); $word-Visible = 0; //$contents will be the string you want to convert to a Word document $word-Documents-Add($contents); $word-Documents[1]-SaveAs(filename.doc); $word-Quit(); $word-Release(); $word = null; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: I don't want to use include
Qt wrote: Dear sirs, Actually I am using virtual server and I think I have no write to use crontab/ But this methods become to me interesting. I will try to learn more about how to use crontab and where can I find that in my virtual server? This isn't exactly a PHP issue, it's your operating system. For Linux you use crontab, for Windows you use Scheduled Tasks. Talk to your web hosting company for information on how to do this (or if it is an option). Some tips to get you started: http://www.nerc-online.com/support/www/crontab.html http://www.iopus.com/guides/winscheduler.htm Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Anybody have RLIB compiled for OS X?
Anybody have the open source report writer via PHP compiled for OS X Here is the URL http://rlib.sicompos.com/ Don Myers -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Benchmarking a script
Anguz wrote: Jason Barnett wrote: Well you could put all of your function definitions into a separate file. Then, just include the function file before you loop through the code that uses the functions. Or as an alternative you could also do: ?php if (!function_exists('name_of_function')) { function name_of_function() { // do something } } ? But this really isn't a good idea. Try to put the function definitions into a separate file if that's feasible. Jason Thank you Jason. The problem I'm having is that part of what I'm benchmarking is having to define the functions compared to having not to. Basically part of the speed improvement is taking big parts of the code out of functions, so I need the definitions there :/ Either way you will save a few microseconds, if you are lucky you will save a few milliseconds. Cristian -- Raditha Dissanayake. - http://www.raditha.com/megaupload/upload.php Sneak past the PHP file upload limits. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ISAPI vs CGI
On Wednesday 23 June 2004 05:08 am, Jason Wong wrote: On Wednesday 23 June 2004 16:42, Vincent DUPONT wrote: I have a script that need to run on ISAPI module on one server and on CGI on anther server. I would like my code to be able to react differently depending on the CGI/ISAPI mode. How can I detect the running mode of PHP?? is there a $_SERVER variable or anything?? I don't know. But you've asked the right question. Take it a step further by doing print_r($_SERVER); on both servers and see if there's something you can use to differentiate the two. You can use the function php_sapi_name(). It tells how php is connected to the webserver.. Very useful. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with creating an XML Document
Using PHP 4.3.2 I am trying to create an XML file that looks similar to the following: ?xml version=1.0 encoding=UTF-8? Server Name=pxtest01 Serical_Number0/Serical_Number Asset_Tag0/Asset_Tag ModelDL380/Model Location8th Floor/Location Cabinet2/Cabinet Application_GroupCustomer/Application_Group PurposeUpgrade/Purpose /server I get the following output: ?xml version=1.0? Server Name=pxtest01Serial_Number/Serial_Number/server Using the following code: ?php $doc = domxml_new_doc(1.0); $root = $doc-add_root(Server); $root-set_attribute(Name, pxtest01); $el = $doc-create_element(Serial_Number); $root-append_child($el); $text = $doc-create_text_node($el[00]); $el-append_child($text); print htmlentities($doc-dump_mem()); ? Can someone help me fix my code so that when I add an element I can also set some contents or a value for that element? example serial_number000/serial_number Thank you! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with creating an XML Document
[snip] Can someone help me fix my code so that when I add an element I can also set some contents or a value for that element? example serial_number000/serial_number [/snip] $doc = domxml_new_doc(1.0); $root = $doc-add_root(Server); $root-set_attribute(Name, pxtest01); $el = $doc-create_element(Serial_Number); $root-append_child($el); $el-append_child($doc-create_text_node('00')); echo pre; $xmlfile = $doc-dump_mem(); echo htmlentities($xmlfile); echo /pre; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with creating an XML Document
I think you only have to change one line of your php code: $text = $doc-create_text_node(00); instead of $text = $doc-create_text_node($el[00]); With best regards Gabriel Birke -- KONTOR4_Neue Medien Plathnerstraße 5 30175 Hannover Fax: +49 51184 48 98 99 mailto:[EMAIL PROTECTED] http://www.kontor4.de Am 23.06.2004 um 16:18 schrieb Eric L. Sammons: Using PHP 4.3.2 I am trying to create an XML file that looks similar to the following: ?xml version=1.0 encoding=UTF-8? Server Name=pxtest01 Serical_Number0/Serical_Number Asset_Tag0/Asset_Tag ModelDL380/Model Location8th Floor/Location Cabinet2/Cabinet Application_GroupCustomer/Application_Group PurposeUpgrade/Purpose /server I get the following output: ?xml version=1.0? Server Name=pxtest01Serial_Number/Serial_Number/server Using the following code: ?php $doc = domxml_new_doc(1.0); $root = $doc-add_root(Server); $root-set_attribute(Name, pxtest01); $el = $doc-create_element(Serial_Number); $root-append_child($el); $text = $doc-create_text_node($el[00]); $el-append_child($text); print htmlentities($doc-dump_mem()); ? Can someone help me fix my code so that when I add an element I can also set some contents or a value for that element? example serial_number000/serial_number Thank you! -- 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] CSV explode problem
I have a csv string. But the string also contains other strings with commas. Explode is not working with this kind of string. For example, 1,2,3,this string gets parsed , at the comma Result of explode(,,string) is 1 2 3 this string gets parsed at the comma But what I want is 1 2 3 this string gets parsed , at the comma I am not fluent with regular expressions. If anybody could help. Thanks, Vp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Trying to create and save a DOM XML file.
I have created an XML, via php, and doing a dump_mem() everything looks as expected. Now I need to have it write to a file. I have found the function DOMDocument-save(); however, when used it appears that it is unknown. I believe this may be deprecated or because I am using domxml_new_doc() to create the document. So I have: $doc-save(/tmp/test.xml); This does not work Thoughts? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: .NFO files and .PNG images
On Tue, 22 Jun 2004 12:05:02 -0400, R4bbit [EMAIL PROTECTED] wrote: can anyone please help with thist? hi, i'm having troubles converting ascii extended symbols, for exaple one of them looks like that 'Ü' in win, but in unicode, or old ibm dos extended ascii its black box. most of ascii art using this and sign like that. what id like to do is create dynamic .png image with content of some ascii file. so far i have no luck, i spent whole night and i cant find a way to convert those symbols. iny ideas? please help ;) -- Using Opera's revolutionary e-mail client: http://www.opera.com/m2/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CSV explode problem
[snip] I have a csv string. But the string also contains other strings with commas. [/snip] is the csv coming from a file? if it is try http://www.php.net/manual/en/function.fgetcsv.php if not there is some user comments on that page that might help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Trying to create and save a DOM XML file.
[snip] So I have: $doc-save(/tmp/test.xml); This does not work Thoughts? [/snip] you have this in your previous email $doc-dump_mem() . Just do this $file = $doc-dump_mem(); then write $file to a file. there is also this http://www.php.net/manual/en/function.domdocument-dump-file.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CSV explode problem
Input is a large string. We have no control over the file, so its not coming from the file. Any help with parsing a string to replace those comma in string? On Wed, 23 Jun 2004 10:12:16 -0500, Matt Matijevich [EMAIL PROTECTED] wrote: [snip] I have a csv string. But the string also contains other strings with commas. [/snip] is the csv coming from a file? if it is try http://www.php.net/manual/en/function.fgetcsv.php if not there is some user comments on that page that might help. -- 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] CSV explode problem
V Patel wrote: Input is a large string. We have no control over the file, so its not coming from the file. Any help with parsing a string to replace those comma in string? On Wed, 23 Jun 2004 10:12:16 -0500, Matt Matijevich [EMAIL PROTECTED] wrote: [snip] I have a csv string. But the string also contains other strings with commas. [/snip] is the csv coming from a file? if it is try http://www.php.net/manual/en/function.fgetcsv.php if not there is some user comments on that page that might help. I have a function to do this. I'll send it in a few minutes (once I get to work). -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CSV explode problem
Justing, I will be waiting for your response Thanks, vp On Wed, 23 Jun 2004 08:19:55 -0700, Justin Patrin [EMAIL PROTECTED] wrote: V Patel wrote: Input is a large string. We have no control over the file, so its not coming from the file. Any help with parsing a string to replace those comma in string? On Wed, 23 Jun 2004 10:12:16 -0500, Matt Matijevich [EMAIL PROTECTED] wrote: [snip] I have a csv string. But the string also contains other strings with commas. [/snip] is the csv coming from a file? if it is try http://www.php.net/manual/en/function.fgetcsv.php if not there is some user comments on that page that might help. I have a function to do this. I'll send it in a few minutes (once I get to work). -- paperCrane Justin Patrin -- 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-based XML utilities
Hey all, I've been working a lot more with XML recently and it seems like there's been a fair number of other people using XML too (based on the moderate number of XML-based problems showing up on this list). So, I thought I might build a form with PHP that helps people trying to work with XML documents. If people are interested, I'll publish the source online (not on this list). But if I'm going to do that, I need to know what features people would find most helpful for their XML development / debugging. The list of form features that seem most helpful to me: - Simple creation of xml nodes. - XML function reference. I'm thinking I will just link to PHP's online documentation here. - Full qname expansion. Some xml documents use namespaces; with this users can click on a localname and see the resolved qname. - XPath highlighting. Enter an XPath expression for your document, and the script returns the source with all matching nodes highlighted. - Validation, with syntax highlighting when an error is found. I also might do: - XSLT function reference. - Before after snapshots of an XSL transformation on a given xml document. Perhaps this would also allow the user to click on one of the xml nodes from the new document and see which transformation affected this node. By creating an html form to handle this generation, I'm hoping that myself and other people will be able to solve more of their xml problems on their own. Comments? Suggestions? Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CSV explode problem
[snip] Any help with parsing a string to replace those comma in string? [/snip] this was in the user comments on http://www.php.net/manual/en/function.fgetcsv.php function csv_split($line,$delim=',',$removeQuotes=true) { #$line: the csv line to be split #$delim: the delimiter to split by #$removeQuotes: if this is false, the quotation marks won't be removed from the fields $fields = array(); $fldCount = 0; $inQuotes = false; for ($i = 0; $i strlen($line); $i++) { if (!isset($fields[$fldCount])) $fields[$fldCount] = ; $tmp = substr($line,$i,strlen($delim)); if ($tmp === $delim !$inQuotes) { $fldCount++; $i += strlen($delim)-1; } else if ($fields[$fldCount] == $line[$i] == '' !$inQuotes) { if (!$removeQuotes) $fields[$fldCount] .= $line[$i]; $inQuotes = true; } else if ($line[$i] == '') { if ($line[$i+1] == '') { $i++; $fields[$fldCount] .= $line[$i]; } else { if (!$removeQuotes) $fields[$fldCount] .= $line[$i]; $inQuotes = false; } } else { $fields[$fldCount] .= $line[$i]; } } return $fields; } $line = '1,2,3,this string gets parsed , at the comma'; print_r(csv_split($line)); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: CSV explode problem
V Patel wrote: I have a csv string. But the string also contains other strings with commas. Explode is not working with this kind of string. For example, 1,2,3,this string gets parsed , at the comma Result of explode(,,string) is 1 2 3 this string gets parsed at the comma But what I want is 1 2 3 this string gets parsed , at the comma I am not fluent with regular expressions. If anybody could help. Thanks, Vp Here's a funciton I cooked up to deal with this: ?php /** * does a regular split, but also accounts for the deliminator to be within quoted fields * for example, if called as such: * splitQuoteFriendly(',', '0,1,2,3,I am still 3,4'); * it will return: * array(0 = '0', * 1 = '1', * 2 = '2', * 3 = '3,I am still 3', * 4 = '4'); * @param string deliminator to split by * @param string text to split * @param string text which surrounds quoted fields (defaults to ) * @return array array of fields after split */ function splitQuoteFriendly($delim, $text, $quote = '') { $strictFields = explode($delim, $text); for($sl = 0, $l = 0; $sl sizeof($strictFields); ++$sl) { $fields[$l] = $strictFields[$sl]; $numQuotes = 0; while(fmod($numQuotes += substr_count($strictFields[$sl], $quote), 2) == 1) { ++$sl; $fields[$l] .= $delim.$strictFields[$sl]; } ++$l; } return $fields; } ? Just do a splitQuoteFriendly(\n, $csv), then loop through the resulting array and do splitQuoteFriendly(',', $line). -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] OT? Getting peer reviews for an entire application
Jason Barnett mailto:[EMAIL PROTECTED] on Tuesday, June 22, 2004 11:23 PM said: I'm not really looking for people to help me accomplish task X as much as I'm looking for people to just make suggestions for general code improvement. So, where else might I find people that are willing to give general reviews of code? hmm... on top of the suggestion greg donald gave, i don't think posting to the list with such a request is A Bad Thing(TM). i'm sure some people would be willing to go through it and give their opinions. (how much the person went through would be determined by how large it is of course.) hth, chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: CSV explode problem
Thanks Justin. Works like a charm vp On Wed, 23 Jun 2004 08:48:57 -0700, Justin Patrin [EMAIL PROTECTED] wrote: V Patel wrote: I have a csv string. But the string also contains other strings with commas. Explode is not working with this kind of string. For example, 1,2,3,this string gets parsed , at the comma Result of explode(,,string) is 1 2 3 this string gets parsed at the comma But what I want is 1 2 3 this string gets parsed , at the comma I am not fluent with regular expressions. If anybody could help. Thanks, Vp Here's a funciton I cooked up to deal with this: ?php /** * does a regular split, but also accounts for the deliminator to be within quoted fields * for example, if called as such: * splitQuoteFriendly(',', '0,1,2,3,I am still 3,4'); * it will return: * array(0 = '0', * 1 = '1', * 2 = '2', * 3 = '3,I am still 3', * 4 = '4'); * @param string deliminator to split by * @param string text to split * @param string text which surrounds quoted fields (defaults to ) * @return array array of fields after split */ function splitQuoteFriendly($delim, $text, $quote = '') { $strictFields = explode($delim, $text); for($sl = 0, $l = 0; $sl sizeof($strictFields); ++$sl) { $fields[$l] = $strictFields[$sl]; $numQuotes = 0; while(fmod($numQuotes += substr_count($strictFields[$sl], $quote), 2) == 1) { ++$sl; $fields[$l] .= $delim.$strictFields[$sl]; } ++$l; } return $fields; } ? Just do a splitQuoteFriendly(\n, $csv), then loop through the resulting array and do splitQuoteFriendly(',', $line). -- paperCrane Justin Patrin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Benchmarking a script
If you have an apache webserver setup you should look into the ab, apache benchmark suite. This will give you a very good tool to benchmark your files in its correct environment without altering your code. If youre on a windows plattform and cant locate the ab.exe tool please tell me and I'll email it to you, I remember I spent some time finding it. -- -- Kim Steinhaug -- There are 10 types of people when it comes to binary numbers: those who understand them, and those who don't. -- www.steinhaug.com - www.easywebshop.no - www.webkitpro.com -- Anguz [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, I have a script I am optimizing and want to compare the before and after in speed. So I wrote a few lines to loop this script but I have a problem. In the script I'm optimizing there's some function definitions and when the script starts the second iteration it throws an error because the function already exists. How can I modify my benchmark code to make it work? This is what I have: ?php $bench_n = 1000; for($bench_i=$bench_n; --$bench_i=0; ){ ob_start(); $bench_time1 = array_sum(explode(' ', microtime())); // script start // script... // script end ** $bench_time0 += array_sum(explode(' ', microtime())) - $bench_time1; while(@ob_end_clean()); } echo 'preTot Time: ' , $bench_time0 , 'br /Loops:' , $bench_n , 'br /Avg Time: ' , ($bench_time0 / $bench_n) , '/pre'; ? Thank you very much in advance. Cristian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] bad programming?
We just moved a bunch of code from one web hosting company to another. Now, one of the pages no longer works. I have been sort of starting from scratch, and the first line is still not working. Am I using something that I shouldn't be? Here is a code snippet: if ($REQUEST_METHOD=='POST') { for(reset($HTTP_POST_VARS); $key=key($HTTP_POST_VARS); next($HTTP_POST_VARS)) { $this = addslashes($HTTP_POST_VARS[$key]); $this = strtr($this, , ); $this = strtr($this, , ); $this = strtr($this, |, ); $$key = $this; } } The part that's not working is the $REQUEST_METHOD=='POST' line. If I replace that with if ($login) (and $login is the name of the submit button on the form), it works fine. I am leary of using $login...any other suggestions? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] bad programming?
[snip] The part that's not working is the $REQUEST_METHOD=='POST' line. [/snip] try $_SERVER['REQUEST_METHOD'] instead of $REQUEST_METHOD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] bad programming?
Try: if ($_SERVER['REQUEST_METHOD'] == 'POST') and then read: http://us4.php.net/reserved.variables -Brad - Original Message - From: Amanda Hemmerich [EMAIL PROTECTED] Date: Wednesday, June 23, 2004 12:13 pm Subject: [PHP] bad programming? We just moved a bunch of code from one web hosting company to another. Now, one of the pages no longer works. I have been sort of starting from scratch, and the first line is still not working. Am I using somethingthat I shouldn't be? Here is a code snippet: if ($REQUEST_METHOD=='POST') { for(reset($HTTP_POST_VARS); $key=key($HTTP_POST_VARS); next($HTTP_POST_VARS)) { $this = addslashes($HTTP_POST_VARS[$key]); $this = strtr($this, , ); $this = strtr($this, , ); $this = strtr($this, |, ); $$key = $this; } } The part that's not working is the $REQUEST_METHOD=='POST' line. If I replace that with if ($login) (and $login is the name of the submit button on the form), it works fine. I am leary of using $login...any other suggestions? 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] Re: bad programming?
Could be something about the server environment, you could try changing to : $_SERVER[REQUEST_METHOD] Run a phpinfo() and see what variables are active on your new server. I know that IIS webservers lack alot of the variables we take for granted mostly. -- -- Kim Steinhaug -- There are 10 types of people when it comes to binary numbers: those who understand them, and those who don't. -- www.steinhaug.com - www.easywebshop.no - www.webkitpro.com -- Amanda Hemmerich [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] We just moved a bunch of code from one web hosting company to another. Now, one of the pages no longer works. I have been sort of starting from scratch, and the first line is still not working. Am I using something that I shouldn't be? Here is a code snippet: if ($REQUEST_METHOD=='POST') { for(reset($HTTP_POST_VARS); $key=key($HTTP_POST_VARS); next($HTTP_POST_VARS)) { $this = addslashes($HTTP_POST_VARS[$key]); $this = strtr($this, , ); $this = strtr($this, , ); $this = strtr($this, |, ); $$key = $this; } } The part that's not working is the $REQUEST_METHOD=='POST' line. If I replace that with if ($login) (and $login is the name of the submit button on the form), it works fine. I am leary of using $login...any other suggestions? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Php survey+database
Dear colleagues.. I am new to php and I am trying to do the following, to create a php file that may contain some kind of form or survey and the data entered may be added to a database... Here the code of the html form - html head titleSurvey/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body p strongSurvey/strong/p form action= method=post name=importance id=importance table width=605 border=0 tr td strongIs reading important? /strong/td /tr tr td yes input name=radiobutton type=radio value=radiobutton/td /tr tr td no input name=radiobutton type=radio value=radiobutton/td /tr tr td maybe input name=radiobutton type=radio value=radiobutton/td /tr tr td i don't know input name=radiobutton type=radio value=radiobutton/td /tr tr td iquest;Why? /td /tr tr td textarea name=textarea cols=85 rows=5 /textarea/td /tr /table /form br /body /html __ msc. tomas alberto ramirez.andujar webmaster - cejisoft - +53 32 26 24 51 universidad pedagogica jose marti. camaguey circunvalacion norte km 51/2 cp 74670. cuba email : [EMAIL PROTECTED] url: http://www.esicm.cu/cejisoft Este mensaje ha sido analizado por MDaemon Antivirus v2.21. Instituto Superior Pedagógico de Camaguey, Cuba. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: printing out messages while processing a file
just use the flush() method. this will send all text that is already pinted see the documentation for more info example: print hello; flush(); sleep(1000); print world; gr GB Merlin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi there, I am writing a backup_restore file which creates directories and picture files with different resolutions out of an original file. After each process completes I would like to print out a [ok] message, but unfortunatelly it prints those msg out only when the script is completely through and done. How can I echo out status messages? The script is run by console php. ( I also noticed that \n or br does not work for the console?!) Thank you for any help, Merlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Php survey+database
tommie ramirez.andujar mailto:[EMAIL PROTECTED] on Wednesday, June 23, 2004 12:31 PM said: I am new to php and I am trying to do the following, to create a php file that may contain some kind of form or survey and the data entered may be added to a database... Here the code of the html form what is it that you need help with? chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SQL Case sensitivity
I hope I don't get too chastised for a double post ( posted in .db first ), but I'm hoping someone can help me. I'm using PHP with ADOdb ( and an MS Access 2000 db ) to write a simple SQL statement but was running into some case sensitivity issues. Here's my SQL currently: SELECT autoQuesID,fldQuesTitle,fldBody FROM tblFAQ_Question WHERE fldBody LIKE '%$strSearchFor%'; All I'm trying to do is have the users search string searched for in the fldBody field. However, I'm having problems trying to get it so that the search is case-insensitive. For instance: If I search on Airline, I get 1 record. If I search on airline, I get 0 records. I make the value of $strSearchFor lower case ( using strtolower() ), but I don't know how to get it so that the contents of the fldBody field is lower case also. I can't seem to find any functions or operators that remove the case-sensitivity. However, I have tried this where clause to no avail: WHERE LCase(fldBody) LIKE '%$strSearchFor%' Any help would be much appreciated! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Form + database / PHP survey + database
On Wednesday 23 June 2004 03:32 pm, tommie ramirez.andujar wrote: Dear colleagues.. I am new to mysql and I am trying to do the following, to create a php file that may contain some kind of form or survey and the data entered may be added to a database. Here's the code of the html form Dearest Colleague, Start writing your project now. No one on this list or the PHP list is going to write this code for you. Either list will be glad to help you with problems you are having with code that you have written. Neither list is going to produce your project for you. I would suggest looking at sourceforge.net for pre-written code. Not Your Code-Monkey, Your Colleagues -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Filesize
Boy you'd think that this would be simple, but I get no filesize with the following for($i = 4; $i count($arrDirectory); $i++){ if(is_dir($arrDirectory[$i])){ if($theDir = opendir($arrDirectory[$i])){ while(($theFile = readdir($theDir)) !== FALSE){ $theSize = filesize($theFile); echo $theFile . \t . $theSize . \n; } } fclose($theDir); } } Heck, I even get some warnings... PHP Warning: filesize(): Stat failed for cw.tol.1040606180942.txt.gz (errno=2 - No such file or directory) in /usr/local/www/data.default/test/dvdArchivePackager.php on line 50 PHP Warning: filesize(): Stat failed for cw.tol.1040607181154.txt.gz (errno=2 - No such file or directory) in /usr/local/www/data.default/test/dvdArchivePackager.php on line 50 cw.acc.1040605182621.txt.gz cw.acc.1040606182502.txt.gz cw.acc.1040607182719.txt.gz cw.tol.1040519181155.txt.gz Have I gone loopy? Wait, don't answer that. Do I need to do something else to get the file size? I have read and searched, but to no avail yet. TIA! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Filesize
[snip] Have I gone loopy? Wait, don't answer that. Do I need to do something else to get the file size? I have read and searched, but to no avail yet. TIA! [/snip] Have you tried absolute path in filesize($theFile); or maybe chdir to $arrDirectory[$i] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Filesize
the file should be in he same folder as that of the php script, otherwise you have to mention the absolute/relative path Geethanandh On Wed, 23 Jun 2004 15:06:52 -0500, Jay Blanchard [EMAIL PROTECTED] wrote: Boy you'd think that this would be simple, but I get no filesize with the following for($i = 4; $i count($arrDirectory); $i++){ if(is_dir($arrDirectory[$i])){ if($theDir = opendir($arrDirectory[$i])){ while(($theFile = readdir($theDir)) !== FALSE){ $theSize = filesize($theFile); echo $theFile . \t . $theSize . \n; } } fclose($theDir); } } Heck, I even get some warnings... PHP Warning: filesize(): Stat failed for cw.tol.1040606180942.txt.gz (errno=2 - No such file or directory) in /usr/local/www/data.default/test/dvdArchivePackager.php on line 50 PHP Warning: filesize(): Stat failed for cw.tol.1040607181154.txt.gz (errno=2 - No such file or directory) in /usr/local/www/data.default/test/dvdArchivePackager.php on line 50 cw.acc.1040605182621.txt.gz cw.acc.1040606182502.txt.gz cw.acc.1040607182719.txt.gz cw.tol.1040519181155.txt.gz Have I gone loopy? Wait, don't answer that. Do I need to do something else to get the file size? I have read and searched, but to no avail yet. TIA! -- 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] Filesize
[snip] the file should be in he same folder as that of the php script, otherwise you have to mention the absolute/relative path [/snip] I have tried the absolute path, it doesn't waork. Crud. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Filesize
Jay Blanchard wrote --- napísal:: Boy you'd think that this would be simple, but I get no filesize with the following for($i = 4; $i count($arrDirectory); $i++){ if(is_dir($arrDirectory[$i])){ if($theDir = opendir($arrDirectory[$i])){ while(($theFile = readdir($theDir)) !== FALSE){ // $theSize = filesize($theFile); $theSize = filesize($arrDirectory[$i] . '/' . $theFile); echo $theFile . \t . $theSize . \n; } } fclose($theDir); } } Heck, I even get some warnings... PHP Warning: filesize(): Stat failed for cw.tol.1040606180942.txt.gz (errno=2 - No such file or directory) in /usr/local/www/data.default/test/dvdArchivePackager.php on line 50 PHP Warning: filesize(): Stat failed for cw.tol.1040607181154.txt.gz (errno=2 - No such file or directory) in /usr/local/www/data.default/test/dvdArchivePackager.php on line 50 cw.acc.1040605182621.txt.gz cw.acc.1040606182502.txt.gz cw.acc.1040607182719.txt.gz cw.tol.1040519181155.txt.gz Have I gone loopy? Wait, don't answer that. Do I need to do something else to get the file size? I have read and searched, but to no avail yet. TIA! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Filesize
while(($theFile = readdir($theDir)) !== FALSE){ != not !== On Wed, 23 Jun 2004 15:06:52 -0500, Jay Blanchard [EMAIL PROTECTED] wrote: Boy you'd think that this would be simple, but I get no filesize with the following for($i = 4; $i count($arrDirectory); $i++){ if(is_dir($arrDirectory[$i])){ if($theDir = opendir($arrDirectory[$i])){ while(($theFile = readdir($theDir)) !== FALSE){ $theSize = filesize($theFile); echo $theFile . \t . $theSize . \n; } } fclose($theDir); } } Heck, I even get some warnings... PHP Warning: filesize(): Stat failed for cw.tol.1040606180942.txt.gz (errno=2 - No such file or directory) in /usr/local/www/data.default/test/dvdArchivePackager.php on line 50 PHP Warning: filesize(): Stat failed for cw.tol.1040607181154.txt.gz (errno=2 - No such file or directory) in /usr/local/www/data.default/test/dvdArchivePackager.php on line 50 cw.acc.1040605182621.txt.gz cw.acc.1040606182502.txt.gz cw.acc.1040607182719.txt.gz cw.tol.1040519181155.txt.gz Have I gone loopy? Wait, don't answer that. Do I need to do something else to get the file size? I have read and searched, but to no avail yet. TIA! -- 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] Filesize SOLVED
[snip] Boy you'd think that this would be simple, but I get no filesize with the following [/snip] I HAVE gone loopy I was concating the directory HANDLE instead of the directory PATH...problem solved, idiot slapped in/on forehead -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Get users MAC-address of visitor
Hi! I wonder how i can retrive the MAC-address of the visitor using PHP? What i am thinking about is using the MAC-address instead of the IP-address to ban troublesome users from forums etc. If i just use the IP-address some users will just change it. I know that it´s possibly to spoof the MAC address but it´s much harder than just changing the IP-address. Do you think that there is a big speed penalty by using the MAC-address? I could just use it when the users first arrives to the site. Then he/she could be logged in using a session the rest of his visit. I could also store the MAC-address of the user in encoded form in a cookie so that i won´t have to retrive the MAC-address the hard way on every visit. Comments and tips would be greatly appreciated! Yours supersinerely, Yngve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Get users MAC-address of visitor
I don't think you can get that information. The packet at the MAC level is encpasulating the IP datagram. When the datagram is passed along to another network (e.g. through a router), another MAC packet is constructed, and the payload (datagram) of the original MAC packet is placed into the new MAC packet. At that point, the original MAC address is lost. cheers, Travis Yngve wrote: Hi! I wonder how i can retrive the MAC-address of the visitor using PHP? What i am thinking about is using the MAC-address instead of the IP-address to ban troublesome users from forums etc. If i just use the IP-address some users will just change it. I know that it´s possibly to spoof the MAC address but it´s much harder than just changing the IP-address. Do you think that there is a big speed penalty by using the MAC-address? I could just use it when the users first arrives to the site. Then he/she could be logged in using a session the rest of his visit. I could also store the MAC-address of the user in encoded form in a cookie so that i won´t have to retrive the MAC-address the hard way on every visit. Comments and tips would be greatly appreciated! Yours supersinerely, Yngve -- Travis Low mailto:[EMAIL PROTECTED] http://www.dawnstar.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Filesize
On Wed, 23 Jun 2004 16:30:59 -0400, Geethanandh Kandasamy [EMAIL PROTECTED] wrote: while(($theFile = readdir($theDir)) !== FALSE){ != not !== !== is correct, check the manual. If you had a directory named 0, != false would be false. -- paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Get users MAC-address of visitor
Yngve wrote --- napsal:: Hi! I wonder how i can retrive the MAC-address of the visitor using PHP? What i am thinking about is using the MAC-address instead of the IP-address to ban troublesome users from forums etc. If i just use the IP-address some users will just change it. I know that its possibly to spoof the MAC address but its much harder than just changing the IP-address. Do you think that there is a big speed penalty by using the MAC-address? I could just use it when the users first arrives to the site. Then he/she could be logged in using a session the rest of his visit. I could also store the MAC-address of the user in encoded form in a cookie so that i wont have to retrive the MAC-address the hard way on every visit. Comments and tips would be greatly appreciated! Yours supersinerely, Yngve You can get it only if the visitor is from your LAN. Execute arp program if that's true. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] issue with inheriting private property from abstract class in php5rc3
if anyone can, would you please explain why the below code does what it does? I would expect $this-test in TestInstance to refer to the inherited $test from Test. Using php5RC3. Thanks. ?php abstract class Test { private $test; abstract public function addToTest($i); } class TestInstance extends Test { public function __construct() { $this-test = 0; } public function addToTest($i) { $this-test += $i; } } $t = new TestInstance(); $t-addToTest(3); var_dump($t); // test var SHOULD be private echo private test (shouldn't be able to access it directly, but i can): .$t-test.\n\n; /* output --- object(TestInstance)#1 (2) { [test:private]= NULL [test]= int(3) } private test (shouldn't be able to access it directly, but i can): 3 */ ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Get users MAC-address of visitor
[snip] What i am thinking about is using the MAC-address instead of the IP-address to ban troublesome users from forums etc. [/snip] Do you make people login? If you do couldn't you just flag troublesome users and not allow them to login. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MHTML in email
Hi! I need to attach a file extension .mhtml in function mail, but i too need view the content from the body of e-mail.That is everything! Regards, Juan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MHTML in email
You could just put the file contents in the body and set its content-type to text/html. On Wed, 23 Jun 2004 18:15:03 -0300 (ART), Juan Pablo Herrera [EMAIL PROTECTED] wrote: Hi! I need to attach a file extension .mhtml in function mail, but i too need view the content from the body of e-mail.That is everything! Regards, Juan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- -- paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] issue with inheriting private property from abstract class in php5rc3
Do you have E_STRICT turned on? If not, I believe PHP5 lets you access private / protected vars wherever you want. On Wed, 23 Jun 2004 13:40:48 -0400, Chris [EMAIL PROTECTED] wrote: if anyone can, would you please explain why the below code does what it does? I would expect $this-test in TestInstance to refer to the inherited $test from Test. Using php5RC3. Thanks. ?php abstract class Test { private $test; abstract public function addToTest($i); } class TestInstance extends Test { public function __construct() { $this-test = 0; } public function addToTest($i) { $this-test += $i; } } $t = new TestInstance(); $t-addToTest(3); var_dump($t); // test var SHOULD be private echo private test (shouldn't be able to access it directly, but i can): .$t-test.\n\n; /* output --- object(TestInstance)#1 (2) { [test:private]= NULL [test]= int(3) } private test (shouldn't be able to access it directly, but i can): 3 */ ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] issue with inheriting private property from abstract class in php5rc3
Chris wrote --- napísal:: if anyone can, would you please explain why the below code does what it does? I would expect $this-test in TestInstance to refer to the inherited $test from Test. Using php5RC3. Thanks. ?php abstract class Test { private $test; abstract public function addToTest($i); } class TestInstance extends Test { public function __construct() { $this-test = 0; } public function addToTest($i) { $this-test += $i; } } $t = new TestInstance(); $t-addToTest(3); var_dump($t); // test var SHOULD be private echo private test (shouldn't be able to access it directly, but i can): .$t-test.\n\n; /* output --- object(TestInstance)#1 (2) { [test:private]= NULL [test]= int(3) } private test (shouldn't be able to access it directly, but i can): 3 */ ? The variable is private for Test, so TestInstance does not have access to it. By assigning 0 to $this-test in the constructor of TestInstance, you create a new property of TestInstance that is public (the default). var_dump() shows it clearly: object(TestInstance)#1 (2) { [test:private]= NULL belongs to Test [test]= int(3) belongs to TestInstance } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP+GD on FreeBSD 5.1
I have been having an extremely difficult getting PHP installed with GD support on a FreeBSD 5.1 system. While I can get the default GD package installed, I can't seem to get it installed with JPEG support. Does anyone know of any good tutorials or instructions for people with basic general knowledge of FreeBSD? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] attach ICO [icon] files to a file thru php
is it possible to attach a custom icon [like an ICO file on the server] to a file thru php ? I want to automatically generate a generic text file [ which is XML that launches a Quicktime Movie] that has a custom icon attached to it... then, I want to automatically send that newly created file in an email...with a user id code for verification the php used to generate the text file [minus the icon] would be something like: ?php $buffer = '?xml version=1.0?' . \n . '?quicktime type=application/x-quicktime-media-link?' . \n . 'embed src=newly_generated_quicktime_movie autoplay=true moviename=id'.$_GET['user_id_generated_from_mysql_db'].'/id /'; Header('Content-Type: application/x-quicktimeplayer'); Header('Content-Length: '.strlen($buffer)); Header('Content-disposition: inline; filename=theMovie.qtl'); print $buffer; ? is this possible? g -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: I don't want to use include
If calling the backup function can wait till after your output is generated, then you can echo/print the output call flush(); and then call the backup routine. Then the backup won't apper to be slowing down as it is running after the output is send to the user. brgds QT sagde: Dear sirs, Actually I am using virtual server and I think I have no write to use crontab/ But this methods become to me interesting. I will try to learn more about how to use crontab and where can I find that in my virtual server? If I use include in my script, I need to wait result of included script and it takes some time because included script should connect one of the my other server and write some data there for backup reason. Actually this backup reason is not so important to slow my main script. Thats why I don't want to result of the backup writing. Jason Barnett [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Qt wrote: Dear Sirs, When I use include, my script is waiting included script results. But I just want to run another local script without wait result. Which command I should to use? Best Regards Are you hoping to set up a task as part of a batch for later processing? There are several ways you could do this. You can set up crontab / scheduled tasks to run a script every so often. Then just make sure the script has a datafile / directory that can run all of the tasks at the scheduled time. If this isn't what you're trying to do, leave a message here and give us a better idea of why you want to run the script without waiting and what you intend to do with the result of the included script. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: MHTML in email
Hello, On 06/23/2004 06:15 PM, Juan Pablo Herrera wrote: I need to attach a file extension .mhtml in function mail, but i too need view the content from the body of e-mail.That is everything! MHTML messages are just HTML messages with alternative plain text version in the same body. You may want to take a look at this class that lets you compose MHTML messages easily: http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] issue with inheriting private property from abstract class
ok, i understand now that private members are NOT inherited. i guess it was just throwing me off that var_dump()/print_r() display the parents private member, even tho its not really a member of the subclass. thanks Marek Kilimajer wrote: Chris wrote --- napísal:: if anyone can, would you please explain why the below code does what it does? I would expect $this-test in TestInstance to refer to the inherited $test from Test. Using php5RC3. Thanks. ?php abstract class Test { private $test; abstract public function addToTest($i); } class TestInstance extends Test { public function __construct() { $this-test = 0; } public function addToTest($i) { $this-test += $i; } } $t = new TestInstance(); $t-addToTest(3); var_dump($t); // test var SHOULD be private echo private test (shouldn't be able to access it directly, but i can): .$t-test.\n\n; /* output --- object(TestInstance)#1 (2) { [test:private]= NULL [test]= int(3) } private test (shouldn't be able to access it directly, but i can): 3 */ ? The variable is private for Test, so TestInstance does not have access to it. By assigning 0 to $this-test in the constructor of TestInstance, you create a new property of TestInstance that is public (the default). var_dump() shows it clearly: object(TestInstance)#1 (2) { [test:private]= NULL belongs to Test [test]= int(3) belongs to TestInstance } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] issue with inheriting private property from abstract class
It's still a member, it just can't be accessed by the sub-class's methods. If you call the parent's methods or a method in the parent is called that isn't defined in the subclass, the private property is still there are still used as normal. On Wed, 23 Jun 2004 18:35:14 -0400, Chris [EMAIL PROTECTED] wrote: ok, i understand now that private members are NOT inherited. i guess it was just throwing me off that var_dump()/print_r() display the parents private member, even tho its not really a member of the subclass. thanks Marek Kilimajer wrote: Chris wrote --- napísal:: if anyone can, would you please explain why the below code does what it does? I would expect $this-test in TestInstance to refer to the inherited $test from Test. Using php5RC3. Thanks. ?php abstract class Test { private $test; abstract public function addToTest($i); } class TestInstance extends Test { public function __construct() { $this-test = 0; } public function addToTest($i) { $this-test += $i; } } $t = new TestInstance(); $t-addToTest(3); var_dump($t); // test var SHOULD be private echo private test (shouldn't be able to access it directly, but i can): .$t-test.\n\n; /* output --- object(TestInstance)#1 (2) { [test:private]= NULL [test]= int(3) } private test (shouldn't be able to access it directly, but i can): 3 */ ? The variable is private for Test, so TestInstance does not have access to it. By assigning 0 to $this-test in the constructor of TestInstance, you create a new property of TestInstance that is public (the default). var_dump() shows it clearly: object(TestInstance)#1 (2) { [test:private]= NULL belongs to Test [test]= int(3) belongs to TestInstance } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Php newbe need help with a script
Hi There! I only used php and never did any scripts in the last time by my self. Now i searched a script but its so frustrated - i didnt had found anything that i can use for my needs. I want to get a script that can do the following: If a user visits my Website - the visitor should get send to a rendom url from a link list. Example .../myscript?=page1 should open a url .../myscript?=page2 an other one and so on. There are a lot of scripts for it i know but i want that the users only see a page one time in 24 hours (ip-block list) and on the next visit an other url. If he refresh a lot of times and all links are visited the last link should stay as standard til his IP go expired (maybe a use with a cookie can be used too). Is there anyone who can help me a bit? Thanks a lot! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] issue with inheriting private property from abstract class in php5rc3
* Thus wrote Marek Kilimajer: Chris wrote --- napísal:: if anyone can, would you please explain why the below code does what it does? I would expect $this-test in TestInstance to refer to the inherited $test from Test. Using php5RC3. Thanks. ?php abstract class Test { private $test; abstract public function addToTest($i); } class TestInstance extends Test { public function __construct() { $this-test = 0; } ... The variable is private for Test, so TestInstance does not have access to it. By assigning 0 to $this-test in the constructor of TestInstance, you create a new property of TestInstance that is public (the default). var_dump() shows it clearly: object(TestInstance)#1 (2) { [test:private]= NULL belongs to Test [test]= int(3) belongs to TestInstance } I think one could argue that that test:private shouldn't even be there. To me that test:private would imply that is TestIntance's private variable. Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Php survey+database
So what is your question. Respectfully, Ligaya Turmelle Tommie Ramirez.Andujar [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dear colleagues.. I am new to php and I am trying to do the following, to create a php file that may contain some kind of form or survey and the data entered may be added to a database... Here the code of the html form - html head titleSurvey/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body p strongSurvey/strong/p form action= method=post name=importance id=importance table width=605 border=0 tr td strongIs reading important? /strong/td /tr tr td yes input name=radiobutton type=radio value=radiobutton/td /tr tr td no input name=radiobutton type=radio value=radiobutton/td /tr tr td maybe input name=radiobutton type=radio value=radiobutton/td /tr tr td i don't know input name=radiobutton type=radio value=radiobutton/td /tr tr td iquest;Why? /td /tr tr td textarea name=textarea cols=85 rows=5 /textarea/td /tr /table /form br /body /html __ msc. tomas alberto ramirez.andujar webmaster - cejisoft - +53 32 26 24 51 universidad pedagogica jose marti. camaguey circunvalacion norte km 51/2 cp 74670. cuba email : [EMAIL PROTECTED] url: http://www.esicm.cu/cejisoft Este mensaje ha sido analizado por MDaemon Antivirus v2.21. Instituto Superior Pedagógico de Camaguey, Cuba. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Determine whether $_GET has a value
Hi, Say you have a querystring - index.php?myname=joe To determine whether myname has a value I have come to the following conclusions / shortcomings when using one of the following: ISSET = as long as the variable myname exists it's set, but there's no guarantee of a value !EMPTY = if your name = 0 (zero) then it's considered empty, for all else it seems to work STRLEN = I have found this to be the only sure way to know. Is there any other way, or should we always use a combination of ISSET and STRLEN? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Determine whether $_GET has a value
--- Terence [EMAIL PROTECTED] wrote: Say you have a querystring - index.php?myname=joe To determine whether myname has a value I have come to the following conclusions / shortcomings when using one of the following: There is an inherent problem in the varying ways that people interpret has a value. ISSET = as long as the variable myname exists it's set, but there's no guarantee of a value If it's set, it has a value. There's no guarantee as to what value, of course, but that's not what isset() is meant to tell you. It only tells you whether the variable is set. To me, the only way for a variable to be defined and not have a value is for it to be set to null: $foo = null; isset(null) returns false, so this follows what I would expect. I can see a valid argument that isset() should return true for this case (since you're setting the variable), but I don't agree with any of the arguments that say isset() returns true when it should be false. Well, I also agree with the way it handles null, but I understand the confusion with that one. !EMPTY = if your name = 0 (zero) then it's considered empty, for all else it seems to work Yes, this one is a bit weird. For integers, it makes perfect sense. For example: $foo = 0; Here, it is clear that I intend $foo to be an integer, so 0 is pretty much what I would consider empty. However, if I have a string: $foo = '0'; I may no longer consider 0 to be empty. Unfortunately, this is not what empty() will indicate, so I can understand the complaints. This is just one of those (rare, in my opinion) cases where a loosely-typed language can be tricky. STRLEN = I have found this to be the only sure way to know. It is best to decide what you really want to test for. Whether something has a value is terribly ambiguous, and thus, there is no way to test for this in a way that will satisfy everyone. It's far too open to interpretation. Just imagine what your has_a_value() function might test for (if you were to write one), and I think you'll begin to see how others might disagree with your approach. If you simply want your string to not be of zero length, strlen() is a fine test. You might want to throw a trim() in there if you don't consider whitespace by itself to count. Lastly, I think you'll find this to be a good reference: http://www.blueshoes.org/en/developer/php_cheat_sheet/ Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming Fall 2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP+GD on FreeBSD 5.1
* Thus wrote Jason Williard: I have been having an extremely difficult getting PHP installed with GD support on a FreeBSD 5.1 system. While I can get the default GD package installed, I can't seem to get it installed with JPEG support. Does anyone know of any good tutorials or instructions for people with basic general knowledge of FreeBSD? You're going to need to obtain the jpeg library, a simple pkg_add -r jpeg Will add the library, and when you configure php: ./configure --with-gd --with-jpeg-dir=/usr/local [other options] Might be wise to read this part of the handbood: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports.html Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Php survey+database
I think he wants us to tell him how to set up PHP and a database, and then write some PHP code to add survey results to the database. So, get on it! On Thu, 24 Jun 2004 13:07:28 +1000, Ligaya Turmelle [EMAIL PROTECTED] wrote: So what is your question. Respectfully, Ligaya Turmelle Tommie Ramirez.Andujar [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dear colleagues.. I am new to php and I am trying to do the following, to create a php file that may contain some kind of form or survey and the data entered may be added to a database... Here the code of the html form - html head titleSurvey/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body p strongSurvey/strong/p form action= method=post name=importance id=importance table width=605 border=0 tr td strongIs reading important? /strong/td /tr tr td yes input name=radiobutton type=radio value=radiobutton/td /tr tr td no input name=radiobutton type=radio value=radiobutton/td /tr tr td maybe input name=radiobutton type=radio value=radiobutton/td /tr tr td i don't know input name=radiobutton type=radio value=radiobutton/td /tr tr td iquest;Why? /td /tr tr td textarea name=textarea cols=85 rows=5 /textarea/td /tr /table /form br /body /html __ msc. tomas alberto ramirez.andujar webmaster - cejisoft - +53 32 26 24 51 universidad pedagogica jose marti. camaguey circunvalacion norte km 51/2 cp 74670. cuba email : [EMAIL PROTECTED] url: http://www.esicm.cu/cejisoft Este mensaje ha sido analizado por MDaemon Antivirus v2.21. Instituto Superior Pedagógico de Camaguey, Cuba. -- 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