[PHP] Large file uploads timeout - ouch!
I'm designing a simple content management system with PHP, and it is going great, except... I do seem to have one problem - I'm trying to use PHP's copy function to upload files through a web browser. It works fine on small files, but times out on large ones, like a 20 MB file I'm sending. I'm on a 1Mbps DSL connection, and routinely download 600MB iso images with no problem, and seem to be having no connection problems on this end. My client is also getting timeouts on large files, and they're on a different network. The web server is running Debian Linux kernel 2.2.19; Apache/1.3.9; PHP 4.0.6 at a web hosting company. I checked the PHP manual, it said that the default maximum file upload size is 2MB. I used phpinfo() to show the server settings, and it reports that it is: upload_max_filesize=2M post_max_size=8M max_execution_time=30 which is the global file upload maximum and POST maximum and execution limit. I changed /cgi-bin/php.ini to include the lines upload_max_filesize=200M post_max_size=200M max_execution_time=2400 memory_limit=120M and saved it. I tried my upload again, but it still times out. Does Apache need to be restarted for the change to take effect? I ran phpinfo() again, and it shows upload_max_filesize=200M post_max_size=200M max_execution_time=2400 so it looks like it took the change to php.ini. I successfully uploaded a 1.8MB file, a 2.2MB file, a 4.1MB file, a 5.4MB file, a 6.1MB file, a 6.9MB file, and a 7.05MB file, but a 7.248MB file and a 7.6MB file timed out like the larger one. I'm doing the upload from IE 6.0 on Windows 2000 (running on my Linux box with VMware). I got the same results on Mozilla 0.9.6 on Mandrake Linux 8.0. I've read that PHP file uploads are done in RAM, so perhaps that is part of the problem? Unfortunately, my client plans to upload ~90MB files this way, and I'd like to leave PHP file upload as the only method needed. Here's part of the page using the upload/rename/delete script. It works flawlessly on smaller files. The only timeout (that I *know of!*) that I don't know how to change is the Apache timeout of 300 seconds. It appears that it is indeed timing out after 300 seconds (five minutes). It shows as HTTP_KEEP_ALIVE = 300 in phpinfo(). All of this is done on a virtual server at a web host, so I don't have access to the httpd.conf for Apache, although they *might* change it if I know what to ask them... ;-) TIA Fred /* New to Linux (nine months) and PHP (2 weeks) but loving it! */ == TABLE BORDER=0 WIDTH=100% CELLSPACING=2 CELLPADDING=2 ALIGN=CENTER ?php //print(\$Clientcode = $Clientcode, \$Usercode = $Usercode\n); /* This file lists all the information for files in a directory and allows the user to delete, upload and rename files. */ if ($Upload) { // Handle file uploads. print (TRTD COLSPAN=4 ALIGN=CENTERUploaded file name: $File_name/TD/TR\n); print (TRTD COLSPAN=4 ALIGN=CENTERUploaded file size: $File_size/TD/TR\n); if (copy ($File, documents/$Folder/$File_name)) { print (TRTD COLSPAN=4 ALIGN=CENTERYour file, $File_name, was successfully uploaded!/TD/TR\n); } else { print (TRTD COLSPAN=4 ALIGN=CENTERYour file, $File_name, could not be copied./TD/TR\n); } unlink ($File); print (TRTD COLSPAN=4 ALIGN=CENTERnbsp;/TD/TR\n); } if ($Delete) { // Handle file deletions. for ($i = 0; $i count ($Delete); $i++) { if ( unlink (documents/$Folder/$Delete[$i]) ) { print (TRTD COLSPAN=4 ALIGN=CENTERYour file, $Delete[$i], was successfully deleted!/TD/TR\n); } else { print (TRTD COLSPAN=4 ALIGN=CENTERYour file, $Delete[$i], could not be deleted./TD/TR\n); } } print (TRTD COLSPAN=4 ALIGN=CENTERnbsp;/TD/TR\n); } if ($Rename) { // Handle file renaming. for ($n = 0; $n count ($Rename); $n++) { $OldFilename = $Rename[$n]; $Old = documents/$Folder/$OldFilename; $New = documents/$Folder/$NewName[$OldFilename]; if ( rename ($Old, $New) ) { print (TRTD COLSPAN=4 ALIGN=CENTERYour file, $Rename[$n], was successfully renamed!/TD/TR\n); } else { print (TRTD COLSPAN=4 ALIGN=CENTERYour file, $Rename[$n], could not be renamed./TD/TR\n); } } print (TRTD COLSPAN=4 ALIGN=CENTERnbsp;/TD/TR\n); } // Start the form. $HTTP_KEEP_ALIVE = 2400; print (FORM METHOD=POST ENCTYPE=\multipart/form-data\ ACTION=\files.php\\n); print (input type=\hidden\ name=\MAX_FILE_SIZE\ value=\2\\n); // max file size set to 200 MB print (TRTDh2Folder bi$Folder/i/b:/h2/TD/TR\n); print (TRTDBFile Name/B/TDTDBFile Size/B/TDTDBDelete/B/TDTDBRename/B (Enter the New Name in the Box)/TD/TR\n); // Read the files from the
Re: [PHP] Uploading to Apache server from VB
See my post today about a file upload problem, which includes a complete script to do this (and more). My script works, but times out on very large files, otherwise it is a champ... Fred On Mon, 03 Dec 2001 15:16:09 -0500, Jim wrote: http://www.php.net/manual/en/features.file-upload.php I've done this successfully both with PHP and VB/ASP. I think PHP is the easiest, but there are several things that could go wrong. There is usually a 2MB limit to the file size and the safe mode setting also affects the outcome. On the HTML side, you must include ENCTYPE=multipart/form-data in your form tag. Once the file is uploaded (you can verify through phpinfo() command) you have to move it someplace. This can be tricky depending on how your server is set up. As a security, some servers do not allow scripts to save files. One solution is to have your script open an ftp socket and put the file in the right place. This way, the script has the ftp password which should be kept secret from the user. Hello, I have a VB program which can download files from a web-site. The webserver is running Apache where we use PHP scripting. That is all working OK. Now I want to let certain people upload data from their PC's. I don't want to use FTP, because I don't want to hand out password's (also not in the code we are distributing). Anonymous FTP is not possible. I can upload files to the site from a browser, but I would to make it (very) easy for people to upload their data: a number of them are not very familiar with computers. I have seen (www.google.com) references to uploading from VB to IIS servers, but how about to Apache/PHP? I've tried some examples with the MicroSoft Internet Control and executing the POST command, but the file would not be uploaded (the PHP script did not get it anyway). Should it be possible? If so, can somebody point in the right direction/example? If not, could somebody please explain why not? Thanks in advance for your help, henk sandkuyl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] [ ] ..
::: ÆĶóÁÖ¶ó ¸ÞÀÏ ¹ß¼Û :::¸ÕÀú »çÀü ¾çÇؾøÀÌ :¸ÞÀÏÀ» º¸³»µå·Á Á˼ÛÇÕ´Ï´Ù. º» ¸ÞÀÏÀº Á¤ÅëºÎ ±Ç°í»çÇ׿¡ ÀÇ°Å Á¦¸ñ¿¡(±¤°í)¶ó Ç¥½ÃµÈ ±¤°í ¸ÞÀÏÀÔ´Ï´Ù. ´õÀÌ»ó ¸ÞÀÏÀ» ¹Þ°í½ÍÁö ¾ÊÀ¸½Ã¸é [¼ö½Å°ÅºÎ]¸¦ ´·¯ÁÖ¼¼¿ä. Á˼ÛÇÕ´Ï´Ù.
Re: [PHP] Large file uploads timeout - ouch!
Sorry, no can do, I can't stand SPAM, and I don't need any more email. Just reply to the newsgroup. I can read it there, and it may help others - that is what newsgroups are for!;-) On Wed, 05 Dec 2001 03:57:05 -0500, Mirek Novak wrote: fix your email to receive answers FIRST! M.N. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Large file uploads timeout - ouch!
so, RTFM HTH M.N. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Large file uploads timeout - ouch!
Now that you've helped me, go and help someone else...please. And yes, I did read the manual and several books on PHP already. Have you? On Wed, 05 Dec 2001 04:09:00 -0500, Mirek Novak wrote: so, RTFM HTH M.N. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Large file uploads timeout - ouch!
Now that you've helped me, go and help someone else...please. And yes, I did read the manual and several books on PHP already. Have you? On Wed, 05 Dec 2001 04:09:00 -0500, Mirek Novak wrote: so, RTFM HTH M.N. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Large file uploads timeout - ouch!
Now that you've helped me, go and help someone else...please. And yes, I did read the manual and several books on PHP already. Have you? On Wed, 05 Dec 2001 04:09:00 -0500, Mirek Novak wrote: so, RTFM HTH M.N. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] sending out an sms
hi all, i'm busy studying and gathering info about sending sms messages from my website. Anybody knows any good urls where I can find more info (or scripts) about sending sms to a given telephone number. My knowledge about this subject is about zero. thx. Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] select join table on mysql
hi i have to select this : $t2=mysql_db_query($db, SELECT radacct.UserName,sum(radacct.AcctSessionTime) as t1,usergroup.GroupName . from radacct LEFT JOIN usergroup ON radacct.UserName=usergroup.UserName where. usergroup.GroupName='unlimited' AND radacct.AcctStartTime='2001-$month-01 00:00:00'. AND AcctStopTime='2001-$month-31 23:59:59' group by UserName); when i do it in mysql database it already give me result and thereis about 400 rows. but when i want to generate it fetch the array there is a error Supplied argument is not a valid MySQL result resource in b./stats.php/b on line (bellow is the line $x=mysql_fetch_array($t2); what might be possible wrong with the code..(it just a simple one) Yamin Prabudy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Large file uploads timeout - ouch!
fred wrote: Now that you've helped me, go and help someone else...please. And yes, I did read the manual and several books on PHP already. Have you? and have you seen function set_time_limit() while u were reading the manual?. BTW - this was on the list many times and as u were noting '... that is what are the newsgroupf for' instead of this they are for to be searched TOO! Just don't be lazy! HTH M.N. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Large file uploads timeout - ouch!
Sorry, I don't know where you are coming from. You don't know me, and are assuming things that just aren't true, calling me lazy? Thank you for the info. Now to answer your accusation... I searched the newsgroups all day and never found that function, and scoured php.net. I searched the PHP bugs forum. Sorry I missed that one function in the 1,259 page PHP manual. I did find the other six items I listed, which stumped a lot of other people, 100's of them in fact, for many reasons. I tested and debugged that script. I posted it for the benefit of others, as well as to give all info about my problem. So, according to you, not only am I lazy, but I guess all the others with the file upload problem must be lazy too. Is that work *your* definition of lazy? It isn't mine. If you want to help people, help them, otherwise, find something else to do. I saw your post here in May asking for help. I guess you're glad someone helped *you* when you asked here, hmm? On Wed, 05 Dec 2001 04:19:51 -0500, Mirek Novak wrote: fred wrote: Now that you've helped me, go and help someone else...please. And yes, I did read the manual and several books on PHP already. Have you? and have you seen function set_time_limit() while u were reading the manual?. BTW - this was on the list many times and as u were noting '... that is what are the newsgroupf for' instead of this they are for to be searched TOO! Just don't be lazy! HTH M.N. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] question on incrementing
I'm trying to increment a variable but either clicking on link or button but I don't want to reload the page. Is there any possible way to pull this off? Thanks, -Jordan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] folver view options
I have just installed mandrake something that is annoying me with KDE is that the default view within the file manager is with icons. Is is possible to have the tree or detailed view as the default. I briefly looked at the prefences and could find it anywhere Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: semaphores not automatically releasing at end of script
The following code fails after the first call: if(!($lock_id = sem_get(2501)) || !sem_acquire($lock_id)) die('failed to get semaphore') ..do something, error triggers exit;.. sem_release($lock_id) But having sem_release right after acquire makes everything work ok. I use FreeBSD and see there was some report of a similar problem at bugs.php.net, but there is no solution, patch, work arounds, etc posted. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Large file uploads timeout - ouch!
After all of this, and you give me the wrong answer. If you read the PHP manual, you will see that set_time_limit falls defaults to max_execution_time, which I already have set to 2400, so your answer is irrelevant. That is not controlling HTTP_KEEP_ALIVE, which is defaulting to 300 seconds somewhere - probably httpd.conf. Now who is lazy? On Wed, 05 Dec 2001 04:25:15 -0500, Fred wrote: Sorry, I don't know where you are coming from. You don't know me, and are assuming things that just aren't true, calling me lazy? Thank you for the info. Now to answer your accusation... I searched the newsgroups all day and never found that function, and scoured php.net. I searched the PHP bugs forum. Sorry I missed that one function in the 1,259 page PHP manual. I did find the other six items I listed, which stumped a lot of other people, 100's of them in fact, for many reasons. I tested and debugged that script. I posted it for the benefit of others, as well as to give all info about my problem. So, according to you, not only am I lazy, but I guess all the others with the file upload problem must be lazy too. Is that work *your* definition of lazy? It isn't mine. If you want to help people, help them, otherwise, find something else to do. I saw your post here in May asking for help. I guess you're glad someone helped *you* when you asked here, hmm? On Wed, 05 Dec 2001 04:19:51 -0500, Mirek Novak wrote: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Mac OSX and MySQL
As soon as the mysqld is running (and PHP also of course), you can use phpMyAdmin to set up new tables. If you are not experienced in CLI it's a nice way to go avoiding the CLI as far as possible (IMHO). Get a look at those pages: www.macosx.org www.stepwise.com best regards Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- - Original Message - From: René Fournier [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, December 05, 2001 6:24 AM Subject: [PHP] Mac OSX and MySQL The migration continues... Now I have to get my mysql database running under MySQL 3.23.46 on OSX 10.1.1. I've dumped the structure and contents of the database (on Windows) into a text file, and now I'd like to recreate it in the new enivronment. I think I can use the mysql admin tools via command line (but really, what is the syntax for piping a 'dumped' database into a new database? mysqladmin create database dumpeddb.sql??), but one question about users... I have to create a MySQL for my PHP scripts. How do I do this in Mac OSX? There are a bunch of command line tools, but I'm not sure which one[s] to use. Thanks. ...Rene --- René Fournier [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] remote directorylisting
Does anybody know how to list a remote directory to get all the filenames into for example an array? This is easily done on your local server by: $handle=opendir('./images/'); while (($file = readdir($handle))!==false) { $filelist[] = $file; } closedir($handle); However, opendir and readdir does not work on remote servers: $handle=opendir('http://www.somesite.net/images/'); So, does anybody know how to do this. I know I can read remote files (directory listing) and then To analyse this for filenames with a lot of string manipulation operations. Is there a simpler approach? Håkon Grønning E-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Please
UNSUBSCRIBE -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] MsSQL question
Hello world! I'm using php 4.0.6 to work with MsSQL (FreeBSD 4.4, Apache 1.3.20). How should i compile php to enable mssql functions? Thanks Zliy pes, http://www.zliypes.com.ua -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Please
did you ever read that f 4 lines at bottom of each mail??? quoteTo unsubscribe, e-mail: [EMAIL PROTECTED] /quote first think, then do Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- - Original Message - From: fazer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 04, 2001 10:45 AM Subject: [PHP] Please UNSUBSCRIBE -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] question on incrementing
I'm trying to increment a variable but either clicking on link or button but I don't want to reload the page. Is there any possible way to pull this off? It would have to be a session or cookie variable for a start. Also you would have to refresh A page inorder to do this so the way i would go is use a hidden frame and onClick of the button refresh the page in the hidden frame. Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] MsSQL question
Hello world! I'm using php 4.0.6 to work with MsSQL (FreeBSD 4.4, Apache 1.3.20). How should i compile php to enable mssql functions? Exactly as described here: http://www.php.net/manual/en/ref.mssql.php RTFM -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] RE:mad .... again jpeg files...
Valentim said: Try to specify absolute path to the jpeg - possible php do not look up for jpeg in current folder... (or use './image.jpg')- but the image.jpg created had file size=0 Johan Holst Nielsen said: Try to remove all html, and instead make a ImageJPEG($img); You should then only get the JPEG file? You set a header, and the browser doesn't understand the HTML... - yes I tried . Jack Dempsey said: also, are you sure both versions of php were compiled the same way with the same options and support? --- well , in my machine configure command ( where jpeg support dont work) I have : './configure' '--with-mysql' '--with-apache=/usr/src/packages/SOURCES/apache_1.3.9/' '--with-zlib-dir=/usr/src/packages/SOURCES/zlib/' '--with-png-dir=/usr/src/packages/SOURCES/libpng/' '--with-jpeg-dir=/usr/src/packages/SOURCES/jpeg-6b/' '--with-gd=/usr/src/packages/SOURCES/gd' '--enable-track-vars' in other machine ( where jpeg works fine ) I have : './configure' '--with-mysql=/usr/local/mysql/' '--with-gd=/share/tmp/gd-1.8.4/' '--with-zlib-dir=/usr/local/lib/' '--with-jpeg-dir=/share/tmp/jpeg-6b/' '--with-png-dir=/share/tmp/libpng-1.0.11/' '--enable-track-vars' '--with-apache=/usr/src/apache_1.3.19/' its amazing.. thanks the effort , time, calm, help, that you had with me . if someone have more ideas, please, I start being crazy ( ... yes, yes, I'm crazy since I was born ) T.Y. Hello all, I still having problem when use jpeg functions... I got: testout.jpg is not a valid JPEG file in .. , with follow code: Header(Content-type: image/jpeg); $img=ImageCreateFromJPEG(testout.jpg); ImageJPEG($img,a.jpg); ImageDestroy($img); testout.jpg was one image created by jpeg-6b after make test, I see image directly in browser (machine_name/directory/where/have/code/testout.jpg) the image, my phpinfo gives me information that gd had support for jpeg enabled I try with other *.jpeg files I try this code: Header(Content-type: image/jpeg); $im=ImageCreate(400,200); $bcg = ImageColorAllocate($im,240,240,240); $prt = ImageColorAllocate($im,0,0,0); $rd = ImageColorAllocate($im,255,0,0); ImageFill($im,400,200,$bcg); ImageLine($im,110,85,280,85,$rd); ImageString($im,5,130,90,--- OK ---,$prt); ImageLine($im,110,110,280,110,$rd); ImageJPEG($im,a.jpg); ImageDestroy($im); and the result was an empty a.jpg file . a. If anyone has any idea ... I already dont know what to do T.Y. -- Best Regards Miguel Joaquim Rodrigues Loureiro -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] looping and incrementing
I guess I didn't state my question very well in my previous post question on incrementing. This is the situation. I'm building a shopping cart... Right now I'm passing a variable $itemnumber from the catalog page to the cart page. $itemnumber is an array and every time a product is added to the cart, the itemnumber is tacked on to this array. I'm then making a loop for the array, referencing each unique value in $itemnumber to an item number in a MySQL database. Then I call the information from the table in MySQL where $itemnumber == $query[itemnumber]. I hope you understand all of that anyway, this is what I'm looking to do. I need a way to increment a variable $quantity. If that means reloading that's ok...but I just can't seem to come up with a way to add to a quantity without effecting my quantity values for all of the other item numbers in the array. any help would be majorly appreciate. -Jordan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Dynamically created dropdowns
Michael, Many thanks for your help. I've opted for the 'straight PHP' route and, in the process, saved myself a lot of time pointlessly trying to see if JavaScript could read from the database. Michael Egan Michael Hall wrote: You can certainly do what you want in straight PHP if you include a form submission after selecting the manufacturer. There is probably a way of doing it in JavaScript without a form submission, but not one that will read data from a MySQL database on a remote machine. JavaScript can't do that. Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Large file uploads timeout - ouch!
fred wrote: After all of this, and you give me the wrong answer. If you read the PHP manual, you will see that set_time_limit falls defaults to max_execution_time, which I already have set to 2400, so your answer is irrelevant. That is not controlling HTTP_KEEP_ALIVE, which is defaulting to 300 seconds somewhere - probably httpd.conf. Now who is lazy? it was ONE question to google.com: +large file uploads +php results in http://www.phpbuilder.com/forum/read.php3?num=2id=137901loc=0thread=118340 -X- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] MsSQL question
Thanks, i've looked in previously downloaded manual and 've found nothing ;) - Original Message - From: Jon Farmer [EMAIL PROTECTED] To: [EMAIL PROTECTED]; PHP [EMAIL PROTECTED] Sent: Wednesday, December 05, 2001 11:55 AM Subject: Re: [PHP] MsSQL question Hello world! I'm using php 4.0.6 to work with MsSQL (FreeBSD 4.4, Apache 1.3.20). How should i compile php to enable mssql functions? Exactly as described here: http://www.php.net/manual/en/ref.mssql.php RTFM -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Reg ex help-Removing extra blank spaces before HTML output
Hello, The example Jack gave you will clear up spaces well, though to get both newlines and spaces into one: $input = preg_replace(/([ ]|\n){1,}/, \\1, $input); James Jack Dempsey [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... $text = preg_replace('|\s+|',' ',$text); -Original Message- From: Ken [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 05, 2001 2:06 AM To: PHP list Subject: [PHP] Reg ex help-Removing extra blank spaces before HTML output I want to remove all superfluous blank spaces before I sent my HTML output, to make the output smaller. So I'd like to take $input, replace any number of blank space or newlines that are consecutive and replace them with a single blank. I.e. I will list a blank space as b and a newline as n: If input is: bTEXTHEREbbbnnnbnMOREbEVENMORE Then output should be: bTEXTHEREbMOREbEVENMORE I imagine this would be handled by a simple regular expression call, but I'm no pro with them yet. Any help? Thanks, Ken [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] How does one use gd/php _with_ freetype?
Everything compiles; phpinfo() says that freetype is compiled in; ldd libphp4.so indicates that freetype is dynamically linked; nm libphp4.so indicates that freetype and gd symbols are included. Yet we cannot produce arial fonts. I'm told this works with Windows, so I'm inclined to look for problems that occur when UNIX is more strict like font names being case sensitive, but have drawn a complete blank. Can anybody suggest a possible cause? This is becoming urgent! Cheers, Mike Dowling M. Dowling HEW
[PHP] Dynamic PHP
Hello! I'm sure I read this somewhere but I'm just not so sure now. Can you produce PHP code in a PHP page and then run it. Kind of like this: ?php $mycode=echo'Hello';; # Something here to execute $mycode ? Is the above possible?? Thanks! Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] problem with session_start
Hello, after execution of session_start, the browser (IE) tries to save the document instead of viewing the pdf-file. After removing the line with session_start() all works fine. configuration: Linux(2.4.2), Apache 1.3.22, PHP 4.0.6, PDFlib 4.0.1. Any thoughts? Bye Roy ?php //get session_id from the URL, it's coded into the path ereg(/([0-9a-z]{32}), $REQUEST_URI, $regs); $session_id = $regs[1]; session_id($session_id); session_start(); // create pdf-document $p = PDF_new(); PDF_open_file($p, ); PDF_set_info($p, Creator, test.php); PDF_begin_page($p, 100,100); PDF_end_page($p); PDF_close($p); // start output $buf = PDF_get_buffer($p); $len = strlen($buf); header(Content-type: application/pdf); header(Content-length: $len); print $buf; PDF_delete($p); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Dynamic PHP
Chris Hemmings wrote: Hello! I'm sure I read this somewhere but I'm just not so sure now. Can you produce PHP code in a PHP page and then run it. Kind of like this: ?php $mycode=echo'Hello';; # Something here to execute $mycode ? Maybe U need this function: http://www.php.net/manual/en/function.eval.php -- Pavel a.k.a. Papi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Classes within classes (Should I do this?)
Cameron Just wrote: Hi, Is this a bad thing to do have a class stored within another class? I would also like to store an array of another class within a class. It seems to work apart from the fact that I can't reference an array of class directly. ie $test_array[0]-get(); This gives an error. There is nothing wrong storing array of classes in a class. $obj-array_of_obj[0]-method() works. or array of classes $array_of_obj[0]-method(). works. -- Yasuo Ohgaki -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Partial answer to FOLLOW UP on column names not liked by odbc/php/access
mweb wrote: OOPS... of couse the query below doesn't work, it doesn't have the table name (see below however) ISQL_exec_String = Insert Into (Artista, Opera, Label, Anno, Nazione, CDNow, Autore, AutoreNome, Genere, GenereCustom, SulWeb, Autorizzato, Unico, VALUES ('prova2', 'inedita', 'ignota', '2001','IT', 'nonesiste', 'io', 'lui','3', 'ulteriori dettagli sul genere musicale', 'http://www.no.it', '1', '20011205111456', 'asdas erfver', 'ciao ni', '2.5', 'Non andare a capo!'); Maybe it's just typo (like missing table name), but U have in statement ... Unico, VALUES ( ... . It should be ... Unico) VALUES ( ... . -- Pavel a.k.a. Papi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] mail function
Is it possible to use php's mail function to send an html formated email (one of your pages or a newsletter, whatever...)? If so, how? GW
RE: [PHP] mail function
Yes it is. A good place to start is with the manual (http://www.php.net/mail), where you will find an explanation of how to do it. Cheers Jon -Original Message- From: Gregory Jon Welling/Parts Trading Inc. [mailto:[EMAIL PROTECTED]] Sent: 05 December 2001 11:07 To: [EMAIL PROTECTED] Subject: [PHP] mail function Is it possible to use php's mail function to send an html formated email (one of your pages or a newsletter, whatever...)? If so, how? GW _ This message has been checked for all known viruses by UUNET delivered through the MessageLabs Virus Control Centre. For further information visit http://www.uk.uu.net/products/security/virus/ ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: mail function
Is it possible to use php's mail function to send an html formated email (one of your pages or a newsletter, whatever...)? If so, how? yes... Make a header called etc. Content-type: text/html Regards, Johan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Large file uploads timeout - ouch!
I've had the same problem. I'll get back to you with what I know. Just give me some time - I'm late for work! Fred [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I'm designing a simple content management system with PHP, and it is going great, except... I do seem to have one problem - I'm trying to use PHP's copy function to upload files through a web browser. It works fine on small files, but times out on large ones, like a 20 MB file I'm sending. I'm on a 1Mbps DSL connection, and routinely download 600MB iso images with no problem, and seem to be having no connection problems on this end. My client is also getting timeouts on large files, and they're on a different network. The web server is running Debian Linux kernel 2.2.19; Apache/1.3.9; PHP 4.0.6 at a web hosting company. I checked the PHP manual, it said that the default maximum file upload size is 2MB. I used phpinfo() to show the server settings, and it reports that it is: upload_max_filesize=2M post_max_size=8M max_execution_time=30 which is the global file upload maximum and POST maximum and execution limit. I changed /cgi-bin/php.ini to include the lines upload_max_filesize=200M post_max_size=200M max_execution_time=2400 memory_limit=120M and saved it. I tried my upload again, but it still times out. Does Apache need to be restarted for the change to take effect? I ran phpinfo() again, and it shows upload_max_filesize=200M post_max_size=200M max_execution_time=2400 so it looks like it took the change to php.ini. I successfully uploaded a 1.8MB file, a 2.2MB file, a 4.1MB file, a 5.4MB file, a 6.1MB file, a 6.9MB file, and a 7.05MB file, but a 7.248MB file and a 7.6MB file timed out like the larger one. I'm doing the upload from IE 6.0 on Windows 2000 (running on my Linux box with VMware). I got the same results on Mozilla 0.9.6 on Mandrake Linux 8.0. I've read that PHP file uploads are done in RAM, so perhaps that is part of the problem? Unfortunately, my client plans to upload ~90MB files this way, and I'd like to leave PHP file upload as the only method needed. Here's part of the page using the upload/rename/delete script. It works flawlessly on smaller files. The only timeout (that I *know of!*) that I don't know how to change is the Apache timeout of 300 seconds. It appears that it is indeed timing out after 300 seconds (five minutes). It shows as HTTP_KEEP_ALIVE = 300 in phpinfo(). All of this is done on a virtual server at a web host, so I don't have access to the httpd.conf for Apache, although they *might* change it if I know what to ask them... ;-) TIA Fred /* New to Linux (nine months) and PHP (2 weeks) but loving it! */ == TABLE BORDER=0 WIDTH=100% CELLSPACING=2 CELLPADDING=2 ALIGN=CENTER ?php //print(\$Clientcode = $Clientcode, \$Usercode = $Usercode\n); /* This file lists all the information for files in a directory and allows the user to delete, upload and rename files. */ if ($Upload) { // Handle file uploads. print (TRTD COLSPAN=4 ALIGN=CENTERUploaded file name: $File_name/TD/TR\n); print (TRTD COLSPAN=4 ALIGN=CENTERUploaded file size: $File_size/TD/TR\n); if (copy ($File, documents/$Folder/$File_name)) { print (TRTD COLSPAN=4 ALIGN=CENTERYour file, $File_name, was successfully uploaded!/TD/TR\n); } else { print (TRTD COLSPAN=4 ALIGN=CENTERYour file, $File_name, could not be copied./TD/TR\n); } unlink ($File); print (TRTD COLSPAN=4 ALIGN=CENTERnbsp;/TD/TR\n); } if ($Delete) { // Handle file deletions. for ($i = 0; $i count ($Delete); $i++) { if ( unlink (documents/$Folder/$Delete[$i]) ) { print (TRTD COLSPAN=4 ALIGN=CENTERYour file, $Delete[$i], was successfully deleted!/TD/TR\n); } else { print (TRTD COLSPAN=4 ALIGN=CENTERYour file, $Delete[$i], could not be deleted./TD/TR\n); } } print (TRTD COLSPAN=4 ALIGN=CENTERnbsp;/TD/TR\n); } if ($Rename) { // Handle file renaming. for ($n = 0; $n count ($Rename); $n++) { $OldFilename = $Rename[$n]; $Old = documents/$Folder/$OldFilename; $New = documents/$Folder/$NewName[$OldFilename]; if ( rename ($Old, $New) ) { print (TRTD COLSPAN=4 ALIGN=CENTERYour file, $Rename[$n], was successfully renamed!/TD/TR\n); } else { print (TRTD COLSPAN=4 ALIGN=CENTERYour file, $Rename[$n], could not be renamed./TD/TR\n); } } print (TRTD COLSPAN=4 ALIGN=CENTERnbsp;/TD/TR\n); } // Start the form. $HTTP_KEEP_ALIVE = 2400; print (FORM METHOD=POST ENCTYPE=\multipart/form-data\ ACTION=\files.php\\n); print (input type=\hidden\ name=\MAX_FILE_SIZE\ value=\2\\n); // max file size set to 200 MB print (TRTDh2Folder bi$Folder/i/b:/h2/TD/TR\n); print (TRTDBFile Name/B/TDTDBFile Size/B/TDTDBDelete/B/TDTDBRename/B (Enter the New Name in the Box)/TD/TR\n); // Read the files from the directory. $Open = opendir
[PHP] Re: remote directorylisting
Well, This is not really possible, unless the server itself allows you to do the listing. One way and after the last condition you can use fopen(sever.com/dir_to_list/) then fread() it and then parse the content in order to get filename, date, ... Håkon grønning [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Does anybody know how to list a remote directory to get all the filenames into for example an array? This is easily done on your local server by: $handle=opendir('./images/'); while (($file = readdir($handle))!==false) { $filelist[] = $file; } closedir($handle); However, opendir and readdir does not work on remote servers: $handle=opendir('http://www.somesite.net/images/'); So, does anybody know how to do this. I know I can read remote files (directory listing) and then To analyse this for filenames with a lot of string manipulation operations. Is there a simpler approach? Håkon Grønning E-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] format output from exe()
how can i format the output from: $who = passthru(system(who)); echo $who; it doesnt put breakes behind each line, so all the stuff iss just one line till the browsers to short... anybody can help? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] headers
Hi all, my q: The results of a form are being POSTed to a php script. There I play around with the inputted variables. Now I want to post them again to a new script. I know I should use header(location:http://www.xxx.yyy/somepage.php) But how do I construct the header which is used to post my variables ($var=value)to the page at www.xxx.yyy/somepage.php I tried this: $var=value; header(Location:http://www.xxx.yyy/somepage.php;); header (var: value); but it didn't work any ideas on constructing a header are welcome!? Thanx in advance, regards, Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] headers
I'm a newbie but how about: header(location: http://www.xxx.yyy/somepage.php?var1=$var1) and so on. And location: needs a space after it! George _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] format output from exe()
Hello, I did this once with ping: exec(ping -c $count $host, $result); for ($i=0; $i count($result); $i++) { $data .= $result[$i]br; } print $data; That might work for ya. Good luck, Tyler Longren - Original Message - From: Daniel Masur [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, December 05, 2001 5:50 AM Subject: [PHP] format output from exe() how can i format the output from: $who = passthru(system(who)); echo $who; it doesnt put breakes behind each line, so all the stuff iss just one line till the browsers to short... anybody can help? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: headers
header(Location: example.php?var=$value); etc... Or sessions... -- Julio Nobrega Don't eat the yellow snow. Wilbert Enserink [EMAIL PROTECTED] wrote in message 00e101c17d86$a2c391a0$[EMAIL PROTECTED]">news:00e101c17d86$a2c391a0$[EMAIL PROTECTED]... Hi all, my q: The results of a form are being POSTed to a php script. There I play around with the inputted variables. Now I want to post them again to a new script. I know I should use header(location:http://www.xxx.yyy/somepage.php) But how do I construct the header which is used to post my variables ($var=value)to the page at www.xxx.yyy/somepage.php I tried this: $var=value; header(Location:http://www.xxx.yyy/somepage.php;); header (var: value); but it didn't work any ideas on constructing a header are welcome!? Thanx in advance, regards, Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] format output from exe()
Daniel Masur wrote: how can i format the output from: $who = passthru(system(who)); echo $who; it doesnt put breakes behind each line, so all the stuff iss just one line till the browsers to short... Try this: echo pre$who/pre; Or substitute those newlines with the equivalent html-lingo (br) with: echo nl2br($who); ./peter - Svenska PHP-listan: http://www.kanalen.org/mailinglistor.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] headers
that's more like a GET method. I prefer the POST method in my case (GPC-order). But thx for the input! - Original Message - From: George Pitcher [EMAIL PROTECTED] To: Wilbert Enserink [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, December 05, 2001 1:18 PM Subject: Re: [PHP] headers I'm a newbie but how about: header(location: http://www.xxx.yyy/somepage.php?var1=$var1) and so on. And location: needs a space after it! George _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] headers
http://www.w3.org/Protocols/rfc2616/rfc2616.txt can help, IMHO M.N. atleast, I think, you must somehow announce , that you are using POST method ...? -- Wilbert Enserink wrote: Hi all, my q: The results of a form are being POSTed to a php script. There I play around with the inputted variables. Now I want to post them again to a new script. I know I should use header(location:http://www.xxx.yyy/somepage.php) But how do I construct the header which is used to post my variables ($var=value)to the page at www.xxx.yyy/somepage.php I tried this: $var=value; header(Location:http://www.xxx.yyy/somepage.php;); header (var: value); but it didn't work any ideas on constructing a header are welcome!? Thanx in advance, regards, Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP and wml problem
Hello, I have a problem with my php files. Here's how it goes: I use Sablotron (a php extension) to parse my XML file in order to view the result on a wap browser. The parsing goes well and the result is good but the browser does not understand that it's a WML file. If I copy the result of the parsing and make a *.WML file with it, verything works fine. If I read the *.PHP file, all the cards are displayed on the same screen and the browser doesn't recognize the title and the timer... Does anybody have a solution? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: PHP and wml problem
Does anybody have a solution? Send wnl heades before displaying results header('Content-type: text/vnd.wap.wml'); Cheers Roko -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] headers
Try this ... http://lwest.free.fr/doc/php/lib/index.php3?page=net_http_clientlang=en - complete HTTP class M.N. -- Wilbert Enserink wrote: Hi all, my q: The results of a form are being POSTed to a php script. There I play around with the inputted variables. Now I want to post them again to a new script. I know I should use header(location:http://www.xxx.yyy/somepage.php) But how do I construct the header which is used to post my variables ($var=value)to the page at www.xxx.yyy/somepage.php I tried this: $var=value; header(Location:http://www.xxx.yyy/somepage.php;); header (var: value); but it didn't work any ideas on constructing a header are welcome!? Thanx in advance, regards, Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Referer Question
Hi, Say I have an image called in a page which is actually a PHP script (A banner image for example). Is there any variable I could use to detect where the the one that entered the page and ran the php script came from? I guess it's something like the referer of HTTP_referer or something. I could do it using some javascript and pass it to the php but that's not really acceptable. Thanks in advance, George E. Papadakis Project Manager Phaistos Networks S.A - http://www.phaistosnetworks.gr [EMAIL PROTECTED] T: +30 892 24450 F: +30 892 23206 - A DOL Digital Company -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Large file uploads timeout - ouch!
Don't know if you're still there... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Referer Question
you can call the predefined variable in PHP $HTTP_REFERER will return the address of the previous page. $REQUEST_URI will return the URI of current page. is those something you need? -- Hidulf http://www.hidulf.com George E. Papadakis [EMAIL PROTECTED] wrote in message 001f01c17d91$46a9af20$07dbdbc2@phaistonian">news:001f01c17d91$46a9af20$07dbdbc2@phaistonian... Hi, Say I have an image called in a page which is actually a PHP script (A banner image for example). Is there any variable I could use to detect where the the one that entered the page and ran the php script came from? I guess it's something like the referer of HTTP_referer or something. I could do it using some javascript and pass it to the php but that's not really acceptable. Thanks in advance, George E. Papadakis Project Manager Phaistos Networks S.A - http://www.phaistosnetworks.gr [EMAIL PROTECTED] T: +30 892 24450 F: +30 892 23206 - A DOL Digital Company -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Mass Mailing
Hi again, These scripts get there email-info from a database. How many mails send per action depends on the max_execution_time set by your provider. Each send mail is marked in the database so if the process stops to early you can continue with the rest and unmarked. Web inventor Michael Cronstrom At 08:04 05/12/01, you wrote: Hi These scripts of yours, do they relay on a mailing list? See, I host with a provider, and I have got php4, but I don't have mailing list access, I need to pay per meg send etc, which works out very expensive. So I'm looking for a script that doesn't require a mailing list. Thank you Rudi Ahlers UNIX Specialist and Web Developer Bonzai Web Design - http://www.bonzai.org.za Cell: 082 926 1689 - Original Message - From: Michael Cronström [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 04, 2001 1:06 AM Subject: Re: [PHP] Mass Mailing OK Nathan, I have a couple of scripts that will do the job for you, if you are interested! Web inventor Michael Cronstrom At 22:51 02/12/01, you wrote: I started writing a set of scripts that would send out mutiple emails to a list of customers. I then realized that most likely this program, and/or snipits had most likely already been written. If so, can some one point me in the right direction and save me 3 or 4 days? Thanks Nathan Webmaster M-Y Communications -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] undefined function: mysql_pconnect()
Debian 2.2 + PHP4 apache module + mysql Trying my first php program (guestbook) I get: Fatal error: Call to undefined function: mysql_pconnect() in /home/jupshoes/public_html/guest/index.php on line 27 thanks Josep. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] undefined function: mysql_pconnect()
are u running at least php 4.0.0? try to use mysql_connect() instead. -- Anthony Washington ([EMAIL PROTECTED]) http://www.shell42.com http://www.comwebhosting.com On Wed, 5 Dec 2001, josep wrote: Debian 2.2 + PHP4 apache module + mysql Trying my first php program (guestbook) I get: Fatal error: Call to undefined function: mysql_pconnect() in /home/jupshoes/public_html/guest/index.php on line 27 thanks Josep. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] FreeBSD 4.3, PHP 4.0.6 unixODBC -- Undefined Symbol
I had previously attempted to get the Openlink ODBC drivers work with iodbc and PHP. I was having no luck and turned to easysoft's solution, which includes unixODBC. I re-configured PHP (removing the config.cache file) and used --with-unixODBC=path/to/unixODBC instead of --with-iodbc=/path/to/iodbc. However, when starting Apache, I now get a 'Cannot load /usr/local/libexec/apache/libphp4.so into server: /usr/local/src/lib/libiodbc.so.3: Undefined symbol pthread_mutex_unlock'. The version of Apache that is installed is 1.3.20. I must not understand something about unixODBC because I didn't think libiodbc should even be getting loaded. Regardless, does anyone have a fix? Thanks, Joe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] format output from exe()
worked wunderfull. thx Tyler Longren [EMAIL PROTECTED] schrieb im Newsbeitrag 005101c17d89$42085b40$0101a8c0@Longren">news:005101c17d89$42085b40$0101a8c0@Longren... Hello, I did this once with ping: exec(ping -c $count $host, $result); for ($i=0; $i count($result); $i++) { $data .= $result[$i]br; } print $data; That might work for ya. Good luck, Tyler Longren - Original Message - From: Daniel Masur [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, December 05, 2001 5:50 AM Subject: [PHP] format output from exe() how can i format the output from: $who = passthru(system(who)); echo $who; it doesnt put breakes behind each line, so all the stuff iss just one line till the browsers to short... anybody can help? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] headers
Try this: http://phpclasses.upperdesign.com/browse.html/package/375 It let's you easily post an array of variables to another page. To do it manually take a look at the function fsockopen(). If you have the need for a modified variant which is able to handle multiple identically named fields then tell me. I hope I could help Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- - Original Message - From: Wilbert Enserink [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, December 05, 2001 1:16 PM Subject: [PHP] headers Hi all, my q: The results of a form are being POSTed to a php script. There I play around with the inputted variables. Now I want to post them again to a new script. I know I should use header(location:http://www.xxx.yyy/somepage.php) But how do I construct the header which is used to post my variables ($var=value)to the page at www.xxx.yyy/somepage.php I tried this: $var=value; header(Location:http://www.xxx.yyy/somepage.php;); header (var: value); but it didn't work any ideas on constructing a header are welcome!? Thanx in advance, regards, Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Column name not liked by PHP/ODBC and Access
Don't know if you've tried it, but typically, you put square brackets '[]' around a table or field name that ODBC doesn't like. (i.e.: it has a space in it, it has a name which is a reserved word in SQL, etc...) - Theo -Original Message- From: Jim [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 04, 2001 5:53 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Column name not liked by PHP/ODBC and Access You could just rename the column in the db. Putting quotes around Note is not the solution because the quotes are causing the invalid name error. I don't see that Note is a reserved word anywhere. Access is quite picky about what data you send it. For instance, if a field is set to require some input, then it will error out if you don't supply any. Jim On Tuesday 04 December 2001 23:25, Jim wrote: I've searched high and low for _good_ PHP/MSACCESS info, but the fact is not that many people use it. I know. It's not my choice, believe me.. :-(( What I've found very helpful is to use MS ACCESS' SQL builder to test out my queries. Fairly reliably, if it works there, it'll work in PHP. Fine, but I guess it won't run on my Linux PC, will it? I'll search the web for examples of its usage, anyway. Any pointer is appreciated. Thanks, mweb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] FreeBSD 4.3, PHP 4.0.6 unixODBC -- Undefined Symbol
Joe, What is the problem you were having with OpenLink and iODBC under BSD? If threading errors, you can simply download the non-threaded version of the SDK and drivers from our site. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Data Integration Technology Providers -Original Message- From: Joe Koenig [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 05, 2001 9:40 AM To: [EMAIL PROTECTED] Subject: [PHP] FreeBSD 4.3, PHP 4.0.6 unixODBC -- Undefined Symbol I had previously attempted to get the Openlink ODBC drivers work with iodbc and PHP. I was having no luck and turned to easysoft's solution, which includes unixODBC. I re-configured PHP (removing the config.cache file) and used --with-unixODBC=path/to/unixODBC instead of --with-iodbc=/path/to/iodbc. However, when starting Apache, I now get a 'Cannot load /usr/local/libexec/apache/libphp4.so into server: /usr/local/src/lib/libiodbc.so.3: Undefined symbol pthread_mutex_unlock'. The version of Apache that is installed is 1.3.20. I must not understand something about unixODBC because I didn't think libiodbc should even be getting loaded. Regardless, does anyone have a fix? Thanks, Joe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] FreeBSD 4.3, PHP 4.0.6 unixODBC -- Undefined Symbol
I played with this a little bit more, added --with-iodbc back into my configure line, and all went well, except ona phpinfo() page, it lists iodbc as my odbc library which won't help because I need to use unixODBC for the easysoft driver to work. Any ideas on what might be causing this? Or how to change my ODBC library? Thanks, joe Joe Koenig wrote: I had previously attempted to get the Openlink ODBC drivers work with iodbc and PHP. I was having no luck and turned to easysoft's solution, which includes unixODBC. I re-configured PHP (removing the config.cache file) and used --with-unixODBC=path/to/unixODBC instead of --with-iodbc=/path/to/iodbc. However, when starting Apache, I now get a 'Cannot load /usr/local/libexec/apache/libphp4.so into server: /usr/local/src/lib/libiodbc.so.3: Undefined symbol pthread_mutex_unlock'. The version of Apache that is installed is 1.3.20. I must not understand something about unixODBC because I didn't think libiodbc should even be getting loaded. Regardless, does anyone have a fix? Thanks, Joe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Class in PHP
Hi all, How many extension of subclass can PHP have? Can I extend subclass to more different subclass? Thanks, Calvin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Mass Mailing
Nop! At 16:36 05/12/01, you wrote: Michael, I'm designing a membership mail-out service right now - and wanting db 'recorded delivery'. Are your scripts available in one of the online script-libraries? Please advise, =dn - Original Message - From: Michael Cronström [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: 05 December 2001 13:43 Subject: Re: [PHP] Mass Mailing Hi again, These scripts get there email-info from a database. How many mails send per action depends on the max_execution_time set by your provider. Each send mail is marked in the database so if the process stops to early you can continue with the rest and unmarked. Web inventor Michael Cronstrom At 08:04 05/12/01, you wrote: Hi These scripts of yours, do they relay on a mailing list? See, I host with a provider, and I have got php4, but I don't have mailing list access, I need to pay per meg send etc, which works out very expensive. So I'm looking for a script that doesn't require a mailing list. Thank you Rudi Ahlers UNIX Specialist and Web Developer Bonzai Web Design - http://www.bonzai.org.za Cell: 082 926 1689 - Original Message - From: Michael Cronström [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 04, 2001 1:06 AM Subject: Re: [PHP] Mass Mailing OK Nathan, I have a couple of scripts that will do the job for you, if you are interested! Web inventor Michael Cronstrom At 22:51 02/12/01, you wrote: I started writing a set of scripts that would send out mutiple emails to a list of customers. I then realized that most likely this program, and/or snipits had most likely already been written. If so, can some one point me in the right direction and save me 3 or 4 days? Thanks Nathan Webmaster M-Y Communications -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Reg ex help-Removing extra blank spaces before HTML output
true...he didn't mention newlines though so i left those out...also, since PHP 4.0.4 $n [meaning $1], being the preferred one. you also don't need double quotes and since + means 1 or more, i'd save myself some typing $input = preg_replace('/(\s|\n)+/',$1,$input); of course since you're now matching and replacing it'll take longer than a straight substitution, although i doubt the files you're scanning are big enough to notice jack -Original Message- From: liljim [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 05, 2001 5:18 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Reg ex help-Removing extra blank spaces before HTML output Hello, The example Jack gave you will clear up spaces well, though to get both newlines and spaces into one: $input = preg_replace(/([ ]|\n){1,}/, \\1, $input); James Jack Dempsey [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... $text = preg_replace('|\s+|',' ',$text); -Original Message- From: Ken [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 05, 2001 2:06 AM To: PHP list Subject: [PHP] Reg ex help-Removing extra blank spaces before HTML output I want to remove all superfluous blank spaces before I sent my HTML output, to make the output smaller. So I'd like to take $input, replace any number of blank space or newlines that are consecutive and replace them with a single blank. I.e. I will list a blank space as b and a newline as n: If input is: bTEXTHEREbbbnnnbnMOREbEVENMORE Then output should be: bTEXTHEREbMOREbEVENMORE I imagine this would be handled by a simple regular expression call, but I'm no pro with them yet. Any help? Thanks, Ken [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: select join table on mysql
The most common couse of this problem is that your query generated an mysql error. To find out what the error is use this instead: $t2=mysql_db_query($db, SELECT radacct.UserName,sum(radacct.AcctSessionTime) as t1,usergroup.GroupName . from radacct LEFT JOIN usergroup ON radacct.UserName=usergroup.UserName where. usergroup.GroupName='unlimited' AND radacct.AcctStartTime='2001-$month-01 00:00:00'. AND AcctStopTime='2001-$month-31 23:59:59' group by UserName) or die(mysql_error()); Yamin Prabudy [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... hi i have to select this : $t2=mysql_db_query($db, SELECT radacct.UserName,sum(radacct.AcctSessionTime) as t1,usergroup.GroupName . from radacct LEFT JOIN usergroup ON radacct.UserName=usergroup.UserName where. usergroup.GroupName='unlimited' AND radacct.AcctStartTime='2001-$month-01 00:00:00'. AND AcctStopTime='2001-$month-31 23:59:59' group by UserName); when i do it in mysql database it already give me result and thereis about 400 rows. but when i want to generate it fetch the array there is a error Supplied argument is not a valid MySQL result resource in b./stats.php/b on line (bellow is the line $x=mysql_fetch_array($t2); what might be possible wrong with the code..(it just a simple one) Yamin Prabudy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] serialize object session_auto_start
Hi, I'm trying to save an object in the session, with the serialize and uunserialize fonction. But i got an error message wich say me that i must define the class before the session start. But my session start automaticly. So I can't include my class before the session start. I'm looking for a workaround. Thanks -- -- Matthieu Brunet - [EMAIL PROTECTED] Réseau-Photo S.A. - http://www.reseau-photo.com 15, rue du Général Campredon - 34000 Montpellier Tél. : 04 67 58 07 08 - Fax : 04 67 58 03 04 Icq : 119683958 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Strange bug
Hi, I was having some problems with my PHP files (the first 3 HTML lines missing and Netscape trying to save the page to disk instead of showing it). So, I telnet'd my web server and manually issued a GET as follows: GET /anglers/index.php HTTP/1.1 And this was the response: HTTP/1.0 200 OK Date: Tue, 04 Dec 2001 21:09:57 GMT Server: WebSitePro/2.4.9 Accept-ranges: bytes !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//ES !-- Copyright ® 1999-2001 Jogua Web Solutions v3.0 -- !-- BOF: default.inc 2001-12-04 18:09:57 -- html head titleAnglers Aventuras \ Inicio/title etc. etc... Note the CRLFs missing after the headers :-/ So the browser -naturally- understand those HTML remarks as being part of the header, and the HTML starting after those two CRLF I have in my HTML file. I know I can fix this just typing two CRLFs at the very beggining of my PHP file, but I'm not supposed to do that. And even if I do that, the header is still incomplete (i.e. mime type missing). This happens with 2 different servers, both running WebSite Pro 2.4 and PHP 4.0.6 (one Windows 2000 Advanced Server and the other Windows XP Pro). Is this a PHP bug, a WebSite bug or my code? I don't think I screwed something up because I'm not playing with the headers here. Any ideas? Regards, Ernesto -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] delete array item and resort
what is the easiest way to delete an array element and then resort the array so the elements receive the correct numbering. I was thinking something like this: $itemArray = array(red,blue,yellow); delete($itemArray[1]); so key 0 is still red but key 2 is still yellow but is remembered to become key 1. Hopefully that makes sense, get rid of one item in the middle and the rest of the array moves up one position. Thanks, » Michael Krisher [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Dumped OK, Restore NOT
On Wednesday 05 December 2001 08:02 am, you wrote: Little problem with MySQL 3.23.46 under Windows ME. I This would be an excellent question for the MySQL mailing list. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] delete array item and resort
$array = array(a,b,c); print_r($array); unset($array[1]); print_r($array); $array = array_values($array); print_r($array); -- produces Array ( [0] = a [1] = b [2] = c ) Array ( [0] = a [2] = c ) Array ( [0] = a [1] = c ) Jim what is the easiest way to delete an array element and then resort the array so the elements receive the correct numbering. I was thinking something like this: $itemArray = array(red,blue,yellow); delete($itemArray[1]); so key 0 is still red but key 2 is still yellow but is remembered to become key 1. Hopefully that makes sense, get rid of one item in the middle and the rest of the array moves up one position. Thanks, » Michael Krisher [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] possible to override session.auto_start in php.ini
I've read the manual notes for ini_set, so I have a feeling the answer to my question is no, but I'd like to make sure. I have no control over my ISP's php.ini file, but the fact that they have session.auto_start set to 1 in php.ini is causing me problems. Is there any way to override this? The manual says that session.auto_start isn't one of the settings that can be manipulated by ini_set, so I'm looking for alternative methods. Thansk. --kurt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] possible to override session.auto_start in php.ini
How about another ISP? I've read the manual notes for ini_set, so I have a feeling the answer to my question is no, but I'd like to make sure. I have no control over my ISP's php.ini file, but the fact that they have session.auto_start set to 1 in php.ini is causing me problems. Is there any way to override this? The manual says that session.auto_start isn't one of the settings that can be manipulated by ini_set, so I'm looking for alternative methods. Thansk. --kurt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] possible to override session.auto_start in php.ini
Try this http://www.google.com/search?hl=enq=%22.htaccess%22+%22override%22+%22php%22+%22settings%22spell=1 Regards, Anrey Hristov - Original Message - From: Kurt Lieber [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, December 05, 2001 7:06 PM Subject: [PHP] possible to override session.auto_start in php.ini I've read the manual notes for ini_set, so I have a feeling the answer to my question is no, but I'd like to make sure. I have no control over my ISP's php.ini file, but the fact that they have session.auto_start set to 1 in php.ini is causing me problems. Is there any way to override this? The manual says that session.auto_start isn't one of the settings that can be manipulated by ini_set, so I'm looking for alternative methods. Thansk. --kurt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] possible to override session.auto_start in php.ini
I think that I found the solution: http://www.zend.com/manual/configuration.php Regards - Original Message - From: Andrey Hristov [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, December 05, 2001 7:04 PM Subject: Re: [PHP] possible to override session.auto_start in php.ini Try this http://www.google.com/search?hl=enq=%22.htaccess%22+%22override%22+%22php%22+%22settings%22spell=1 Regards, Anrey Hristov - Original Message - From: Kurt Lieber [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, December 05, 2001 7:06 PM Subject: [PHP] possible to override session.auto_start in php.ini I've read the manual notes for ini_set, so I have a feeling the answer to my question is no, but I'd like to make sure. I have no control over my ISP's php.ini file, but the fact that they have session.auto_start set to 1 in php.ini is causing me problems. Is there any way to override this? The manual says that session.auto_start isn't one of the settings that can be manipulated by ini_set, so I'm looking for alternative methods. Thansk. --kurt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Dumped OK, Restore NOT
Maybe you can try to launch the sql dump file from the SQL shell, not directly from the command line. I think it will give you more feedback about what is going on. Go to the directory where you have your smarts.sql file. Just type mysql smarts And in the SQL shell type \. smarts.sql If you are not in the directory of the file smarts.sql then you need to give a full path to this file. Hope it helps. Nicolas -Message d'origine- De : René Fournier [mailto:[EMAIL PROTECTED]] Envoyé : mercredi 5 décembre 2001 17:02 À : [EMAIL PROTECTED]; [EMAIL PROTECTED] Objet : [PHP] Dumped OK, Restore NOT Little problem with MySQL 3.23.46 under Windows ME. I'm trying to create a database from an .sql file (the dumped remains of a functioning database--also MySQL). The dumping was easy, but I'm having a problem putting it back. I have a dumped file called smarts.sql that starts this way: - # MySQL dump 8.14 # # Host: localhostDatabase: smarts # # Server version3.23.38 # # Table structure for table 'about' # CREATE TABLE about ( id smallint(5) unsigned NOT NULL auto_increment, lang char(2) default NULL, recordname varchar(40) default NULL, key1 tinytext, key2 tinytext, status varchar(10) default NULL, title tinytext, par1 tinytext, PRIMARY KEY (id) ) TYPE=MyISAM; # # Dumping data for table 'about' # INSERT INTO about VALUES (1,'en','about' ---(and so on) This is what I'm doing to try to recreate the database locally: 1. I type mysqladmin create smarts OK--I see a new directory called smarts (no files in it) 2. I type mysql smarts smarts.sql It pauses for a few seconds (seeming to input the file), then returns the DOS prompt with no message, error or otherwise. Seems to have worked, right? But when I check the 'smarts' database directory, there are no files in it. (Incidentally mysqld is running.) What am I doing wrong?? ...Rene --- René Fournier [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: mysql update query
Greg, You must specify the tablename :) Like this: UPDATE myTableName ... or mysql UPDATE persondata SET age=age+1; For the official syntax visit mysql language reference at http://www.mysql.com at http://www.mysql.com/doc/U/P/UPDATE.html Kind Regards, Richard Creech [EMAIL PROTECTED] 250.744.3350 Pacific Time Canada Dreamriver Software Powers the Net http://www.dreamriver.com You wrote: From: Greg Sidelinger [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Tue, 4 Dec 2001 22:27:20 -0500 Message-ID: 000d01c17d3c$c0a393e0$1000a8c0@asylum MIME-Version: 1.0 Content-Type: multipart/alternative; boundary==_NextPart_000_000E_01C17D12.D7CD8BE0 Subject: mysql update query I'm having trouble getting an update query to work Here is what I'm doing $result = mysql_query(update table set value1='$value1', value2='$value2' where id='$id'); It is not updating the database. All the $vars have values and I'm using the correct columns names. Could someone please point me in the correct direction because I have been trying different things for a while but can't seem to get it to work. Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Qukc days to time() conversion?
I am prompting users for a number of days and then wanting to pull items from a database older than the number of days. All dates are stored as timestamps in the database so wondering how I can come up witht he required timestamp to compare with? (for for example 30 days). I have a difference conversion between the two timestamps but don't have it to that I can find the timestamp to search on... Jeff
Re: [PHP] Qukc days to time() conversion?
Read this : http://www.mysql.com/doc/D/a/Date_calculations.html Regards, Andrey Hristov - Original Message - From: Jeff Lewis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, December 05, 2001 7:19 PM Subject: [PHP] Qukc days to time() conversion? I am prompting users for a number of days and then wanting to pull items from a database older than the number of days. All dates are stored as timestamps in the database so wondering how I can come up witht he required timestamp to compare with? (for for example 30 days). I have a difference conversion between the two timestamps but don't have it to that I can find the timestamp to search on... Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] possible to override session.auto_start in php.ini
That worked! Thanks! For those who may be interested, I added the following lines to my .htaccess file: # change some php.ini settings IfModule mod_php4.c php_flag session.auto_start off /IfModule Also, this obviously only works with Apache with PHP running as a module. Not sure if there's an equivalent option for IIS. (if you remove the IfModule lines from the above example and just include the php_flag line, it should work for php compiled as a CGI, but I haven't tested that.) --kurt On Wednesday 05 December 2001 09:07 am, Andrey Hristov wrote: I think that I found the solution: http://www.zend.com/manual/configuration.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP newbie alert
I use PHP Coder (http://www.phpide.de ) which has been changed to Maguma PHP4EE Studio. http://www.maguma.com/english/welcome.html There's a Light and a Pro version. The Light version is free -Jon -Original Message- From: shaun murphy [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 04, 2001 5:25 AM To: [EMAIL PROTECTED] Subject:[PHP] PHP newbie alert Hello! Being one not to refuse a challenge, I have been asked to administer and update a PHP based website. I was wondering what a good editor is for such a task. I have been having a look at Dreamweaver as I use that quite a lot but are there any extensions I should be using? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: How can I uncompress zlib data in the browser?
Thanks! It seems to work when I put this at the very top of my php file: ob_start(ob_gzhandler); When I do a tcpdump on port 80, I see a small amount of garbage with that statement and huge amount of text without it. The text displays correctly in my browser either way, so it looks like it works. - Brian Yes. Read the manual about output buffering. Also read up on Apache's site about mod_gzip. http://apache.org Now, the 64 dollar question: Will the browser *CORRECTLY* identify and decompress the gzipped data? - Brian (Be sure to remove the # symbol before replying to my email address) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] How do I pass variables from a PHP script to an HTML document?
Hi, I currently have a form that calls a PHP script when submit is pressed. Within the PHP script, I wish to call a custom confirmation screen. I do so by issuing the following command: Header(Location: . $form[redirect]); Now, I wanted my form variables passed from the PHP script to my HTML document so I wrote a function within the form that adds the variable names and values to the URL by urlencoing them like such: $output = ?; $output .= urlencode($key) . = . urlencode(stripslashes($val)) . ; returning the above in a variable $vars, I call my redirect as such: Header(Location: . $form[redirect] . $vars); If I am not mistaken, this is synonymous with an HTTP GET? Here is my problem; the above fails with a large form, i.e., a form containing many fields. A bit of investigation has determined that there is a 1Kb limit on the total size of a request (URL+params) and I have one form that must be exceeding the limit. Question: Is there a way to emulate my above scheme via an HTTP POST as POST has no limit? Alternatively, is there another way to pass variables from a PHP script to a HTML form where I won't run into this limit? Thanks, Don
Re: [PHP] How do I pass variables from a PHP script to an HTMLdocument?
Why don't you try sessions? They make this sort of thing easy by letting you store all the data in $form and making it available on subsequent requests to this or other scripts. http://php.net/sessions Jim Hi, I currently have a form that calls a PHP script when submit is pressed. Within the PHP script, I wish to call a custom confirmation screen. I do so by issuing the following command: Header(Location: . $form[redirect]); Now, I wanted my form variables passed from the PHP script to my HTML document so I wrote a function within the form that adds the variable names and values to the URL by urlencoing them like such: $output = ?; $output .= urlencode($key) . = . urlencode(stripslashes($val)) . ; returning the above in a variable $vars, I call my redirect as such: Header(Location: . $form[redirect] . $vars); If I am not mistaken, this is synonymous with an HTTP GET? Here is my problem; the above fails with a large form, i.e., a form containing many fields. A bit of investigation has determined that there is a 1Kb limit on the total size of a request (URL+params) and I have one form that must be exceeding the limit. Question: Is there a way to emulate my above scheme via an HTTP POST as POST has no limit? Alternatively, is there another way to pass variables from a PHP script to a HTML form where I won't run into this limit? Thanks, Don -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How do I pass variables from a PHP script to an HTML document?
On Wednesday 05 December 2001 10:00 am, you wrote: Alternatively, is there another way to pass variables from a PHP script to a HTML form where I won't run into this limit? I'm not seeing why you have to redirect the user just to get a custom response. If you can instead use an include(); to customize your response, then you don't have to worry about redirecting the user to a different page. In other words, instead of doing this: form -- PHP Script -- confirmation page Just do: form -- PHP Script And have the PHP script format and output the confirmation page. --kurt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Is php safe for e-commerce applications?
What a scary day, and it just gets worse 1. A user finds their account balance is displayed incorrectly on one of my live e-commerce sites. 2. I discover that floor() intermittently gives the wrong answer i.e. print floor(10*(8.20 - 0.20)); Answer : 79 print floor(10*(8.10 - 0.10)); Answer : 80 (php 4.0.6 and 4.0.4.pl1 under Linux 2.2.19.) 3. I find this is a known feature with no intention of ever being fixed. See http://bugs.php.net/bug.php?id=6220 print floor( (0.7 + 0.1) * 10); Answer : 7 4. I check the php documentation that was added because of that bug (http://www.php.net/manual/en/language.types.float.php) and discover :- never trust floating number results to the last digit and never compare floating point numbers for equality. 5. I realise that the last digit might also be the first so that means never trust anything except integers! 6. The truth really sinks in... It seems I simply cannot use php for e-commerce applications unless I convert all money to integers e.g. $4.32 must be handled as 432 cents, or all arithmetic operations and comparisons have to be converted to use bc functions. Instead of : if ($cost == 10.00) you must write if (bcomp($cost,10.00,2)) == 0) etc.,etc. 7. The horror unfolds... php is just as full of geeko-trash as C/Perl/Java and the rest of them! I will have to spend the rest of my life worrying about types/casts/floating point precision and all that garbage even when I'm just adding up dollars and cents! I can't even escape to Italy and work in Lira, they're switching to euros with decimal places too! I should have stayed with Java, it may be rubbish but at least it's obviously rubbish! Please someone, tell me I'm wrong! Tell me that 0.1 + 0.7 can be 0.8 and not almost 0.8! Tell me I don't have to check the last three years of work! Tell me php isn't just for kids waiting to graduate/degradate to Java! Tell me the techno-geeks haven't won! Hell.. George -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Large file uploads timeout - ouch!
Did you read my post? I did all of that *before* I posted my question. Anyone else have a suggestion? TIA Fred On Wed, 05 Dec 2001 05:16:38 -0500, Mirek Novak wrote: fred wrote: After all of this, and you give me the wrong answer. If you read the PHP manual, you will see that set_time_limit falls defaults to max_execution_time, which I already have set to 2400, so your answer is irrelevant. That is not controlling HTTP_KEEP_ALIVE, which is defaulting to 300 seconds somewhere - probably httpd.conf. Now who is lazy? it was ONE question to google.com: +large file uploads +php results in http://www.phpbuilder.com/forum/read.php3?num=2id=137901loc=0thread=118340 -X- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] md5 decrypt
Is there away to take a md5 encrypted password and decrypt it and give that to the client, if they fogot their password. = dan mccullough Theres no such thing as a problem unless the servers are on fire! __ Do You Yahoo!? Buy the perfect holiday gifts at Yahoo! Shopping. http://shopping.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Recursive Threading with PHP and MySQL.
I want to know how can i do that Recursive loop to get categories as example can any body help me by give my tutorial or any thing to understand this techniqe
Re: [PHP] What is causing duplicate keys?
You should specify the column names to prevent this from happening. Such as ... INSERT INTO rcensioni (col1,col2,etc) VALUES ('value','value','etc...') Just make sure you don't specify the column that is autonumbering. Jim Hello, Always struggling on my php-odbc-MS access project, I managed to successfully add a record to a table. Now, no matter what I write in the first field (random numbers, AUTO, AUTO_INCREMENT...) I get this: Insert Into recensioni VALUES (300, 'riee', 'reworew', 'wer', 2001,'IT', 2.5, 'dond to it, 'rew', 'uno',1, 'Caro', 3, 'stuff', 20011205201040, 'writeurl, 1, '5/12/2001 20.10.40', '1', '1','enter keyword') Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again., SQL state 23000 in SQLExecDirect in C:\domini\mnet\inser_rec.php on line 109 Error in odbc_exec( no cursor returned ) How can I find out what I am duplicating? The first field is the unique key, but what should I send to Access to tell it just auto increment and go? If I put 0 or NULL it complains. Also, Andrew Hill siggested the use of odbc_tables and odbc_columns to get info about the structure of each column which I don't know in detail because the DB was written by the guy who quit, not me) What is the exact syntax of those instructions? I have tried to apply the manual, but without success on the second one. TIA, mweb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] md5 decrypt
On Wed, 5 Dec 2001, Dan McCullough wrote: -Is there away to take a md5 encrypted password and decrypt it and give that to the client, if they -fogot their password. No. - -= -dan mccullough - -Theres no such thing as a problem unless the servers are on fire! - - -__ -Do You Yahoo!? -Buy the perfect holiday gifts at Yahoo! Shopping. -http://shopping.yahoo.com - --- -PHP General Mailing List (http://www.php.net/) -To unsubscribe, e-mail: [EMAIL PROTECTED] -For additional commands, e-mail: [EMAIL PROTECTED] -To contact the list administrators, e-mail: [EMAIL PROTECTED] - ** John Huggins VANet 7101 Oriole Avenue Springfield, VA 22150 703-912-6453 703-912-4831 fax [EMAIL PROTECTED] http://www.va.net/ ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Minimum Apache CD-ROM root
running apache from a distro CD mm! I suppose you can't :( why you don't build a static version of your PHP application??? it's far easy... there are some utilities for done it :) do a search in google cheers, Valter Santos - Original Message - From: John Monfort [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 04, 2001 4:21 AM Subject: [PHP] Minimum Apache CD-ROM root Hello all, I'm writing a PHP application that will run on a cd-rom. I have two questions: 1) Apache Server I wanted to add the apache server on the disk. What are the minimum files that I need, for apache to run? i.e. apache.exe httpd.conf etc. 2) Configuration File PATH In the apache configuration file, the ServerRoot asks for a absolute path. Is there a Window's (system) Variable to shows the current directory? I'm hoping for something like ServerRoot DirPath/Apache/ So that, apache would run correctly, regardless if the CD-ROM drive is D: or F: or any other name. Any Ideas? If you have any suggestions on a small, portable, browser with PHP suport, then please let me know. Thanks in advance. __John Monfort_ _+---+_ P E P I E D E S I G N S www.pepiedesigns.com The world is waiting, are you ready? -+___+- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] md5 decrypt
I'm pretty sure you can't. You would have to set up an area where they can have their password reset and the new password emailed to their email address. Jeff - Original Message - From: Dan McCullough [EMAIL PROTECTED] To: PHP General List [EMAIL PROTECTED] Sent: Wednesday, December 05, 2001 2:21 PM Subject: [PHP] md5 decrypt Is there away to take a md5 encrypted password and decrypt it and give that to the client, if they fogot their password. = dan mccullough Theres no such thing as a problem unless the servers are on fire! __ Do You Yahoo!? Buy the perfect holiday gifts at Yahoo! Shopping. http://shopping.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] md5 decrypt
Dan McCullough [EMAIL PROTECTED] wrote: Is there away to take a md5 encrypted password and decrypt it and give that to the client, if they fogot their password. Short answer is no, long answer below. I just answered this on another list 10 minutes ago so I'm pasting in part of my reply unedited. You could use something like John the Ripper, which is a password cracker you can install on the server. It works by taking a list of words, word-number combinations, etc. from a dictionary and encrypting them, then comparing the encrypted results with the encrypted passwords stored on your server. If there's a match it notes the cracked password. It's good for detecting weak passwords and can actually detect them very quickly, but if the passwords are strong then it's not effective for your purposes (that's a good thing) since by the time it cracked the password (if it did) your user would have likely taken their business elsewhere. On a few servers I manage I run it periodically to check for weak passwords, then I contact the users with weak passwords and ask that they change them. John the Ripper: http://www.openwall.com/john/ -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] xml header
What is the proper header to send when presenting dynamic xml pages to the browser? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Reg ex help-Removing extra blank spaces before HTML output
actually it does... james' solution will work but I forgot to mention a \s is whitespace, not a space, therefore it will get tabs, newlines, and spaces. look at http://www.cs.tut.fi/~jkorpela/perl/regexp.html \s matches any whitespace character (space, tab, newline) therefore my suggestion works: $t = preg_replace('/\s+/',' ',$text); its quicker to code, easier to understand, and will run faster because it doesn't have to match and remember or do alternation... jack -Original Message- From: Ken [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 05, 2001 2:01 PM To: Jack Dempsey Subject: RE: [PHP] Reg ex help-Removing extra blank spaces before HTML output At 10:57 AM 12/5/01 -0500, Jack Dempsey wrote: a space (\s is from perl) Ah, OK, yours doesn't deal with newlines. From list member James, a solution that does: - From: liljim [EMAIL PROTECTED] The example Jack gave you will clear up spaces well, though to get both newlines and spaces into one: $input = preg_replace(/([ ]|\n){1,}/, \\1, $input); - Thanks again! - Ken [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Is php safe for e-commerce applications?
Reading the Bug report, it was mentioned if you want precision mathmatics, use BCMath http://www.php.net/manual/en/ref.bc.php That will give you the precision you are looking for. Jason Lotito [EMAIL PROTECTED] www.NewbieNetwork.net -Original Message- From: George Whiffen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 05, 2001 3:05 PM To: [EMAIL PROTECTED] Subject: [PHP] Is php safe for e-commerce applications? What a scary day, and it just gets worse 1. A user finds their account balance is displayed incorrectly on one of my live e-commerce sites. 2. I discover that floor() intermittently gives the wrong answer i.e. print floor(10*(8.20 - 0.20)); Answer : 79 print floor(10*(8.10 - 0.10)); Answer : 80 (php 4.0.6 and 4.0.4.pl1 under Linux 2.2.19.) 3. I find this is a known feature with no intention of ever being fixed. See http://bugs.php.net/bug.php?id=6220 print floor( (0.7 + 0.1) * 10); Answer : 7 4. I check the php documentation that was added because of that bug (http://www.php.net/manual/en/language.types.float.php) and discover :- never trust floating number results to the last digit and never compare floating point numbers for equality. 5. I realise that the last digit might also be the first so that means never trust anything except integers! 6. The truth really sinks in... It seems I simply cannot use php for e-commerce applications unless I convert all money to integers e.g. $4.32 must be handled as 432 cents, or all arithmetic operations and comparisons have to be converted to use bc functions. Instead of : if ($cost == 10.00) you must write if (bcomp($cost,10.00,2)) == 0) etc.,etc. 7. The horror unfolds... php is just as full of geeko-trash as C/Perl/Java and the rest of them! I will have to spend the rest of my life worrying about types/casts/floating point precision and all that garbage even when I'm just adding up dollars and cents! I can't even escape to Italy and work in Lira, they're switching to euros with decimal places too! I should have stayed with Java, it may be rubbish but at least it's obviously rubbish! Please someone, tell me I'm wrong! Tell me that 0.1 + 0.7 can be 0.8 and not almost 0.8! Tell me I don't have to check the last three years of work! Tell me php isn't just for kids waiting to graduate/degradate to Java! Tell me the techno-geeks haven't won! Hell.. George -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Is php safe for e-commerce applications?
Would sprintf() handle your needs? This seems to work correctly... $val = sprintf(%.0f,(10*(8.20-0.20))); produces a string $val equal to 80. Is this too geeky? Jimtronic What a scary day, and it just gets worse 1. A user finds their account balance is displayed incorrectly on one of my live e-commerce sites. 2. I discover that floor() intermittently gives the wrong answer i.e. print floor(10*(8.20 - 0.20)); Answer : 79 print floor(10*(8.10 - 0.10)); Answer : 80 (php 4.0.6 and 4.0.4.pl1 under Linux 2.2.19.) 3. I find this is a known feature with no intention of ever being fixed. See http://bugs.php.net/bug.php?id=6220 print floor( (0.7 + 0.1) * 10); Answer : 7 4. I check the php documentation that was added because of that bug (http://www.php.net/manual/en/language.types.float.php) and discover :- never trust floating number results to the last digit and never compare floating point numbers for equality. 5. I realise that the last digit might also be the first so that means never trust anything except integers! 6. The truth really sinks in... It seems I simply cannot use php for e-commerce applications unless I convert all money to integers e.g. $4.32 must be handled as 432 cents, or all arithmetic operations and comparisons have to be converted to use bc functions. Instead of : if ($cost == 10.00) you must write if (bcomp($cost,10.00,2)) == 0) etc.,etc. 7. The horror unfolds... php is just as full of geeko-trash as C/Perl/Java and the rest of them! I will have to spend the rest of my life worrying about types/casts/floating point precision and all that garbage even when I'm just adding up dollars and cents! I can't even escape to Italy and work in Lira, they're switching to euros with decimal places too! I should have stayed with Java, it may be rubbish but at least it's obviously rubbish! Please someone, tell me I'm wrong! Tell me that 0.1 + 0.7 can be 0.8 and not almost 0.8! Tell me I don't have to check the last three years of work! Tell me php isn't just for kids waiting to graduate/degradate to Java! Tell me the techno-geeks haven't won! Hell.. George -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Class in PHP
On Wed, 5 Dec 2001 10:41:53 -0500 Wee Chua [EMAIL PROTECTED] wrote: Hi all, How many extension of subclass can PHP have? Can I extend subclass to more different subclass? Do you mean how deep a inheritance you can have? e.g. A \ B | \ C D | \ E F There is nothing wrong with doing Class F extends D (which then in turn inherits it's stuff from class b, etc.) -- Get your firstname@lastname email for FREE at http://Nameplanet.com/?su -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]