[PHP] PHP, ASP, IIS and MySQL
Hi! I hope this is the right place to ask this kind of question, otherwise I apologize. I would like some advice, this is the situation: We´re using IIS today and unfortunate we will have to cope with this situation for a long time ahead. There are plans for using Apache on Linux but not right now (not even Apache on Win). A great deal of work has been done in coding ASP (towards an Access-DB) :( Now we´re going to replace Access with either MySQL or possibly PostgreSQL. Since we in the future would like to run Apache on Linux instead of IIS on Win, it would be great to code all new functions in PHP instead of ASP (and nicer code too). I have done some experiments with PHP on IIS (towards MySQL) and it all seems to work just fine. My questions for you: 1) Is there a penelty/drawback when coding PHP instead of ASP on IIS (towards MySQL)? 2) Do you see any problems in having both ASP-code and PHP-code on the same server (it seems to work fine for me)? 3) (on the edge of topic) Do you have any comments or thoughts concerning the choice of DB. MySQL appears to like Win more than Postgres, or? Many thanks in advance! Jesper -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] isset() VS if($var)
Hi! Is there any difference between writing: isset($my_var) and... if ($my_var) ?? Thanks! / Jesper Blomstroem -- Jesper Blomstrm [EMAIL PROTECTED] Arbete: 08-566 280 08 Hem:08-669 23 10 Mobil: 070-30 24 911 -- 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] isset() VS if($var)
This cleared up the difficulties! I will look deep into the archive, now and forever. Thanks from Stockholm, Sweden. / Jeppe "PHPBeginner.com" wrote: It is really a long discussion (check the archives of the last month - two) Basically, isset() will tell you if the variable is declared, in other words it is set. It can still be empty but declared, and that will return you true; if($var) will return false only if 1. variable is not declared, 2. variable contains an empty string or 0. the best (or at least my favorite) way to see if the variable contains anything is if(isset($var) and $var!='') this excludes every possibility of variable being empty or containing an empty string in it. hope this helps. Truly, check the archives, there so many things were said on this issue. Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com -Original Message- From: Jesper Blomstrm [mailto:[EMAIL PROTECTED]] Sent: Monday, April 09, 2001 9:57 PM To: [EMAIL PROTECTED] Subject: [PHP] isset() VS if($var) Hi! Is there any difference between writing: isset($my_var) and... if ($my_var) ?? Thanks! / Jesper Blomstroem -- Jesper Blomstrm [EMAIL PROTECTED] Arbete: 08-566 280 08 Hem:08-669 23 10 Mobil: 070-30 24 911 -- 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] -- Jesper Blomstrm [EMAIL PROTECTED] Arbete: 08-566 280 08 Hem:08-669 23 10 Mobil: 070-30 24 911 -- 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]
SV: [PHP] PHP vs Servlet
Okey, sorry about that. Communicating with a servlet via http is not different from other php-http-methods: For example: # First declare some parameters which shall be sent to the Servlet/JSP $eqid = '1'; $oparameter = 'tablist'; $nocolumn = '1'; $request = '?eqid=' . urlencode($eqid); $request .= 'oparameter=' . urlencode($oparameter); $request .= 'nocolumn=' . urlencode($nocolumn); # Then it is just a simple as reading a file via http (NOTE! the client does not care whether it is a file or a stream) # To be able to access the server I must also submit a userId and a pwd. $elements = file("http://userid:[EMAIL PROTECTED]/servlets/XQuery".$request); Then all you have to do is to iterate the returned array (there are many way ie: for ($i = 0; $i sizeof($elements); $i++)). If you want to split the stream with a RE you can try to use a method like this one: function readandsplit($filename, $separator) { $fd = fopen($filename, "r"); $contents = ""; $chunksize = 1000; do { $tmpstr = fread ($fd, $chunksize); $contents = $contents.$tmpstr; } while (strlen($tmpstr) == $chunksize); fclose($fd); # And for example use the preg_split-method which takes the RE and splits the string $elements=preg_split($separator, $contents); return($elements); } By from Stockholm, Sweden! / Jeppe Krznaric Michael [EMAIL PROTECTED] skrev i diskussionsgruppsmeddelandet:81A3043681E6824EBE672F7421C30E7E2A1952@SRVTORON TO.RAND.COM... So tell us? Mike -Original Message- From: Jesper Blomstrm [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 4:51 PM To: [EMAIL PROTECTED] Subject: SV: [PHP] PHP vs Servlet I found out how to do it. Thx anyway / J Jesper Blomström [EMAIL PROTECTED] skrev i diskussionsgruppsmeddelandet:[EMAIL PROTECTED] Hi! I am sure you have a solution to this... How shall I communicate with a servlet from PHP? I have a servlet which makes a DB-query and returns the result. Thanks! / Jeppe -- Jesper Blomström [EMAIL PROTECTED] Arbete: 08-566 280 08 Hem:08-669 23 10 Mobil: 070-30 24 911 -- 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]
SV: [PHP] Changing within a file
Hi! This is what you want: http://www.php.net/manual/en/function.preg-replace.php The preg_replace-method uses a ordinary RE to search and replace. Hoppas det går vägen! / Jeppe Jimmy Bäckström [EMAIL PROTECTED] skrev i diskussionsgruppsmeddelandet:001901c0b543$329648c0$[EMAIL PROTECTED] Yo! Does anyone know how I can change a line in a textfile? I want to find a specific line, and then change it a bit... -- 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 vs Servlet
Hi! I am sure you have a solution to this... How shall I communicate with a servlet from PHP? I have a servlet which makes a DB-query and returns the result. Thanks! / Jeppe -- Jesper Blomstrm [EMAIL PROTECTED] Arbete: 08-566 280 08 Hem:08-669 23 10 Mobil: 070-30 24 911 -- 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]
SV: [PHP] PHP vs Servlet
I found out how to do it. Thx anyway / J Jesper Blomström [EMAIL PROTECTED] skrev i diskussionsgruppsmeddelandet:[EMAIL PROTECTED] Hi! I am sure you have a solution to this... How shall I communicate with a servlet from PHP? I have a servlet which makes a DB-query and returns the result. Thanks! / Jeppe -- Jesper Blomström [EMAIL PROTECTED] Arbete: 08-566 280 08 Hem:08-669 23 10 Mobil: 070-30 24 911 -- 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] newline in preg_split
Hi! I have text file looking something like this: core 010105 business 070344 core 020202 ... The textfile is a result from a database question and I am trying to parse the file in order to retrieve each line. I have tried using the explode()-method but I can´t get it to work with the delimiter \n (or \r or \\n...). I have also tried to use the preg_split()-method which takes a RE-argument but that doesn´t seem to work either (have tried in a lot of ways). Can anyone give me a clue how to solve this problem? Many thanks from Stockholm, Sweden! Jesper Blomstroem -- Jesper Blomström 08-370 317 (Hem) 08-566 280 08 (Arbete) 070-3024911 Ångermannagatan 113 162 64 Vällingby -- 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]