[PHP] To copy a file from one server to another server in php
Hi Can anyone tell me how can we copy one file from one server to another server using PHP Thanks Suma _ Spice up your IM conversations. New, colorful and animated emoticons. Get chatting! http://server1.msn.co.in/SP05/emoticons/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] To copy a file from one server to another server in php
Hello, On Jan 2, 2006, at 12:27 AM, suma parakala wrote: Hi Can anyone tell me how can we copy one file from one server to another server using PHP Thanks Suma I use this function to grab mp3's from one server and place them on another (transfers 10mb files rather nicely): function grab_mp3($in, $out) { $remote = fopen($in, 'r'); # Remember to chmod download folder to 777: $local = fopen('test/'.$out, 'w+'); if(!$remote) { // handle failed request here ... echo Oops!; } else { while (!feof($remote)) { # Use @ to supress warning messages: @$a .= fread($remote, 8192); } } fwrite($local, $a); fclose($remote); fclose($local); # Bye bye. } You could also use cURL: http://us3.php.net/curl Hth, Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] XML to PDF
Hi ALL My applications requires converting XML file to PDF using PHP. Some surfing on the net revealed that it has to be first transformed to XSLT and then XSL:FO and finally to PDF . But i have no idea as where to start from. Confused and need directions or references to tutorials / resources which can shade lights on the inputs required. Thanks in advance. Binay
Re: [PHP] To copy a file from one server to another server in php
On Jan 2, 2006, at 12:32 AM, Michael Hulse wrote: You could also use cURL: From the cURL manual (in a terminal window type man curl, without the quotes): ... ... -o/--output file Write output to file instead of stdout. If you are using {} or [] to fetch multiple documents, you can use '#' followed by a number in the file specifier. That variable will be replaced with the current string for the URL being fetched. Like in: curl http://{one,two}.site.com -o file_#1.txt or use several variables like: curl http://{site,host}.host[1-5].com -o #1_#2 You may use this option as many times as you have number of URLs. -O/--remote-name Write output to a local file named like the remote file we get. (Only the file part of the remote file is used, the path is cut off.) You may use this option as many times as you have number of URLs. ... ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to check if an object is empty in PHP5
Hello ppl, How can i check if an Object is empty in PHP5? Becouse empty() doesn't work. Quote: As of PHP 5, objects with no properties are no longer considered empty.. Thx in advanced. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] AT / php / apache question
Dear PHP users, I am trying to write a php script that allows me to schedule jobs using the at deamon (unix) for execution in the arbitrary future. I have everything working except that the default login shell for apache (nologin) means that the at deamon fails to execute the command. If I run the at command as another (not apache) user or change the apache login script to bash then everything works fine. I understand the nologin shell is a security feature for the apache account so i am reluctant to change it. AT is supposed to use the shell defined by the SHELL environment variable at the time of job submission but this does not appear to work in this case. I have tried wrapping the command in a setuid script to use another user id to side step this but I think scripts are prevented from using setuid. I could sidestep this by making a setuid executable but this seems like a desperate measure and that there should be a more sensible way of achieving this safely. So does anyone have any suggestions? since at is a common word looking for solutions on the web is rather difficult... Cheers, SA _ On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] AT / php / apache question
Hi You could call the script via the http-server with wget (or lynx). david blunkett wrote: Dear PHP users, I am trying to write a php script that allows me to schedule jobs using the at deamon (unix) for execution in the arbitrary future. I have everything working except that the default login shell for apache (nologin) means that the at deamon fails to execute the command. If I run the at command as another (not apache) user or change the apache login script to bash then everything works fine. I understand the nologin shell is a security feature for the apache account so i am reluctant to change it. AT is supposed to use the shell defined by the SHELL environment variable at the time of job submission but this does not appear to work in this case. I have tried wrapping the command in a setuid script to use another user id to side step this but I think scripts are prevented from using setuid. I could sidestep this by making a setuid executable but this seems like a desperate measure and that there should be a more sensible way of achieving this safely. So does anyone have any suggestions? since at is a common word looking for solutions on the web is rather difficult... Cheers, SA _ On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to check if an object is empty in PHP5
Mathijs wrote: Hello ppl, How can i check if an Object is empty in PHP5? Becouse empty() doesn't work. Quote: As of PHP 5, objects with no properties are no longer considered empty.. try: class Test {} $obj = new Test; $arr = (array) $obj; var_dump( empty($obj), empty($arr) ); Thx in advanced. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Reverse destruction
Is it possible to reverse class __destruct() instead of following the class initiations? It makes more sence to me to close objects in last start first close. ?php class Class1 { function __construct() { echo 'Constructing ' . __CLASS__ . \n; } Function __destruct() { echo 'Destructing ' . __CLASS__ . \n; } } class Class2 { function __construct() { echo 'Constructing ' . __CLASS__ . \n; } Function __destruct() { echo 'Destructing ' . __CLASS__ . \n; } } class Class3 { function __construct() { echo 'Constructing ' . __CLASS__ . \n; } Function __destruct() { echo 'Destructing ' . __CLASS__ . \n; } } $Class1 = new Class1(); $Class2 = new Class2(); $Class3 = new Class3(); ? Would output, Constructing Class1 Constructing Class2 Constructing Class3 Destructing Class1 Destructing Class2 Destructing Class3 I'd like for it to do: Constructing Class1 Constructing Class2 Constructing Class3 Destructing Class1 Destructing Class2 Destructing Class3 Constructing Class1 Constructing Class2 Constructing Class3 Destructing Class3 Destructing Class2 Destructing Class1 Destructing the last started object first -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reverse destruction
Mattias Segerdahl wrote: Is it possible to reverse class __destruct() instead of following the class initiations? It makes more sence to me to close objects in last start first close. why don't you go and read up on request shutdown issues and __destruct() - there is plenty in the archives of the internals@lists.php.net mailing list; it's many times more complex than you might imagine (imagine 2 'chicken egg' problems in tandem - oh and a solution is needed to handle circular references properly so that object refcounts behave the way you would expect with regard to triggering dtor functions). bottom line don't hold your breath if you want the __destruct() and shutdown code/beahviour changed. * * tell us why do you want to control the descruction order of your objects? * it might help someone offer a viable alternative * btw: stating a new post/thread by replying to an existing one is very bad form - given that you have knowledge of ctors/dtors in php your skill level is probably greta enough that you should know better ;-) ?php class Class1 { function __construct() { echo 'Constructing ' . __CLASS__ . \n; } Function __destruct() { echo 'Destructing ' . __CLASS__ . \n; } } class Class2 { function __construct() { echo 'Constructing ' . __CLASS__ . \n; } Function __destruct() { echo 'Destructing ' . __CLASS__ . \n; } } class Class3 { function __construct() { echo 'Constructing ' . __CLASS__ . \n; } Function __destruct() { echo 'Destructing ' . __CLASS__ . \n; } } $Class1 = new Class1(); $Class2 = new Class2(); $Class3 = new Class3(); ? Would output, Constructing Class1 Constructing Class2 Constructing Class3 Destructing Class1 Destructing Class2 Destructing Class3 I'd like for it to do: Constructing Class1 Constructing Class2 Constructing Class3 Destructing Class1 Destructing Class2 Destructing Class3 Constructing Class1 Constructing Class2 Constructing Class3 Destructing Class3 Destructing Class2 Destructing Class1 Destructing the last started object first -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Which is faster, a MySQL access, or a set of PHP variables?
Thank you for the advice. The point was raised, and it's a good one, that if I'm getting content from the database for most pages, then attaining the necessary translations probably won't make a difference. And of course, it is true that at my current levels of hits, the server load is negligible. But, of course, one always hopes that site popularity will increase and justify the efforts of making it efficient. I think I am going to database the translations for now, and then later if need be, I will go with the suggestions of creating a list of variables from the database once a day with a cron job. I appreciate all the help people have given to let me understand the issue. -- Dave M G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Which is faster, a MySQL access, or a set of PHPvariables?
Dave M G wrote: Thank you for the advice. The point was raised, and it's a good one, that if I'm getting content from the database for most pages, then attaining the necessary translations probably won't make a difference. And of course, it is true that at my current levels of hits, the server load is negligible. But, of course, one always hopes that site popularity will increase and justify the efforts of making it efficient. I think I am going to database the translations for now, and then later if need be, I will go with the suggestions of creating a list of variables from the database once a day with a cron job. I appreciate all the help people have given to let me understand the issue. -- Dave M G If you are that concerned, I'd suggest making a test script with both approaches and measure the execution times. The performance difference may depend on on the DB server performance. On a previous shared webhost, I found the mySQL server was incredibly slow, so simple files were much faster. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] manipulating constant name as string
Tom Rogers wrote: Hi, Monday, January 2, 2006, 4:37:17 AM, you wrote: DG Hello DG I am trying to access the constant name as string and not the constant DG contents. For example, DG define('myconst', 'const text 1'); DG $myArray = array() DG myArray['myconst'] = this is it DG etc. DG $xmltext=; DG foreach ($myArray as $key = $val) { DG echo $key = $val\n\n; DG $xmltext .= $xmltext = $xmltext . $key $val /$key; DG } DG Unfortunately, $key within the string concatenation is translated into DG the constant value. However, for the echo statement, then $key constant DG name is displayed. Is there a way to keep the constant name rather its DG value when manipulating it as a string? DG thanks, DG Daniel drop the single quotes to use the constant: myArray[myconst] = this is it A suggestion.. Make it a habit to use all caps for your constants. It makes little gotchas easier to spot. e.g., define('MYCONST', 'const text 1'); Then your array would be obvious: myArray[MYCONST] = this is it; verses myArray['myconst'] = this is it; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] A curl question
Hi: I've asked this question on the [EMAIL PROTECTED] list, but replies were few and didn't address the problem. Whereas, I've seen considerable discussion of curl on this list, so here goes. I am writing a client-side application that uses curl commands to communicate with a php application. At present I can send the php application logon, password, and variables via: curl -u userID:password --url http://mydomain.com/myApp.php?what=what That works! However, I would like to send the variables hidden instead of attached to the url. So, what would the curl command be? Many thanks for any suggestions or solutions. tedd -- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] XML to PDF
Hello, Binay [...]. But i have no idea as where to start from. Confused and need directions or references to tutorials / resources which can shade lights on the inputs required. [...] Try out FPDF at www.fpdf.org . It's quite easy to use and it's highly extendable !!! HAPPY NEW YEAR !! Björn Bartels -Development/IT-Services- -- dbusiness.de gmbh digital business printing gmbh Greifswalder Str. 152 D-10409 Berlin Fon: [0.30] 4.21.19.95 Fax: [0.30] 4.21.19.74 www.dbusiness.de [EMAIL PROTECTED] ftp://dbusiness.dyndns.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] A curl question
I would suggest using the -d (or --data) flag. That allows you to send POST data. example: exec(curl -d name=Rafael%20Sagulaphone=3320780 http://www.where.com/guest.php) For more information, check the man page for cURL and search for POST within that document. Or check out the PHP Manual for the appropriate CURL syntax with LibCURL http://us3.php.net/manual/en/function.curl-init.php I have a script that uses the exec statement (was inherited from the last guy) and I'd be interested to know if libCURL makes the script wait on that line until CURL returns the result. Sometimes when getting data from a really slow site, scripts will take a lot longer than expected (10-15 minutes). I would assume that both ways would have the same effect, but efficiency is always king ;) HTH Ray Original Message Subject: [PHP] A curl question From: tedd [EMAIL PROTECTED] Date: Mon, January 02, 2006 9:07 am To: php-general@lists.php.net Hi: I've asked this question on the [EMAIL PROTECTED] list, but replies were few and didn't address the problem. Whereas, I've seen considerable discussion of curl on this list, so here goes. I am writing a client-side application that uses curl commands to communicate with a php application. At present I can send the php application logon, password, and variables via: curl -u userID:password --url http://mydomain.com/myApp.php?what=what That works! However, I would like to send the variables hidden instead of attached to the url. So, what would the curl command be? Many thanks for any suggestions or solutions. tedd -- http://sperling.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] AT / php / apache question
On Mon, Jan 02, 2006 at 11:19:45AM +, david blunkett wrote: Dear PHP users, I am trying to write a php script that allows me to schedule jobs using the at deamon (unix) for execution in the arbitrary future. I have everything working except that the default login shell for apache (nologin) means that the at deamon fails to execute the command. If I run the at command as another (not apache) user or change the apache login script to bash then everything works fine. Just use cron. Curt. -- cat .signature: No such file or directory -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A curl question
On Mon, Jan 02, 2006 at 11:07:33AM -0500, tedd wrote: Hi: I've asked this question on the [EMAIL PROTECTED] list, but replies were few and didn't address the problem. Whereas, I've seen considerable discussion of curl on this list, so here goes. I am writing a client-side application that uses curl commands to communicate with a php application. At present I can send the php application logon, password, and variables via: curl -u userID:password --url http://mydomain.com/myApp.php?what=what That works! However, I would like to send the variables hidden instead of attached to the url. So, what would the curl command be? How do you mean hidden? You have to send the userid and pass somehow either with the -u option or specifying them in the url: http://userID:[EMAIL PROTECTED]/ If you are worried about people seing the network traffic of the username or passowrd then use https. Curt. -- cat .signature: No such file or directory -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Solaris 10 libnetsnmp build failure
On Fri, Dec 30, 2005 at 12:56:35AM -0800, Dean wrote: Posted this to php-install with no response. See: http://marc.theaimsgroup.com/?l=php-installm=113579793423896w=2 Hi folks, I am trying to install php-4.4.1 on sparc-solaris 10, but make fails with: /bin/sh /root/tmp/php-4.4.1/libtool 90-line snip -o sapi/cgi/php gcc: /usr/sfw/lib/sparcv9/.libs/libnetsnmp.so: No such file or directory *** Error code 1 make: Fatal error: Command failed for target `sapi/cgi/php' My configure line is: ./configure --with-mysql --with-snmp This is almost the right place for libnetsnmp - /usr/sfw/lib, but there is no .libs directory. What does this give you: net-snmp-config --libdir or net-snmp-config --netsnmp-libs It should give the path to the /usr/sfw/lib If it does say that you could try a: ./configure --with-snmp=/usr/sfw/ Also, check the output of config.log for some errors related to net-snmp that might help explain why php's configure choose .libs. The .libs dir is something that is used in the compilation of the net-snmp code, which is generaly put in $prefix/lib on a make install, if you compiled netsnmp manually. Curt. -- cat .signature: No such file or directory -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] watermark png on jpg
I have png image with transparent background, and 1 jpg file. I use imageCopyMerge to paste the png image on the jpg image. the result image contain no transparent background mean the png file have white background when its suppose to be transparent what is the simple and best way to make this work. tanks in advance. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange Right-Shift Problem
On Fri, Dec 30, 2005 at 12:34:35PM -0600, Richard Lynch wrote: On Thu, December 29, 2005 5:37 pm, Michael Gross wrote: Hello I have to migrate a PHP-application to a new Linux-Box. Both the old and the new system are Linux and PHP 5.1.1. (the old one has a Pentium 4, the new one two Xeon CPUs). I have a problem using the Crypt_Xtea-Extension. I narrowed it down to the following right-shift operation: (-3281063054 11) produces different results: Old System: 495070 New System: -1048576 I understand that both results are wrong, but everything worked with the old behavior and I need that behavior back very urgent. Maybe someone can explain me in which way the bits are shifted so that the result is 495070? If I understand it, I implement my own shift function. Assuming the previous hypothesis that it's 32-bit versus 64-bit machines at work... If you can determine the number of bits on your system, you could use a different number from 11 on the two systems to get the answer you want. if (is_32_bit_machine()){ $y = $x 11; } else{ $y = $x 43; //11 + 32 (guess) } One hack for detecting 32-bit machine might be this: Isn't php suppose to handle all this? This seems odd to me. Curt. -- cat .signature: No such file or directory -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fread problem
Hi! I have a problem using fread with a XML document. When i read some nodes with a great amount of text it cuts in the same place of the text. There are any limitation of text or something? I have in the php.ini the amount of memory in 256M. Thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Upload with process meter
Hi, is it possible to upload a file and see the process of uploading (before the file is uploaded, there is something showing from 0% to 100%) using PHP and Javascript ? I saw some applications in Perl and mostly in JAVA, but I also found out something about some extension for PHP, but i think it wasn't complete at that time. Thanks for sharing your knowledge about this... :) Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A curl question
On Mon, Jan 02, 2006 at 11:07:33AM -0500, tedd wrote: Hi: I've asked this question on the [EMAIL PROTECTED] list, but replies were few and didn't address the problem. Whereas, I've seen considerable discussion of curl on this list, so here goes. I am writing a client-side application that uses curl commands to communicate with a php application. At present I can send the php application logon, password, and variables via: curl -u userID:password --url http://mydomain.com/myApp.php?what=what That works! However, I would like to send the variables hidden instead of attached to the url. So, what would the curl command be? How do you mean hidden? You have to send the userid and pass somehow either with the -u option or specifying them in the url: http://userID:[EMAIL PROTECTED]/ If you are worried about people seing the network traffic of the username or passowrd then use https. Curt. Curt: Thanks for your reply. To answer you question, hidden means, as I said, data that is NOT attached to the url as found in the curl example I provided. Please note that the userID and password are NOT the data that I speak of. Besides, I am not worried about the ID or password being shown, because it isn't. What I am concerned about -- however -- is sending data attached to the end of the url because I would like to hide that from the user. For example, typically input statements in forms provide hidden data -- but unfortunately, my client-side application cannot mimic a form. So, let me state the problem again. I have written a client-side application that communicates very well with a php application. The php application requires authorization and the curl command I use to provide this authorization with subsequent data is as follows: curl -u userID:password --url http://mydomain.com/myApp.php?what=what Now, what I am asking is -- is there a curl command that will send both id:password AND data without attaching data to the end of the url string? Is there such a critter? Thanks, tedd PS: Please don't tell me to use a php-command or php-function because this is for a client side application that can only use curl commands to communicate with a php application. -- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] A curl question
Ray: I would suggest using the -d (or --data) flag. That allows you to send POST data. example: exec(curl -d name=Rafael%20Sagulaphone=3320780 http://www.where.com/guest.php) Yes, I understand -d -- is there a way to use that AND to provide userID and password? Thanks. tedd For more information, check the man page for cURL and search for POST within that document. Or check out the PHP Manual for the appropriate CURL syntax with LibCURL http://us3.php.net/manual/en/function.curl-init.php I have a script that uses the exec statement (was inherited from the last guy) and I'd be interested to know if libCURL makes the script wait on that line until CURL returns the result. Sometimes when getting data from a really slow site, scripts will take a lot longer than expected (10-15 minutes). I would assume that both ways would have the same effect, but efficiency is always king ;) HTH Ray Original Message Subject: [PHP] A curl question From: tedd [EMAIL PROTECTED] Date: Mon, January 02, 2006 9:07 am To: php-general@lists.php.net Hi: I've asked this question on the [EMAIL PROTECTED] list, but replies were few and didn't address the problem. Whereas, I've seen considerable discussion of curl on this list, so here goes. I am writing a client-side application that uses curl commands to communicate with a php application. At present I can send the php application logon, password, and variables via: curl -u userID:password --url http://mydomain.com/myApp.php?what=what That works! However, I would like to send the variables hidden instead of attached to the url. So, what would the curl command be? Many thanks for any suggestions or solutions. tedd -- http://sperling.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 -- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP MySQL
A table with a column big5 char(2) not null primary key. $target-query(delete from canton); for ($ii=0; $ii256; $ii++) { for ($jj=0; $jj256; $jj++) { echo $ii ... $jj . \n; $query=insert into canton ( big5 ) values ( ' . mysql_real_escape_string(chr($ii).chr($jj)) . ' ); $target-query($query); } } The program died with this output: 0.92 0.93 0.94 0.95 0.96 0.97 Duplicate entry '' for key 1 The character strings shouldn't be repeated. Why did it stop at (0,97)? -- .~.Might, Courage, Vision. SINCERITY. http://www.linux-sxs.org / v \ /( _ )\ (Ubuntu 5.10) Linux 2.6.14.4 ^ ^22:15:01 up 8 days 11:12 load average: 0.02 0.06 0.10 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] New PHP MVC Framework
We're writing to you to invite you to take a look at our open source software project, Pipeline for PHP. The project is in its very early stages, and so we ask you to know that there will be more to come, and that this is just the first developer preview. However, we can stand behind it in our belief that it's a highly evolved specimen, and will be of interest to anybody developing web applications, or just writing about them. In the future we will be releasing commercial products under the Livepipe brand, but for now all of the work we are announcing today, or in the near future, will be released under the MIT license for all to enjoy. We'd love any feedback, so have a look and tell us what you think. http://livepipe.net/ Happy New Year, Ryan Johnson, Architect and Founder Nicholas Zulauf, President -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP MySQL
Man-wai Chang wrote: A table with a column big5 char(2) not null primary key. $target-query(delete from canton); for ($ii=0; $ii256; $ii++) { for ($jj=0; $jj256; $jj++) { echo $ii ... $jj . \n; $query=insert into canton ( big5 ) values ( ' . mysql_real_escape_string(chr($ii).chr($jj)) . ' ); $target-query($query); } } The program died with this output: 0.92 0.93 0.94 0.95 0.96 0.97 Duplicate entry '' for key 1 The character strings shouldn't be repeated. Why did it stop at (0,97)? Here's one thought . ascii (97) is the letter a is it possible that the ascii (65) A was interpreted as lowercase thus creating a duplicate primary key? Or your DBMS doesn't make a distinction between upper or lower case. -- Jerry Kita http://www.salkehatchiehuntersville.com email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
SV: [PHP] Upload with process meter
Martin, There is no native support in php for this today. That said, it's not impossible to do. There are two different approaches you can take. The easy one, is to use PDoru's patch at http://pdoru.from.ro/ The second one, which I experimented with the other week, is to set the wrong enctype, receive the file yourself and use a dhtml technique to keep track off the upload. http://se.php.net/manual/sv/function.apache-request-headers.php gives you the content-length to start with, all you need to do, is to work with the raw post data yourself. You could even use curl to locally post it into $_FILES once you've received it. What I'm saying is, it's possible, but it's really ugly. -Ursprungligt meddelande- Från: Martin Zvarík [mailto:[EMAIL PROTECTED] Skickat: den 2 januari 2006 22:30 Till: php-general@lists.php.net Ämne: [PHP] Upload with process meter Hi, is it possible to upload a file and see the process of uploading (before the file is uploaded, there is something showing from 0% to 100%) using PHP and Javascript ? I saw some applications in Perl and mostly in JAVA, but I also found out something about some extension for PHP, but i think it wasn't complete at that time. Thanks for sharing your knowledge about this... :) Martin -- 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