Re: [PHP] My first XML!
Here's a start for you ? /* Connect to database */ $sql = SELECT * FROM categories ORDER BY parent_id,cat_id ASC; $result = @mysql_query($sql) or die(Couldn't select categories.); $menu = array(); while ($row = mysql_fetch_array($result)) { $id = $row['cat_id']; $category = $row['category']; $pid = $row['parent_id']; $menu[$pid][$id] = $category; } function show_cats ($parent=, $indent=) { global $menu; foreach($menu as $key1 = $value1) { if ($key1 == $parent) {// if it's a top category print it foreach ($value1 as $key2 = $value2) { $catname = $value2; // $value2 same as $value1[$key2] $catID = $key2; echo str_repeat(nbsp;nbsp;, $indent); echo a href=\search/show_results.php?catID=$catID\$catname/abr; show_cats($catID, $indent+1); } } } } // end show_cats function show_cats(); ? --- Boris Kolev [EMAIL PROTECTED] wrote: Hello php-general, Hi. I want to know how i can export tree structure from Mysql table to XML mysql table structure is: ID - Group Unique Id P_ID - Parent Id Name - Name of group I want to make XML whit tree structure. Can some body help me! -- Best regards, Boris mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php bugs (Chinese word display problem)-help
Hello, Tom Culpepper [EMAIL PROTECTED] wrote: I am not positive of the problem as I can not see your code, but if you want to display the words that end in '5C' the you can do them like so: \(escape character) like this: \(95 5C 5C) Putting a space (or some other character) after the character in question is actually a good workaround--though not really a solution :( Anyway, this kind of problem also exist with Chinese characters used in Japanese (sjis encoding). There could be various ways to handle this but here are some: 1. Try using a different encoding. Like utf-8 or some other Chinese encoding. (In Japanese, you can use euc instead of sjis.) 2. Creating your own addslashes function for escaping. These are basically from the Japanese ML: (It's, of course, in Japanese.) http://ns1.php.gr.jp/pipermail/php-users/2001-August/001641.html By the way Samuel, there's a patched version of php that I've mention here: http://marc.theaimsgroup.com/?l=php-generalm=103781121614978w=2 The patched version corrected some problems having to do with multi-byte strings so it might just work for Chinese as well. There were also some other info in the site I mentioned above but I'm afraid they're all in Japanese so... Anyway, I justed to post some ideas that might help. Also, please make sure to check the manual about multibyte strings-- http://www.php.net/manual/en/ref.mbstring.php - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: amp; in Query String
Hello, Chris Shiflett [EMAIL PROTECTED] wrote: [snip] Does it not work for you? [/snip] It does, just like I said earlier :) Anyway, I just wanted to add that not only in IE6 but even in NN4 or N7 (also in linux) it works perfectly fine. - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Invalid Charactors in a string.
Gidday Philip, Full answer: http://www.oreilly.com/catalog/regex/ Short answer: PHPBuilder etc have articles introducing the use of RegExes (Regular Expressions) for this sort of thing. (but please not the Arthurian how do I validate an email address...) Regards, =dn Where should i start, tips wanted. I would like to check a username string for valid charactors before the name is processed. Someone point me in the right direction please --- Philip J. Newman. Head Developer. PhilipNZ.com New Zealand Ltd. http://www.philipnz.com/ [EMAIL PROTECTED] Mob: +64 (25) 6144012. Tele: +64 (9) 5769491. VitalKiwi Site: Philip J. Newman Internet Developer http://www.newman.net.nz/ [EMAIL PROTECTED] * Friends are like Stars, You can't always see them, But you know they are there. * ICQ#: 20482482 MSN ID: [EMAIL PROTECTED] Yahoo: [EMAIL PROTECTED] AIM: newmanpjkiwi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Changing SERVER's IP ADDRESS
Hai Jason, Thanks a lot for the reply. you are right I call the perl script in form page. How to output a meta refresh tag from PHP? and is it in form or in the main page? In form page after I call the perl script which changes the IP address of the server, I have header(Location:https://$HTTP_HOST/mainpage.php;);( I use https) which tries to redirect to main page. Can you please explain me where should I output meta refresh tag. Is the meta refresh tag is the same as the one I have in HTML. meta http-equiv=refresh content =15 regards, adharsh. Jason Wong wrote: On Wednesday 27 November 2002 15:52, Adharsh Praveen R wrote: hai php-general, I want to know how can I redirect the browser to contact to a new ip address of the same server. In Detail I have a server say 192.168.1.10 (eth0) running apache.( Linux Machine running Apache). I contact the server through a client(Browser), through this client I change the IP address of the server, from 192.168.1.10 to 192.168.1.15. (After entering IP Address in the text field and clicking on the button save I call Presumably this is done in a form and submitted to a php page which then calls your perl script? a perl script which calls ifconfig to change the address,perl script is called with exec() ). After few seconds I get Page cannot be found message as the browser tries to contact the old IP address. How can I make the client point to the new IP address of the same server? Have your php output a meta refresh tag. I can show the code also. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Encyclopedia for sale by father. Son knows everything. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php/mysql report builder
Hi Mike; sorry for posting this mysql question again. im searching for a report builder for mysql specifically for creating reports for invoice/receipt..etc. just like crystal reports and oracle report builder. or is there any suggestion to do it in PHP . On my travels (FWIW) I have seen nothing as sophisticated as Crystal/Oracle*Reports (and certainly not open/free) - however I have been v.pleased not to be asked to provide such (well I was once, but he was such an Excel 'expert', I gave him the data and let him while away many 'happy' hours...) You have reminded me that before I was dragged away onto another project/product set, I had started to play with JaneBuilder (www.seejanecode.com/). Which is really simple but seems to do a heap of basic 'grunt work' of turning table schema into display/data-entry forms, etc. May be a start!? Please let us know your findings, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] spawing new PHP process
In article [EMAIL PROTECTED], Robert McPeak [EMAIL PROTECTED] wrote: I have other situations where I would like to somehow spawn a new php process so that the page loads quickly and my user doesn't get frustrated or confused. Hang on, there's lots of talking around the point here. This is not hard. Look in the manual under pcntl_fork. This will let you create a separate process that stays running all the time (not just when you're running a web page) and you can send commands to either using pcntl_signal (docs are out of date - also look up ticks) or through your database. You will need to have the CGI version of PHP installed, as well as mod_php - and in 4.3 this happens very easily. Having said all that, I've run into a separate probem further down the road doing just what you're wanting to do. My back-end process runs perfectly with no problems but after 5 mins or so starts generating chunk/page already free errors, then crashes. Looks to be a bug in there somewhere, but not sure where yet. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Newbie : How work with parameters?
Hello, I want to read the parameters in the URL, but I can't find the right way to do that. I've tried several things : my URL is: http://localhost/test.php?id=abc I tried to use the $id, but in this case, I have a notice with 'undefined variable'. I have the same problem if I try the variable $QUERY_STRING (still undefined variable). Do you know what is the best way to read this parameters? Many thanks Stéphane -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie : How work with parameters?
At 09:58 27.11.2002, Stéphane Génin said: [snip] I want to read the parameters in the URL, but I can't find the right way to do that. I've tried several things : my URL is: http://localhost/test.php?id=abc Check out the PHP manual at http://www.php.net/manual/en/reserved.variables.php#reserved.variables.get I tried to use the $id, but in this case, I have a notice with 'undefined variable'. I have the same problem if I try the variable $QUERY_STRING (still undefined variable). Do you know what is the best way to read this parameters? Most certainly, register_globals is OFF in your php.ini. This is the default setting since PHP 4.2, for security reasons. Read http://www.php.net/manual/en/security.registerglobals.php on the security issues with register_globals = on. To access parameters, generally use the superglobals arrays $_GET (parameters passed in the URL), $_POST (passed in posted forms), $_REQUEST (both get and post combined), and $_COOKIE (cookies passed to your script). Hope this gets you started. You may always find it helpful to refer to the _extremely_ well done online manual at http://www.php.net/manual/en/. Regards, -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie : How work with parameters?
Use the superglobal array $_GET echo $_GET{'id'}; // should return abc Cheers Scott Stéphane Génin wrote, On 11/27/2002 10:58 AM: Hello, I want to read the parameters in the URL, but I can't find the right way to do that. I've tried several things : my URL is: http://localhost/test.php?id=abc I tried to use the $id, but in this case, I have a notice with 'undefined variable'. I have the same problem if I try the variable $QUERY_STRING (still undefined variable). Do you know what is the best way to read this parameters? Many thanks Stéphane -- Scott Houseman Senior Software Developer Junk Mail Publishing (Pty) Ltd T + 27 12 342 3840 ext 2806 F +27 12 342 3876 E [EMAIL PROTECTED] | www.junkmail.co.za A 1312 Pretorius Street, Hatfield, Pretoria P O Box 6574, Pretoria, 0001, South Africa +27 82 491 8021 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Newbie : How work with parameters?
Stephane http://www.php.net/manual/en/security.registerglobals.php http://www.php.net/manual/en/faq.php Substitute 'fr' for 'en' if your prefer it en francais Use: $_GET['id'] or $_REQUEST['id'] Ciao Rich -Original Message- From: Stéphane Génin [mailto:[EMAIL PROTECTED]] Sent: 27 November 2002 08:58 To: [EMAIL PROTECTED] Subject: [PHP] Newbie : How work with parameters? Hello, I want to read the parameters in the URL, but I can't find the right way to do that. I've tried several things : my URL is: http://localhost/test.php?id=abc I tried to use the $id, but in this case, I have a notice with 'undefined variable'. I have the same problem if I try the variable $QUERY_STRING (still undefined variable). Do you know what is the best way to read this parameters? Many thanks Stéphane -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Decrypt Password
Stephen wrote: That's what I'm going to do but how can I pull it from the database to decrypt it, then send it? You can't. Well that depends what method you used to create the passwords, but most likely you used a one-way encryption. How to solve the problem then? 1. User klicks link 'Forgot my password' 2. Generate a one-time password for this user. Do not change the users ordinary password yet. 3. Send mail to user with the one-time pw. This must be a verified mailaddress. 4. Let the user enter his login/mailaddress and the one-time pw to login. 5. Let the user enter a new pw. Then update the dB. That's one way to do it with reasonable security. Regards Joakim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Confirm message box
Hi Wilmar, And when the user hits the Delete link a pop up dialog box (javascript style) asks for confirmation. Not a big deal. Your PHP script has to generate Links like: a href=myscript.php?del=xy onClick=return confirm('really delete?')delete/a where xy is the id of your record. The link will be followed after a positive conformation, myscript.php can delete the record. Good luck Keith -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Confirm message box
I use this javascript code: function confirmAction(question, uri) { if(confirm(question)){ document.location=uri + 'confirm=1'; } return false; } create link like this: a href=delete.php onclick=return confirmAction('Do you really ...?','delete.php?')delete/a If user has javascript enabled, on delete.php you will get $_GET['confirm']=1, and you know the action has been confirmed and go straight to deleting. If user has no javascript, you won't receive $_GET['confirm'], thus you know you need to confirm the action using php/html. PS: even if you don't need parameters to your script, add at least ? for it to work. Wilmar Perez wrote: Hello guys I have an script that just shows a list of names brought from a data base as this: name 1 name 2 etc... I want to have the following: name 1 Delete name 2 Delete etc... And when the user hits the Delete link a pop up dialog box (javascript style) asks for confirmation. I guess this is a simple task but being my first time mixing php and javascript variables I'm a bit confused. It would be nice if someone could point me at an example or a tutorial that may help me (I already did some searching but couldn't find anything useful). Thanks a lot *** Wilmar Pérez Network Administrator Library System Tel: ++57(4)2105962 University of Antioquia Medellín - Colombia 2002 *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 27 Nov 2002 11:17:23 -0000 Issue 1729
php-general Digest 27 Nov 2002 11:17:23 - Issue 1729 Topics (messages 126201 through 126259): Re: amp; in Query String 126201 by: Ernest E Vogelsinger 126209 by: Chris Shiflett 126247 by: . Edwin session problems 126202 by: Jason Romero 126207 by: John W. Holmes 126233 by: conbud 126236 by: conbud Re: Problems with a simple While-If condition 126203 by: Bret L Conard 126205 by: Jason Romero Re: URL hiding 126204 by: Marco Tabini 126211 by: Kris 126213 by: Marco Tabini 126219 by: Bob Irwin 126224 by: John Nichel Re: deleting a record. 126206 by: Peter Houchin Re: Problems with a simple While-If condition With the statement 126208 by: Rodrigo de Oliveira PHP zipcode distance class 126210 by: UberGoober Re: Multiple page form 126212 by: Verdon Vaillancourt 126226 by: . Nilaab Re: Need email solution 126214 by: Bryan Koschmann - GKT displaying record number in a cell in a table 126215 by: Peter Houchin 126217 by: Van Andel, Robert 126220 by: Peter Houchin testing for empty array 126216 by: poliva.cox.net 126218 by: Van Andel, Robert 126221 by: Kyle Gibson 126222 by: Morgan Hughes php/mysql report builder 126223 by: Michael P. Carel 126225 by: John W. Holmes 126227 by: Miles Thompson 126250 by: DL Neil php bugs (Chinese word display problem)-help 126228 by: samuel.3give.com 126229 by: Tom Culpepper 126234 by: samuel.3give.com 126246 by: . Edwin How do i provide Download facility ?? 126230 by: Venkatesh Hosur 126232 by: Chris Shiflett 126235 by: Justin French Re: Linux Question 126231 by: Justin French Re: php version of majordomo? 126237 by: Jason Wong Invalid Charactors in a string. 126238 by: Philip J. Newman 126239 by: Tom Culpepper 126243 by: Justin French 126248 by: DL Neil My first XML! 126240 by: Boris Kolev 126245 by: olinux Changing SERVER's IP ADDRESS 126241 by: Adharsh Praveen R 126244 by: Jason Wong 126249 by: Adharsh Praveen R array manipulations 126242 by: Mattia Wow Re: spawing new PHP process 126251 by: Geranium Newbie : How work with parameters? 126252 by: Stéphane Génin 126253 by: Ernest E Vogelsinger 126254 by: Scott Houseman 126255 by: Rich Gray XSLT support for RH8 126256 by: Dan Kuykendall Re: Decrypt Password 126257 by: Joakim Andersson Re: Confirm message box 126258 by: Keith Sauvant 126259 by: Marek Kilimajer 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--- At 00:00 27.11.2002, Jonathan Rosenberg \(Tabby's Place\) said: [snip] Ok ... I take back what I said about amp; not working in a query string. It works just fine. [snip] Ahhh - and I just created a test page for all to check out... nevertheless, here it is: http://www.vogelsinger.at/test.php Simply provides a link using query parameters encoded with amp;, to check with different browsers. Maybe someone will check this outwith his browser anyway. -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ ---End Message--- ---BeginMessage--- --- Jonathan Rosenberg [EMAIL PROTECTED] wrote: I tried it it fails. The browser sends the query string with the amp; the $_GET access fails. I am using IE 6. I can't imagine that it would be buggy in this regard. I just tried this in IE 6, and it worked fine for me. My test code follows: ? if (isset($_GET[foo])) { echo pre; print_r($_GET); echo /pre; } else { ? a href=./test.php?foo=baramp;blah=blahClick Here/a ? } ? This should display: Array ( [foo] = bar [blah] = blah ) Does it not work for you? Chris ---End Message--- ---BeginMessage--- Hello, Chris Shiflett [EMAIL PROTECTED] wrote: [snip] Does it not work for you? [/snip] It does, just like I said earlier :) Anyway, I just wanted to add that not only in IE6 but even in NN4 or N7 (also in linux) it works perfectly fine. - E ---End Message--- ---BeginMessage--- when using session registered variables i can only get them to save as session variables for one page then on the next page they are gone far as i can tell the variables are not getting written over or unset and the session is not gettting destroyed any other ideas what it might be? Jason ---End Message--- ---BeginMessage--- when using session registered variables i can only
[PHP] XSLT support for RH8
I cannot seem to get RH8 to to compile XSLT support. Has anyone else gotten this to work? Anyone with the resulting php-xslt rpm? Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Identifying users
Anyone know off of hand - Is there a reliable/semi-reliable way of looking users up by country. e.g - On the likes of altavista or google, I have noticed that if you type in www.altavista.com and you are in the uk, it will redirect to uk.altavista.com, and google aswell for certain countrys. Anyone any Ideas? Craig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is it possible to do this in PHP ? If it is then, how ?
Hi, I was wondering if this is possible to in PHP ... I am developing an application for a pizza place, where touch typing interface is much faster than using the mouse, so I was wondering if I can develop an interface with a calculator style keypad, and the codes entered (using something like STDIN in Perl), are automatically compared to the MySQL database to provide realtime feedback to the user, such as code 32 is hawaian pizza, and after the user enters code 32 Hawaian pizza get's displayed as feedback ... and then awaits for some other input such as size, etc... i.e. x- 32 Hawaian pizza14 $ 12 xx xxx Total = Thanks in advance, Ricardo Fitzgerald AXIS Computers Web development __ Omni ICQ#: 37031810 Current ICQ status: + More ways to contact me __ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Identifying users
Try http://www.xpenguin.com/ip-atlas.php Craig wrote: Anyone know off of hand - Is there a reliable/semi-reliable way of looking users up by country. e.g - On the likes of altavista or google, I have noticed that if you type in www.altavista.com and you are in the uk, it will redirect to uk.altavista.com, and google aswell for certain countrys. Anyone any Ideas? Craig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to do this in PHP ? If it is then, how ?
Axis Computers wrote: Hi, I was wondering if this is possible to in PHP ... I am developing an application for a pizza place, where touch typing interface is much faster than using the mouse, so I was wondering if I can develop an interface with a calculator style keypad, and the codes entered (using something like STDIN in Perl), are automatically compared to the MySQL database to provide realtime feedback to the user, such as code 32 is hawaian pizza, and after the user enters code 32 Hawaian pizza get's displayed as feedback ... and then awaits for some other input such as size, etc... I can't think of any reason why not. Obviously this won't be a web application :) Though a good design could be re-used to form an online ordering application also. Cheers, Rob. -- .-. | Worlds of Carnage - http://www.wocmud.org | :-: | Come visit a world of myth and legend where | | fantastical creatures come to life and the | | stuff of nightmares grasp for your soul.| `-' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem on OpenDir()
Jack wrote: Dear Joakim First of all, thx for the reply and here is the code : ? include 'phpstudy/constant.inc'; $link=mysql_pconnect(HOST,USER,PASSWD); mysql_select_db(DBNAME,$link); file://Define Date format $currentyear = date('y'); $currentmonth = date(m); $previousmonth=$currentmonth -1; $curmondate=date(Y).$currentmonth; $premondate=date(Y).$previousmonth; // Define file extension, file path, share path $ext=.pdf; $filepath=c:/pdf_reports/Bills/Oct02/; $sharepath=/Nedcoraphk/pdf_reports/Bills/; file://open the directory (c:\pdf_reports\bills) $handle=opendir($filepath); while (false!==($file=readdir($handle))) { if (ereg(2002,$file)) { print ($file.br); } } closedir($handle); file://check if the directory exist for last month file://Folder's Name $folder=date(M,mktime(0,0,0,$previousmonth,1,$currentyear)); $dirname=Oct-02; if (is_dir(Oct-02)) { print (Good); } ? here is the Error Message : Warning : OpenDir: Invalid argument (errno22) in c:\inetpub\wwwroot\nedcor internal live\reports\bills\reports\page.php on line 21 and second error message : Warning Supplied argument is not a valid Directory resource in c:\Interpub\wwwroot\nedcor internal live\reports\bills reports\page.php on line 22 have you seems somthing like this before? Thx a lot jack Try these, one at the time... $filepath=c:\\pdf_reports\\Bills\\Oct02\\; $filepath=c:\\pdf_reports\\Bills\\; How are your permissions set up? Are they the same on Bills and the subfolder Oct02? I see that among the last lines you have a referense to Oct-02. Please check at least two more times that you have got the folder name right at all places in your scripts. Have you tried to delete (or just move) the subfolder and create it again? Regards Joakim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to do this in PHP ? If it is then, how ?
I was wondering if this is possible to in PHP ... I am developing an application for a pizza place, where touch typing interface is much faster than using the mouse, so I was wondering if I can develop an interface with a calculator style keypad, and the codes entered (using something like STDIN in Perl), are automatically compared to the MySQL database to provide realtime feedback to the user, such as code 32 is hawaian pizza, and after the user enters code 32 Hawaian pizza get's displayed as feedback ... and then awaits for some other input such as size, etc... Sure, it's possible, but I don't think PHP is the best solution for a program like this. Remember that this would all be a web interface. So you'd have to enter 32, hit Submit, PHP will process the page and show Hawaian Pizza, etc. Maybe PHP-GTK would be a solution for this, but I know almost nothing about it. Google for info. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sorting files in directory
Hi all, I have several directories filled with files written like this: * 02-09-19-filename.etc * 02-10-02-anotherfile.whatever How does php order these files if read from the directory and printed to the screen? -- I need them in date order, do I need to sort them somehow? Many thanks... -- Nick Wilson // www.tioka.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do i provide Download facility ??
Perhaps he wants to track downloads of files and obscure the physical locations... Justin French [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, I am a newbie in this PHP world. I was just looking around for information on Download of files using PHP. I need to provide link/button, by clicking which a user can download a file (Say a CSV file..). Does PHP provide any class or methods to achieve the same...? Looking forward for your suggestions ... Why do you need it to be anything to do with PHP? You need to tell us more information, because plain HTML like this works fine: a href=myfile.csvClick here to download the CSV file/a ...but I assume you want to restrict file downloads to only logged in users, or you wish to count the number of downloads, or something else?? Justin French http://Indent.com.au Web Development Graphic Design -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php/mysql report builder
http://www.phplens.com/ might be something you could use. Michael P. Carel [EMAIL PROTECTED] wrote in message 002d01c295b8$f0301800$[EMAIL PROTECTED]">news:002d01c295b8$f0301800$[EMAIL PROTECTED]... hi to all; sorry for posting this mysql question again. im searching for a report builder for mysql specifically for creating reports for invoice/receipt..etc. just like crystal reports and oracle report builder. or is there any suggestion to do it in PHP . any idea? thanks in advance Regards, mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to do this in PHP ? If it is then, how ?
I was wondering if this is possible to in PHP ... I am developing an application for a pizza place, where touch typing interface is much faster than using the mouse, so I was wondering if I can develop an interface with a calculator style keypad, and the codes entered (using something like STDIN in Perl), are automatically compared to the MySQL database to provide realtime feedback to the user, such as code 32 is hawaian pizza, and after the user enters code 32 Hawaian pizza get's displayed as feedback ... and then awaits for some other input such as size, etc... I can't think of any reason why not. Obviously this won't be a web application :) Though a good design could be re-used to form an online ordering application also. You could go one step further and develope it for use with a touch screen then you could just write it as a web application and run it thru a full-screen browser :) (Which I have done - using php, mysql and full-screen IE :) - and is a nice solution for such issues - if feasable). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/MySQL Installation
At 20:44 25.11.2002, manh spoke out and said: [snip] I am a beginner of PHP/MySQL. I have tried several times to install PHP3 and MySQL (free products) to conduct some web pages for my company, but lots of trouble came up. I just followed the instruction on www.php.net but it did not help. [snip] What platform are you on? Just out of interest - why are you trying to install PHP3 - current version is PHP 4.2, available on all platforms. If you have a Linux distribution, most certainly PHP is already there, check it out with locate php or whereis php. For Win32 there are prefab'ed binaries, including an installer, downloadable at PHP's web site: http://www.php.net/downloads.php -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/
Re: [PHP] Is it possible to do this in PHP ? If it is then, how ?
Using javascript you can change the src of image. So you start with blank image, and if onchange event handler finds out the input field has two chars, changes the src of the image to say show_image.php?id=input.value Axis Computers wrote: Hi, I was wondering if this is possible to in PHP ... I am developing an application for a pizza place, where touch typing interface is much faster than using the mouse, so I was wondering if I can develop an interface with a calculator style keypad, and the codes entered (using something like STDIN in Perl), are automatically compared to the MySQL database to provide realtime feedback to the user, such as code 32 is hawaian pizza, and after the user enters code 32 Hawaian pizza get's displayed as feedback ... and then awaits for some other input such as size, etc... i.e. x- 32 Hawaian pizza14 $ 12 xx xxx Total = Thanks in advance, Ricardo Fitzgerald AXIS Computers Web development __ Omni ICQ#: 37031810 Current ICQ status: + More ways to contact me __ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need email solution
Not free or Opensource or anything, but our company has had very good results with a package called iMail. http://www.ipswitch.com/Products/IMail_Server/index.html On Tue, 2002-11-26 at 15:38, Manuel Ochoa wrote: I'm setting up a Windows 2000 server with Apache, PHP and MySQL. I also need to setup email service for 1 domain name. I'm looking for any suggestions on SMTP software. -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
RE: [PHP] sorting files in directory
I've done this by reading the directory contents into an array and then sorting that array. This really sorts on filename and not date, but your filenames seem to contain dates so this might work for you. James Hicks -Original Message- From: Nick Wilson [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 27, 2002 8:02 AM To: php-general Subject: [PHP] sorting files in directory Hi all, I have several directories filled with files written like this: * 02-09-19-filename.etc * 02-10-02-anotherfile.whatever How does php order these files if read from the directory and printed to the screen? -- I need them in date order, do I need to sort them somehow? Many thanks... -- Nick Wilson // www.tioka.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sorting files in directory
Yes, you do. Add each dir to an array, sort the array, then loop through it printing the dirs out. Nick Wilson wrote: Hi all, I have several directories filled with files written like this: * 02-09-19-filename.etc * 02-10-02-anotherfile.whatever How does php order these files if read from the directory and printed to the screen? -- I need them in date order, do I need to sort them somehow? Many thanks... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Redirecting after changing server's IP address!
hai php-general, I want to know how can I redirect the browser to contact to a new ip address of the same server. In Detail I have a server say 192.168.1.10 (eth0) running apache.( Linux Machine running Apache). I contact the server through a client(Browser), through this client I change the IP address of the server, from 192.168.1.10 to 192.168.1.15. (After entering IP Address in the text field and clicking on the button save I call a perl script which calls ifconfig to change the address,perl script is called with exec() ). After few seconds I get Page cannot be found message as the browser tries to contact the old IP address. How can I make the client point to the new IP address of the same server? I can show the code also. Please help. regards, adharsh. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] object passing by reference
I want to pass a reference to objectA along with other strings to a new objectB( constructor. Where does my go? I just keep getting Fatal error: Call to a member function on a non-object Geoff Hoffman Web Designer/Programmer AZ Interactive Media Group Work: (480) 898-7730 Cell: (480) 231-8323 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Trouble maintaining a session - FIXED
Hey all, Not exactly sure why this fixed it, but when I upgraded the PHP on the NT4 server to PHP 4.2.3, everything worked as I had hoped. I plan on looking into it more, but I just thought that I would let you all know in case anyone else comes across a similar problem in the future. -- _ / Joshua Minnie\ ++---+ | Wild Web Technology| | Independent Web Consultant/Developer | | [EMAIL PROTECTED] | || | Tel : 616.890.1566 | ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] object passing by reference
At 01:34 27.11.2002, Hoffman, Geoffrey spoke out and said: [snip] I want to pass a reference to objectA along with other strings to a new objectB( constructor. Where does my go? I just keep getting Fatal error: Call to a member function on a non-object [snip] Just as the error message says - you're trying to execute a function (like $hObj-foo()) where there's no such function. Would be helpful if you posted some code where the error arises... -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/
[PHP] Newbie Mail() Question...
Is there a way to have an email sent to a specified email address either when a page is accessed, or when a file is downloaded? Maybe I should just be logging the info into a table? Basically, I am trying to set up a secure site that would send the sysadmin an email when a file has been downloaded with reference to the page title and/or filename. I have a feeling that this may be a bit too complicated for a newbie like me... ...Suggestions? Chase -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Redirecting after changing server's IP address!
Is the connection still valid after changing the IP? I think this should work: You should run your perl script from within shutdown function, so it is run after the connection is closed and any output is sent to the browser. Send header('Refresh: 5; url=http://NEW_IP/next_page.php'); to redirect the browser after five seconds, also print some html informing the user he will be redirected, then exit. Your shutdown function will be called, and you can change the ip Adharsh Praveen R wrote: hai php-general, I want to know how can I redirect the browser to contact to a new ip address of the same server. In Detail I have a server say 192.168.1.10 (eth0) running apache.( Linux Machine running Apache). I contact the server through a client(Browser), through this client I change the IP address of the server, from 192.168.1.10 to 192.168.1.15. (After entering IP Address in the text field and clicking on the button save I call a perl script which calls ifconfig to change the address,perl script is called with exec() ). After few seconds I get Page cannot be found message as the browser tries to contact the old IP address. How can I make the client point to the new IP address of the same server? I can show the code also. Please help. regards, adharsh. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sorting files in directory
Justin French wrote I think PHP reads them in date created order, or something else... The order is not guarantied, it just happens to be so. I suppose most filesystems return files in the order they were added to the directory, but also reuse the space left after deleting a file. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Jobs -- Barcelona, Spain
Seeking 1-2 *experienced* PHP developers to join the development staff of an established, profitable company in Barcelona, Spain. These positions offer an excellent opportunity for developers with strong design skills to build a new codebase for a heavily-trafficked international site. Job requirements include: * MUST BE EU CITIZEN OR HAVE WORK PERMIT FOR EUROPEAN UNION EMPLOYMENT! * 2+ years _professional_ experience with PHP, MySQL, Linux, and database design. You should consider yourself an expert PHP developer and very comfortable with mysql (db design and management) to apply. * Must be fluent in HTML/XHTML (hand-coding) and at least mid-level knowledge of Javascript. * Successful track record working on real-world projects (fulltime, freelance, or open-source) * Comfortable working with Apache, CVS, unix command-line AND Windows desktop * Strong *English* written and verbal communication skills. Other languages a plus (Spanish is most helpful, but others also benficial.) * Excellent self-motivatation skills, and able to work independently and in small groups. * Fun and interesting personality with an upbeat attitude * Comfortable in an open office environment (desks, no cubes) Experience with any of the following a plus: * multilingual UI development * payment systems integration * content management systems/tools development * XML and XSL * PEAR libraries and Smarty templates This is a full-time position with benefits. If interested in being considered, please send (1) a letter introducing yourself (in English), (2) your current CV/resume including URLs, and (3) salary requirements, in text/Microsoft Word/Adobe Acrobat format to: [EMAIL PROTECTED] Thanks! _ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Upgrading PHP windows binaries
Hi, I want to see if I can use PHP 4.3.0RC1, and downloaded the windows binaries. Currently I'm using PHP 4.2.3 on a Win NT and XP OS, I've made the installation with the phpdev package from firepages. My question. What files do I have to change so I don't have to reinstall my Apache and Mysql? Is it just copying the Files from the Win PHP 4.3 ORC1 to my current php directory, and then altering the php.ini file or are there other files (such as httpd.conf) that should be reconfigured? If so, which files? Thanks! Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] object passing by reference
But I know the function is in there! Consider the following code: ?php class parentClass { var $x; var $child; function parentClass($_x, $_child) { $this-x = $_x; $this-child = $_child; $this-child-m = Grow up, sonbr; } function foo() { return I'm the parent.br; } } class childClass { var $m; function childClass($_m) { $this-m = $_m; } function goo(){ return I'm the child.br; } } $son = new childClass(I want my mommybr); $dad = new parentClass(I want a new Porchebr, $son); echo $dad-child-goo(); echo $dad-child-m; echo $son-m; ? // the output is I'm the child. Grow up, son I want my mommy My question is: Where do I put the operator so that I pass a reference instead of a copy -- so the output will be I'm the child. Grow up, son. Grow up, son. I've tried everywhere I can think of to pass a reference instead of a copy and it doesn't error and doesn't pass a reference. I always pass a copy, even when I use multiple 's all over the place. If I can get this simplest of examples working, and then fail to get my code working in my previous post, I'll paste it for your guidance suggestions. TIA- Geoff -Original Message- From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 27, 2002 7:06 AM To: Hoffman, Geoffrey Cc: [EMAIL PROTECTED] Subject: Re: [PHP] object passing by reference At 01:34 27.11.2002, Hoffman, Geoffrey spoke out and said: [snip] I want to pass a reference to objectA along with other strings to a new objectB( constructor. Where does my go? I just keep getting Fatal error: Call to a member function on a non-object [snip] Just as the error message says - you're trying to execute a function (like $hObj-foo()) where there's no such function. Would be helpful if you posted some code where the error arises... -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Newbie Mail() Question...
Er yea - just call the mail() function at the appropriate time in your script... http://www.php.net/manual/en/function.mail.php However IMO if you need to log this sort of information then using a database is far more appropriate than sending emails - especially on a busy site... Rich -Original Message- From: Chase [mailto:[EMAIL PROTECTED]] Sent: 27 November 2002 14:24 To: [EMAIL PROTECTED] Subject: [PHP] Newbie Mail() Question... Is there a way to have an email sent to a specified email address either when a page is accessed, or when a file is downloaded? Maybe I should just be logging the info into a table? Basically, I am trying to set up a secure site that would send the sysadmin an email when a file has been downloaded with reference to the page title and/or filename. I have a feeling that this may be a bit too complicated for a newbie like me... ...Suggestions? Chase -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] object passing by reference
Hi This should do it: class parentClass { var $x; var $child; function parentClass($_x, $_child) {// $this-x = $_x; $this-child = $_child; // $this-child-m = Grow up, sonbr; } function foo() { return I'm the parent.br; } } class childClass { var $m; function childClass($_m) { $this-m = $_m; } function goo(){ return I'm the child.br; } } $son = new childClass(I want my mommybr); $dad = new parentClass(I want a new Porchebr, $son); echo $dad-child-goo(); echo $dad-child-m; echo $son-m; -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem with https
i have apache 1.3.26 on php 4.2.3 everything else is running fine except https//whatever when i am trying to access the files thru apache , I have looked for SSL properties in httpd.conf and everything is properly enables( that what i think ) . The error generated is page not found and when i am running without s in the https://; the page is being displayed properly , Do any1 have any idea vivek kedia [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: object passing by reference
Geoffrey Hoffman wrote: I want to pass a reference to objectA along with other strings to a new objectB( constructor. Where does my go? I just keep getting Fatal error: Call to a member function on a non-object Can you post the relevant snippet of code? Derick -- - Derick Rethans http://derickrethans.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: problem with https
Vivek Kedia wrote: i have apache 1.3.26 on php 4.2.3 everything else is running fine except https//whatever when i am trying to access the files thru apache , I have looked for SSL properties in httpd.conf and everything is properly enables( that what i think ) . The error generated is page not found and when i am running without s in the https://; the page is being displayed properly , Do any1 have any idea What does the apache log file (error_log and access_log) tell you about this? -- - Derick Rethans http://derickrethans.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to create zip files in PHP ?
Hi,sir: How to create zip files in PHP ? I found that php's zip function are read only... Can any one help me with that ? Thanks Fongming 2002-11-28 - This mail sent through IMP: http://web.horde.org/imp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with https
At the bottom of your httpd.conf, in the default SSL section, there is a path that normally points to /path/to/apache/htdocs if you store your webfiles some where other then the default, even if you change it near the top of your file, it won't work for SSL till you modify it at the bottom, if you can't find it by just looking, do a search for htdocs in your file, all the way down till you find it. On Wed, 2002-11-27 at 10:14, Vivek Kedia wrote: i have apache 1.3.26 on php 4.2.3 everything else is running fine except https//whatever when i am trying to access the files thru apache , I have looked for SSL properties in httpd.conf and everything is properly enables( that what i think ) . The error generated is page not found and when i am running without s in the https://; the page is being displayed properly , Do any1 have any idea vivek kedia [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
[PHP] Re: How to create zip files in PHP ?
Php User wrote: How to create zip files in PHP ? I found that php's zip function are read only... Can any one help me with that ? See this tutorial on zend.com: http://www.zend.com/zend/spotlight/creating-zip-files1.php http://www.zend.com/zend/spotlight/creating-zip-files2.php http://www.zend.com/zend/spotlight/creating-zip-files3.php -- - Derick Rethans http://derickrethans.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to create zip files in PHP ?
You will have to invoke an external utility, like PKZIP on Windows or zip on Linux to create the archives you need. Marco -- php|architect - The magazine for PHP Professionals The monthly worldwide magazine dedicated to PHP programmers Come visit us at http://www.phparch.com! ---BeginMessage--- Hi,sir: How to create zip files in PHP ? I found that php's zip function are read only... Can any one help me with that ? Thanks Fongming 2002-11-28 - This mail sent through IMP: http://web.horde.org/imp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How to create zip files in PHP ?
Hello, On 11/27/2002 01:08 PM, Php User wrote: How to create zip files in PHP ? I found that php's zip function are read only... Can any one help me with that ? You can find here a class ready to do exactly that: http://www.phpclasses.org/phpzip -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: How to create zip files in PHP ?
check this, it could help : http://www.phpclasses.org/browse.html/class/42.html Hatem - Original Message - From: Derick Rethans [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 27, 2002 4:26 PM Subject: [PHP] Re: How to create zip files in PHP ? Php User wrote: How to create zip files in PHP ? I found that php's zip function are read only... Can any one help me with that ? See this tutorial on zend.com: http://www.zend.com/zend/spotlight/creating-zip-files1.php http://www.zend.com/zend/spotlight/creating-zip-files2.php http://www.zend.com/zend/spotlight/creating-zip-files3.php -- - Derick Rethans http://derickrethans.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: My first XML!
Hello, On 11/27/2002 05:29 AM, Boris Kolev wrote: I want to know how i can export tree structure from Mysql table to XML mysql table structure is: ID - Group Unique Id P_ID - Parent Id Name - Name of group I want to make XML whit tree structure. Can some body help me! You may want to try this class to compose nicely formatted XML documents: http://www.phpclasses.org/xmlwriter Or even this that already converts the XML data from and to MySQL: http://www.phpclasses.org/mysql_xml -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sorting files in directory
* and then Justin French declared How does php order these files if read from the directory and printed to the screen? -- I need them in date order, do I need to sort them somehow? There's an optional second parameter for asort() and rsort(), so check it out in the manual... it *may* be needed to get what you want. Great, thanks everyone. Just wondered if it would have problems with asort() and the dates in the filenames like: * 02-11-23-whatever.php * 02-12-03-whatever.php Cheers... -- Nick Wilson // www.tioka.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Parsing XML files, logic involved...
I have to write a script to parse XML files we receive daily. The XML files are all individual stories but there is an index page that comes with each batch that contains blocks of information for each story as follows (below). I need to run through this index file and for each story I need to grab the NewsItemID, the Time, and then the SourceFilePath. From there I need to then open up the individual stories and do some formatting but for now I need to get by this :) I was planning on line by line through the file but am not sure how I would go about grabbing the information I require. Sometimes there is a SourceFilepath but sometimes its missing. Any help would be greatly appreciated. ContentItem Comment NewsItemID=780023, Time=28-05-02 13:43/ Comment SlugLine=Canada-U.S.-Protectionism/ DataContent CPOnlineFile Type=IndexStoryItem JavaScript ScriptLanguage=JavaScriptLanguage;CPJavaScriptOpenWindow;/JavaScript CPIndexStoryHeadChretien pushes Bush on softwood, agriculture, but gets no promises/CPIndexStoryHead CPStory CPStoryPara Number=1 ParaSpace=FALSE (CP) - Prime Minister Jean Chretien said he pressed U.S. President George W. Bush on Tuesday to address festering trade disputes between the two countries, but got no assurances that disagreements over softwood lumber or agricultural subsidies would be resolved. Chretien, who raised the matters after a NATO meeting in the Italian capital, said he was very forceful with Bush. But he said the president blamed Congress for the logjam. /CPStoryPara CPStoryPara Number=2 ParaSpace=FALSE It's always like that when you deal with the president of the United States: 'Yes, but the Congress and the Senate . . . ' In Canada you blame the prime minister or you congratulate the prime minister because he cannot pass the buck to anyone else. /CPStoryPara /CPStory CPLink Type=StoryFile Number=1 SourceFilePath=./n052814A.xml/ /CPOnlineFile /DataContent /ContentItem
[PHP] RE: object passing by reference
Tom, you rule. It works. I figured out my problem with my other script too. I had written get and set accessor methods in my class. I discovered that attempting to pass the reference to the set method in the class constructor DOES NOT work, while setting it directly in the class constructor DOES work! // DOES NOT WORK class parentClass { var $a; function parentClass($_a){ $this-setA($_a); } function setA($_a){ $this-a = $_a; } } // DOES WORK class parentClass { var $a; function parentClass($xa){ $this-a = $xa; } // doesn't work from constructor function setA($_a){ $this-a = $_a; } } Hope this helps someone else out there. -Geoff -Original Message- From: Tom Rogers [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 27, 2002 7:56 AM Cc: [EMAIL PROTECTED] //[snip] function parentClass($_x, $_child) {// //[snip] $this-child = $_child; // //[snip] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How Do I install php on Apache 2.0
Hello, I am on windows XP Pro, and I have adobe istalled. How can I get php to work on Apache? I download php-4.2.3 (the installer) and chose apache, and It didnt work. I still cant get my php to work for apache. Can somebody guide me step by steb through installing php on apache? thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with https
Hi Vivek, If you are accessing https on localhost, you would need to enter: https://localhost/whatever_file You might want to check whether you have https enabled: check phpinfo() under 'Apache Environment'. [HTTPS ] should be on as well. hth, Andre On Wednesday 27 November 2002 10:14 am, Vivek Kedia wrote: i have apache 1.3.26 on php 4.2.3 everything else is running fine except https//whatever when i am trying to access the files thru apache , I have looked for SSL properties in httpd.conf and everything is properly enables( that what i think ) . The error generated is page not found and when i am running without s in the https://; the page is being displayed properly , Do any1 have any idea vivek kedia [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How Do I install php on Apache 2.0
A. What does having Adobe installed matter? B. Why are you trying to run 2.0? Apache 2.0 isn't even recommended for use with PHP on linux systems yet, let alone windows. You'd have much better luck with the 1.3.27 version. On Wed, 2002-11-27 at 11:22, Tweak2x wrote: Hello, I am on windows XP Pro, and I have adobe istalled. How can I get php to work on Apache? I download php-4.2.3 (the installer) and chose apache, and It didnt work. I still cant get my php to work for apache. Can somebody guide me step by steb through installing php on apache? thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
[PHP] Session End
Hi I am have created an authentication system, wherein the user is authenticated on the basis of a MySQL database. Here is the code ?php $auth = false; // Assume user is not authenticated if (isset( $PHP_AUTH_USER ) isset($PHP_AUTH_PW)) { // Connect to MySQL mysql_pconnect( 'localhost', 'mysql', 'sunny' ) or die ( 'Unable to connect to server.' ); // Select database on MySQL server mysql_select_db( 'testbed' ) or die ( 'Unable to select database.' ); // Formulate the query $sql = SELECT * FROM guest WHERE login= '$PHP_AUTH_USER' AND password = '$PHP_AUTH_PW'; // Execute the query and put results in $result $result = mysql_query( $sql ) or die ( 'Unable to execute query.' ); // Get number of rows in $result. $num = mysql_numrows( $result ); if ( $num != 0 ) { // A matching row was found - the user is authenticated. $auth = true; session_start(); } } if ( ! $auth ) { header( 'WWW-Authenticate: Basic realm=Pushpinder Singh\'s World' ); header( 'HTTP/1.0 401 Unauthorized' ); echo 'Authorization Required.'; exit; } else { echo 'PYou are authorized!/P'; } ? However this keeps the user logged on. I want to be able to close the session once the user has finished his work. How do I do that?? Many Thanks --pS Pushpinder Singh Garcha _ Web Architect T. Falcon Napier and Associates, Inc. Off : 704 987 6500 Cell : 704 236 2939 Fax : 704 987 5002 _
[PHP] controlling ownership on file uploads ...
Greetings. I've written a simple form to allow my clients to upload files to me, and it works fine EXCEPT that the uploaded file is owned by www and I while I can read the file, I don't have the necessary permissions to delete it when done ... Since this site is being hosted elsewhere, is there a way I can control ownership so that I can delete the file? I've written my ISP/web hoster and received no response -- usually that's their subtle way of telling me I should ask the PHP quiestion here :-) Any and all help would be appreciated. Thanks, kenn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] controlling ownership on file uploads ...
exec(/bin/chown newuser:newuser /path/to/file); On Wed, 2002-11-27 at 12:03, Kenn Murrah wrote: Greetings. I've written a simple form to allow my clients to upload files to me, and it works fine EXCEPT that the uploaded file is owned by www and I while I can read the file, I don't have the necessary permissions to delete it when done ... Since this site is being hosted elsewhere, is there a way I can control ownership so that I can delete the file? I've written my ISP/web hoster and received no response -- usually that's their subtle way of telling me I should ask the PHP quiestion here :-) Any and all help would be appreciated. Thanks, kenn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
[PHP] MySql-PHP-Excel=french weird chars
Hi all I'm using a MySql database to save French data. In addition, I have a PHP page which is using header(Content-Type: application/vnd.ms-excel; name='excel'); header(Content-Disposition: attachment; filename=filename.xls); to save all the data from the database to the excel file. The problem is that when I open the excel file I get this: é instead of this: é and the same thing for all the French accented chars. I've tried to save the data as acsv file too but I get the same problem. Does anyone have a solution? Many Thanks Mario _ Marios Adamantopoulos Senior Developer Tonic +44 (0)20 7691 2227 +44 (0)7904 221663 www.tonic.co.uk Recent projects www.polydor.co.uk www.adcecreative.org www.sony-europe.com/pocketlife Opinions, conclusions and other information in this message that do not relate to the official business of Tonic Design Limited shall be understood as neither given nor endorsed by them.
Re: [PHP] Session End
At 18:04 27.11.2002, 1LT John W. Holmes spoke out and said: [snip] I'm surprised that is actually working, since you never register $auth into the session. [snip] Nothing to do with session... Here PHP_AUTH is used, so once logged in the browser always transmits the realm's auth info. The script is constantly looking up the database. Some kind of overkill... and also a drawback in using the HTTP/Auth method. You cannot keep the browser from transmitting auth info for the same realm. If PHP_AUTH is to be used I'd suggest using a dynamic realm to keep the browser from auto-logging in, some kind of this: if (!$_SESSION['authorized'] isset( $PHP_AUTH_USER ) isset($PHP_AUTH_PW)) { // do the database lookup here, if successful: $_SESSION['authorized'] = true; } } // no else here! if (!$_SESSION['authorized']) { $realm = date('Y/M/d H:i:s'); header('WWW-Authenticate: ' . 'Basic realm=Pushpinder Singh\'s World ' . ($realm)); header( 'HTTP/1.0 401 Unauthorized' ); echo 'Authorization Required.'; exit; } Do not destroy the session upon logout, just unset the auth variable: unset($_SESSION['authorized']); This will create a unique realm due to the use of date/time, so when the user logs off he will be presented with a 401 response, even if the browser has cached the login info from the previous login attempt. Another realm, another game. Disclaimer: untested, as usual. -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/
Re: [PHP] controlling ownership on file uploads ...
On Thursday 28 November 2002 01:04, Adam Voigt wrote: exec(/bin/chown newuser:newuser /path/to/file); The user running apache (in this case 'www') will most likely not have the requisite permissions to perform that operation. On Wed, 2002-11-27 at 12:03, Kenn Murrah wrote: Greetings. I've written a simple form to allow my clients to upload files to me, and it works fine EXCEPT that the uploaded file is owned by www and I while I can read the file, I don't have the necessary permissions to delete it when done ... Use chmod() to make the file(s) rw by 'others'. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Beware of Programmers who carry screwdrivers. -- Leonard Brandwein */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] IIS and PHP with $HTTP_SERVER_VARS
Hi The problem I am having is as follows: I setup PHP with IIS and it seems to work fine. I am creating a Intranet site and would like to obtain the user logged on to the networks username. I have setup basic auth but when I visit the site it asks me for my username and password before I can get in. Integrated Windows Auth is turned off. When I turn it on and try to login it says login failed. I know that ASP can have a script added to the page to turn pass through auth but I need one for PHP. I am using $HTTP_SERVER_VARS[LOGON_USER] to get the username and it works when I login. I just need to get rid of the login box. Please any help or ideas would be much appricated Thanks for your help in advance. Shaun Garriock *** The contents of this message are confidential and are intended for the addressee only. The views expressed in this message do not necessarily represent those of Robert Gordon's College. Electronic mail transmission is not guaranteed to be secure, therefore, Robert Gordon's College does not accept liability for the contents of this transmission. This message does not form a legal binding contract. ***
Re: [PHP] controlling ownership on file uploads ...
On Thursday 28 November 2002 01:04, Adam Voigt wrote: exec(/bin/chown newuser:newuser /path/to/file); The user running apache (in this case 'www') will most likely not have the requisite permissions to perform that operation. On Wed, 2002-11-27 at 12:03, Kenn Murrah wrote: Greetings. I've written a simple form to allow my clients to upload files to me, and it works fine EXCEPT that the uploaded file is owned by www and I while I can read the file, I don't have the necessary permissions to delete it when done ... Use chmod() to make the file(s) rw by 'others'. In my experience, this won't work for the same reason. Trying to run the chmod() function in PHP will give you an error about permission denied. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Password Script
Hi everyone! I'm looking to code a script that does the following. Please bear with me as I'm a total novice at this ^^! It's sort of like a multiple password thing. Users need to type in between 3 and 6 (I will be changing the use of this script and sometimes there will only be 3 answers sometimes as many as 6) things. If they get it right they'll be redirected to a page, if they get it wrong either a javascript prompt will popup saying Incorrect or they'll be redirected to a different page. I'm not sure if I'll put a limit on how many times they can guess, so if you could tell me how I would put a limit (say 10 guesses a day) I'd be greatful. Thank you! Please try and make your replies detailed so I can understand them ^_~ -Vicky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] IPs comparing
Hi, I have several subnets in my network and want to show different webs depending on the subnet the user was. I know how to get the IP but not how to compare two IPs numeracally, I mean: If ((USER-IP 192.168.0.1) (USER-IP 192.168.0.255)) Else if ((USER-IP 192.168.1.1) (USER-IP 192.168.1.255)) ... What do you suggest me? Thanks, Tackel. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] max file size on uploading files
Hi all, I must be missunderstanding something here, I have this in an php 'upload form': input type=hidden name=MAX_FILE_SIZE value=10 So why won't it upload a 1.5MB file? Many thanks -- Nick Wilson // www.tioka.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] controlling ownership on file uploads ...
Since the user Apache is running as created the file, it owns it too. Make a quick PHP script to delete the files when ready. HTH, Peter Janett New Media One Web Services New Upgrades Are Now Live!!! Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1 Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25, Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43 PostgreSQL coming soon! http://www.newmediaone.net [EMAIL PROTECTED] (303)828-9882 - Original Message - From: Kenn Murrah [EMAIL PROTECTED] To: php list [EMAIL PROTECTED] Sent: Wednesday, November 27, 2002 10:03 AM Subject: [PHP] controlling ownership on file uploads ... Greetings. I've written a simple form to allow my clients to upload files to me, and it works fine EXCEPT that the uploaded file is owned by www and I while I can read the file, I don't have the necessary permissions to delete it when done ... Since this site is being hosted elsewhere, is there a way I can control ownership so that I can delete the file? I've written my ISP/web hoster and received no response -- usually that's their subtle way of telling me I should ask the PHP quiestion here :-) Any and all help would be appreciated. Thanks, kenn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with https
The fact that https://whatever gives you a 404 file not found means that Apache SSL IS working, but it's not pointing where you want it to. So, you need to check the DocumentRoot setting in httpd.conf and see that it's pointing where you want it. You probably either have a virtual host set on port 443 to point to the wrong DocumentRoot, or you need to set one up on port 443, pointing to the right DocumentRoot. HTH, Peter Janett New Media One Web Services New Upgrades Are Now Live!!! Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1 Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25, Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43 PostgreSQL coming soon! http://www.newmediaone.net [EMAIL PROTECTED] (303)828-9882 - Original Message - From: Andre Dubuc [EMAIL PROTECTED] To: Vivek Kedia [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, November 27, 2002 9:23 AM Subject: Re: [PHP] problem with https Hi Vivek, If you are accessing https on localhost, you would need to enter: https://localhost/whatever_file You might want to check whether you have https enabled: check phpinfo() under 'Apache Environment'. [HTTPS ] should be on as well. hth, Andre On Wednesday 27 November 2002 10:14 am, Vivek Kedia wrote: i have apache 1.3.26 on php 4.2.3 everything else is running fine except https//whatever when i am trying to access the files thru apache , I have looked for SSL properties in httpd.conf and everything is properly enables( that what i think ) . The error generated is page not found and when i am running without s in the https://; the page is being displayed properly , Do any1 have any idea vivek kedia [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] max file size on uploading files
On Thursday 28 November 2002 02:02, Nick Wilson wrote: Hi all, I must be missunderstanding something here, I have this in an php 'upload form': input type=hidden name=MAX_FILE_SIZE value=10 So why won't it upload a 1.5MB file? manual - Handling File Uploads -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Leave no stone unturned. -- Euripides */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] controlling ownership on file uploads ...
On Thursday 28 November 2002 01:47, 1LT John W. Holmes wrote: Use chmod() to make the file(s) rw by 'others'. In my experience, this won't work for the same reason. Trying to run the chmod() function in PHP will give you an error about permission denied. Works for me :) Maybe you're using safe mode? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* If you see an onion ring -- answer it! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IPs comparing
On Thursday 28 November 2002 01:51, Jesús Pérez wrote: Hi, I have several subnets in my network and want to show different webs depending on the subnet the user was. I know how to get the IP but not how to compare two IPs numeracally, I mean: If ((USER-IP 192.168.0.1) (USER-IP 192.168.0.255)) Else if ((USER-IP 192.168.1.1) (USER-IP 192.168.1.255)) ... What do you suggest me? If the cases are as simple as the examples above then you can just use string comparison functions. Something like: if (strstr($USER_IP, '192.168.0.')) { do_something(); ... -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* A memorandum is written not to inform the reader, but to protect the writer. -- Dean Acheson */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IPs comparing
Hi Jesús, I have several subnets in my network and want to show different webs depending on the subnet the user was. I know how to get the IP but not how to compare two IPs numeracally, I mean: If ((USER-IP 192.168.0.1) (USER-IP 192.168.0.255)) Else if ((USER-IP 192.168.1.1) (USER-IP 192.168.1.255)) ... What do you suggest me? I suggest treating them as strings, and use (IF) equality/switch statements to deliver the appropriate web... Regards, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IPs comparing
On Thu, 28 Nov 2002 02:19:18 +0800 Jason Wong [EMAIL PROTECTED] wrote: I have several subnets in my network and want to show different webs depending on the subnet the user was. I know how to get the IP but not how to compare two IPs numeracally, I mean: If ((USER-IP 192.168.0.1) (USER-IP 192.168.0.255)) Else if ((USER-IP 192.168.1.1) (USER-IP 192.168.1.255)) What do you suggest me? If the cases are as simple as the examples above then you can just use string comparison functions Or look at the ip2long/long2ip functions (and there's a couple of other IP handling classes in PEAR) Alister -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FTP and security
On Wednesday 27 November 2002 03:25, Richard Fox wrote: To relate this to php, I am ready to give up trying to make my system(scp ..); code work, because I will have to give the apache user more permissions than I am comfortable with. What exactly are the problems you're encountering using scp? I created an apache user, which I called apache, and made sure this user could connect to the remote servers and created rsa keys so no passwords would be necessary (so my system($cmd) call would work). This is what happens when I run scp: [snip] There is more output, but as you can see the read of the src files failed and an empty ibuf is sent. This command line call works if I am a normal user for whom I have set up known_hosts and authorized_keys. But the above is the result when I run scp as user 'apache'. Here's what I've used before and it works for me: In the HOME directory of the apache user I have the usual .ssh/known_hosts file. Then in php, simply: shell_exec(/usr/bin/scp -i id_dsa_key file_to_send [EMAIL PROTECTED]:/tmp/); -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Finding out what goes on in the C.I.A. is like performing acupuncture on a rock. -- New York Times, Jan. 20, 1981 */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] max file size on uploading files
* and then Jason Wong declared On Thursday 28 November 2002 02:02, Nick Wilson wrote: Hi all, I must be missunderstanding something here, I have this in an php 'upload form': input type=hidden name=MAX_FILE_SIZE value=10 So why won't it upload a 1.5MB file? manual - Handling File Uploads Why don't you just not reply? -- It's the first place I went I must be missunderstanding something --- Every time I post here you come along with some rude unhelpfull comment. Go and annoy someone else, I'm here to ask for help not rude unhelpful comments (again, and again and again) -- Nick Wilson // www.tioka.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] max file size on uploading files
One problem may be your browser timing out before the end of the script. Another may be (although I'm not 100% sure) is that the file excedes the max memory set aside by PHP. Robbert van Andel -Original Message- From: Nick Wilson [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 27, 2002 10:03 AM To: php-general Subject: [PHP] max file size on uploading files Hi all, I must be missunderstanding something here, I have this in an php 'upload form': input type=hidden name=MAX_FILE_SIZE value=10 So why won't it upload a 1.5MB file? Many thanks -- Nick Wilson // www.tioka.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] max file size on uploading files
On Thursday 28 November 2002 02:40, Nick Wilson wrote: * and then Jason Wong declared On Thursday 28 November 2002 02:02, Nick Wilson wrote: Hi all, I must be missunderstanding something here, I have this in an php 'upload form': input type=hidden name=MAX_FILE_SIZE value=10 So why won't it upload a 1.5MB file? manual - Handling File Uploads Why don't you just not reply? -- It's the first place I went I must be missunderstanding something --- Every time I post here you come along with some rude unhelpfull comment. Did you read the manual then? The bit after the 1st paragraph Related Configurations Note ?? How about the section on Common Pitfalls? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Existence of programs that do the impossible is not a proof that that impossible is now possible. - Tigran Aivazian */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] max file size on uploading files
At 19:02 27.11.2002, Nick Wilson spoke out and said: [snip] Hi all, I must be missunderstanding something here, I have this in an php 'upload form': input type=hidden name=MAX_FILE_SIZE value=10 So why won't it upload a 1.5MB file? [snip] I can just guess here... you've got 1 billion in max_file_size, maybe this is way too big for the browser's (integer?) math? Does it upload without max_file_size? Did you try setting max_file_size to 1572864 (which is exactly 1.5 MB)? I found no mention of problems _refusing_ upload (except size exceeds, of course) in the online manual. I only found that browsers can be directrd to easily circumvent the limit (save html locally, edit form action to point to your server, edit max_file_size, and there you go...) Try the above hints and tell us about the outcome. -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/
Re: [PHP] max file size on uploading files
At 19:45 27.11.2002, Jason Wong spoke out and said: [snip] Did you read the manual then? The bit after the 1st paragraph Related Configurations Note ?? [snip] Jason, you may be a genius programmer, but you certainly lack style and social skills. -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/
Re: [PHP] max file size on uploading files
* and then Ernest E Vogelsinger declared I can just guess here... you've got 1 billion in max_file_size, maybe this is way too big for the browser's (integer?) math? Does it upload without max_file_size? Did you try setting max_file_size to 1572864 (which is exactly 1.5 MB)? Nope, that doesn't do it Try the above hints and tell us about the outcome. Well, I checked the php.ini and all the other things that could possibly go wrong *before I originally posted* but have now done it again. No joy there either ;-( Next step, try the script on another machine I guess Thnaks for the help Ernest... -- Nick Wilson // www.tioka.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] max file size on uploading files
* and then Nick Wilson declared Next step, try the script on another machine I guess Thnaks for the help Ernest... Could it be an Apache 2.0 thing? -- just upgraded. THis is what I get: Request entity too large! The POST method does not allow the data transmitted, or the data volume exceeds the capacity limit. If you think this is a server error, please contact the webmaster Error 413 Thanks... -- Nick Wilson // www.tioka.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] max file size on uploading files
At 20:12 27.11.2002, Nick Wilson spoke out and said: [snip] Request entity too large! The POST method does not allow the data transmitted, or the data volume exceeds the capacity limit. If you think this is a server error, please contact the webmaster Error 413 [snip] Ooops - you should normally only get this with GET requests where the max. query string size is exceeded - I'd check the Apache docs though... seems positively to be connected to the web server. Simple check - write some log file at the very beginning of your script to see if the web server runs your script, or not (what I assume). -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/
Re: [PHP] max file size on uploading files
* and then Van Andel, Robert declared One problem may be your browser timing out before the end of the script. Another may be (although I'm not 100% sure) is that the file excedes the max memory set aside by PHP. Thanks Robert, that's not it though -- Nick Wilson // www.tioka.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] **** Converting dynamic webpages into static HTML pages
I have an interesting challenge. I have built an online product catalog that is driven entirely by the contents of the product database (MySQL). The entire catalog is implemented in a single PHP script (catalog.php). The dynamic nature of this implementation allows the catalog script to generate hundreds of product description pages. Now, my client has requested that I give him the ability to generate a static version of the catalog so that he can burn it onto a CD for distribution at trade shows. He wants the CD to be a snapshot of the catalog. Furthermore, he wants to be able to generate this snapshot frequently so that pricing info on the CD will be current. To accommodate this, the process for generating the snapshot must be easy and intuitive. My plan of attack is to generate static HTML files by running the catalog script once for each product in the database. Here is my quandary; instead of echoing the output to a buffer for Apache to send off to the client, I need the script to output to a file. I do not want to write a second version of catalog.php that writes everything to file. There must be an easier way to do this. Is there a way I can access the output buffer that Apache sends to the client? Any other ideas? Thanks, Ron
Re: [PHP] max file size on uploading files
At 20:11 27.11.2002, Ernest E Vogelsinger spoke out and said: [snip] Ooops - you should normally only get this with GET requests where the max. query string size is exceeded - I'd check the Apache docs though... seems positively to be connected to the web server. [snip] wrong. From RFC2616 (http://ftp.rfc-editor.org/in-notes/rfc2616.txt): 10.4.14 413 Request Entity Too Large The server is refusing to process a request because the request entity is larger than the server is willing or able to process. The server MAY close the connection to prevent the client from continuing the request. If the condition is temporary, the server SHOULD include a Retry- After header field to indicate that it is temporary and after what time the client MAY try again. 10.4.15 414 Request-URI Too Long The server is refusing to service the request because the Request-URI is longer than the server is willing to interpret. This rare condition is only likely to occur when a client has improperly converted a POST request to a GET request with long query information, when the client has descended into a URI black hole of redirection (e.g., a redirected URI prefix that points to a suffix of itself), or when the server is under attack by a client attempting to exploit security holes present in some servers using fixed-length buffers for reading or manipulating the Request-URI. Error 413 certainly denotes that the web server refuses to handle the request. No idea how to configure this value but I'm sure it can be done with Apache. I see a better chance of getting this answere on the apache mailing list. -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/
Re: [PHP] max file size on uploading files
At 20:18 27.11.2002, Ernest E Vogelsinger spoke out and said: [snip] Error 413 certainly denotes that the web server refuses to handle the request. No idea how to configure this value but I'm sure it can be done with Apache. I see a better chance of getting this answere on the apache mailing list. [snip] I should check first and holler later. From the Apache docs (1.3.2): LimitRequestBody directive Syntax: LimitRequestBody bytes Default: LimitRequestBody 0 Context: server config, virtual host, directory, .htaccess Status: core Compatibility: LimitRequestBody is only available in Apache 1.3.2 and later. This directive specifies the number of bytes from 0 (meaning unlimited) to 2147483647 (2GB) that are allowed in a request body. The default value is defined by the compile-time constant DEFAULT_LIMIT_REQUEST_BODY (0 as distributed). The LimitRequestBody directive allows the user to set a limit on the allowed size of an HTTP request message body within the context in which the directive is given (server, per-directory, per-file or per-location). If the client request exceeds that limit, the server will return an error response instead of servicing the request. The size of a normal request message body will vary greatly depending on the nature of the resource and the methods allowed on that resource. CGI scripts typically use the message body for passing form information to the server. Implementations of the PUT method will require a value at least as large as any representation that the server wishes to accept for that resource. This directive gives the server administrator greater control over abnormal client request behavior, which may be useful for avoiding some forms of denial-of-service attacks. If, for example, you are permitting file upload to a particular location, and wich to limit the size of the uploaded file to 100K, you might use the following directive: LimitRequestBody 102400 [snip] Try this directive if you have access to the server configuration. If you have only a virtual directory you might also use your .htaccess file, provided the directory has been configured using AllowOverride Limit, or AllowOverride All. -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/
Re: [PHP] controlling ownership on file uploads ...
but if i don't have the permissions to do that ... ??? - Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 27, 2002 11:35 AM Subject: Re: [PHP] controlling ownership on file uploads ... On Thursday 28 November 2002 01:04, Adam Voigt wrote: exec(/bin/chown newuser:newuser /path/to/file); The user running apache (in this case 'www') will most likely not have the requisite permissions to perform that operation. On Wed, 2002-11-27 at 12:03, Kenn Murrah wrote: Greetings. I've written a simple form to allow my clients to upload files to me, and it works fine EXCEPT that the uploaded file is owned by www and I while I can read the file, I don't have the necessary permissions to delete it when done ... Use chmod() to make the file(s) rw by 'others'. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Beware of Programmers who carry screwdrivers. -- Leonard Brandwein */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] controlling ownership on file uploads ...
At 20:27 27.11.2002, Kenn Murrah spoke out and said: [snip] but if i don't have the permissions to do that ... ??? [snip] Since the Apache user (www in your case) owns the file it will always be able to delete it again. If www doesn't have permissions to run chmod there's not a lot that can be done. You may not chown a file to any other user except yourself (unless you're root), or to any group you're not member of. You need to check what groups the www user is member of. In short - if you can create the file, you can delete it as well. (At least that's what I've learned). -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/
Re: [PHP] **** Converting dynamic webpages into static HTML pages
Compile php as a static binary (CGI execution mode?) and add something liek the following to your code at the top: #!/usr/local/bin/php $arg_count = 1; while ($arg_count count($argv)) { $argument = $argv[$arg_count]; $arg_split = split(=,$argument); $variable = trim($arg_split[0]); $value = trim($arg_split[1]); if ($variable != $value != ) $$variable = $value; $arg_count = $arg_count + 1; } Make catalog.php executable, then run it as such: (assuming product_type and product_seq are the vars you use) ./catalog.php product_type=1 product_seq=2 products.html Matt - Original Message - From: Ron Stagg [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 27, 2002 2:18 PM Subject: [PHP] Converting dynamic webpages into static HTML pages I have an interesting challenge. I have built an online product catalog that is driven entirely by the contents of the product database (MySQL). The entire catalog is implemented in a single PHP script (catalog.php). The dynamic nature of this implementation allows the catalog script to generate hundreds of product description pages. Now, my client has requested that I give him the ability to generate a static version of the catalog so that he can burn it onto a CD for distribution at trade shows. He wants the CD to be a snapshot of the catalog. Furthermore, he wants to be able to generate this snapshot frequently so that pricing info on the CD will be current. To accommodate this, the process for generating the snapshot must be easy and intuitive. My plan of attack is to generate static HTML files by running the catalog script once for each product in the database. Here is my quandary; instead of echoing the output to a buffer for Apache to send off to the client, I need the script to output to a file. I do not want to write a second version of catalog.php that writes everything to file. There must be an easier way to do this. Is there a way I can access the output buffer that Apache sends to the client? Any other ideas? Thanks, Ron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] max file size on uploading files
On Wed, 27 Nov 2002, Nick Wilson wrote: * and then Nick Wilson declared Next step, try the script on another machine I guess Thnaks for the help Ernest... Could it be an Apache 2.0 thing? -- just upgraded. THis is what I get: That's actually a downgrade these days. I'd strongly suggest sticking with Apache 1.3.x for the time being. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] **** Converting dynamic webpages into static HTML pages
I'm not sure... I always echo... I don't really like embedded code... gets confusing when one part of the page is one thing and another is another. At the very least you coudl try it, I know its farily easy to build a script which will rip through the script to fix it to make it all php friendly. The other alternative is to have a script require() the php file, just set your variables in the script, then require('catalog.php'); All code will be executed as if it were part of the script. Matt - Original Message - From: Ron Stagg [EMAIL PROTECTED] To: Matt Vos [EMAIL PROTECTED] Sent: Wednesday, November 27, 2002 2:49 PM Subject: RE: [PHP] Converting dynamic webpages into static HTML pages I like your direction. When running PHP as a static binary, how does it handle text (HTML code) that falls outsize of the ?PHP ? tags. Is the text ignored or outputted? Ron -Original Message- From: Matt Vos [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 27, 2002 12:42 PM To: Ron Stagg; [EMAIL PROTECTED] Subject: Re: [PHP] Converting dynamic webpages into static HTML pages Compile php as a static binary (CGI execution mode?) and add something liek the following to your code at the top: #!/usr/local/bin/php $arg_count = 1; while ($arg_count count($argv)) { $argument = $argv[$arg_count]; $arg_split = split(=,$argument); $variable = trim($arg_split[0]); $value = trim($arg_split[1]); if ($variable != $value != ) $$variable = $value; $arg_count = $arg_count + 1; } Make catalog.php executable, then run it as such: (assuming product_type and product_seq are the vars you use) ./catalog.php product_type=1 product_seq=2 products.html Matt - Original Message - From: Ron Stagg [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 27, 2002 2:18 PM Subject: [PHP] Converting dynamic webpages into static HTML pages I have an interesting challenge. I have built an online product catalog that is driven entirely by the contents of the product database (MySQL). The entire catalog is implemented in a single PHP script (catalog.php). The dynamic nature of this implementation allows the catalog script to generate hundreds of product description pages. Now, my client has requested that I give him the ability to generate a static version of the catalog so that he can burn it onto a CD for distribution at trade shows. He wants the CD to be a snapshot of the catalog. Furthermore, he wants to be able to generate this snapshot frequently so that pricing info on the CD will be current. To accommodate this, the process for generating the snapshot must be easy and intuitive. My plan of attack is to generate static HTML files by running the catalog script once for each product in the database. Here is my quandary; instead of echoing the output to a buffer for Apache to send off to the client, I need the script to output to a file. I do not want to write a second version of catalog.php that writes everything to file. There must be an easier way to do this. Is there a way I can access the output buffer that Apache sends to the client? Any other ideas? Thanks, Ron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] search question
Hello, I'm wondering what you all think the best way to search for a string is. I guess its more of a matching (regex I'm thinking) but basically what I want is this.. I'm outputting some rows of data. If one of the columns of that row contain a string of text, either beginning, end, or middle, highlight it with a different row color. The part I need opinions on is matching the search. Would I just do an ereg/preg? Thanks, Bryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Bad File Mode?
I'm still trying to get a file posted to another server, but I seem to have run across an odd snag, and I was hoping someone can point out where I've gone wrong. Here's the code: ? $data = mtype=XMLDOCoutfile=true; $dataFile = http://www.healthtvchannel.org/courses/pay/data/test.xml;; $fileSize = filesize($dataFile); $fp = fopen($dataFile, rb); $strFile = fread($fp, $fileSize); fclose($fp); $osbURL=https://partners.netledger.com/SmbXml;; $ch = curl_init(); $res = curl_setopt($ch, CURLOPT_POST, 1); echo Set Post: .$res; $res = curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); echo br /Set Follow: .$res; $res = curl_setopt($ch, CURLOPT_VERBOSE, 1); echo br /Set Verbose: .$res; $res = curl_setopt($ch, CURLOPT_URL, $osbURL); echo br /Set URL: .$res; $res = curl_setopt($ch, CURLOPT_POSTFIELDS, $data.mediafile=.$strFile); echo br /Set Postfields: .$res; $res = curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); echo br /Set ReturnTransfer: .$res; $result = curl_exec($ch); curl_close($ch); echo $result; ? What I'm getting is Warning: stat failed for http://www.healthtvchannel.org/courses/pay/data/test.xml (errno=2 - No such file or directory) in /usr/local/www/vhosts/healthtvchannel.org/htdocs/courses/pay/posttest.php on line 20 I'm positive the file exists, and if I cut and paste the URL from the error to a browser window, I can see the file. What am I doing wrong? -- S. Keller UI Engineer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Pkwy. Anchorage, AK 99508 907.770.6200 ext.220 907.336.6205 (fax) Email: [EMAIL PROTECTED] Web: www.healthtvchannel.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/MySQL Installation
On Monday 25 November 2002 20:44, manh wrote: I am a beginner of PHP/MySQL. I have tried several times to install PHP3 and MySQL (free products) to conduct some web pages for my company, but lots of trouble came up. I just followed the instruction on www.php.net but it did not help. Can you help me? Thanks. Manh. [EMAIL PROTECTED] Hello, I am also a beginner, and i have't found any trouble to install and use Apache-PHP-Mysql: but here i get you some hints: 1) the last version of PHP is 4.2.x: this major version( 4,x.x.) has a lot of features for connecting PHP-MySQL-Apache. 2) Installation of MYSQL is (with SUSE) more easy if you try to install the rpm(binary) version. The best (obviusly) is to intall source package and then compiling it with all the options you want. but isn't so easy doing.. Regards. Federico -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] search question
I'm wondering what you all think the best way to search for a string is. I guess its more of a matching (regex I'm thinking) but basically what I want is this.. You could try any number of PHP functions, but the best ones would be strchr/strstr/stristr (for locating the first occurrence of the string), strpos (find the position of the first occurrence), or strrchr (to find the last). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Show only user that variable musiccontain pop
Hi, I need information about a simple command... I have a DB (of course...) and I need to show only ID that variable musiccontain pop I found this example that is suppose to do a similar thing in a msql query... SELECT * FROM $TBL_NEWS WHERE music LIKE '%pop%' AND ORDER BY name So it's not working properly... Thanks for your help Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php