[PHP] New on-line exchange: Yachts boats for sale or charter, holidays afloat .... 27/11/2001 07:08:52
If you have any interest in yachting, boats, sailing or holidays afloat... Visit www.yacht-search.net the new international boat yacht charter sales system - FREE OF CHARGE FOR ALL USERS... Free advertising or enquires using $1.5 Million USD (£1M) of technology! CREATING NEW MARKETS WITH SEARCH MATCH SOFTWARE FROM SEARCH PLC (Brokers / owners / charterers) (We have been given your email address as someone who may be interested in the boating business; This email is a one off but if you have no interest in yachts or shipping and would like to be 100% sure that you will never receive an email from us again please simply mail [EMAIL PROTECTED] and type remove in the subject line - we apologize for bothering you.)
[PHP] Question about Linux Rpm
Hello, I see all the ways to compile the tarball on a raq 3 for php after one installs freetype/gd and has mysql well, what about the rpm? Since I have mysql installed, after I get gd/freetype up will the rpm know what to do to incorporate them? Or would I still have to modify certain files? For those that have used linux rpm's instead of using the tarball and compiling with make, ./configure ... Thanks, just curious Joel
[PHP] Extracting data
Hi, I'm looking for a way to extract data from a single variable. I'll explain: The variable contains somthing that look like: #@data1#@data2#@data3 What I would like to do is check the data between the #@'s so I can compare data1, 2 and 3 with a another variable. The next this I would like to be able to do is count the #@'s so I can seen how many items there are in the variable. Any help would be greatly appreciated! Joeri Vankelst -- 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] Extracting data
?php $str = '#@data1#@data2#@data3#@'; $count = preg_match_all('/\#\@([\w\d]+?)(?=\#\@)/',$str,$results); var_dump($results); ? Produces : array(2) { [0]= array(3) { [0]= string(7) #@data1 [1]= string(7) #@data2 [2]= string(7) #@data3 } [1]= array(3) { [0]= string(5) data1 [1]= string(5) data2 [2]= string(5) data3 } } Best regards, Andrey Hristov IcyGEN Corporation http://www.icygen.com BALANCED SOLUTIONS - Original Message - From: Joeri Vankelst [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 27, 2001 11:27 AM Subject: [PHP] Extracting data Hi, I'm looking for a way to extract data from a single variable. I'll explain: The variable contains somthing that look like: #@data1#@data2#@data3 What I would like to do is check the data between the #@'s so I can compare data1, 2 and 3 with a another variable. The next this I would like to be able to do is count the #@'s so I can seen how many items there are in the variable. Any help would be greatly appreciated! Joeri Vankelst -- 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] Redirect
Hi, As far as I understand header(Location: next-page.php); only works on Apache. What can you do to redirect if you do not have Apache? Tx MH -- 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] set_error_handler in a class
Hi, how can i set an error handling function in a class? i have tried set_error_handler('myclass-myErrorHandler'); but it doesnt work. Any help? Regards, Holger -- 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] client ip address
Hi all How can i get client IP address thanks, Narko -- 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] XML Segmentation Fault??
Hello! This is my first post, so bare with me. I'm trying to use PHP together with some XML files to create an array of elements and values. This, looking at the examples seemed fairly reasonable. After recompiling Apache/PHP using --with-xml everything seems fine. I am using Solaris 2.6, Apache 1.3.12 and PHP 4.0.4 and I gather PHP will use Expat from this version of Apache, All fine! Now when I run any script that uses the XML parser (My script and any example ones) I seem to get a segmentation error in the Apache error log. A bit of the error log is shown below: [Tue Nov 27 10:10:26 2001] [notice] child pid 5757 exit signal Segmentation Fault (11) [Tue Nov 27 10:10:26 2001] [notice] child pid 5778 exit signal Segmentation Fault (11) [Tue Nov 27 10:12:47 2001] [notice] child pid 5780 exit signal Segmentation Fault (11) [Tue Nov 27 10:13:56 2001] [notice] child pid 5755 exit signal Segmentation Fault (11) Now, to be honest I havn't got a clue 'Segmentation Fault' is, so I can't really work out how to fix this problem. Has anybody got any ideas??? Thanks for your help! Chris -- 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] Objects and sessions
On Monday 26 November 2001 23:37, Christopher William Wesley wrote: On Mon, 26 Nov 2001, Greg Sidelinger wrote: Can someone tell me how to store a class in a session var. I want to There are several things you need to do. 1) include the class definition before you do anything 2) start the session shortly thereafter 3) register a session variable 4) create your object 5) serialize your object 6) store the serialized object (now a string) in your registered session variable Doesn't php take care of the last 2 already? As I know you don't have to serialize manually, php will do it, you just have to make sure that the class's definition is loaded before session_start is used. Arpi -- 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] Printing Reports
As a Newbe to PHP, I need to print reports. I'd like to stay away from PDF but will use it if necessary. In general, what seems to be the best way to print reports?? It would be nice when they ask for a report it would brint in the report window that allows them to select the printer, number of copies, print quality etc. Thanks for your help... Dan. -- 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] Redirect
Hi. This is HTML: meta http-equiv='Refresh' Content='2; URL=foo.html' Content=x in seconds bye On Tue, 27 Nov 2001, MindHunter wrote: Hi, As far as I understand header(Location: next-page.php); only works on Apache. What can you do to redirect if you do not have Apache? Tx MH -- 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]
Re: [PHP] client ip address
$REMOTE_ADDR PHP Manual, Predefined variables On Tue, 27 Nov 2001, narko wrote: Hi all How can i get client IP address thanks, Narko -- 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] call php with javascript
Hi, i have test.php: ? echo test; ? to call this in the html, i use SCRIPT LANGUAGE=Javascript SRC=test.php/script this works fine for IE, but is there an alternative for Netscape to do this? Tnx, Bas -- 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] more complex exec()-problem
Hi everybody, I sent this to the php.windows-group but got no answer, so I'll try again here :-) Since I'm not used to working under Windows-OSes (never really knew why, now I do..) it took me a while to get moving. I put together a small project but now I'm really stuck. Not even reading the entire internet (well most of it anyway) did help. So maybe someone can give this a short look: I need to transfer a file via net to some remote server. I need to encrypt, since I could not find a way to use something like sftp under WinNT / php I tried pscp (PuTTY Packet). Now this works fine when started manually, even when embedde in a php-script it works when I execute this script directly, however it does NOT work when I call the script via cgi-bin from Apache. I tried all those strange things with prepending something like command /c etc, nothing worked. In fact the pscp executable IS called it just vanishes in nirvana. No error, no output, no filetransfer. In Compact: - WinNT Apache 1.3.something php4.06 as cgi-exe - Dir-Structure: C-somepath-Apache-htdocs-somepath-scp-scp.php -PHP-php.exe -Tools-PuTTY-pscp.exe - a short php-script: --- ?PHP # blabla... :-) echo htmlheadtitlescp test/title/head\n; echo body\n; $pscp=C:/somepath/Tools/Putty/pscp; $user=some_user; $host=some_host; $pass=some_pass; $target_path=Deliver; $target_file=targetfile; $source_path=C:/somepath/Tools/PuTTY; $source_file=sourcefile; $connect_string=sprintf(%s -v -pw %s %s %s@%s:%s, $pscp, $pass, sprintf(%s/%s, $source_path, $source_file), $user, $host, sprintf(%s/%s, $target_path, $target_file) ); $ret_arr=array(); echo'exec($connect_string, $ret_arr, $ret_var); br'.\n; echoexec($connect_string, $ret_arr, $ret_var); br.\n; $res_var=exec($connect_string, $ret_arr, $ret_var); echo results --br\n; echo res_var: .$res_var.br\n; echo ret_var: .$ret_var.br\n; echo ret_arr: .$ret_arr.br\n; foreach ($ret_arr as $value) echo .$value.br\n; echo /body\n; echo /html\n; ? --- OK, it does not matter if I use exec, system, passthru or whatever, the effect is the same: pscp is called, works for some seconds, the server is not contacted (checked logs), the browser stops (loaded) with the result: --- exec($connect_string, $ret_arr, $ret_var); exec(C:/somepath/Tools/Putty/pscp -v -pw some_pass \ C:/somepath/Tools/PuTTY/sourcefile \ some_user@some_host:Deliver/targetfile, Array, ); results -- res_var: ret_var: 0 ret_arr: Array --- So far so good (depends actually). Now, there are two strange things: a) when executing another command (I tried 'tar xvzf somefile.tgz', yes, under WinNT) - no problem. takes a few seconds, returns a list of all extracted files in $ret_arr. Same with things like dir etc. b) when calling scp.php directly it does work: C: somepath\PHP\php C:\...\scp.php the source is copied to target, the result shows the verbosity-messages like 'login...authenticated...session...copying...'. Everything is fine. Hmmm: The tar-test shows that the arguments are ok when handed to the executable (even checked via a batch-file echoing the args). The direct call shows that pscp works and can be used from inside php. So where is the difference when apache calls php via cgi? Ok folks, I'll be glad for any hints or suggestions since being a little under pressure to get this working and I really got no clue where else to look :-( Any Ideas anybody??? Anyone wants a cookie??? Thanks in advance, Christian -- Christian Reiner Entwicklung Projekt Management ImageWare Components GmbH Berliner Freiheit 36, D - 53111 Bonn - Germany Tel: +49 - 228 - 969 85 - 37 Fax:+49 - 228 - 969 85 - 84 E-Mail: [EMAIL PROTECTED] Web:www.imageware.de ImageWare Components GmbH ist ein Beteiligungsunternehmen der T-Venture, die Corporate Venture Capital Tochter der Deutschen Telekom AG und der Bonn-Innova GmbH Co.KG Interessiert an weiteren Neuigkeiten? Klicken Sie sich durch unsere neue Homepage unter www.imageware.de -- 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] Re: call php with javascript
i have test.php: ? echo test; ? to call this in the html, i use SCRIPT LANGUAGE=Javascript SRC=test.php/script this works fine for IE, but is there an alternative for Netscape to do this? PHP is a server side programming language and it does not execute in the browser. What you are doing here is including php code fragment and telling the broswer it is Javascript. IE is forgiving about % and ignores it, but Netscape throws a Javascript error (as it should). Once again, PHP is executed on the server side. http://www.php.net Roko -- 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] Printing Reports
what type of reports ??? if you really want to print it using a common printer i suggest that you go for PDF... if your type of reports are server log reports you can use GD or ImageMagick and display it using HTML cheers, Valter Santos - Original Message - From: Dan Koken [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 27, 2001 11:00 AM Subject: [PHP] Printing Reports As a Newbe to PHP, I need to print reports. I'd like to stay away from PDF but will use it if necessary. In general, what seems to be the best way to print reports?? It would be nice when they ask for a report it would brint in the report window that allows them to select the printer, number of copies, print quality etc. Thanks for your help... Dan. -- 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] How can i start using templates
Hi all, How can i start using templates? Thanks, Narko -- 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] Printing Reports
As a Newbe to PHP, I need to print reports. I'd like to stay away from PDF but will use it if necessary. This really is becoming a faq. A search will come up with more information. Short anwer: You could write the report to the browser, use a new window if you have to. PHP=serverside and cannot print on your local printer.. I think you could create a javascript to handle the printing.. If it's from a local source like a MySQL database you could use a report generator -- seach the web.. they do exist.. www.google.com will be a good point to start. Bye, B. -- 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] How can i start using templates
First choose one from the amount of the avaible packages for templates: 1)PHPLIB templates 2)Class FastTemplate 3)Smarty Templates(written by two, one of the from Zend) 4)Write your own Regards, Andrey Hristov IcyGEN Corporation http://www.icygen.com BALANCED SOLUTIONS - Original Message - From: narko [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 27, 2001 2:46 PM Subject: [PHP] How can i start using templates Hi all, How can i start using templates? Thanks, Narko -- 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]
Re: [PHP] Printing Reports
On Tue, 27 Nov 2001, Dan Koken wrote: As a Newbe to PHP, I need to print reports. One way to do it, I think is use XML/XSL. I have never done it before though (I use PDF's myself, but would like to get away from it).. Could anyone with some real-world experience with this elaborate, please? -- Alexander Deruwe ([EMAIL PROTECTED]) AQS-CarControl -- 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] How can i start using templates
On Tue, 27 Nov 2001, narko wrote: How can i start using templates? PHPLib or Smarty come to mind. Search Google. -- Alexander Deruwe ([EMAIL PROTECTED]) AQS-CarControl -- 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] Re:
Warning Unable to process data: multipart/related; type=multipart/alternative; boundary=_ABC1234567890DEF_
Re: [PHP] Question about Linux Rpm
On Tue, 27 Nov 2001 03:11:42 EST [EMAIL PROTECTED] mentioned: Hello, I see all the ways to compile the tarball on a raq 3 for php after one installs freetype/gd and has mysql well, what about the rpm? Since I have mysql installed, after I get gd/freetype up will the rpm know what to do to incorporate them? Or would I still have to modify certain files? RPM is good if everything is installed by RPM. Otherwise, RPM won't know that you have dependencies installed, and will fail. For those that have used linux rpm's instead of using the tarball and compiling with make, ./configure ... Thanks, just curious Joel -- -=-=-=-=-=-=-=-=-=-=-=-=- Michael A. Peters http://24.5.29.77:10080/ -- 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] Printing Reports
What kind of reports? Your question is so general it can't be answered except by saying ... Send the report, to a new browser window if you wish, and then use the browser's controls to print the sucker.Why re-invent what already exists? Miles Thompson At 03:00 AM 11/27/2001 -0800, Dan Koken wrote: As a Newbe to PHP, I need to print reports. I'd like to stay away from PDF but will use it if necessary. In general, what seems to be the best way to print reports?? It would be nice when they ask for a report it would brint in the report window that allows them to select the printer, number of copies, print quality etc. Thanks for your help... Dan. -- 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]
RE: [PHP] changing a variable according to the input in a checkbox
Hi I think if you want the user to type in a number, rather use a textbox, not a checkbox ;-)) Then call the textbox phone in the form you want the user to fill in, and when submitted, the variable $phone will contain the number he typed in. Then use: $prefix = substr($phone, 0, 3); if (($prefix == 072) || ($prefix == 082)) { mail($[EMAIL PROTECTED], $subject, $message, From: $from_address\nReply-To: $to_address\nX-Mailer: PHP/ . phpversion()); } else if (($prefix == 073) || ($prefix == 083)) { mail($[EMAIL PROTECTED], $subject, $message, From: $from_address\nReply-To: $to_address\nX-Mailer: PHP/ . phpversion()); } else if ($prefix == 084) { mail($cellnum@cellc's address, $subject, $message, From: $from_address\nReply-To: $to_address\nX-Mailer: PHP/ . phpversion()); } Regards Yoan Bosch eStart Computer Services cc http://www.estart-online.co.za -Original Message- From: Rudi Ahlers [mailto:[EMAIL PROTECTED]] Sent: 26 November 2001 14:04 To: PHP General Subject: [PHP] changing a variable according to the input in a checkbox How would I be able to change a variable from the input in a checkbox? I need to write an sms script, that would be able to sms to three different providers, and I only want the use to type in the phone number. Thus, if he types in 083xx, it should goto provider 1, if he types in 082xx, it should goto provider 2, and if he types in 084xx, it should goto provider 3. I have a simple mail script, with $phone for the phone number variable, and this is the one that needs to change. Rudi Ahlers UNIX Specialist and Web Developer Bonzai Web Design - http://www.bonzai.org.za Cell: 082 926 1689 -- 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] Re: Printing Reports
There are so many reports. The system I have is a manufacturing system, and currently contains some 400 programs. Some examples of reports are: Bill of Lading with bar codes Production reports Management and analysis Labels for lab analysis with bar codes Planning reports Quality assurance Preventative maintenance work orders Warehouse Planning Billing And others Some of these are reports long, but I guess most are less than 20 pages. Most of the sites that use the system are small and usually have from 200 to 500 terminals and have systems that manage multiple printers. So they would like to direct the printed output. Like just about everyone, I'd like them to use more interactive stuff on the system. But users want their reports... HTH. Thanks again for the help. -- 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] LDAP server side sorting
Does anybody know how to call ldap_set_option in order to use server side sorting? using: $sortval={'cn', 0,1}; $ctrl1 = array(oid = 1.2.840.113556.1.4.473, value =$sortval); ldap_set_option($ds, LDAP_OPT_SERVER_CONTROLS, array($ctrl1)); reports success, but ldap_get_option() returns nothing and a subsequend ldap_search returns protocol error. I use LDAP V3 (iPlanet). Thanks Christos Sintoris -- 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] Re: ereg
I'm not sure if the ereg supports the inline greedy modifier like: .+? or .*? so: ereg(\?php.*?\?\, $html, $phpIncludes); if not use preg_match() instead... Christoph Starkmann [EMAIL PROTECTED] wrote in message B120D7EC8868D411A63D0050040EDA771118F3@XCHANGE">news:B120D7EC8868D411A63D0050040EDA771118F3@XCHANGE... As far as I can say, a simple ereg-command is always greedy, isn't it? Can you tell me how to switch greedy off? I want to find everything between the start- and end-php-tags: $phpIncludes = array(); ereg(\?php.*\?\, $html, $phpIncludes); where $html contains the entire page, containing one php-script-section at the very top and one at the very botton, and maybe some inbetween. Now the above ereg always returns me the entire site in $phpIncludes[0]; All help is appreciated, thanx a lot, cheers, Kiko - It's not a bug, it's a feature. christoph starkmann mailto:[EMAIL PROTECTED] http://www.fh-augsburg.de/~kiko ICQ: 100601600 - -- 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] Why doesn't this work? HTTP_USER_AGENT
This is interesting. I did my testing in Opera 5.05 and it fails to display the page correctly. I then opened Netscape 6.2 and it works fine. Must be a problem with Opera. I also set Opera to identify itself as Netscape and it still failed to load the page. Thanks for the assistance. Chip On Monday 26 November 2001 11:11 pm, David Robley wrote: On Tue, 27 Nov 2001 17:43, Craig Vincent wrote: snip What have I done wrong in such a simple bit of code? - htmlheadtitle/title/head body ? $browser = $HTTP_USER_AGENT; $ip = $REMOTE_ADDR ; $db = mysql_connect ( localhost , username , password ); mysql_select_db ( database , $db ); $sql = INSERT INTO table_name(ip,browser,received) VALUES('$ip','$browser',now()) ; $results = mysql_query ( $sql); ? h1Howdy/h1 /body/html /snip I copy pasted your code onto a test HTML page and modified the mysql commands to appropriately connect to my MySQL server. There was absolutely no problem with this code at all. What version of PHP are you using? Just about to do that but he saved me the effort. Any chance you created the script with DOS end of line characters?? -- 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] error handling and __LINE__
Thanks, assert() is cool, but it still reports the filename and line number of the included file with the function in which the error occurred, not the script that called the functon with illegal arguments. Or...??? Eg.: index.php: ? include_once(functions.php); // foo() is declared here foo(123); // illegal argument ? This will produce a message saying an error occurred in functions.php, but I want it to tell me that the error occurred in index.php, line 3. Because if I call foo() many times in a script, it is difficult to find out which call that failed. Is this impossible? Papp Gyozo wrote: try, assert() instead of echo()ing error messages. assert('is_object($obj)'); and write your error handler code or use mine :) or am i missing something? Papp Gyozo - [EMAIL PROTECTED] - Original Message - From: SafeV [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 4:15 PM Subject: [PHP] error handling and __LINE__ | Hi, | I wonder if there's a way to find the line number of the calling script | from a function, like the error messages PHP generates. An example: | | In an included file I have a function and want to do something similar to: | | function foo($obj) { | if (!is_object($obj)) { | echo Error: supplied argument is not an object in ; | echo __FILE__ . line . __LINE__; | } | ... | } | | But __FILE__ and __LINE__ refers to the current file, ie. the file with | the function in, and not the file where the function is called from. | The first one I can solve by using $SCRIPT_NAME, but what about the line | number??? | | | | -- | 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]
Re: [PHP] call php with javascript
I don't get what you are trying to do. Does test.php contain JavaScript that you are trying to execute? If so, then test.php should be called test.js, and should look something like this: function (blah) { var foo = blah; document.write(foo); } If test.php is a PHP document that you're trying to execute, then your main document should look like this: ? include(test.php); ? ...and it should be called something like myDocument.php. The problem is that PHP is a server-side language and you're trying to force it to execute like a browser-side language. It won't work. ?rant IE is far too forgiving of the inclusion of bad code, which is why I never recommend that it be used for testing purposes -- in my experience, developers who develop for IE or who test on IE universally create bad code, because IE just lets it happen. Use Netscape for testing your pages; if it works in Netscape, it will work in IE and Opera and Mozilla, etc. If it works in IE, it may or may not work in other browsers. ? At 03:36 AM 11/27/2001, Bas Jobsen wrote: Hi, i have test.php: ? echo test; ? to call this in the html, i use SCRIPT LANGUAGE=Javascript SRC=test.php/script this works fine for IE, but is there an alternative for Netscape to do this? Tnx, Bas -- 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] Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- 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] Why doesn't this work? HTTP_USER_AGENT
$sql = INSERT INTO table_name(ip,browser,received) VALUES('.mysql_escape_string($ip).','.mysql_escape_string($browser).',now()) ; - Original Message - From: chip [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, November 27, 2001 4:39 PM Subject: Re: [PHP] Why doesn't this work? HTTP_USER_AGENT This is interesting. I did my testing in Opera 5.05 and it fails to display the page correctly. I then opened Netscape 6.2 and it works fine. Must be a problem with Opera. I also set Opera to identify itself as Netscape and it still failed to load the page. Thanks for the assistance. Chip On Monday 26 November 2001 11:11 pm, David Robley wrote: On Tue, 27 Nov 2001 17:43, Craig Vincent wrote: snip What have I done wrong in such a simple bit of code? - htmlheadtitle/title/head body ? $browser = $HTTP_USER_AGENT; $ip = $REMOTE_ADDR ; $db = mysql_connect ( localhost , username , password ); mysql_select_db ( database , $db ); $sql = INSERT INTO table_name(ip,browser,received) VALUES('$ip','$browser',now()) ; $results = mysql_query ( $sql); ? h1Howdy/h1 /body/html /snip I copy pasted your code onto a test HTML page and modified the mysql commands to appropriately connect to my MySQL server. There was absolutely no problem with this code at all. What version of PHP are you using? Just about to do that but he saved me the effort. Any chance you created the script with DOS end of line characters?? -- 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]
RE: [PHP] Printing Reports
I do this a lot. If you want to use just the browser and server abilities without introducing the complexities of PDF/XML/XSLT and such, it is not too hard. I have done PDF, Standard Text and HTML to the browser and I have printed directly to a printer from the server using PHP. First, is the site a Corporate intranet where the server knows about all of the shared printers connected to the network? Or, is the site accessed over the internet? If it's a Corporate intranet then you can create reports and submit them to the appropriate spooler. On Unix this is easy. I'm not sure about Windows. You can gather a list of available printers and create a little form that allows the user to select which printer to send the report to. If the site is over the internet then create the report in a separate window that is divided into two frames. The top frame will consist of close and print buttons. The second will contain the report and a JavaScript function that performs the printing. The print button in the top frame, when pushed, will execute the print function in the bottom frame. The print function sets focus on the report and then executes this.print(). The print dialogue box will automatically pop up and the user can select their own printer along with number of copies, etc. If you use HTML you can even set page breaks (in IE5 anyway). Have fun, Dean -Original Message- From: Dan Koken [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 27, 2001 5:00 AM To: [EMAIL PROTECTED] Subject: [PHP] Printing Reports As a Newbe to PHP, I need to print reports. I'd like to stay away from PDF but will use it if necessary. In general, what seems to be the best way to print reports?? It would be nice when they ask for a report it would brint in the report window that allows them to select the printer, number of copies, print quality etc. Thanks for your help... Dan. -- 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]
Re: [PHP] Re: Printing Reports
So, is this a system that's being moved from workstations, a desktop interface, to a web-based interface? Do you want a web interface to select printers? Do you want tight formatting control over the report? There are big differences between a 20 pg mfg report, a bill of lading with bar code, and label for lab analysis. We're spoiled by all the top quality report generators out there, which work on the desktop. Or, using the lab analysis example, would it work like this: User brings up the page Fills in the form Presses Submit and the request gets written to the database. Confirmation comes back, displaying the submitted information with: 1. list of available printers 2. field for # of copies 3. Submit button. Here's the guess ... Click on submit, and the script makes an exec() calling the appropriate function in the application to print the report on a given printer with the selected set of parameters. Or bypasses the application altogether to have the report writer do the same thing. What about checking MSFT's BizTalk stuff? There may be some XML stuff there which does that? Regards - Miles Thompson At 06:04 AM 11/27/2001 -0800, Dan Koken wrote: There are so many reports. The system I have is a manufacturing system, and currently contains some 400 programs. Some examples of reports are: Bill of Lading with bar codes Production reports Management and analysis Labels for lab analysis with bar codes Planning reports Quality assurance Preventative maintenance work orders Warehouse Planning Billing And others Some of these are reports long, but I guess most are less than 20 pages. Most of the sites that use the system are small and usually have from 200 to 500 terminals and have systems that manage multiple printers. So they would like to direct the printed output. Like just about everyone, I'd like them to use more interactive stuff on the system. But users want their reports... HTH. Thanks again for the help. -- 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]
Re: [PHP] Printing Reports
Thanks Dean; I like your idea a lot. They happen to be internet. If you have example code on your solution it would save me some time. Thanks again... I'm gonna try it. Dan... -- 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] writing text on images
Hi all, I've stored on a db using blob fields, the content of some image file. Ayones know how to write on these image on fly w/o using the filesystem? I mean: ? $sql=SELECT file_img FROM ..; while($val=mysql_fetch_row($select)){ header(Content-type: image/jpeg); $img=$val[0]; //here I need to write on this $img ... but How can I do? ... ? many thanks in advance max -- 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] Re: Printing Reports
Well I guess it's like most applications. Every print job has it's own special requirements. For example the lab analysis report. When the manufacturing process starts on a liquid process, they request certain samples. Samples consist of lab analysis they should take and how often they should take a sample. Most samples consist of about 10 to 12 analysis and are usually taken every 20 minutes to 1/2 hr. A process may last a couple days. So if they take a sample every 1/2 hour for 2 days that's 96 samples at 10 analysis each or around 1000 lab analysis. So the system will print 96 labels with 10 bar coded analysis on it. The labels are sent to the operations area. As they take a sample they affix a label to the bottle and send it to the lab. The lab does the analysis, enters the result and wands the proper analysis bar code on the bottle. The bottle then goes to the next lab analysis area. Most lab work is automated and a dry lab such as gas chromatography and automatic absorption units. The bottle enters a conveyor, the analysis is done and the bar code scanned as it passes the scan area. The data is then sent automatically with the bar code information to the system. Since the bar code scanner can't know exactly what bar code to read a bar code to the bar code is also on the sample. This report is not as complicated as most, but it may help give you some idea of what is needed. Some reports need fairly exact font and line control and others are just text files. Thanks again for all the help.. Dan -- 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] setcookie BUG w/ IE 5.5, 6.0 Netscape!
Oh yeah, about the lifetime of the cookie - with no valid expiry time it is created as a session cookie - which is supposed to only live as long as the browser does. [opening a new independent browser window does not share the session, but window.open() calls do, as do other 'browser created from browser with session' methods, if that makes any sense, grin] -- Shane On Saturday 29 Dec 2001 6:35 pm, Kris Wilkinson wrote: Just recently I've noticed an issue with setcookie. My scripts which normall ran : setcookie (myCookie,Blah,time()+7201); Are killing the cookie immediately after you close the browser window, or access another https:// site. It appears as though the life of the cookie is actually not being set, and is based entirely around the life of the browser window which it was originally called. if you leave the window open, and attempt at access the cookie from another window, the cookie does not exist. IDEAS? PHP GODS? :) -- 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] cookies
Speaking of cookies, is there a way using session control to modify the expiration date of a cookie? I would like to add a check box in a login dialog that says remember me Thanks Urb -- 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] cookies
Hi Urb Can you not just set the cookie again [using the updated expiry date]. If I remember correctly, this should work.. -- Shane On Tuesday 27 Nov 2001 5:45 pm, Urb LeJeune wrote: Speaking of cookies, is there a way using session control to modify the expiration date of a cookie? I would like to add a check box in a login dialog that says remember me Thanks Urb -- 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] anybody can tell me how to use PEAR under windows?
I am using Foxserv v2.0 beta 3.. anybody can tell me how to install PEAR?
php-general Digest 27 Nov 2001 18:23:42 -0000 Issue 1019
php-general Digest 27 Nov 2001 18:23:42 - Issue 1019 Topics (messages 75748 through 75802): Re: Selecting databases 75748 by: Martin Towell 75749 by: Craig Vincent Why doesn't this work? HTTP_USER_AGENT 75750 by: chip 75751 by: Craig Vincent 75752 by: David Robley 75783 by: chip 75786 by: Andrey Hristov Re: Updating Timestamps 75753 by: Ben Gollmer How can I acces an environment var $SERVER_ADMIN 75754 by: Silvia Mahiques 75795 by: Papp Gyozo New on-line exchange: Yachts boats for sale or charter, holidays afloat 27/11/2001 07:08:52 75755 by: The team . yacht-search.net Question about Linux Rpm 75756 by: Joelmon2001.aol.com 75777 by: Michael A. Peters Extracting data 75757 by: Joeri Vankelst 75758 by: Andrey Hristov Redirect 75759 by: MindHunter 75765 by: mcsaba.medsite.hu set_error_handler in a class 75760 by: Holger Schopohl client ip address 75761 by: narko 75766 by: mcsaba.medsite.hu XML Segmentation Fault?? 75762 by: Chris Hemmings Re: Objects and sessions 75763 by: Tamas Arpad Printing Reports 75764 by: Dan Koken 75770 by: Valter Santos 75772 by: B. van Ouwerkerk 75774 by: Alexander Deruwe 75778 by: Miles Thompson 75780 by: Dan Koken 75787 by: Grimes, Dean 75790 by: Miles Thompson 75791 by: Dan Koken 75793 by: Dan Koken call php with javascript 75767 by: Bas Jobsen 75769 by: Roko Roic 75785 by: Richard S. Crawford more complex exec()-problem 75768 by: Christian Reiner How can i start using templates 75771 by: narko 75773 by: Andrey Hristov 75775 by: Alexander Deruwe Re: 75776 by: bradley j joyner Re: changing a variable according to the input in a checkbox 75779 by: Yoan Bosch [VDB TECH SUPPORT DEVEL] LDAP server side sorting 75781 by: Christos Sintoris Re: ereg 75782 by: lallous Re: error handling and __LINE__ 75784 by: SafeV 75796 by: Papp Gyozo Coding methods (was RE: [PHP-DB] gzip image files) 75788 by: Boget, Chris 75789 by: Jon Haworth writing text on images 75792 by: e c h o p l u s A T w o r k Need advide on partnership agreement for a php application... 75794 by: py setcookie BUG w/ IE 5.5, 6.0 Netscape! 75797 by: Kris Wilkinson 75798 by: Shane Wright 75799 by: Shane Wright cookies 75800 by: Urb LeJeune 75801 by: Shane Wright anybody can tell me how to use PEAR under windows? 75802 by: Dino Leung Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- if something like: if ($db == 1) connect to db1 else if ($db == 2) connect to db2 else if ($db == 3) connect to db3 would that do? -Original Message- From: Marts [mailto:[EMAIL PROTECTED]] Sent: Friday, November 23, 2001 11:45 AM To: [EMAIL PROTECTED] Subject: [PHP] Selecting databases Hay all, I have a script that needs to be able to choose between 3 different databases related to a pull down menu. Any ideas about what functions I should be looking at CHeers, Marty ;) -- 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] ---End Message--- ---BeginMessage--- I have a script that needs to be able to choose between 3 different databases related to a pull down menu. Any ideas about what functions I should be looking at There's really no need for a function. Most ANSI standard SQL servers will allow you to specify databases on the fly in your queries. So say you had a pulldown menu SELECT name=database OPTION value=db1Database 1/OPTION OPTION value=db2Database 2/OPTION OPTION value=db3Database 3/OPTION /SELECT With this the name of the database will be transfered to the $database variable upon the form being submitted. Then: mysql_query(SELECT * FROM $database.table_name); Will run a query on the appropriate database...of course this format is assuming that all the table names will be identical, although if you do have different table names for each database it's very easy to change that dynamically as well. Sincerely, Craig Vincent ---End Message--- ---BeginMessage--- I have this small test page, below, which returns an error - Parse error: parse error in /usr/local/apache/htdocs/test.php on line 4 on the $browser line, if I comment it out, it returns an error on the $ip line, etc. I can leave all the php lines out, add an echo
Re: [PHP] Question about Linux Rpm
? RPM is good if everything is installed by RPM. Otherwise, RPM won't know that you have dependencies installed, and will fail. Thanks. But how do I know if an rpm can run on a raq 3 when I read it's supported for redhat? Sometimes I read For redhat 6.1 and then some say yes, you can install rpm's Just curious. But I do see what you are saying if I can get them to install I would have to install the php/gd first with many others...but knowing *if* I can is hard enough And if I did, php/gd and php/mysql and what not I presume go first before the php rpm? Along with a few others. Wow, maybe it is best from source
[PHP] Re: Need advide on partnership agreement for a php application...
Py wrote: Hello, I have an application wich I maintained on my servers (PHP, Apache, MySQL). I have a client that is already using the application trought a secure link directly from his web site. But he would like to have my application update a database directly on his server (Oracle) in order to protect the statistical data collected trought the application, wich is a lot... I see no problem to open a connection to update his Oracle database on his server. I use phplib so it would not be a major modification. But some questions remains: - Opening a connection directly to his oracle database is not really more secure in any way. (If I get hacked, he get's hacked...) - It seems to me a false security since the data are manipulated by the PHP engine on my server anyway... - Creating a database (in order to replicate mine) would tell him a lot about how I do my stuff... (but I do not really care tho) My solution was to provide all statistical data to him with a secure (SSL) link and give him everything in XML so he could update his database just the way he want's it. What do you think? What sould I tell him? I really need advice since this is a field unknown to me... py p.s. I do not really know where to post a question like this one wich is not really related to PHP directly... Sorry... Hi Py, I guess it all depends on why your user really wants the data. Does he want to keep it as a backup in case something happens to the copy on your server or does he really want to manipulate it via Oracle? If he wants a backup I guess that's fair enough but why should he bother putting it in Oracle until he needs it? If he wants to manipulate, I guess your question is what is that he wants that do you not provide? Some observations: 1. If I were you I would not want to get involved with his Oracle database at all. It's all too easy for you to get blamed unjustifiably for all kinds of problems e.g. the comms link doesn't work, they don't like the data structures, their Oracle crashed etc. etc. 2. Your idea of providing the data in xml sounds good. But are they up to handling xml? Everyone talks about it and claims they want it, but when it comes down to it, they're not ready! What about giving him a boring old csv or tab-delimited text file? He can easily enough get it into Oracle when he wants, and it's very hard for anyone to blame you for Oracle problems. It's also nice for managerial customers, because you can show them the data in Excel/whatever and they can see for themselves that you're supplying the data. Then, if they are not getting what they want, it's absolutely clear that it's because of problems at their end, not your end. 3. The one time I met a proper cracker, Oracle databases were among his favourite targets, so, as you say, opening an Oracle connection doesn't sound like an improvement to security! Practically, my approach to your customer would be to agree with whatever he asks for in principle, but make sure that you end up sending him csv/tab-delimited versions of all the data via a https download first. You can say it's as a test, or so they can explore the issues, get a feel for the data structure/volumes or whatever. My guess is that is all you will ever have to do. Once they see how much work they have to do at THEIR end, they'll go all quiet. You might also suggest that while they are exploring the issue you could fill in any immediate gaps in what you're offering them e.g. more summaries, different analyses, whatever... Hope that helps, George -- 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] cookies
On 27 November 2001 12:45, Urb LeJeune wrote: Speaking of cookies, is there a way using session control to modify the expiration date of a cookie? I would like to add a check box in a login dialog that says remember me The checkbox is a form field, and thusly passes it's value to the page that loads when you submit the form. So in the page that sets the cookie: if ($checkbox == 1 ) { setcookie (whatever); } else { setcookie (whateverelse); } -- Casey Allen Shobe [EMAIL PROTECTED] GCS/CM d+ s+:-+: a-- C++() ULU$ P- L+++ E- W++ N++ !o K- w-- !O M V- PS++ PE Y+ PGP++ t+ 5+ X R+ tv-- b++ DI+ D G++ e h-(*) r--- z-- -- 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] setcookie BUG w/ IE 5.5, 6.0 Netscape!
On 29 December 2001 13:35, Kris Wilkinson spaketh unto ye recipient: setcookie (myCookie,Blah,time()+7201); For some reason, you must specify the domain, and make sure you use *exact* formatting on the time, including the GMT suffix. I gave up on setcookie and started using this: $date = gmdate(D, d-M-Y H:i:s, ($time)); header ('Set-Cookie: username='.$username.'; expires='.$date.' GMT; path=/; domain='.$SERVER_ADDR); Problem is, I just upgraded a machine to Netscape 6.2 from 6.1, and now it won't set the cookie :( -- Casey Allen Shobe [EMAIL PROTECTED] GCS/CM d+ s+:-+: a-- C++() ULU$ P- L+++ E- W++ N++ !o K- w-- !O M V- PS++ PE Y+ PGP++ t+ 5+ X R+ tv-- b++ DI+ D G++ e h-(*) r--- z-- -- 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] PDF print page creation...
Hello, A client requested a script to create a page to print out the list of clients that are subscribed to a chosen service. This list will be printed and then faxed to an outer source because that's how the second company that oursources the service requests it. The present script creates a HTML page with an image, text and a few tables. The problem with the HTML page is that the browser prints the web address of the script to the lower left corner of the sheet (and also things like Page 1 from 1). The PDF is meant to eliminate it all. How complex would it be to code this script to generate the PDF file. How much time would it take to make a PDF creator based on existing script that gets the data out of the database? Remember, the PDF would have to contain tables and a logo as well (image). The text has to be positioned and aligned as requested by the client. So my questions: 1. How hard would it be to create such a script? 2. How much time would it take? (any common pitfalls that could make coding time longer?) 3. What are the best classes/wrappers out there to handle the job? 4. Or would it be better to get a HTML to PDF converter (do such things exist and do they do a good job?) Thanks in advance! Yours, Lauri -- 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] Re: Need advide on partnership agreement for a php application...
I agree with George. I was in a somewhat similar situation recently in which a client, for whom I was writing an intranet application that I would not be hosting, asked if I could give my application the ability to export data for some archain application just in case they decided they wanted to do something else with the data. My solution was to provide them with the ability to export data in tab delimted files so that they could import it into any application they desired. They were more than happy with this approach as it gave them the ability to use the data in any way they may dream up in the future. To make the solution more attractive, I added a form to my application which allowed them to submit any select query they could dream up and return the results in tab delimted format. When returning the results I set the content type header to vnd.ms-excel and voila, when they submit the form the results immediately appear in an excel spreadsheet. This situation worked out for both of us because I am in no way responsible for compatibilty or performance issues with other applications and yet they have the ability to use the data in any manner they wish. Fred George Whiffen [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Py wrote: Hello, I have an application wich I maintained on my servers (PHP, Apache, MySQL). I have a client that is already using the application trought a secure link directly from his web site. But he would like to have my application update a database directly on his server (Oracle) in order to protect the statistical data collected trought the application, wich is a lot... I see no problem to open a connection to update his Oracle database on his server. I use phplib so it would not be a major modification. But some questions remains: - Opening a connection directly to his oracle database is not really more secure in any way. (If I get hacked, he get's hacked...) - It seems to me a false security since the data are manipulated by the PHP engine on my server anyway... - Creating a database (in order to replicate mine) would tell him a lot about how I do my stuff... (but I do not really care tho) My solution was to provide all statistical data to him with a secure (SSL) link and give him everything in XML so he could update his database just the way he want's it. What do you think? What sould I tell him? I really need advice since this is a field unknown to me... py p.s. I do not really know where to post a question like this one wich is not really related to PHP directly... Sorry... Hi Py, I guess it all depends on why your user really wants the data. Does he want to keep it as a backup in case something happens to the copy on your server or does he really want to manipulate it via Oracle? If he wants a backup I guess that's fair enough but why should he bother putting it in Oracle until he needs it? If he wants to manipulate, I guess your question is what is that he wants that do you not provide? Some observations: 1. If I were you I would not want to get involved with his Oracle database at all. It's all too easy for you to get blamed unjustifiably for all kinds of problems e.g. the comms link doesn't work, they don't like the data structures, their Oracle crashed etc. etc. 2. Your idea of providing the data in xml sounds good. But are they up to handling xml? Everyone talks about it and claims they want it, but when it comes down to it, they're not ready! What about giving him a boring old csv or tab-delimited text file? He can easily enough get it into Oracle when he wants, and it's very hard for anyone to blame you for Oracle problems. It's also nice for managerial customers, because you can show them the data in Excel/whatever and they can see for themselves that you're supplying the data. Then, if they are not getting what they want, it's absolutely clear that it's because of problems at their end, not your end. 3. The one time I met a proper cracker, Oracle databases were among his favourite targets, so, as you say, opening an Oracle connection doesn't sound like an improvement to security! Practically, my approach to your customer would be to agree with whatever he asks for in principle, but make sure that you end up sending him csv/tab-delimited versions of all the data via a https download first. You can say it's as a test, or so they can explore the issues, get a feel for the data structure/volumes or whatever. My guess is that is all you will ever have to do. Once they see how much work they have to do at THEIR end, they'll go all quiet. You might also suggest that while they are exploring the issue you could fill in any immediate gaps in what you're offering them e.g. more summaries, different analyses, whatever... Hope that helps, George -- PHP General Mailing List (http://www.php.net/) To unsubscribe,
[PHP] What kind of looping ?
Hey guys, I cant figure out what functions and/or looping I need to use for what I need to do. Im reading a directory and pushing all the file names in the directory into an arrary. I want to be able print out each element(file name) in the array into an HTML table while limiting a certain number of elements for each row. Example: $image_dir = opendir(../images/bullets/); while ($file = readdir($image_dir)) { $file_list[] = $file; }; Now $file_list[] has some number a file names. I want print 4 file names into a row. Each file name has to be in its on cell. table tr tdFILE 0/td tdFILE 1/td tdFILE 2/td tdFILE 3/td /tr tr tdFILE 4/td tdFILE 5/td tdFILE 6/td tdFILE 7/td /tr /table I would image I would use a for loop, but I cant figure it out. Can somone assist me ? Thanks, Steve -- 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] What kind of looping ?
Steve Maroney [EMAIL PROTECTED] wrote: Now $file_list[] has some number a file names. I want print 4 file names into a row. Each file name has to be in its on cell. table tr tdFILE 0/td tdFILE 1/td tdFILE 2/td tdFILE 3/td /tr tr tdFILE 4/td tdFILE 5/td tdFILE 6/td tdFILE 7/td /tr /table I would image I would use a for loop, but I cant figure it out. Can somone assist me ? The % (modulus) operator is the key to this type of looping. I didn't test the code below, but I've done this enough times that I'm pretty sure it's correct. If not it should be pretty easy to correct after you test it. $columns = 4; $array_count = count( $file_list ); for ( $i = 0; $i $array_count; $i++ ) { if ( $i % $columns == 0 ) { $o .= 'tr'; } $o .= td{$file_list[$i]}/td; if ( $i % $columns == $columns - 1 ) { $o .= '/tr'; } } // Create blank table cells if final row doesn't use all columns. // You can get away without this on broken browsers like IE, but // then you'll generate invalid HTML and browsers like NS // won't display your pages. if ( $array_count % $columns 0 ) { $o .= str_repeat( tdnbsp;/td, $columns - ( $array_count % $columns ) ) . /tr; } -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.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]
Re: [PHP] What kind of looping ?
try using $count=0; before the loop (while loop is fine) then before the end of the loop $count++; inside the loop if ($count % 4) { that is where you want it to break and start running the other code } so you would have $table = table; $counter = 0; while ($tableset = mysql_fetch_array($result) ) { $table = table; if ($counter % 4 == 0) { $table .= tr tdFILE 0/td tdFILE 1/td tdFILE 2/td tdFILE 3/td /tr; } else { $table .= tr tdFILE 4/td tdFILE 5/td tdFILE 6/td tdFILE 7/td /tr; } $counter++; } $table .= /table; something like that, if this doesnt get the total desired result try playing with the % 4 == 0 to like == 1 or 2, see if that gets a desired result. please please this is some psudo code I threw together you might need to tweek. --- Steve Maroney [EMAIL PROTECTED] wrote: Hey guys, I cant figure out what functions and/or looping I need to use for what I need to do. Im reading a directory and pushing all the file names in the directory into an arrary. I want to be able print out each element(file name) in the array into an HTML table while limiting a certain number of elements for each row. Example: $image_dir = opendir(../images/bullets/); while ($file = readdir($image_dir)) { $file_list[] = $file; }; Now $file_list[] has some number a file names. I want print 4 file names into a row. Each file name has to be in its on cell. table tr tdFILE 0/td tdFILE 1/td tdFILE 2/td tdFILE 3/td /tr tr tdFILE 4/td tdFILE 5/td tdFILE 6/td tdFILE 7/td /tr /table I would image I would use a for loop, but I cant figure it out. Can somone assist me ? Thanks, Steve -- 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] = Dan McCullough --- Theres no such thing as a problem unless the servers are on fire! h: 603.444.9808 w: McCullough Family w: At Work __ Do You Yahoo!? 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] Array Help
How can I access the inner most info in this array? Ie, Item and url $var = array( category = array( subcategory = array( Item = url ), ) ); -- 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] How to install gdlibrary?
Hi there, does anybody know a link where the installation of gdlibrary is explained. I was trying to install zlib which is mandatory for gd but there is nowhere a install documentation! Thanx for any help cheers Andy -- 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] Array Help
you can just kept adding []'s $var[category][subcategory][Item] = url; -Original Message- From: Brian V Bonini [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 27, 2001 4:56 PM To: PHP Lists Subject: [PHP] Array Help How can I access the inner most info in this array? Ie, Item and url $var = array( category = array( subcategory = array( Item = url ), ) ); -- 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] Session script hangs page on Windows
I am a newbie running 4.06 on PWS in Win 98. Any sample script about sessions I can find just hangs in Personal Web Server. Session id gets created in data file but nothing happens on the page. Has anyone come across this? Have searched on Google and can't find any reference. Thanks in advance for the help. -- 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] Session script hangs page on Windows
Don't run PWS. Go to nusphere.com and get the complete package of Apache, PHP, Perl, and MySQL works like a champ. At 05:17 PM 11/27/01 -0500, MM wrote I am a newbie running 4.06 on PWS in Win 98. Any sample script about sessions I can find just hangs in Personal Web Server. Session id gets created in data file but nothing happens on the page. Has anyone come across this? Have searched on Google and can't find any reference. Thanks in advance for the help. -- 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]
Re: [PHP] Re: Printing Reports
If all you want to do is print, then a simple JavaScript code should do the trick. example: //use php to send the report to a new browser //in this case, report.php has the code to generate the reports. a href=report.php?option=xy target=newXY Report/a //in the new window (or at the end of report.php) generate this link a href=# onclick=window.print() Print This Report/a //this would open the print dialog box, to allow users to select the target printer. The key would be to program 'report.php' to generate a clean, printer friendly, report. __John Monfort_ _+---+_ P E P I E D E S I G N S www.pepiedesigns.com The world is waiting, are you ready? -+___+- On Tue, 27 Nov 2001, Dan Koken wrote: There are so many reports. The system I have is a manufacturing system, and currently contains some 400 programs. Some examples of reports are: Bill of Lading with bar codes Production reports Management and analysis Labels for lab analysis with bar codes Planning reports Quality assurance Preventative maintenance work orders Warehouse Planning Billing And others Some of these are reports long, but I guess most are less than 20 pages. Most of the sites that use the system are small and usually have from 200 to 500 terminals and have systems that manage multiple printers. So they would like to direct the printed output. Like just about everyone, I'd like them to use more interactive stuff on the system. But users want their reports... HTH. Thanks again for the help. -- 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]
RE: [PHP] Printing Reports
Grimes, I do this a lot. If you want to use just the browser and server abilities without introducing the complexities of PDF/XML/XSLT and such, it is not too hard. I have done PDF, Standard Text and HTML to the browser and I have printed directly to a printer from the server using PHP. Have you been able to bypass the dialog box? That is, send the file directly to the printer, without the user's interaction? If so, then I would love to learn how you did it. I was trying to do that with one of my projects, but couldn't. As far as I know, the browsers do not allow that. But, I've been told you could do it via sockets... Were you able to bypass the dialog box? -john First, is the site a Corporate intranet where the server knows about all of the shared printers connected to the network? Or, is the site accessed over the internet? If it's a Corporate intranet then you can create reports and submit them to the appropriate spooler. On Unix this is easy. I'm not sure about Windows. You can gather a list of available printers and create a little form that allows the user to select which printer to send the report to. If the site is over the internet then create the report in a separate window that is divided into two frames. The top frame will consist of close and print buttons. The second will contain the report and a JavaScript function that performs the printing. The print button in the top frame, when pushed, will execute the print function in the bottom frame. The print function sets focus on the report and then executes this.print(). The print dialogue box will automatically pop up and the user can select their own printer along with number of copies, etc. If you use HTML you can even set page breaks (in IE5 anyway). Have fun, Dean -Original Message- From: Dan Koken [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 27, 2001 5:00 AM To: [EMAIL PROTECTED] Subject: [PHP] Printing Reports As a Newbe to PHP, I need to print reports. I'd like to stay away from PDF but will use it if necessary. In general, what seems to be the best way to print reports?? It would be nice when they ask for a report it would brint in the report window that allows them to select the printer, number of copies, print quality etc. Thanks for your help... Dan. -- 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 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] Using a file to make an array
Hey Guys, I'm having a trouble I can't seem to solve and hoped maybe one of you might take a look and see if you can help me. (If you don't want to learn my approach just skip to the bottom to help me with the final bit.. skip to hear) What I want to do is open the text file testtext.txt (attached) and input all the information from one row (divided into fields and colum) and input that into a database (mysql)... I thought the easiest way to do this is split the fields in the row into an array... since they are all seperated by spaces If only it was so easy. This is what I did: code $count=0; $fd = fopen (./Testtext.txt, r); while (!feof ($fd)) { $buffer = fgets($fd, 4096); $count++; if($count 2 $count 4){ $thearray=split([ ]+, $buffer); $maxi=count($thearray); for($i=0; $i$maxi; $i++){ echo $thearray[$i] $i ; } echo br; } } /code Ok now the echo statement above prints the following: 07/29/2001 12:00 0 a 28.6 28.6 28.5 0.0 31.2 -- 0 0.0 0.0 1018.8 3.1 6.3 N 28.0 1.9 0.00 0.0 74 23.4 32.1 10 12.00 1 It looks all good till well the 0 (where did that come from?) after the 12:00! But upon further code writing: code $wdate=$thearray[0]; $wtime=$thearray[1]; $wtimeampm=$thearray[2]; echo BRThe date of the data is : $wdate taken at the time of $wtime $wtimampm; /code that prints: The date of the data is : 07/29/2001 12:00 taken at the time of a 28.6 28.6 28.5 0.0 31.2 -- 0 0.0 0.0 1018.8 3.1 6.3 N 28.0 1.9 0.00 0.0 74 23.4 32.1 10 12.00 It looks as the array is having trouble splitting the date from the time (why there is a space there!!??) and makes all the other data into one or two other parts of the area (instead of the many fields). --HEAR-- So I've narrowed it to this: $thearray=split([ ]+, $buffer); Does this look like what I should use to separate all my data in the array? It gets this data from one row in the file testtext.txt which looks like all fields are separated by at least one space. What should I do? Thanks a bunch, Yoed begin 666 Testtext.txt M0E!:7()0D)4V]I; D)4V]L87()4V]L87()15G+@D)5VEN9 D)5VEN9 E7 M:6YD0D)2D)41E=PE4+D@N4$N4)A='0N#0I$871E51I;64)55M E( M:0E,;W)150)55M E,96%F5)A9 E%;F5R9WD)1%YPE87()4W!E960) M2D)1ER4-H:6QL5)U;@E286EN5)A=4)2'5M5!O:6YT4EN95X5!E M@E6;VQTPT*,#O,CDO,C P,0DQ,CHP,!A3(X+C8),C@N-@DR.XU3 N M,# P,# ),S$N,@DM+0DP3 N, DP+C ),3 Q.XX3,N,0DV+C,)3@DR.XP M3$N.0DP+C P3 N, DW- DR,RXT3,R+C$),3 ),3(N,# -C W+S(Y+S(P M,#$),3(Z,3 @80DR.XU3(X+C8),C@N- DM+0DS,2XR2TM3 ),XP3 N M, DQ,#$X+C)-XP38N-PE.3(W+C8),BXV3 N,# ),XP3S3(S+C() M,S(N, DQ, DQ,BXP, T*,#O,CDO,C P,0DQ,CHR,!A3(X+C4),C@N-@DR M.XT2TM3,Q+C$)+2T), DP+C ),XP3$P,3@N. DS+C$)-2XT4X),CN M.0DQ+C@),XP, DP+C )-S0),C,N- DS,BXQ3$P3$R+C P#0HP-R\R.2\R M,# Q3$R.C,P($),C@N-0DR.XU3(X+C0)+2T),S$N,0DM+0DP3 N, DP M+C ),3 Q.XW3,N,0DU+C0)3@DR-RXY3$N.0DP+C P3 N, DW,PDR,RXR M3,R+C ),3 ),3(N,# -C W+S(Y+S(P,#$),3(Z-# @80DR.XT3(X+C0) M,C@N- DM+0DS,2XQ2TM3 ),XP3 N, DQ,#$X+C8),BXR30N, E.3(X M+C(),2XT3 N,# ),XP3S3(S+C(),S(N, DQ, DQ,BXP, T*,#O,CDO M,C P,0DQ,CHU,!A3(X+C0),C@N- DR.XT2TM3,Q+C )+2T), DP+C ) M,XP3$P,3@N-0DR+C()-XP4X),C@N,@DQ+C,),XP, DP+C )-S0),C,N M- DS,BXQ3$P3$R+C P#0HP-R\R.2\R,# Q3$Z,# @80DR.XT3(X+C0) M,C@N,PDP+C P,# P3,P+CD)+2T), DP+C ),XP3$P,3@N- DR+C)-XY M4X),CN.0DQ+C8),XP, DP+C )-S0),C,N,PDS,BXQ3$P3$R+C P#0HP M-R\R.2\R,# Q3$Z,3 @80DR.XR3(X+C,),C@N,@DM+0DS,XY2TM3 ) M,XP3 N, DQ,#$X+C0),BXR30N, E.3(W+CD),2XT3 N,# ),XP3T M3(S+C(),S(N,0DQ, DQ,BXP, T*,#O,CDO,C P,0DQ.C(P($),C@N,PDR M.XS3(X+C()+2T),S N.0DM+0DP3 N, DP+C ),3 Q.XS3,N-@DT+CD) M3@DR-RXU3(N,0DP+C P3 N, DW- DR,RXR3,R+C$),3 ),3(N,# -C W M+S(Y+S(P,#$),3HS,!A3(X+C,),C@N,PDR.XS2TM3,P+C@)+2T), DP M+C ),XP3$P,3@N,PDR+C)-XY4X),CN.0DQ+C8),XP, DP+C )-S0) M,C,N,PDS,BXQ3$P3$R+C P#0HP-R\R.2\R,# Q3$Z-# @80DR.XS3(X M+C,),C@N,PDM+0DS,XX2TM3 ),XP3 N, DQ,#$X+C,),RXQ34N- E. M3(W+C),2XX3 N,# ),XP3U3(S+C0),S(N,@DQ, DQ,BXP, T*,#O M,CDO,C P,0DQ.C4P($),C@N,PDR.XS3(X+C,)+2T),S N. DM+0DP3 N M, DP+C ),3 Q.XR3(N-PDT+CD)3@DR-RXY3$N. DP+C P3 N, DW-0DR M,RXU3,R+C(),3 ),3(N,# -C W+S(Y+S(P,#$),CHP,!A3(X+C,),C@N M,PDR.XR3 N,# P,# ),S N-PDM+0DP3 N, DP+C ),3 Q.XQ3,N,0DT M+CD)3@DR-RXW3$N.0DP+C P3 N, DW,PDR,RXP3,R+C ),3 ),3(N,# - MC W+S(Y+S(P,#$),CHQ,!A3(X+C,),C@N,PDR.XS2TM3,P+C)+2T) M, DP+C ),XP3$P,3@N,0DS+C$)-BXW4X),CN-PDQ+C@),XP, DP+C ) M-S4),C,N- DS,BXR3$P3$R+C P#0HP-R\R.2\R,# Q3(Z,C @80DR.XS M3(X+C,),C@N,PDM+0DS,XW2TM3 ),XP3 N, DQ,#$X+C ),RXV34N M- E.3(W+C4),BXQ3 N,# ),XP3W3(S+CD),S(N- DQ, DQ,BXP, T* M,#O,CDO,C P,0DR.C,P($),C@N,@DR.XS3(X+C()+2T),S N-@DM+0DP M3 N, DP+C ),3 Q.XP3,N-@DU+C0)3@DR-RXT3(N,0DP+C P3 N, DW M-0DR,RXT3,R+C(),3 ),3(N,# -C W+S(Y+S(P,#$),CHT,!A3(X+C() M,C@N,@DR.XR2TM3,P+C8)+2T), DP+C ),XP3$P,3@N, DS+C$)-2XT M4X),CN-@DQ+CD),XP, DP+C )-S8),C,N-@DS,BXS3$P3$R+C P#0HP M-R\R.2\R,# Q3(Z-3 @80DR.XR3(X+C,),C@N,@DM+0DS,XV2TM3 ) M,XP3 N, DQ,#$X+C$),RXQ34N. E.3(W+C8),2XY3 N,# ),XP3W M3(S+C@),S(N- DQ, DQ,BXP, T*,#O,CDO,C P,0DS.C P($),C@N,PDR M.XS3(X+C(),XP,# P, DS,XU2TM3 ),XP3 N, DQ,#$X+C$),BXR M30N.0E.3(X+C ),2XS3 N,#
Re: [PHP] Using a file to make an array
You're making this real hard on yourself ... and you didn't really look at the file ... it's *tab* delimited, not spaces ... so this works just ducky on the file you attached: #!/usr/bin/php4 -q ?php $contents = file(f.txt); while(list(,$line) = each($contents)) { if(ereg('^[0-9]+',$line)) { $fields = explode(\t,$line); while(list($key,$field) = each($fields)) { echo $key = $field\n; } } } ? file() sucks the whole file into an array 1 record per line ... $contents in this case. The first while loop processes each line, the ereg-if effectively strips out the headers by requiring it to start with a digit. explode() does the breakup on the tabs and then the inner while handles the output ... and what you should modify to handle your database calls. HTH Hank On Tue, Nov 27, 2001 at 05:29:37PM -0600, Yoed Anis wrote: Hey Guys, I'm having a trouble I can't seem to solve and hoped maybe one of you might take a look and see if you can help me. (If you don't want to learn my approach just skip to the bottom to help me with the final bit.. skip to hear) What I want to do is open the text file testtext.txt (attached) and input all the information from one row (divided into fields and colum) and input that into a database (mysql)... I thought the easiest way to do this is split the fields in the row into an array... since they are all seperated by spaces If only it was so easy. This is what I did: code $count=0; $fd = fopen (./Testtext.txt, r); while (!feof ($fd)) { $buffer = fgets($fd, 4096); $count++; if($count 2 $count 4){ $thearray=split([ ]+, $buffer); $maxi=count($thearray); for($i=0; $i$maxi; $i++){ echo $thearray[$i] $i ; } echo br; } } /code Ok now the echo statement above prints the following: 07/29/2001 12:00 0 a 28.6 28.6 28.5 0.0 31.2 -- 0 0.0 0.0 1018.8 3.1 6.3 N 28.0 1.9 0.00 0.0 74 23.4 32.1 10 12.00 1 It looks all good till well the 0 (where did that come from?) after the 12:00! But upon further code writing: code $wdate=$thearray[0]; $wtime=$thearray[1]; $wtimeampm=$thearray[2]; echo BRThe date of the data is : $wdate taken at the time of $wtime $wtimampm; /code that prints: The date of the data is : 07/29/2001 12:00 taken at the time of a 28.6 28.6 28.5 0.0 31.2 -- 0 0.0 0.0 1018.8 3.1 6.3 N 28.0 1.9 0.00 0.0 74 23.4 32.1 10 12.00 It looks as the array is having trouble splitting the date from the time (why there is a space there!!??) and makes all the other data into one or two other parts of the area (instead of the many fields). --HEAR-- So I've narrowed it to this: $thearray=split([ ]+, $buffer); Does this look like what I should use to separate all my data in the array? It gets this data from one row in the file testtext.txt which looks like all fields are separated by at least one space. What should I do? Thanks a bunch, Yoed begin 666 Testtext.txt M0E!:7()0D)4V]I; D)4V]L87()4V]L87()15G+@D)5VEN9 D)5VEN9 E7 M:6YD0D)2D)41E=PE4+D@N4$N4)A='0N#0I$871E51I;64)55M E( M:0E,;W)150)55M E,96%F5)A9 E%;F5R9WD)1%YPE87()4W!E960) M2D)1ER4-H:6QL5)U;@E286EN5)A=4)2'5M5!O:6YT4EN95X5!E M@E6;VQTPT*,#O,CDO,C P,0DQ,CHP,!A3(X+C8),C@N-@DR.XU3 N M,# P,# ),S$N,@DM+0DP3 N, DP+C ),3 Q.XX3,N,0DV+C,)3@DR.XP M3$N.0DP+C P3 N, DW- DR,RXT3,R+C$),3 ),3(N,# -C W+S(Y+S(P M,#$),3(Z,3 @80DR.XU3(X+C8),C@N- DM+0DS,2XR2TM3 ),XP3 N M, DQ,#$X+C)-XP38N-PE.3(W+C8),BXV3 N,# ),XP3S3(S+C() M,S(N, DQ, DQ,BXP, T*,#O,CDO,C P,0DQ,CHR,!A3(X+C4),C@N-@DR M.XT2TM3,Q+C$)+2T), DP+C ),XP3$P,3@N. DS+C$)-2XT4X),CN M.0DQ+C@),XP, DP+C )-S0),C,N- DS,BXQ3$P3$R+C P#0HP-R\R.2\R M,# Q3$R.C,P($),C@N-0DR.XU3(X+C0)+2T),S$N,0DM+0DP3 N, DP M+C ),3 Q.XW3,N,0DU+C0)3@DR-RXY3$N.0DP+C P3 N, DW,PDR,RXR M3,R+C ),3 ),3(N,# -C W+S(Y+S(P,#$),3(Z-# @80DR.XT3(X+C0) M,C@N- DM+0DS,2XQ2TM3 ),XP3 N, DQ,#$X+C8),BXR30N, E.3(X M+C(),2XT3 N,# ),XP3S3(S+C(),S(N, DQ, DQ,BXP, T*,#O,CDO M,C P,0DQ,CHU,!A3(X+C0),C@N- DR.XT2TM3,Q+C )+2T), DP+C ) M,XP3$P,3@N-0DR+C()-XP4X),C@N,@DQ+C,),XP, DP+C )-S0),C,N M- DS,BXQ3$P3$R+C P#0HP-R\R.2\R,# Q3$Z,# @80DR.XT3(X+C0) M,C@N,PDP+C P,# P3,P+CD)+2T), DP+C ),XP3$P,3@N- DR+C)-XY M4X),CN.0DQ+C8),XP, DP+C )-S0),C,N,PDS,BXQ3$P3$R+C P#0HP M-R\R.2\R,# Q3$Z,3 @80DR.XR3(X+C,),C@N,@DM+0DS,XY2TM3 ) M,XP3 N, DQ,#$X+C0),BXR30N, E.3(W+CD),2XT3 N,# ),XP3T M3(S+C(),S(N,0DQ, DQ,BXP, T*,#O,CDO,C P,0DQ.C(P($),C@N,PDR M.XS3(X+C()+2T),S N.0DM+0DP3 N, DP+C ),3 Q.XS3,N-@DT+CD) M3@DR-RXU3(N,0DP+C P3 N, DW- DR,RXR3,R+C$),3 ),3(N,# -C W M+S(Y+S(P,#$),3HS,!A3(X+C,),C@N,PDR.XS2TM3,P+C@)+2T), DP M+C ),XP3$P,3@N,PDR+C)-XY4X),CN.0DQ+C8),XP, DP+C )-S0) M,C,N,PDS,BXQ3$P3$R+C P#0HP-R\R.2\R,# Q3$Z-# @80DR.XS3(X M+C,),C@N,PDM+0DS,XX2TM3 ),XP3 N, DQ,#$X+C,),RXQ34N- E. M3(W+C),2XX3 N,# ),XP3U3(S+C0),S(N,@DQ, DQ,BXP, T*,#O M,CDO,C P,0DQ.C4P($),C@N,PDR.XS3(X+C,)+2T),S N. DM+0DP3 N M, DP+C ),3
[PHP] php apache module and file writing vs security ?
I need to be able to have high security for the default web user such that php can not write files. The level of security is such that I can't open up directories in the web root for writing by the default www user (php runs as this user). Question #1: Is there a way to securly write files to the webroot in the apache module version of PHP? Question #2: Is it safe to install a second CGI copy of php on the server with the current apache module version of php ? Would it be able to share the same php.ini. I'm installing on RedHat Linux, current apache module is php4.4 version. Michael -- 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] how to acess php array var in Js?
If I have a series of checkboxes like this: input type=checkbox name=cb[] value=1 This is 1 input type=checkbox name=cb[] value=2 This is 2 input type=checkbox name=cb[] value=3 This is 3 input type=checkbox name=cb[] value=4 This is 4 how can I acess cb[] in Javascript other than using the elements array?? I can't do cb[][0].checked for example... it gives me parse error... using the elements array is not that nice codewise... any hints? _ . Christian Dechery . . Gaita-L Owner / Web Developer . . http://www.webstyle.com.br . . http://www.tanamesa.com.br -- 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] how to acess php array var in Js?
try : form_name[cb[]] -Original Message- From: Christian Dechery [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 28, 2001 11:53 AM To: [EMAIL PROTECTED] Subject: [PHP] how to acess php array var in Js? If I have a series of checkboxes like this: input type=checkbox name=cb[] value=1 This is 1 input type=checkbox name=cb[] value=2 This is 2 input type=checkbox name=cb[] value=3 This is 3 input type=checkbox name=cb[] value=4 This is 4 how can I acess cb[] in Javascript other than using the elements array?? I can't do cb[][0].checked for example... it gives me parse error... using the elements array is not that nice codewise... any hints? _ . Christian Dechery . . Gaita-L Owner / Web Developer . . http://www.webstyle.com.br . . http://www.tanamesa.com.br -- 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] Apache 2.0.28 and PHP 4.0.6
Is it possible to compile and make it work under linux without any changes? I mean is there a --with-apache2 or something? -- - Lars When mailing me, remember there is no truth in my mail! -- 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] Re:
Warning Unable to process data: multipart/related; type=multipart/alternative; boundary=_ABC1234567890DEF_
[PHP] Re: Using a file to make an array
There is no need to reinvent the wheel here. MySQL has a built in function to do exactlywhat you want to do. Check out LOAD DATA INFILE here: http://www.mysql.com/doc/L/O/LOAD_DATA.html Fred Yoed Anis [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hey Guys, I'm having a trouble I can't seem to solve and hoped maybe one of you might take a look and see if you can help me. (If you don't want to learn my approach just skip to the bottom to help me with the final bit.. skip to hear) What I want to do is open the text file testtext.txt (attached) and input all the information from one row (divided into fields and colum) and input that into a database (mysql)... I thought the easiest way to do this is split the fields in the row into an array... since they are all seperated by spaces If only it was so easy. This is what I did: code $count=0; $fd = fopen (./Testtext.txt, r); while (!feof ($fd)) { $buffer = fgets($fd, 4096); $count++; if($count 2 $count 4){ $thearray=split([ ]+, $buffer); $maxi=count($thearray); for($i=0; $i$maxi; $i++){ echo $thearray[$i] $i ; } echo br; } } /code Ok now the echo statement above prints the following: 07/29/2001 12:00 0 a 28.6 28.6 28.5 0.0 31.2 -- 0 0.0 0.0 1018.8 3.1 6.3 N 28.0 1.9 0.00 0.0 74 23.4 32.1 10 12.00 1 It looks all good till well the 0 (where did that come from?) after the 12:00! But upon further code writing: code $wdate=$thearray[0]; $wtime=$thearray[1]; $wtimeampm=$thearray[2]; echo BRThe date of the data is : $wdate taken at the time of $wtime $wtimampm; /code that prints: The date of the data is : 07/29/2001 12:00 taken at the time of a 28.6 28.6 28.5 0.0 31.2 -- 0 0.0 0.0 1018.8 3.1 6.3 N 28.0 1.9 0.00 0.0 74 23.4 32.1 10 12.00 It looks as the array is having trouble splitting the date from the time (why there is a space there!!??) and makes all the other data into one or two other parts of the area (instead of the many fields). --HEAR-- So I've narrowed it to this: $thearray=split([ ]+, $buffer); Does this look like what I should use to separate all my data in the array? It gets this data from one row in the file testtext.txt which looks like all fields are separated by at least one space. What should I do? Thanks a bunch, Yoed -- 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] Re: Apache 2.0.28 and PHP 4.0.6
Hi Lars, I can't get the 2 to compile together. I think there's been too many changes in Apache 2.x.x for php 4.0.6 to work with it. A CVS version of PHP might work though. Anyway, if you want to give it a try, configure PHP like this: ./configure --with-apxs2=/path/to/apxs --with-whatever-else Good luck, Tyler Longren -- 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] Updating rows in a MySQL database with PHP
Ok, this may well turn out to be a total newbie question. But it's got me stumped. I'm trying to create a small, simple news system for a personal website. I've gotten sections to insert the news into the database. but I can't seem to get it to update itself. So far I have ?php include(accesscontrol.php); (This is a login script to authenticate users, so they cannot access pages by merely typing the address into the address bar. It references the database connection script, so that I shouldn't need to call that again. Is that right?) dbconnect(My_db_name); mysql_query (UPDATE news SET subject='$newsubject', content='$newcontent' WHERE id='$id'); ? The $newsubject and $newcontent variables are taken from the results of a form on an earlier page. when the script is run through in full, I get no errors, but the database is not updated. The table has the following format id, date, subject, content, user I can get the correct news entry displayed in the forms on previous screen, where the altering takes place. (code for the form is below) form name=news method=get action=alternews.php input type=hidden name=user value=?=$username? pSubject: input type=text name=newsubject maxlength=120 value=?=$subject? /p pContent:br textarea name=newcontent rows=6 cols=60?=$content?/textarea /p p align=right input type=submit name=Submit value=Submit input type=reset name=reset value=Reset /p /form The variables are passed through to the page that actually performs the update, but the update never takes place. I don't get an error from MySQL, or a parsing error from PHP, all the pages display as if the update had taken place. Can anyone see what I'm doing wrong? This all seemed like a good way of learning PHP and MySQL, it's just leading to further hair loss! Oh, and I'm sorry if this really should go to another list, but this was the first one that leapt to mind. Cheers, Chris Janes -- 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] Re: Updating rows in a MySQL database with PHP
Nothing is being updated because $id is empty and in fact is not even set. You need to pass the id via a hidden form variable in order to get the results you expect. In the future I suggest always debugging your scripts by echoing your variables so that you can determine if they contain what you think they contain. Fred Chris Janes [EMAIL PROTECTED] wrote in message 000e01c177c1$79a78620$a25ffea9@d7e5f4">news:000e01c177c1$79a78620$a25ffea9@d7e5f4... Ok, this may well turn out to be a total newbie question. But it's got me stumped. I'm trying to create a small, simple news system for a personal website. I've gotten sections to insert the news into the database. but I can't seem to get it to update itself. So far I have ?php include(accesscontrol.php); (This is a login script to authenticate users, so they cannot access pages by merely typing the address into the address bar. It references the database connection script, so that I shouldn't need to call that again. Is that right?) dbconnect(My_db_name); mysql_query (UPDATE news SET subject='$newsubject', content='$newcontent' WHERE id='$id'); ? The $newsubject and $newcontent variables are taken from the results of a form on an earlier page. when the script is run through in full, I get no errors, but the database is not updated. The table has the following format id, date, subject, content, user I can get the correct news entry displayed in the forms on previous screen, where the altering takes place. (code for the form is below) form name=news method=get action=alternews.php input type=hidden name=user value=?=$username? pSubject: input type=text name=newsubject maxlength=120 value=?=$subject? /p pContent:br textarea name=newcontent rows=6 cols=60?=$content?/textarea /p p align=right input type=submit name=Submit value=Submit input type=reset name=reset value=Reset /p /form The variables are passed through to the page that actually performs the update, but the update never takes place. I don't get an error from MySQL, or a parsing error from PHP, all the pages display as if the update had taken place. Can anyone see what I'm doing wrong? This all seemed like a good way of learning PHP and MySQL, it's just leading to further hair loss! Oh, and I'm sorry if this really should go to another list, but this was the first one that leapt to mind. Cheers, Chris Janes -- 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] Newbie Image uplaod question
Im new to PHP and am trying to upload images to the server and store the file name into mySQL database.. but i dont have a clue how to do this... all i know is i need to use Input Type=File other than that im lost. # Function MakeUploadForm() ### function MakeUploadForm($Variable) { printMakeForm IMG SRC=../graphics/blank.gif WIDTH=40 HEIGHT=1 Please note. Your files are being uploaded to a computer with a Unix operating system. With Unix, as opposed to Windows, the case of letters makes a difference. For the sake of standardization, all file names will have letters converted to all lower case. Also, Unix does not allow files with embedded spaces or any special characters. All file names will have anything other than alpha or numeric characters removed. P CENTER FORM ENCTYPE=multipart/form-data ACTION=$Variable[PHP_SELF] METHOD=POST INPUT TYPE=HIDDEN NAME=Action VALUE=UploadFile INPUT TYPE=HIDDEN NAME=MAX_FILE_SIZE VALUE=10 Upload this file: INPUT NAME=UserFile TYPE=FILE INPUT TYPE=SUBMIT VALUE=Upload Now /FORM /CENTER MakeForm; } # End of function MakeUploadForm() ## -- 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] Re: Updating rows in a MySQL database with PHP
Also, I've found that if an SQL statement isn't doing what you're expecting it to do, then echo it out and copy/paste it into the database querier (mysql, sqlplus, isql, etc). I've found these quieriers give better error messages than what you get back through PHP -Original Message- From: Fred [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 28, 2001 3:32 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: Updating rows in a MySQL database with PHP Nothing is being updated because $id is empty and in fact is not even set. You need to pass the id via a hidden form variable in order to get the results you expect. In the future I suggest always debugging your scripts by echoing your variables so that you can determine if they contain what you think they contain. Fred Chris Janes [EMAIL PROTECTED] wrote in message 000e01c177c1$79a78620$a25ffea9@d7e5f4">news:000e01c177c1$79a78620$a25ffea9@d7e5f4... Ok, this may well turn out to be a total newbie question. But it's got me stumped. I'm trying to create a small, simple news system for a personal website. I've gotten sections to insert the news into the database. but I can't seem to get it to update itself. So far I have ?php include(accesscontrol.php); (This is a login script to authenticate users, so they cannot access pages by merely typing the address into the address bar. It references the database connection script, so that I shouldn't need to call that again. Is that right?) dbconnect(My_db_name); mysql_query (UPDATE news SET subject='$newsubject', content='$newcontent' WHERE id='$id'); ? The $newsubject and $newcontent variables are taken from the results of a form on an earlier page. when the script is run through in full, I get no errors, but the database is not updated. The table has the following format id, date, subject, content, user I can get the correct news entry displayed in the forms on previous screen, where the altering takes place. (code for the form is below) form name=news method=get action=alternews.php input type=hidden name=user value=?=$username? pSubject: input type=text name=newsubject maxlength=120 value=?=$subject? /p pContent:br textarea name=newcontent rows=6 cols=60?=$content?/textarea /p p align=right input type=submit name=Submit value=Submit input type=reset name=reset value=Reset /p /form The variables are passed through to the page that actually performs the update, but the update never takes place. I don't get an error from MySQL, or a parsing error from PHP, all the pages display as if the update had taken place. Can anyone see what I'm doing wrong? This all seemed like a good way of learning PHP and MySQL, it's just leading to further hair loss! Oh, and I'm sorry if this really should go to another list, but this was the first one that leapt to mind. Cheers, Chris Janes -- 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] Newbie Image uplaod question
ok... ive tried this but no go: - function UploadImage(){ global $HTTP_POST_FILES; global $image; reset($HTTP_POST_FILES); $pic_file = $HTTP_POST_FILES['image']; copy ($pic_file['tmp_name'], ../images); } FORM ACTION=?php $SCRIPT_NAME ? Method=Post ENCTYPE=multipart/form-data Input Type=File Name=$image Input Type=Submit Name=Submit /FORM - all i get returned is an empty filename () and an error. please help! Ryan Hank Marquardt [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... http://www.php.net/manual/en/features.file-upload.php On Tue, Nov 27, 2001 at 08:14:48PM -0800, Ryan Stephens wrote: Hey guys... Im new to PHP and am trying to upload images to the server and store the file name into mySQL database.. but i dont have a clue how to do this... all i know is i need to use Input Type=File other than that im lost. Any help would be great. Thanks Ryan Stephens -- 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] -- Hank Marquardt [EMAIL PROTECTED] http://web.yerpso.net GPG Id: 2BB5E60C Fingerprint: D807 61BC FD18 370A AC1D 3EDF 2BF9 8A2D 2BB5 E60C *** Web Development: PHP, MySQL/PgSQL - Network Admin: Debian/FreeBSD *** PHP Instructor - Intnl. Webmasters Assn./HTML Writers Guild *** Beginning PHP -- Starts January 7, 2002 *** See http://www.hwg.org/services/classes -- 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] Newbie Image uplaod question
try changing Input Type=File Name=$image to Input Type=File Name=image -Original Message- From: Ryan Stephens [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 28, 2001 4:13 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Newbie Image uplaod question ok... ive tried this but no go: - function UploadImage(){ global $HTTP_POST_FILES; global $image; reset($HTTP_POST_FILES); $pic_file = $HTTP_POST_FILES['image']; copy ($pic_file['tmp_name'], ../images); } FORM ACTION=?php $SCRIPT_NAME ? Method=Post ENCTYPE=multipart/form-data Input Type=File Name=$image Input Type=Submit Name=Submit /FORM - all i get returned is an empty filename () and an error. please help! Ryan Hank Marquardt [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... http://www.php.net/manual/en/features.file-upload.php On Tue, Nov 27, 2001 at 08:14:48PM -0800, Ryan Stephens wrote: Hey guys... Im new to PHP and am trying to upload images to the server and store the file name into mySQL database.. but i dont have a clue how to do this... all i know is i need to use Input Type=File other than that im lost. Any help would be great. Thanks Ryan Stephens -- 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] -- Hank Marquardt [EMAIL PROTECTED] http://web.yerpso.net GPG Id: 2BB5E60C Fingerprint: D807 61BC FD18 370A AC1D 3EDF 2BF9 8A2D 2BB5 E60C *** Web Development: PHP, MySQL/PgSQL - Network Admin: Debian/FreeBSD *** PHP Instructor - Intnl. Webmasters Assn./HTML Writers Guild *** Beginning PHP -- Starts January 7, 2002 *** See http://www.hwg.org/services/classes -- 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] Newbie Image uplaod question
Sorry... i changed Input Type=File Name=$image to Input Type=File Name=image but still no luck. it returns Array as the file name and doesnt upload the file. Whats up?? Ryan Ryan Stephens [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... ok... ive tried this but no go: - function UploadImage(){ global $HTTP_POST_FILES; global $image; reset($HTTP_POST_FILES); $pic_file = $HTTP_POST_FILES['image']; copy ($pic_file['tmp_name'], ../images); } FORM ACTION=?php $SCRIPT_NAME ? Method=Post ENCTYPE=multipart/form-data Input Type=File Name=$image Input Type=Submit Name=Submit /FORM - all i get returned is an empty filename () and an error. please help! Ryan Hank Marquardt [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... http://www.php.net/manual/en/features.file-upload.php On Tue, Nov 27, 2001 at 08:14:48PM -0800, Ryan Stephens wrote: Hey guys... Im new to PHP and am trying to upload images to the server and store the file name into mySQL database.. but i dont have a clue how to do this... all i know is i need to use Input Type=File other than that im lost. Any help would be great. Thanks Ryan Stephens -- 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] -- Hank Marquardt [EMAIL PROTECTED] http://web.yerpso.net GPG Id: 2BB5E60C Fingerprint: D807 61BC FD18 370A AC1D 3EDF 2BF9 8A2D 2BB5 E60C *** Web Development: PHP, MySQL/PgSQL - Network Admin: Debian/FreeBSD *** PHP Instructor - Intnl. Webmasters Assn./HTML Writers Guild *** Beginning PHP -- Starts January 7, 2002 *** See http://www.hwg.org/services/classes -- 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] Directory Contents Listing
Greetings ! How do I display the directory contents using PHP? Regards, DT -- 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] Newbie Image uplaod question
rf: http://www.php.net/manual/en/features.file-upload.php $userfile - The temporary filename in which the uploaded file was stored on the server machine. $userfile_name - The original name or path of the file on the sender's system. $userfile_size - The size of the uploaded file in bytes. $userfile_type - The mime type of the file if the browser provided this information. An example would be image/gif. so you'd use $image_name instead of $image -Original Message- From: Ryan Stephens [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 28, 2001 4:17 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Newbie Image uplaod question Sorry... i changed Input Type=File Name=$image to Input Type=File Name=image but still no luck. it returns Array as the file name and doesnt upload the file. Whats up?? Ryan Ryan Stephens [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... ok... ive tried this but no go: - function UploadImage(){ global $HTTP_POST_FILES; global $image; reset($HTTP_POST_FILES); $pic_file = $HTTP_POST_FILES['image']; copy ($pic_file['tmp_name'], ../images); } FORM ACTION=?php $SCRIPT_NAME ? Method=Post ENCTYPE=multipart/form-data Input Type=File Name=$image Input Type=Submit Name=Submit /FORM - all i get returned is an empty filename () and an error. please help! Ryan Hank Marquardt [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... http://www.php.net/manual/en/features.file-upload.php On Tue, Nov 27, 2001 at 08:14:48PM -0800, Ryan Stephens wrote: Hey guys... Im new to PHP and am trying to upload images to the server and store the file name into mySQL database.. but i dont have a clue how to do this... all i know is i need to use Input Type=File other than that im lost. Any help would be great. Thanks Ryan Stephens -- 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] -- Hank Marquardt [EMAIL PROTECTED] http://web.yerpso.net GPG Id: 2BB5E60C Fingerprint: D807 61BC FD18 370A AC1D 3EDF 2BF9 8A2D 2BB5 E60C *** Web Development: PHP, MySQL/PgSQL - Network Admin: Debian/FreeBSD *** PHP Instructor - Intnl. Webmasters Assn./HTML Writers Guild *** Beginning PHP -- Starts January 7, 2002 *** See http://www.hwg.org/services/classes -- 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] how to transfer a local DB to a DB on Server ?
does anyone know ? pls help me, thanks... -- 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] LDAP sorting
Hi All- Can anyone tell me if PHP's LDAP functions support server side sorting of search results as defined in this RFC: http://www.ietf.org/rfc/rfc2891.txt Sorting results from LDAP searches in PHP is a pain because of the structure of the result array. Alternatively if anyone has a nice function for sorting the array returned by ldap_get_entries() by any desired attribute, that would be a great help also. Cheers. Regards, Adam Whitehead Systems Developer - Computer Support and Maintenance Ph. (08) 8936 3164 ** Mobile (0411) 241 120 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]
Re: [PHP] Directory Contents Listing
Deependra B. Tandukar [EMAIL PROTECTED] wrote: How do I display the directory contents using PHP? See readdir() in the online manual. I'm pretty sure it even has example code you could paste in. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.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]
Re: [PHP] how to transfer a local DB to a DB on Server ?
trongduc [EMAIL PROTECTED] wrote: does anyone know ? pls help me, thanks... Very open-ended, do you have some details? What type of database? Is this really PHP related? The short answer is to use a program to generate SQL statements for all of the source db's tables and pipe the SQL statements to the target db to recreate the database. For example, mysqldump and pg_dump are available for mysql and postgresql respectively. Or if your db supports it and the source and target machines are similar you may be able to copy the database files directly from the source machine to the destination machine using FTP. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.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]
Re: [PHP] Apache 2.0.28 and PHP 4.0.6
I haven't read the original message, so this is only a guess. --with-apxs2 Mick On Wed, 28 Nov 2001, Larz wrote: Is it possible to compile and make it work under linux without any changes? I mean is there a --with-apache2 or something? -- - Lars When mailing me, remember there is no truth in my mail! -- Michael Hall [EMAIL PROTECTED] [EMAIL PROTECTED] http://openlearningcommunity.org -- 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] php and tables
i have created a program that allows users to make custom sql queries to a mysql db and display the output to the browser. the program works as desired but what i would like to do is display the data in a table. as there can be up to 4 columns with up to 13 different titles, i cannot hard code this info in. i would like to have the title used in the query to the be the title of the table with the relevant data below in an easily read format. here is a sample of my code can any one help??? function db_search(){ global $search,$search0,$search1,$search2,$search3,$where,$boulean,$variable; // from the subnet and the host make the ip address $ip_addr = $ip . $address; // check to see if the variable is empty and discard other wise add the contents to $field if(!empty($search)) { $field .= $search, ; } if(!empty($search0)) { $field .= $search0, ; } if(!empty($search1)) { $field .= $search1, ; } if(!empty($search2)) { $field .= $search2, ; } if(!empty($where)) { $field1 .= $where ; } if(!empty($search3)) { $field1 .= $search3 ; } if(!empty($boulean)) { $field1 .= $boulean ; } if(!empty($variable)) { $field1 .= '$variable' ; } //strip the last character off of $field $field = substr($field,0,strlen($field)-2); //$field1 = substr($field1,0,strlen($field1)-2); // prepare the query $sql = select $field from machine $field1 ; print $field; // action the query $result = mysql_query($sql) or die (Cannot do query, query = $sql); // Printing results in HTML print table\n; while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { print \ttr\n; foreach ($line as $col_value) { print \t\ttd$col_value/td\n; } print \t/tr\n; } print hr width='100%'; print /table\n; print hr width='100%'; echo \n\ncenterYour Job has Completed/center\n\n\na href=\javascript:history.back();\\n\ncenterBack/center/a; } -- 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] ¡îÑ°ÕÒJSPÐéÄâÖ÷»ú£¿¿´¿´ÎÒÃÇΪÄúÌṩʲôÑùµÄ·þÎñ°É
Ñ°ÇóÒ»¸öºÃµÄÓòÃû¡¢¸ßËÙÎȶ¨µÄ¿Õ¼ä? ÄǾÍÇëÄúÀ´ÕâÀï¿´¿´°É£º http://www.now.net.cn ʱ´´ÍøÂ磡 ¡î ÂÊÏÈÖ§³ÖJSP ¼°×îбê×¼JDBC Êý¾Ý¿â£¬ÍêÈ«½â×¼ÖÐÎļ°Êý¾Ý¿âÖÐÎÄÎÊÌâ ¡î ¶àÖÖ¶¯Ì¬½Å±¾°üÀ¨ ASP£¬PHP,CGI £¬PERL5.6 ,JSP,Servlet , »¹ÓпìËÙCGI £¬¿ìËÙPERL£¨fcgi)Ö§³Ö£¬ PHPÒ²´ø×îмÓËÙÒýÖ¿£¡ (Ïê¼û:http://www.now.net.cn/host/) ¡î ¶àÖÖÊý¾Ý¿âÖ§³Ö£¬°üÀ¨ SQL SERVER2000 MYSQL MYSQL-MAX ACESS ¡î ¶ÀÓеĿÉÊÓ»¯ÓòÃû·þÎñÆ÷VDNSϵͳ£¬Ê¹ÓÃÄÜÈÎÒâµØ½¨Á¢ÄúµÄ×ÓÓòÃû¼°×ÓÍøÕ¾ (Ïê¼û:http://www.now.net.cn/support/VDNSFAQ.net ÓòÃû×¢²á°üÀ¨ : .com .net .org .biz .info .cc .tv .sh .com.cn .net.cn .gov.cn .org.cn ) ¡î ȫеÄÆóÒµÓʼþϵͳ£¬³¬´óÈÝÁ¿¡¢Ç¿´óµÄ¹¦ÄÜ£¬»¹ÓÐÍêÕû¹ÜÀíºǫ́£¬ ½¨Á¢Äú¹«Ë¾µÄÆóÒµÓʾ֣¬Ö»ÊǼ¸·ÖÖÓµÄÊ£¡ (Ïê¼û:http://www.now.net.cn/email) ÎÒÃÇ»¹ÌṩIDC¡¢Ö÷»úÍйܡ¢Ö÷»ú×âÁÞ¡¢ÆóÒµµç×ÓÓʾÖϵͳ£¬·þÎñ¸üºÃ£¬¼Û¸ñ¸üÓÅ£¡ http://idc.now.net.cn ¿ìµ½http://www.now.net.ʱ´´ÍøÂç°É£¡¿ÉÄÜ»áÒâÏë²»µ½µÄ¾ªÏ²¡¡¡¡¡¡¡¡.. ^-^ ʱ´´ÍøÂç ÁªÏµÈË£ºÇñС½ã »ÆС½ã »¶ÓÄú·ÃÎÊToday's Network lt;http://www.now.net.cngt; »¶ÓÄúÖÂÐÅToday's Network [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] Hierarchies
Hi, I need to display hierarchies (hierarchical structures). I have a MYSQL table with data like this: Node,Parent A, B,A C,A D,B E,B F,D G,A It can go down to 10 levels. I do not want display one level and then click to display the next, I want to see the entire tree at once, say like this: A ---B --D -F --E ---C ---G Any ideas, scripts on how I can do this? I seems like I have to use a recursive function and /or arrays? Any help will be appreciated! Thanks MH -- 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] Help me!
Could Anybody help me ? I have the problem with installation of my PHP and Apache Web Server running on OS AIX Version 4.3! and use RDBMS Oracle8i Enterprise Edition Release 8.1.7.0.0. When I installed them, founded any error. I use the downloaded sources are apache_1.3.22-000964804C00-ibm-aix4.3.tar.gz and php-4.0.3pl1.tar.gz. What does the recomended apache source and php source ? Is Any the best practise of guide installation ? Thanks Punkq
[PHP] detection and resolving of blocking functions ...
Hi, I originally posted this message to the php-db list, but I think that although this seems originally an oracle related problem ... there must be a PHP solution to it. What I'm looking for is a way to detect and destroy or interrupt a blocking function. Below, in the example in the original post, the OCIServerVersion function just hangs the entire application when the network connection is removed, and I find no way to overcome this. If you have any experiences regarding this kind of problems, please let me know, as this is starting te become a major blocker ;-) Thanks a lot in advance ... Christophe VG --- Hi, While writing an app that regularly checks an oracle database for new entries I run into problems when the database server suddenly goes offline (the network connection can't be trusted). The call right after such a connection loss just hangs the application. Here is a little example to illustrate ... ? ob_implicit_flush(); $cnn = OCILogon( 'scott', 'tiger' ); function valid_cnn( $cnn ) { return ( trim( OCIServerVersion($cnn) ) != '' ); } while( true ) { print valid_cnn( $cnn ) ? OK\n : DOWN\n; sleep(1); } ? Running it results in a nice collection of OK's and a hangup when I disconnect the network. Plugging the network back in resumes the series of OK's after a while ... But the desired behaviour ( DOWN ) won't appear. Did anyone of you encountered a similar situation ? How did you solve this ? ... Any ideas are good, since I'm a bit stuck and any lead might help to a probably very simple solution (that I just can see rigth now) Thanks in advance, Christophe VG -- 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] Coding methods (was RE: [PHP-DB] gzip image files)
$filename = 'kunden/'.$name.'.png'; I see this all the time and I'm curious: what takes more computing power (granted, either would be incredibly little I'm sure, just curious which requires more work by PHP)? this: $filename = this . $varname . that; or this: $filename = this $varname that; I would think the latter example but am not sure. Another question, but this is more about personal style: I almost always use the latter method in my coding practices. It looks cleaner and, IMO, is easier to follow especially when there are a number of variables involved. For those that use the former method, why do you? I'm not trying to be judgemental, just curious why people do what they do. In asking, I may actually learn some- thing. :p Chris
RE: [PHP] Coding methods (was RE: [PHP-DB] gzip image files)
I use the latter style, because otherwise my syntax highlighting doesn't kick in. $filename = this $varname that; # $filename is in blue, the rest is in green $filename = this. $varname. that; # $filename and $varname are in blue, the rest is in green I've done it so much now it's burned into a finger macro, takes 0.01 seconds longer to type (approx) Cheers Jon -Original Message- From: Boget, Chris [mailto:[EMAIL PROTECTED]] Sent: 27 November 2001 15:29 To: [EMAIL PROTECTED]; '[EMAIL PROTECTED]' Subject: [PHP] Coding methods (was RE: [PHP-DB] gzip image files) $filename = 'kunden/'.$name.'.png'; I see this all the time and I'm curious: what takes more computing power (granted, either would be incredibly little I'm sure, just curious which requires more work by PHP)? this: $filename = this . $varname . that; or this: $filename = this $varname that; I would think the latter example but am not sure. Another question, but this is more about personal style: I almost always use the latter method in my coding practices. It looks cleaner and, IMO, is easier to follow especially when there are a number of variables involved. For those that use the former method, why do you? I'm not trying to be judgemental, just curious why people do what they do. In asking, I may actually learn some- thing. :p Chris ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** -- 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]