[PHP-WIN] Re: cURL: curl_exec returning chopped up result on a POST operation
John Palmer wrote: > System: > > BSDI 4.1 > Apache 1.3.26 > PHP 4.1.2 > cURL 7.9.8 > > I have the following function in PHP: > > function XMLExec($command) > { > > > $ch = curl_init(); > curl_setopt($ch, CURLOPT_URL, http://host.name/.cgi-bin/cgiprogram); > curl_setopt($ch, CURLOPT_POST, 1); > curl_setopt($ch, CURLOPT_FAILONERROR, 1); > curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); > curl_setopt($ch, CURLOPT_POSTFIELDS, $command); > curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); > > $res = curl_exec($ch); > curl_close($ch); > > return $res; > > } > > > Really simple little thing. The CGI-BIN program is a C program that returns XML >output. The first line > is Content-type: text/html, then a blank line and then XML > > Problem: Sometimes, especially when the XML output is long (maybe 12k or so), the >output that ends up in > the $res string is all chopped up. Usually, the first part of the output is present, >but then a huge chunk is > missing and then a middle section is there and then the end of the output is chopped >off. > > Has anyone seen this before? The only error that I can see is that when Apache >starts, it whines about > PHP not being compiled with EAPI. Other than that, no other problems. > > I'm wondering if there is a buffering problem somwhere but I havent found any >mention of this > on any lists > > > There has been a buffer problem with the curl module but it should be fixed in CVS. I' not sure if this has anything to do with your problem. http://bugs.php.net/bug.php?id=17963 /Per -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-WIN] Re: Trapping PHP errors
Matt Babineau wrote: > Does anyone know of a way to trap PHP errors and have them automatically > emailed to an email address? I am trying to do some remote testing on a > script but the problem it is it's server to server interaction so I > can't see what is going on! Any ideas? > > Matt Babineau > MCWD / CCFD > - > e: <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED] > p: 603.943.4237 > w: <http://www.criticalcode.com/> http://www.criticalcode.com > PO BOX 601 > Manchester, NH 03105 > > Look in chapter 15 Error Handling in the documentation, there is an example that might help you. /Per -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-WIN] second argument in strtotime seems to have no effect
Second argument in strtotime seems to have no effect. strtotime("2001-02-02 12:01:01",98700); strtotime("2001-02-02 12:01:01",1000); strtotime("2001-02-02 12:01:01",time()); strtotime("2001-02-02 12:01:01"); all gives the same output: 981111661. Am I or the function erronous? /Per -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-WIN] Get rid of session id in url when using session_set_save_handler
Hi Anyone who knows how to get rid of the session id in the url. When I don't use session_set_save_handler the session id gets set automatically in a cookie but not when i use session_set_save_handler, then it will be included in the url. How should I do to set it in a cookie and get rid of it in the URL? /Per -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-WIN] Compiling PHP under Windows
Hey Windows PHP people, I am trying to compile PHP 4.2.3 under Windows with Visual C++ 6.0. However, I am not being very successful. Do I need any special libraries/etc to get this working? (I am trying to build the php4dllts project in the win32 directory, for use as an embedded library in another application) I realized that inet/arpa.h et al did not exist so I replaced them for winsock.h. Still, I am getting strange problems that FD_SETSIZE (a #define in winsock.h) has not been defined, even though winsock.h has been properly included. This is when trying to compile ext/ftp/ftp.c. Does anyone recognize this, and does anyone have a proper fix? -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.capio.com -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-WIN] Re: Compiling PHP under Windows
Jean Baptiste FAVRE wrote: Hey Jean-Baptiste, For compiling PHP itself, all you need is writen in the doc: http://www.php.net/manual/en/install.windows.php In order to compile some extensions, you'll need external libraries. Generaly, it's writen in the doc too. Thank you! For some reason, I didn't see these build instructions; I took for granted that it would be in the source archive itself... I'll try following these instructions and let's see what turns out. -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.capio.com -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-WIN] Trouble with php4ts.dll
Hey folks, I have now managed to compile php4ts.dll successfully (thanks to you who helped me with this!) and I've managed to link a test application to this library. However, it does not work properly. The same program works fine when running with the non-TS PHP4 library on Linux, so I'm suspecting the thread safety code that's broken. Any hints? -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.capio.com -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-WIN] php.ini
Naqashzade, Sadeq wrote: I know that in Linux I must be able to use .httaccess but do not know how? and in Windows I do not know at all. You can use .htaccess in Apache both on Linux and Windows. Like this: php_value auto_prepend_file platform/platform.php Make sure AllowOverride in the Apache httpd.conf is set to All for this to work. And, remember that using .htaccess is fairly slow; it would be better to add directives in the Apache config for your directories. -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.capio.com -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-WIN] initialize variables
Wade wrote: $total= 0; echo 'Your order was for the following:'; echo 'Entree: "' . $_POST . $Course1 . '"'; echo 'Dessert: "' . $_POST . $ListBox2 . '"'; foreach (array($Course1, $ListBox2) as $val) { if (ereg('[0-9]+', $val, $regs)) $total += $regs[0]; } echo 'TOTAL BILL = $"' . $total . '"'; ?> Your questions are well-covered by the manual, especially here: http://www.php.net/manual/en/language.variables.external.php http://www.php.net/manual/en/reserved.variables.php#reserved.variables.post http://www.php.net/manual/en/language.types.array.php The PHP manual is very well-written and helpful for people who are used to other programming languages. If you have no previous programming experience, I'd suggest to go to the local library (if you have one) or a book shop and borrow/buy a book about the basic concepts of computer programming. It will be wortwhile and save you a lot of time in the long run. -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.capio.com -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-WIN] Configuring a web server I haven't written yet...
[EMAIL PROTECTED] wrote: Hey Jill, I'm writing a web server for Windows. I want to know how to make it support PHP. > Here's the bit I _DON'T_ know how to do... How can my server INITIALISE the superglobal variables $_GET, $_POST, $_SERVER, $_SESSION, etc. in preparation for running the script? In the binary distribution of PHP for Windows, there is a file called php4ts.dll. You will need to link your web server to this DLL. It contains the PHP interpreter. This is the way other SAPI (Server API) implementations work. Get the PHP source code, if you don't have it already, and unpack it to a directory of your choice. In the php-4.3.0 (or whatever) directory, look in the sapi directory for examples about how PHP interacts with Apache, ISAPI and other web server extensions. I have done something similar to what you are doing so you may email me politely (i.e. without using profane/blasphemous language) if you have any other questions. -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.capio.com -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-WIN] Politely?
[EMAIL PROTECTED] wrote: Wow! I've only been on this mailing list for about half a hour, and I've only sent two emails (this is the third). What kind of a reputation do I have already? And how did I get it? Do you know something I don't? Why should anyone assume I would ever be anything other than polite? It was stated in the email from me that you quoted: > ... so you may email me politely (i.e. without > using profane/blasphemous language) if you have any other questions. Be polite = do not use profane/blasphemous language. Simple courtesy. -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.capio.com -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-WIN] Re: How do i load my new activex dll?
Wayne wrote: But i get the following error, now, apache only works as a multi threaded webserver doesn't it? Apache for Windows, yes. (Apache for Linux and Unix is an altogether different story) Fatal error: dl() is not supported in multithreaded Web servers - use extension statements in your php.ini in c:\servers\root\php_nuke\md5.php on line 7 You should not use dl() for loading just any kind of DLL:s, but rather PHP extensions. What kind of error did you get when trying to use the COM support? -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.capio.com -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-WIN] how to make php4ts.dll act as a module of vb6 program?
cmkpl wrote: as title,thanks What is it that you want to do, run PHP as a script interpreter with your program? Look in sapi/embedded (only in PHP 4.3.0) in the PHP source code for an example of the minimal functionality required. php4ts.dll is not an ActiveX component so it is not just "plug and play" like with other stuff; you might be required to write a wrapper in C to implement some of the PHP4 callbacks. But, it is definitely doable. -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.capio.com -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-WIN] how to make php4ts.dll act as a module of vb6 program?
Svensson, B.A.T. (HKG) wrote: I understood it as that he wanted to know the library functions of that DLL. Yeah, but that's likely not an end in itself but rather just a means to an end. By the way, cmkpl, getting the symbol names from a DLL is just a matter of running a program such as "Dependency Walker" (included in Visual Studio). -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.capio.com -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-WIN] how to make php4ts.dll act as a module of vb6 program?
cmkpl wrote: i just want to use this dll to do input of php pages and get the output Look in the source code of the CGI or CLI sapi (in sapi/cli or sapi/cgi in the PHP source distribution) for an example of how to do it in C. I have no idea of how to call C libraries from within Visual Basic; it may or may not be a trivial task. -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.capio.com -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-WIN] dom
parvez Soobhany wrote: to cofingure my apache and php to use php dom...where do I type this command --with -dom When you compile PHP. But you probably have it compiled already, as a module, if you're using the binary archive from php.net. Look in php.ini for the extension lines. There should be a line (commented out) listing php_domxml.dll. -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.capio.com -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-WIN] site navigation with odbc mssql7
[EMAIL PROTECTED] wrote: we need example for site navigation (for database, we use odbc and MSSQL 7), Be more specific. What kind of site navigation? A javascript menu, a HTML site map or something else? What kind of help are you looking for, a table design? -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.capio.com -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-WIN] reading lines from a file
On Tue, 2003-02-11 at 18:27, Svensson, B.A.T. (HKG) wrote: > Also excuse my limited ignorant knowledge about PHP, but > my impression about PHP is that it is runs as an instance > of the web server or something? (Please, correct me if I > made any fundamental mistake here!) Yes and no. It can be run both as a SAPI module (running in Apache, IIS, Netscape or another web server) or as a stand-alone process in what is called CGI and CLI modes. There is even wrappers for writing Gtk+ applications with PHP using these modes (the wrapper is called PHP-GTK I think). I would say PHP is just as "all-round" as Perl actually, and I have personally switched from Perl to PHP completely because I prefer PHP's more "C-like" syntax. Maybe you should Read The Fine Manual, Anders? :-) > On the other hand I can imagine an performance difference > on doing this with C/C++, which would be my natural choose > when writing a cmd line parser. But then again, doing the parser would be a much more time-consuming process. And even worse, we're on the wrong mailing list for that... :) -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.capio.com -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-WIN] quotes and backslashes
On Wed, 2003-02-12 at 09:35, Bobo Wieland wrote: > When I have strings like 'Hello "World"' containing quotes and passes them > to another page I use: rawurlenecode(html_entity_decode($string, > ENT_QUOTES)). > > And then I use rawurldecode to display them again, getting the string: > 'Hello \"World\"' ... > > Why, and hw do I fix it? I think your problem is caused by PHP also doing its own encoding of parameters. This is called 'magic quotes' and is well documented in the manual if you wish to educate yourself on the subject. I think it will work straight off if you remove the rawurlencode() or change the setting of magic_quotes_gpc to off (but be aware that this can be a HUGE security risk if your code is not well-written). -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.capio.com -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-WIN] Problems installation of Apache 2.0.44
On Sun, 2003-02-16 at 18:24, Moses Johnson wrote: > when I add LoadModule php4_module c:/php-4.3.0-win32/sapi/php4apache.php in the >apache configuration file and tried to start apache > I get this error message on starting apache " syntax error on line 173 of c:/ >Program File/Apache Group/Apache2/conf/ > httpd.conf: > cannot load c:/php-4.3.0-win32/sapi/php4apache.php into serve: the specificied >module cannot be found." The file is called php4apache.dll, not .php -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.capio.com -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-WIN] Information not being correctly parsed
On Wed, 2003-02-19 at 04:38, Andrew Ferguson wrote: > I recently upgraded to PHP 4.3.1 from 4.2. I use the nusphere bundle, and > they had not yet incorporated the new version yet. Anyways, now my pages are > being parsed correctly. Basically, I'm trying to post information through > the url (i.e. randompage.php?male=y&age=43), and then have PHP retrieve it > from my mySQL database. I've tried just making a script that would echo the > POSTed information, but it doesn't echo it. I've looked through everything, > and double checked all my settings. Any ideas? The default value of register_globals has changed. This means that a POST variable called "test" will now be in $_POST["test"] and not $test. You can change this behaviour in php.ini if you like but it is not recommended; rather, rewrite your code. -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.capio.com -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-WIN] Re: why is this mail code not working on a windows server?
It does not look like you have set the SMTP-port in the code you use below... Try to set the port too and see if that helps Best Regards, Per Christian "Cathy" <[EMAIL PROTECTED]> skrev i melding news:[EMAIL PROTECTED] > Hi, > I'm getting rather desperate about this one. > > Code below is working fine on one server: Apache 1.3.26 /PHP 4.1.2/Linux. > On another server (Apache 1.3.24/PHP 4.3.1/Windows 2000) I get keeping this > error: > > Failed to connect to mailserver at "smtp.vt4.net" port 25, verify your > "SMTP" and "smtp_port" setting in php.ini or use ini_set() in > c:\oracle\ora91\apache\apache\htdocs\templateprobeersel\tmp47v15anqr5.php on > line 16 > > CODE: > > $headers.="From:[EMAIL PROTECTED]"; > ini_set("SMTP", "smtp.vt4.net"); > ini_set("sendmail_from","[EMAIL PROTECTED]"); > > mail("[EMAIL PROTECTED]", "test php", "Line 1",$headers); > > Can anyone help me? > Thx, > Cathy > > -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-WIN] Duplicate entry removal
Hi I'm building a PHP project for fun, and are going to get some dates from my database (mysql). The problem is that I only want the year, but the date is in the format -MM-DD so I get the whole column and remove the -MM-DD part, but now I have a lot of the same year Is there a function or some code that removes duplicate entries from a array? Best Regards, Per Christian -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-WIN] Forget it...
Just forget it... I figured it out myself "Per Christian" <[EMAIL PROTECTED]> skrev i melding news:[EMAIL PROTECTED] > Hi > > I'm building a PHP project for fun, and are going to get some dates from my > database (mysql). > The problem is that I only want the year, but the date is in the format > -MM-DD so I get the whole column and remove the -MM-DD part, but now I > have a lot of the same year > Is there a function or some code that removes duplicate entries from a > array? > > Best Regards, > Per Christian > > -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-WIN] Re: The inevitable LoadModule problem
It works best with an older version of Apache, but 2.0 should work fine I read in the install-guide that the message you got, was caused because it could not find a .dll php4apache.dll needed Try to copy all the dll's from C:/php/sapi into the directory where you installed Apache... That worked fine for me. Best Regards, Per Christian "Rotsky" <[EMAIL PROTECTED]> skrev i melding news:[EMAIL PROTECTED] > Okay, I know you've all heard this one before, but I'm really new to all > this, can't really claim to be a programmer and am on a steep learning > curve, so... > > I've installed PHP 4.3.1 and Apache 2.0.44. I've made the various changes to > Apache's httpd.conf file, including the infamous line: > > LoadModule php4_module "C:/php/sapi/php4apache2.dll" > > (That's cut'n'pasted straight from the .conf file, so you can see I got the > slashes in the right direction). And, php4apache2.dll is very definitely in > that directory. I've installed in a couple of times from the downloaded zip > file in case something had corrupted it. > > Yet during Apache start-up it still tells me it can't find that > php4apache2.dll file, saying: > Cannot load C:/php/sapi/php4apache2.dll into server. The specified module > could not be found. > > Now, I know PHP 4.3.1 is recent and that every time PHP or Apache is > updated, this problem crops up again. Anyone any thoughts? > > I'm running WinXP HE version 2002 with SP1. > > Am I being hopelessly optimistic and should install an earlier version of > Apache? > > > -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-WIN] Re: Subject: Disable FTP in Win32 Binary ?
On Wed, 2003-02-26 at 10:48, Neil Smith wrote: > Easy enough to do (my ISP does this) : Look up disable_functions in > http://www.php.net/manual/en/features.safe-mode.php > > You need to set in your php.ini file a list of disallowed functions (just > add the function_name for FTP functions to the list). You can of course do > this better by per-site configuration in Apache httpd.conf This is not enough to stop FTP; it is easy to write an FTP client in PHP if someone wanted to. What you would effectively need to stop is all socket access from PHP. -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.capio.com signature.asc Description: This is a digitally signed message part
Re: [PHP-WIN] not serving css styles?, css not showing up on localdev box
On Wed, 2003-02-26 at 22:36, Beach, Jim wrote: > My default browser for development is Mozilla but the same problem > occurs when I try it with IE6. That makes me think it's an Apache config > thing. > > Does anyone have an idea? The only thing that pops up in my mind is that it could be a bad MIME configuration. CSS files should be sent as text/css. This is configured in mime.types in Apache. Mozilla will print a warning message about this in the Javascript console, so you can look there and see what you get. -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.capio.com signature.asc Description: This is a digitally signed message part
Re: [PHP-WIN] PHP as CSS Stylesheet - broken in IE6/PHP 4.3.x
On Fri, 2003-03-28 at 05:24, Isetro Savi wrote: > Hi there, > > I recently upgraded to PHP 4.3.1 from 4.2.2 on XP/IIS 5.1. On a web > application I have, I use a dynamic stylesheet such as: > Do you have something like this in your PHP code? header("Content-type: text/css"); -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.capio.com signature.asc Description: This is a digitally signed message part
Re: [PHP-WIN] PHP as CSS Stylesheet - broken in IE6/PHP 4.3.x
On Fri, 2003-03-28 at 13:15, Isetro Savi wrote: > On Fri, Mar 28, 2003 at 10:45:10AM +0100, Per Lundberg wrote: > > Do you have something like this in your PHP code? > > > > header("Content-type: text/css"); > > I did not have that in the stylesheet, but putting it in did not help. Does the stylesheet validate? (http://validator.w3.org) I would guess this is a register_globals problem. -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.capio.com signature.asc Description: This is a digitally signed message part
Re: [PHP-WIN] PHP as CSS Stylesheet - broken in IE6/PHP 4.3.x
On Mon, 2003-03-31 at 21:58, Isetro Savi wrote: > > Does the stylesheet validate? (http://validator.w3.org) > > > > I would guess this is a register_globals problem. What this means is that you can no longer write $moo to get the contents of the GET/POST/cookie variable "moo", but you rather need to use $_GET["moo"], $_POST["moo"] and similar. But you might already be aware of that. > The stylesheet validates. I've been trying to comment out some of the > database code (stylesheet colors stored in mysql db) to see if that > helps, but I've still had no luck. I'm not explicitly using any > globals, but I'll check through and see if I note anything. I have had some *really* weird problems with stylesheets in Mozilla sometimes. It simply doesn't load my stylesheet if there are things printed before the starting tag (like debug messages and such). I don't know if this is the cause of your problems (it might not be) but it might be worth at try. Try also using a blank page (or as blank as possible) that includes the CSS to make sure there is nothing that interferes somehow. -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.nobolt.com signature.asc Description: This is a digitally signed message part
Re: [PHP-WIN] doing $mc=new myclass(); or $mc= &new myclass(); ?
On Fri, 2003-06-06 at 11:23, Peter Misun wrote: > need help: > what do you suggest to use: > > $mc = new myclass(); > or > $mc = &new myclass(); The first form will copy the object. If you don't want this, use the second form. -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.nobolt.com signature.asc Description: This is a digitally signed message part
Re: [PHP-WIN] Re: Display new Page after Form is processed
On Fri, 2003-06-06 at 18:19, Cristian MARIN wrote: > Yes,you can, I just did it. I don't know if it is because I use > php4.3.2 or what is the cause You probably have some form of output buffering enabled. -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.nobolt.com signature.asc Description: This is a digitally signed message part
Re: [PHP-WIN] Installation problems...
On Sat, 2003-05-31 at 11:15, Bobo Wieland wrote: > Okey, I still need help! > > The error message still states as follows: > Warning: mysql_connect() [function.mysql-connect]: Access denied for user: > '[EMAIL PROTECTED]' (Using password: YES) in > E:\pingstkyrkan\data\common_db.inc on line 12 > 0: Connection faild to the host localhost. > > I have no idea what to do, but I expect that it all has to do with my > inexperience of installing and configuring these things. Yes, I would also say that this is true. How would you answer these questions? 1) Have you created a MySQL user with the user name pingstkyrkan_ne, which is allowed to connect from 127.0.0.1? 2) Does it work to connect with another username/password (such as the root user)? My suggestion: install phpMyAdmin. It will make your life a whole lot easier. Take a look at http://www.phpmyadmin.net. It will let you access your MySQL databases from a web browser, and also do user management etc. (Regarding your other question, about only listening on the local interface: I don't know much about Apache 2, but look in the configuration for the BindAddress directive) -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.nobolt.com signature.asc Description: This is a digitally signed message part
Re: [PHP-WIN] Best way to upgrade?
On Mon, 2003-06-02 at 23:18, Rod Martin wrote: > Is there a simple way to transfer > the changes I have made to the php.ini file into the new version? How > can I do this and minimize the chance of creating some long-term > downtime because I forgot to do something in the .ini that I (1) > figured out a year ago and (2) have subsequently forgotten. Use a diff tool, and compare the php.ini shipped with the version of PHP you are using (4.2.1). That way, you will see exactly what have been changed. Under Unix systems, you would run the command line program 'diff'. Since you are running Windows, you likely don't have this elegant program installed (unless you use Cygwin) but there is a graphical Windows program that can do the same thing. It is called WinMerge and it can be found on http://winmerge.sourceforge.net Hope this helps. I use this program regularly on Windows and it works like a charm. It is also Open Source/free software, just like PHP itself. -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.nobolt.com signature.asc Description: This is a digitally signed message part
Re: [PHP-WIN] Re: Undefined variables
On Mon, 2003-06-16 at 18:49, DvDmanDT wrote: > It's your PHP.ini... You must set error_reporting to like E_ALL & ~E_NOTICE > or something like that... You might also want to check register_globals, > most likely you want this to be On instead of Off which is default... Both of these are very bad advice. Why not fix the code instead of relying on bad and deprecated functionality? -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.nobolt.com signature.asc Description: This is a digitally signed message part
Re: [PHP-WIN] Re: Undefined variables
On Tue, 2003-06-17 at 01:20, DvDmanDT wrote: > Because if you are reading a book, and want to try the samples, chances are > quite big you want to try it exactly bit by bit, not modifying it on your > own... And even more, if you get like a CD or something, it must feel VERY > bad to have to rewrite it all... Agreed. But register_globals has been default to "off" since PHP 4.2.0, which was released in April 2002. There sure must be PHP books that have been published since then that don't rely on this semantics? > Now, which part was depricated? Writing code which presumes that register_globals = on. You see, at some time, the register_globals directive might be dropped altogether and the feature will not be there any more. Yes, you might be able to work around it by writing your own register_globals() function, but wouldn't it be better to fix the code instead? My rationale is pretty simple: register_globals has been disabled for good reasons. You can read more about it at http://www.php.net/manual/en/security.registerglobals.php > And in php.ini-dist, error_reporting is set to all but notices by default.. This is probably because there is so much bad code out there, that generates tons of notices. In a development environment, regardless of the programming language, be it PHP, C, C++, Java or something different, I am very strongly in favor of all warnings being turned on. This is because it will help you so much, avoiding common pitfalls. For example, if notices are turned off, and you somewhere in a 25000 line class misspell a variable, how would you know? The code wouldn't work, and it would take a while to debug it to find where the error is. With notices enabled, this error would be spotted immediately. So, the conclusion: having notices turned on when developing PHP is strongly encouraged, because: 1) it will make the code better. 2) it will help you in the development. > Register_globals are however bad, I'll agree to that... But still, all hosts > I know of has it enabled and besides, why not? The reason many hosts has it enabled is because there are so many scrips that rely heavily on it being enabled. > I'm probably missing something, but what is the insecure part of > register_globals? See the link I posted above. > I mean, for the scripts that needs security, you can use $_POST and $_SESSION > and so on, but for things like "Enter two numbers to see which one is biggest", > it feels quite silly to disable it... With all due respect, I believe this to be the big flaw in your reasoning. "for the scripts that needs security" -- that says it all. Now, I totally agree that there might actually be scripts that *don't* need any NASA level of security, but still, the thinking is flawed, because code changes. Your little "enter two numbers" script might end up being used in a completely different environment to what you thought. And *in that environment*, security might be highly important. Let me give another example, that will show you what I mean. Microsoft developed Windows as a 16-bit extension to DOS, with some fluffy GUI features. This was in the 80:s. Then, they worked on it and changed bits and pieces here and there, and suddenly the Internet started becoming popular, so a company developed a program called Trumpet Winsock that would let you connect to the Internet. Fantastic! But hey, what about security? Windows was never designed to be used in this kind of environment, but still, it didn't matter too much since it was mostly used with dialup connections. Then, the development continued and in September 1994 (if I'm not mistaken) Windows 95 was released. It was a revolution to the Windows users. There were so many improvements to the old Windows 3.1 and 3.11 systems that they are too many to be mentioned here. One of the things that was changed was that TCP/IP was now integrated in the main system, shipped with the standard version. Still, the system had not been redesigned; it was still a single-user system, where Internet connectivity was simply a "plug-in" and not something that the system was designed for (such as is the case with Unix which was designed with multi-user and network in mind). This could clearly be seen with all the security problems that appeared, in the Internet Explorer browser for example, and in the IIS/PWS web servers. And now, today, many people are connected to the Internet using broadband connections, where their machines are accessible through the Internet all day long. Using an operating system that was never designed for this kind of environment. Oh, how I wish that Microsoft would just have "set register_globals = off" at some time in the past... (I hope you understand the analogy) -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.nobolt.com signature.asc Description: This is a digitally signed message part
Re: [PHP-WIN] Install
On Wed, 2003-06-18 at 14:39, Anand Tomar wrote: > i tried installing mysql-4.1.0-alpha, apache, php4.3.2 on windows2000Pro. > now the issue is that i have all the 3 application running and interacting > with each other in > sync but every time i try to connect to mysql through php it gives me > this error: > > Warning: mysql_connect(): Client does not support authentication protocol > requested by server. Consider upgrading MySQL client This is because MySQL 4.1 has a new protocol that is not compatible with the old (3.23 and 4.0) protocol. There is no support for this protocol in PHP 4.3.2 and will unlikely ever be in the 4.3.x series of PHP. PHP5 already includes it but it is not ready yet. So, in other words, you have two opportunities: 1) Revert back to MySQL 3.23 or 4.0 2) Use the (unstable and not yet released) PHP5 from CVS. http://snaps.php.net have pre-compiled snapshots for Windows. Beware! that this is a CVS snapshot we are talking about. You should not expect it to be bug-free. You should not expect to even install properly. You are totally on your own, and you are expected to fix problems that you find in the C source code yourself. But then again, that doesn't mean that it cannot work. I have had it running on Linux for quite a while now with very few problems. I recommend going with option (1) since you seem to say you don't have very much experience setting PHP up. -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.nobolt.com signature.asc Description: This is a digitally signed message part
RE: [PHP-WIN] Install
On Wed, 2003-06-18 at 21:05, Cory Daehn wrote: > Actually, if she's brave, there's a third option... she could interact > with the MySQL server by using ODBC and the latest MyODBC driver instead > of the built-in MySQL functions... But that seems like a slower (and much > easier to break) way of doing things. That's actually not a bad idea at all. It will make the code easier to port do other database engines in the future as well. -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.nobolt.com signature.asc Description: This is a digitally signed message part
Re: [PHP-WIN] Upgrading to MySQL 4.1 or higher worried aboutclients
On Wed, 2003-06-25 at 03:50, Paul Menard wrote: > I'be been considering upgrading my data , MySQL > 3.23.42 to 4.013 or even going to 4.1. I've read on > the MySQL upgrade documents that some client might be > affected when upgrading to 4.1. It does specificall > mention Perl which I use to supplement PHP. By I'm > more concerned about PHP. > > Should I be concerned? Yes, it will not work at all. MySQL 4.1 uses a protocol that's not compatible with MySQL 3.23 and 4.0. You need to use the ext/mysqli extension for it to work, but there are two problems with this: 1) it is only available with PHP5 which is not released yet. 2) it cannot be legally used since the MySQL 4.1 client libraries have been re-licensed under the GPL (old versions of the client libraries used to be under the more friendly LGPL). The only way out of this mess would be to use the ODBC driver for MySQL, but that will likely not be at all as fast as the native driver. -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.nobolt.com signature.asc Description: This is a digitally signed message part
Re: [PHP-WIN] E-Mail Attachments...
On Thu, 2003-07-31 at 19:14, Guru wrote: > Hi, > > Are there any efficient ways fo attaching files to e-mails and sending them > using mail() function... please help Try phpmailer. http://phpmailer.sf.net -- Best regards, Per Lundberg / Capio ApS Phone: +46-18-4186040 Fax: +46-18-4186049 Web: http://www.nobolt.com signature.asc Description: This is a digitally signed message part
[PHP-WIN] Problem uploading files...
Hello... I'm a newbie and having a bit of a problem uploading files with php. So please help... The problem: == I'm having a problem uploading a file from a client (through a browser) to my server (http/post). If a choose a file on the client - for example "C:\Program Files\Netscape\Communicator\Program\nareadme.htm" I get the following message when I try to send the file: nareadme.htm /* my debug none /* my debug Warning: Unable to open 'none' for reading: No such file or directory in D:\DOKUMENTER\CornerTechnology\tester\uploadHandle.php It seems that PHP is trying to fetch the file from the same directory as where my "form" and "php-scrip"t are placed and NOT from the chosen directory on client's directory! What am I doing wrong? Per -- Code and config below --- The Code === The form code: Pick a file Send this file: The "uploadHandle.php" file "); echo($userfile); if (copy($userfile, "upload.txt")) { echo("The file is now uploaded"); } else { echo("Error: Damm..!"); } unlink($userfile); ?> System configuration /SERVER === Win NT Service pack 5 Microsoft Information Server PHP v. 4.0.3 p1 PHP.ini: file_uploads = on upload_tmp_dir = C:\UPLOADS End --- -- Web: www.CornerTechnology.com E-Mail: [EMAIL PROTECTED] -- Per Nielsen Corner Technology ApS Sanatorievej 75 Tel.: (+45) 75 11 74 826710 Esbjerg V. Fax: (+45) 75 11 76 55Denmark, Europe -- -- 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-WIN] Re: Uploading files...Solved
Well... My problem uploading files is now solved. The problem was my restriction in file size in my upload form and the size of the file I picked for uploading. Well needless to say that I feel a bit more than ordinary stupid right now. Not the first time though... Per -- Web: www.CornerTechnology.com E-Mail: [EMAIL PROTECTED] -- Per Nielsen Corner Technology ApS Sanatorievej 75 Tel.: (+45) 75 11 74 826710 Esbjerg V. Fax: (+45) 75 11 76 55Denmark, Europe -- -- 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-WIN] SV: File Uploading
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 --- Upload Send this file: --- File: uploadhandle.php --- "); echo($userfile); if (copy($userfile, "upload.txt")) { echo("The file is now uploaded"); } 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- Send these files: --file-upload.php Files uploaded... 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. . 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 -- 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]