Re: [PHP-WIN] Remove End of Line Characters

2008-07-01 Thread M. Sokolewicz
Wei, Alice J. wrote: Hi, for ($i=1; $i <= 3; $i++) { echo $i . ": " . $lines4[$i] . "\n"; list($words, $file) = explode(" ", $lines4[$i]); $carriage= array("\r\n", "\r", "\n"); str_replace($carriage, "", $lines4[$i]); echo "File: $file has $words words\n\n"; $query3="INSERT INTO youtoo(Descript

Re: [PHP-WIN] What's the difference between and ???

2007-09-30 Thread M. Sokolewicz
grep, replace all thanks for the quick reply. I agree it is good to follow the rules (i mean standard ;) ), But the thing is if I use some script written by someone else, i have to rely on his/her choice. Thanks On 9/30/07, TG <[EMAIL PROTECTED]> wrote: There's a setting in php.ini that dictat

Re: [PHP-WIN] Outlook 2007

2007-09-13 Thread M. Sokolewicz
Gustav, it's great that you're an active poster here, but I am starting to get the feeling you're into this all too deep. You have no idea what's going on, and instead of starting slowly and learning, you just dive in, get lost and ask the mailinglist to help you with every single problem you

Re: [PHP-WIN] ORDER BY is not sorting

2007-08-01 Thread M. Sokolewicz
Gustav Wiberg wrote: Hi! I can't see anything with your code either. Mysql_fetch_array should work fine yes. No indexes are needed to sort fields, but are recommended for speeding up the process :-) How does the table users look like? (Please send a link to a screenshot or something like tha

Re: [PHP-WIN] Arrays past to functions

2007-07-27 Thread M. Sokolewicz
Niel Archer wrote: Hi hi Niel, I believe Jacob wanted to know how he could calculate the tax for _all_ states passed in as an array in one go. Yours simply gives it for 1 State ("locale"). Other than thatm $taxRate($state) translates to Array($state) which gives an E_FATAL_ERROR obviously.

Re: [PHP-WIN] Arrays past to functions

2007-07-27 Thread M. Sokolewicz
Niel Archer wrote: Hi Jacob. Spotted another problem. function compute_salestax ($Amount , $State) { $taxRate = array("CA" => 5 , "WA" => 7, "OR" => 8); return $Amount / 100 * $taxRate($State); } $payment = 1500; $locale = 'CA'; print "Tax on $amount in $locale is " . compute_salesta

Re: [PHP-WIN] Arrays past to functions

2007-07-27 Thread M. Sokolewicz
etax "; }} $Amount = 1850; compute_salestax($Amount , $State); - When I run it, I get this --------- 0= | 0 1=1.08 | 1998 2=1.05 | 1942.5

Re: [PHP-WIN] Arrays past to functions

2007-07-27 Thread M. Sokolewicz
function ComputeSalesTax($Amt, $State) { if(is_array($State)) { $total = 0; foreach($State as $s) { $total += ComputeSalesTax($Amt, $s); } return $total; } else { switch ($State) { case "CA"

Re: [PHP-WIN] Re: php-windows Digest 23 Jul 2007 22:52:16 -0000Issue 3288

2007-07-26 Thread M. Sokolewicz
I'm not sure what you're replying to exactly. First of all, Sandeep just sent back the mailinglist-digest mail from last week which is a combination of all mails posted to this mailinglist in the last 7 days. He did not actually _ask_ anything or even _say anything at all_ (Sandeep, don't do th

Re: [PHP-WIN] How do configure PHP support for MySQL on Windows?

2007-07-24 Thread M. Sokolewicz
If that's literally from a book then I strongly suggest you burn the book. I would never trust _anything_ learned from a book that actively disables error-reporting on almost _all_ functions. Kick out all the @ operators and you might start seeing errors (they force PHP to ignore them silently)

Re: [PHP-WIN] Save classes to db?

2007-06-26 Thread M. Sokolewicz
http://www.php.net/manual/en/language.oop5.magic.php Gustav Wiberg wrote: Hi again! I really can't find a manual for __sleep on the php.net site!? But I understand that __sleep is called before serialize and __wakeup is called before unserialize? Do you mean that I create a function __sleep

Re: [PHP-WIN] php displays nothing

2006-05-30 Thread M. Sokolewicz
Alf Stockton wrote: Luis Moreira wrote: Personally, I do it the hard way : Beginning at the very first line of code, a message saying something like "just got in", and then lots, and lots and lots and lots of echo messages throughout the code, including messages on the procedures and function

[PHP-WIN] Re: Test.php loads, but nothing in Browser

2006-01-27 Thread M. Sokolewicz
actually, the closing tag is optional in php; it's not required(!) and PHP also doesn't mind a ton of whitespaces, it ignores them I would also suggest checking your display_errors value in your php.ini, make sure it's On. - tul Howard wrote: Error Reporting is set as you show. I changed

[PHP-WIN] Re: any good suggestion on books

2006-01-14 Thread M. Sokolewicz
El Bekko wrote: pfancy wrote: for beginners. I've been browsing the group for a little while. I honestly have not gotten a book to learn php on. just wanted to learn and see what you all were saying here. I'm not going to ask question about php since I haven't started yet, My question I am

Re: [PHP-WIN] If code not working?

2006-01-04 Thread M. Sokolewicz
I agree with the points about the futility of having a 0 there, however, it won't have any impact on how it works :) why? just follow the logic: if the ip equals x.x.x.x: access_disabled OR if the ip equals y.y.y.y: access_disabled OR if FALSE: (never happens) so, what you get is that on true fr

[PHP-WIN] Re: HTML event handling

2005-11-28 Thread M. Sokolewicz
Panos Laganakos wrote: Is it possible to handle the X/HTML events through PHP or, its only possible through JS? i.e. could I handle an onload event? Seen as PHP is a *serverside* language and JS is a *clientside* language combined with the fact that DOM events (which includes XHTML/HTML eve

[PHP-WIN] Re: [PHP] Re: Wanna Join me for an open source PHP Project?

2005-11-26 Thread M. Sokolewicz
Robert Cummings wrote: On Sat, 2005-11-26 at 14:03, M. Sokolewicz wrote: Robert Cummings wrote: On Sat, 2005-11-26 at 11:09, M. Sokolewicz wrote: I'm pretty sure something like this already exists. Why? because I know somebody who uses it. Ok, so it's written in asp (by MS

[PHP-WIN] Re: Parse errors not showing up in the browser

2005-11-26 Thread M. Sokolewicz
Wayne Khan wrote: Hi all, I am using Sokkit 3.5, and my parse errors are not showing up in the browser. I'm sure its something to do with php.ini, and trust me I've tried changing it, but it still doesn't show the parse errors. The result is that I spent a lot of time looking for that extra (or m

[PHP-WIN] Re: [PHP] Re: Wanna Join me for an open source PHP Project?

2005-11-26 Thread M. Sokolewicz
Robert Cummings wrote: On Sat, 2005-11-26 at 11:09, M. Sokolewicz wrote: I'm pretty sure something like this already exists. Why? because I know somebody who uses it. Ok, so it's written in asp (by MS if I'm not mistaking), still... I wouldn't know why you'd want t

[PHP-WIN] Re: Wanna Join me for an open source PHP Project?

2005-11-26 Thread M. Sokolewicz
I'm pretty sure something like this already exists. Why? because I know somebody who uses it. Ok, so it's written in asp (by MS if I'm not mistaking), still... I wouldn't know why you'd want to write a new one in php... seems hard to make to me; might be wrong though. anyway, good luck bala c

[PHP-WIN] Re: Handling objects (again)

2005-11-12 Thread M. Sokolewicz
Marcos R. Cardoso wrote: > Hello to everyone, > > I'm manipulating objects in some scripts I've developed, and I've come > across a doubt: I perform a query and do some checkings, but to perform > this checkings I need to instantiate an object, and I really don't know > how to do it without crashi

Re: [PHP-WIN] Re: Calling MSSQL Stored Procedure

2005-09-16 Thread M. Sokolewicz
Alf Stockton wrote: Mark Rees wrote: I get 2005/09/16 10:09:22 AM which is exactly the same format as it appears in the database table when viewed via Enterprise Manager. I wouldn't set too much store by how it looks in EM. It is a datetime value, so its internal representation will b

Re: [PHP-WIN] MSIE problems

2005-09-16 Thread M. Sokolewicz
Bob Stout wrote: Bob Stout wrote: Although it works fine with Firefox, whenever I use a object to open a PHP file in a frame, with an internal reference, it ignores the reference. IOW, if the link I want in the frame is "somefile.php", everything works OK. If, instead, the link I want in the

Re: [PHP-WIN] Misunderstanding mssql_query in the manual

2005-09-12 Thread M. Sokolewicz
Darvin Andrioli wrote: -Messaggio originale- Da: Alf Stockton [mailto:[EMAIL PROTECTED] Inviato: lunedì 12 settembre 2005 17.45 [...] So my code reads:- if(($rs = TRUE)) { ^^^ Is it your code or do you forget many "=" in the example? It should be if(($rs === TRU

Re: [PHP-WIN] How to make mail() use correct headers?

2005-07-12 Thread M. Sokolewicz
or you can set it via htaccess in the virtual domain dir of every user ;) (might be easier) anton wrote: Thanks so much Ross !! This works :) Now I only need to set it in a auto_prepend file :) -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/

[PHP-WIN] Re: HOW TO SEND a file from server to client

2005-06-22 Thread M. Sokolewicz
send the correct Content-Type header, and then simply output the contents of the file you want to send. -tul Burkhard Herre wrote: hello i want to send a file as response of a skript call from the server to the client. of course i want to use the open connection. like the command: echo("te

Re: [PHP-WIN] PHP & GD on Windows

2005-06-19 Thread M. Sokolewicz
I've been trying to compile PHP on windows using VC++7, and although it "works" in most cases, and even quite a number of extensions compile (after editing various minor things), it still occasionally suddenly crashes, for apparently no reason at all. I'm quite interested at how it's being bui

[PHP-WIN] Re: PHP 4.3.2-Win32 - This Program has Performed an Illegal Operation

2005-06-17 Thread M. Sokolewicz
hello, this is not a problem with the script, which I'll try not to criticise here; instead it's a problem with your php installation. Since this is PHP 4.3.2, I would suggest you redownload/reinstall PHP, and preferably do that with the *latest* version. There's a big chance that the bug you

[PHP-WIN] Re: what's wrong with this while loop?

2005-06-06 Thread M. Sokolewicz
the problem with your loop is that after php enters it, it can't get out because there is no break, nor a way to turn the expression to false. Normally, you have a loop which always evaluates to TRUE, and when it doesn't, you want to quit. And even when this is not how you did it, eg with whil

[PHP-WIN] Re: Just a question, answer appreciated

2005-05-08 Thread M. Sokolewicz
S.F. Alim wrote: Hi list, How do you increase to a counter without refreshing the whole page. For example if you check site www.gmail.com under âDon't throw anything away.â heading there is counter which is increasing (could be javascript magic) but other example is www.n

[PHP-WIN] Re: Jaw Breaker - What's the ansewer?

2005-04-20 Thread M. Sokolewicz
JC Botha wrote: The following is a section of PHP code (see Apache.org and PHP.net). function f($c) { $c++; if ($c % 2) { return f($c); } return $c++; } function g($n) { for ($i=1;$i<10;$i++) { $n = f($n*$i); } return ($n); } print(g($x)); What is

[PHP-WIN] Re: Localhost not working with cookies

2005-04-17 Thread M. Sokolewicz
Proudly Pinoy wrote: I've read from php.net/setcookie and codecomments.com that using localhost won't work with cookies and neither are IP addresses. So how do I test cookies on local system? set the hostname to an empty string; and 2, don't CROSS-post. That's a *very* bad habit -- PHP Windows Ma

Re: [PHP-WIN] replacing file contents

2005-04-11 Thread M. Sokolewicz
why are you using regexp-functions anyway? there's /absolutely/ no need for them in your case. I can only see disadvantages: 1 - they use more memory than str_replace 2 - they're slower than str_replace 3 - they're more complicated than str_replace Simply use str_replace, and it'll work just fine

Re: [PHP-WIN] Problem with PHP functions under Win2K3

2005-04-07 Thread M. Sokolewicz
Ken wrote: On Apr 7, 2005 12:11 PM, Juhász Zoltán <[EMAIL PROTECTED]> wrote: Hi! I installed PHP 4 on Windows 2003 Enterprise to test it. Some functions cannot work, example $REMOTE_ADDR, $HTTP_ACCEPT_LANGUAGE, etc. All functions get back an error: Notice: Undefined variable: HTTP_ACCEPT_LANGUAGE i

Re: [PHP-WIN] howto do a backtrace on windows?

2005-03-22 Thread M. Sokolewicz
tically. You'd need to compile php in the debug mode in order to get some useful information out of it though. Edin ----- Original Message - From: "M. Sokolewicz" <[EMAIL PROTECTED]> To: Sent: Tuesday, March 22, 2005 5:17 PM Subject: [PHP-WIN] howto do a backtrace on

[PHP-WIN] Re: howto do a backtrace on windows?

2005-03-22 Thread M. Sokolewicz
actually, this isn't related to the php language itself, but more to the code beneath it ;) Since the entire php/apache process segfaults (according to the logs), I can't do a debug_backtrace() from within php :) - tul Jason Barnett wrote: Use cygwin / gcc?!?! :P Is debug_backtrace() unable to

[PHP-WIN] howto do a backtrace on windows?

2005-03-22 Thread M. Sokolewicz
hello, I've compiled PHP (and apache) on windows (using MSVC++.NET), and have been doing so for a while now. Lately I've noticed Apache crashing when I run certain scripts, so I figured I'd best make a backtrace in such cases (since the scripts it crashes on are pretty long and complex, so gett

[PHP-WIN] Re: XP and PHP

2005-03-10 Thread M. Sokolewicz
and check for register_globals Jim Plush wrote: just try echo 'HEY PHP!'; ?> "Stan Holmes" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi New at this game. I loaded php5 on XP with the php installer. I cannot get a varable to parse. Can anyone help. I do believe it is with the

[PHP-WIN] Re: Can't use php-soap in windows enviroment?

2005-03-08 Thread M. Sokolewicz
[EMAIL PROTECTED] wrote: First of all, I'd like to thanks everybody in advance. Actually I've got a winlamp distribution of php 5 in a web server. My need is to use the php-soap functions to implement soap webservices (server) but in php-soap specification is shown I need php configured with

[PHP-WIN] Re: how to move files from one place to another ?

2005-02-27 Thread M. Sokolewicz
Vaibhav Sibal wrote: Hello, Can some please guide me as to how should I move files from one directory to another on the server itself using PHP ? I use PHP 5.0.3 and Apache2 and Mysql. Thanks Vaibhav http://www.php.net/copy -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: ht

[PHP-WIN] Re: Not able to add data to a MySQL database

2005-02-25 Thread M. Sokolewicz
You've got errors in your SQL. For once, table-names should not be quoted (with single or double quotes), same goes for column names ('uname' and 'access' in your example). Easiest way to find out without asking is to add a call to mysql_error(), so called "error handling"...! That would've told

[PHP-WIN] Re: Cookie Problems on Localhost

2005-02-23 Thread M. Sokolewicz
Joseph L. Mueller wrote: I am testing some PHP code (example 15.5 from Sams Teach Yourself PHP MySQL, PHP and Apache in 24 Hours). I am running running PHP 5.0.3 and Apache 2.0.43 on my WinXp Home system. My problem is I cannot seem to set a cookie. I tried using "localhost" and "127.0.0.1" for

[PHP-WIN] Re: Missing MySQL DLLs in Windows PHP 5.0.3 - not in pecl either!

2005-02-21 Thread M. Sokolewicz
well, they should be available via PECL (php_mysql.dll that is), libmysql should be in the download of the main product. As for php_pdo_mysql.dll, you'll need php_pdo.dll running aswell, and then use the PDO functions: http://www.php.net/manual/en/ref.pdo.php Jimbus wrote: The instructions stat