php-windows Digest 5 Feb 2001 12:57:24 -0000 Issue 429 Topics (messages 5372 through 5383): Re: File Uploading 5372 by: Alain Fontaine 5377 by: Per Nielsen Re: forking processes 5373 by: Alain Fontaine Re: php_imap4r2.dll not loaded ?!?! (win2k) 5374 by: Alain Fontaine 5379 by: Eelco de Vries 5380 by: Eelco de Vries Re: sending pop3/imap mail 5375 by: Alain Fontaine 5383 by: Bikes Re: Reading CSV data into a database 5376 by: Ingo Baab Re: [PHP] Re: [PHP-WIN] For My Information 5378 by: Ingo Baab Mcrypt 5381 by: Danilo Meles 5382 by: Mangiola Nunzio Datavia Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
Randall, It looks as if your upload path AND the destination path for your uploaded files is the same, namely c:\temp; could that be the problem? Also, try setting the path to the full "c:\\temp" and make sure this directory exists ! "Randall Barber" <[EMAIL PROTECTED]> a écrit dans le message news: 001801c08f0d$543bdcd0$[EMAIL PROTECTED] I have scanned the archives (probably looking in the wrong place), and have tried the code in the documentation to no avail. I need help understanding the issues of file uploading using php. Here is the setup: PHP (ISAPI) installation. PHP.INI is in C:\WINNT the two DLLs are in C:\WINNT\SYSTEM32 (php4st.dll and msrcvt.dll) i think those are the names my entensions reside in C:\PHP\EXTENSIONS. My PATH variable includes this location. Here is the code: ---formtest.html--------------------------------- <html> <body> <form action="file-upload.php" method="post" enctype="multipart/form-data"> Send these files:<br> <input name="userfile[]" type="file"><br> <input name="userfile[]" type="file"><br> <input type='submit' value='Send Files'> </form> </body> </html> --file-upload.php-------------------------------- <html> <body> Files uploaded... <?php move_uploaded_file($userfile[0], "\\temp"); // Just move the first file. ?> </body> </html> I get one of two things happening: 1) I get two WARNINGS: Cannot open/create ([1] the file I uploaded, and [2] the target directory) or 2) No errors, no warnings, but also no file was copied to the C:\TEMP directory where I asked it to copy to. It is also never consistent. I either get the warnings with no result, or NO warnings with no result. In either case, I get no results. <frown>. I am on Win2k and FAT32 disk format. Therefore I don't have much directory/file security to worry about. Anyone help me please? This is my first look at PHP and I can see the power, but if it won't do what it is supposed to do, I don't see much use in it. Thanks in advance RDB
Hi Randall, The code below should show you how to handle the file upload process (in example a text file). I've kept the source as simple as possible. Place both files in the same directory and the uploaded file should also appear there. If you want to upload multiple files you will need to handle each file separately in your php-file. Best regards, Per The code: ======= --- File: form.html --- <html> <head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> <meta name="generator" content="Upload"> <title>Upload</title> </head> <body bgcolor="#ffffff"> <FORM ENCTYPE="multipart/form-data" ACTION="uploadhandle.php" METHOD=POST> <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="10000"> Send this file: <INPUT NAME="userfile" TYPE="file"> <INPUT TYPE="submit" VALUE="Send File"> </FORM> </body> </html> --- File: uploadhandle.php --- <? echo($userfile_name); echo("<BR>"); echo($userfile); if (copy($userfile, "upload.txt")) { echo("<B>The file is now uploaded....</B>"); } else { echo("Error: Damm..!"); } unlink($userfile); ?> I have scanned the archives (probably looking in the wrong place), and have tried the code in the documentation to no avail. I need help understanding the issues of file uploading using php. Here is the setup: PHP (ISAPI) installation. PHP.INI is in C:\WINNT the two DLLs are in C:\WINNT\SYSTEM32 (php4st.dll and msrcvt.dll) i think those are the names my entensions reside in C:\PHP\EXTENSIONS. My PATH variable includes this location. Here is the code: ---formtest.html--------------------------------- <html> <body> <form action="file-upload.php" method="post" enctype="multipart/form-data"> Send these files:<br> <input name="userfile[]" type="file"><br> <input name="userfile[]" type="file"><br> <input type='submit' value='Send Files'> </form> </body> </html> --file-upload.php-------------------------------- <html> <body> Files uploaded... <?php move_uploaded_file($userfile[0], "\\temp"); // Just move the first file. ?> </body> </html> I get one of two things happening: 1) I get two WARNINGS: Cannot open/create ([1] the file I uploaded, and [2] the target directory) or 2) No errors, no warnings, but also no file was copied to the C:\TEMP directory where I asked it to copy to. It is also never consistent. I either get the warnings with no result, or NO warnings with no result. In either case, I get no results. <frown>. I am on Win2k and FAT32 disk format. Therefore I don't have much directory/file security to worry about. Anyone help me please? This is my first look at PHP and I can see the power, but if it won't do what it is supposed to do, I don't see much use in it. Thanks in advance RDB
Jason, I have recently read about another quite useful way to do what you want: create a separate php script file the purpose of which is to do the actual mail sending. From your main PHP script on the website, use system() [see documentation] to call that script and let that script process the mail sending in the background. Your user won't have any feedback about the mail sending process, but you could design a system that logs the process information to a file or database, and display that information once the sending is done. "Jason Hoover" <[EMAIL PROTECTED]> a écrit dans le message news: [EMAIL PROTECTED] > I have a form that launches an e-mail message to numerous people as > determined by the user filling out the form (user picks people from select > lists...e-mail addresses are kept in database,etc..). > > When the form is submitted the user is forced to wait until the script that > launches the e-mails finishes it's job, before he/she is redirected to > another page in the application. > > Question: Is there a way to launch this e-mail script as a separate > process, so the user isn't forced to wait through this script before being > redirected.? I know in Java you can do this, but is is possible in > Interpreted languages? > > > Jason Hoover > Web Application Programmer > > Entolo > 2299 Territorial Road > St. Paul, MN 55114 > Phone: 763.847.8022 > Fax: 763.642.1600 > [EMAIL PROTECTED] > www.entolo.com > > > -- > PHP Windows 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] >
Eelco, You don't need to compile anything yourself (unless you really want to) on Windows. Your problem is more related to an incorrect extension_path setting in php.ini, which makes that PHP cannot find the dll you are requesting. Make sure that your extensions path is set correctly, and I bet it will work ! ""Eelco de Vries"" <[EMAIL PROTECTED]> a écrit dans le message news: [EMAIL PROTECTED] > Hello, > > I'm trying to use some POP3 functions and the manual states I would need to > use the IMAP functions. > So I uncommented the ";extension=php_imap4r2.dll" line in my > "c:\winnt\php.ini" file. But it gave me the following error: > > "Unable to load dynamic library './php_imap4r2.dll' - The specified module > could not be found". > > I read I needed the download install the "imap-4.5.tar" module. The README > file has only instructions how to "make" it for UNIX. The default "MakeFile" > is for UNIX. So I tried to clown around and rename "MakeFile.nt" to > "MakeFile" and make it. But I only get errors: > > Could Not Find D:\temp\imap-4.5\c-client\LINKAGE.* > NMAKE : fatal error U1077: 'C:\WINNT\system32\cmd.exe' : return code '0x1' > Stop. > NMAKE : fatal error U1077: 'C:\WINNT\system32\cmd.exe' : return code '0x2' > Stop. > > > I also tried this with the "MakeFile.ntk" (don't know what ntk stands for), > but no fix. > Can anybody help me with this problem? > > Regards; > Eelco. > > > -- > PHP Windows 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] >
but the whole php_imap4r2.dll file does not exist in my entire system. It's not a wonder it can't find it, is it? Where can I get that file? Anybody ...?? > Eelco, > > You don't need to compile anything yourself (unless you really want to) on > Windows. Your problem is more related to an incorrect > extension_path setting > in php.ini, which makes that PHP cannot find the dll you are requesting. > Make sure that your extensions path is set correctly, and I bet > it will work > ! > > ""Eelco de Vries"" <[EMAIL PROTECTED]> a écrit dans le message news: > [EMAIL PROTECTED] > > Hello, > > > > I'm trying to use some POP3 functions and the manual states I would need > to > > use the IMAP functions. > > So I uncommented the ";extension=php_imap4r2.dll" line in my > > "c:\winnt\php.ini" file. But it gave me the following error: > > > > "Unable to load dynamic library './php_imap4r2.dll' - The > specified module > > could not be found". > > > > I read I needed the download install the "imap-4.5.tar" module. > The README > > file has only instructions how to "make" it for UNIX. The default > "MakeFile" > > is for UNIX. So I tried to clown around and rename "MakeFile.nt" to > > "MakeFile" and make it. But I only get errors: > > > > Could Not Find D:\temp\imap-4.5\c-client\LINKAGE.* > > NMAKE : fatal error U1077: 'C:\WINNT\system32\cmd.exe' : return > code '0x1' > > Stop. > > NMAKE : fatal error U1077: 'C:\WINNT\system32\cmd.exe' : return > code '0x2' > > Stop. > > > > > > I also tried this with the "MakeFile.ntk" (don't know what ntk stands > for), > > but no fix. > > Can anybody help me with this problem? > > > > Regards; > > Eelco. > > > > > > -- > > PHP Windows 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 Windows 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] > >
And it's not in the full php-4.0.4-Win32.zip distribution either. :( I'm kinda desperate with this issue. Eelco. > Surely all you need to do is find the php_imap4r2.dll ? its > probably in the > large windows (~3mb) download ? Otherwise, just search for it on > the net... > > Siggy > > ----- Original Message ----- > From: "Eelco de Vries" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Sunday, February 04, 2001 10:39 PM > Subject: [PHP-WIN] php_imap4r2.dll not loaded ?!?! (win2k) > > > > Hello, > > > > I'm trying to use some POP3 functions and the manual states I would need > to > > use the IMAP functions. > > So I uncommented the ";extension=php_imap4r2.dll" line in my > > "c:\winnt\php.ini" file. But it gave me the following error: > > > > "Unable to load dynamic library './php_imap4r2.dll' - The > specified module > > could not be found". > > > > I read I needed the download install the "imap-4.5.tar" module. > The README > > file has only instructions how to "make" it for UNIX. The default > "MakeFile" > > is for UNIX. So I tried to clown around and rename "MakeFile.nt" to > > "MakeFile" and make it. But I only get errors: > > > > Could Not Find D:\temp\imap-4.5\c-client\LINKAGE.* > > NMAKE : fatal error U1077: 'C:\WINNT\system32\cmd.exe' : return > code '0x1' > > Stop. > > NMAKE : fatal error U1077: 'C:\WINNT\system32\cmd.exe' : return > code '0x2' > > Stop. > > > > > > I also tried this with the "MakeFile.ntk" (don't know what ntk stands > for), > > but no fix. > > Can anybody help me with this problem? > > > > Regards; > > Eelco. > > > > > > -- > > PHP Windows 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] > > > > > >
Hi, 1. Have you loaded the required imap DLL in php.ini ? 2. Make sure your extensions path is set correctly in php.ini ""Paul R. Edelkamp, Jr."" <[EMAIL PROTECTED]> a écrit dans le message news: [EMAIL PROTECTED] > I'm trying to get a pop3 webmail script working and have been getting > runtime errors. I believe I've tracked down the problem to the imap > extention. What are the appropriate steps to get php to work with IMAP and > pop3 mail working on windows 2000 with IIS? I'd appreciate any help, > especially a step-by-step guide to get it to work. Both scripts that I've > tried call for an installation --with imap. > > Thanks very much, > Paul > > > -- > PHP Windows 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] >
Hi Paul, I would be happy if you could contact me when your script works. I think I might need it too, and I would not mind if you can send me the script and steps to take. Thank you Bikes -----Original Message----- From: Paul R. Edelkamp, Jr. To: [EMAIL PROTECTED] Sent: 2/4/01 7:57 AM Subject: [PHP-WIN] sending pop3/imap mail I'm trying to get a pop3 webmail script working and have been getting runtime errors. I believe I've tracked down the problem to the imap extention. What are the appropriate steps to get php to work with IMAP and pop3 mail working on windows 2000 with IIS? I'd appreciate any help, especially a step-by-step guide to get it to work. Both scripts that I've tried call for an installation --with imap. Thanks very much, Paul -- PHP Windows 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]
Is this List for explaining trivial PHP-coding??? ingo baab phobo schrieb: > use the mysql functions. - see www.php.net/mysql. > if you're on windows (i assume, since you're on this list), mysql functions > are built in. > > in a nut shell : > > > $row = 1; > > $fp = fopen ("test.txt","r"); > > $con = mysql_connect(-mysql_server_ip-, -username-, -password-); > $con = mysql_select_db (-databasename-) > > > while ($data = fgetcsv ($fp, 1000, "\t")) { > > $num = count ($data); > > $row++; > > for ($c=0; $c<$num; $c++) { > > print $data[$c] . "<br>"; > > } > mysql_query("INSERT into tablename SET('blah', $data); > > > } > > fclose ($fp); > mysql_close($con); > > > > ?> > > Siggy > > ----- Original Message ----- > From: "Ben Cairns" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Saturday, February 03, 2001 6:00 AM > Subject: [PHP-WIN] Reading CSV data into a database > > > I have this script: > > <? > > > > $row = 1; > > $fp = fopen ("test.txt","r"); > > while ($data = fgetcsv ($fp, 1000, "\t")) { > > $num = count ($data); > > $row++; > > for ($c=0; $c<$num; $c++) { > > print $data[$c] . "<br>"; > > } > > } > > fclose ($fp); > > > > ?> > > It reads a csv file (actually its tab seperated) into an array called > $data. > > > > When I call this in my browser, this is fine. But what I need to do is to > > put this information into a MySQL database... > > > > The file contains these fields: > > region > > event_type > > event_date > > title > > info > > times > > venue > > price > > event_id (this is auto_incrementing) > > > > How do I read this file into the database? > > > > Any help appreciated, as I have RTFM but I still no idea...... > > > > > > > > -- > > PHP Windows 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 Windows 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]
> Berber-Guy, I don't believe that there is any question today that apache [on ony platform], is the best webserver you *can't* buy ;) ingo baab > > Guys, > > > > I don't believe that there is any question today that IIS5 on win2K > > is the best webserver $$$ can buy. > > > > Sincerely > > > > berber > > > > Visit http://www.weberdev.com Today!!! > > To see where PHP might take you tomorrow.
Hi there; I have to encrypt a string into a cookie, how to do that??? Should a use mcrypt function??? If yes how to put this function working in PHP??? Thank you all!!! Danilo Meles
Try this site, they give a tutorial on encryption. http://hotwired.lycos.com/webmonkey/programming/php/index.html Hope it works for you. > ---------- > From: Danilo Meles[SMTP:[EMAIL PROTECTED]] > Reply To: Danilo Meles > Sent: Monday, February 05, 2001 1:41 PM > To: [EMAIL PROTECTED] > Subject: [PHP-WIN] Mcrypt > > Hi there; > > I have to encrypt a string into a cookie, how to do that??? Should a use > mcrypt function??? > > If yes how to put this function working in PHP??? > > Thank you all!!! > > Danilo Meles > > > -- > PHP Windows 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] >