php-windows Digest 14 Dec 2002 06:53:33 -0000 Issue 1486

Topics (messages 17402 through 17407):

Re: Dealing with Mac files
        17402 by: Brian 'Bex' Huff
        17403 by: Dash McElroy (php)

FUSION NEWS
        17404 by: Zerutreck

Re: newbie question (forms)-thank you
        17405 by: Elvin Certeza

code that highlights itself
        17406 by: Matt Hillebrand

Win32 EAPI - Not recognising preprocessor option.
        17407 by: nofa

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]


----------------------------------------------------------------------
--- Begin Message ---
2 things to note about Mac files... some browsers (IE) intermittently perform a MacBinary encoding of the file, and neglect to inform the server application. The data will be unparsable until decoded. You will need to first do a check to see if the file is MacBinary, and then execute some kind of utility to decode it on your Windows / Unix server. There's a few utilities available:

http://download.com.com/3120-20-0.html?qt=macbinary&tg=dl-2001

Second, the end-of-line character on the mac is just '\r', as opposed to '\r\n' on windows, and '\n' on Unix... it looks like you already found this out... so a lot of the useful PHP utility functions may not work well. You may be stuck using 'fopen' and 'fgets' to parse the file:

http://www.php.net/manual/en/function.fgets.php

--

Brian 'Bex' Huff
[EMAIL PROTECTED]
Phone: 952-903-2023
Fax: 952-829-5424


--- End Message ---
--- Begin Message ---
Check this out - it just might be helpful:

http://www.php.net/manual/en/ref.filesystem.php#ini.auto-detect-line-endings

Does require PHP 4.3.0 (currently at RC3) though. Here's what it says:

auto_detect_line_endings  boolean

    When turned on, PHP will examine the data read by fgets() and file() to
see if it is using Unix, MS-Dos or Macintosh line-ending conventions.

    This enables PHP to interoperate with Macintosh systems, but defaults to
Off, as there is a very small performance penalty when detecting the EOL
conventions for the first line, and also because people using
carriage-returns as item separators under Unix systems would experience
non-backwards-compatible behaviour.

        Note: This configuration option was introduced in PHP 4.3. 

-Dash

-----Original Message-----
From: Sterling Anderson [mailto:[EMAIL PROTECTED]] 
Sent: Friday, December 13, 2002 7:00 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Dealing with Mac files


I am working on an application for a school district and am having some
problems with the files they are supplying for import.
They are supplying data files and I am writing routines to populate the
database using these files. Its a simple file upload then I just need to
parse through the tab separated value file. I am using the most recent
PHP build on Windows with IIS ISAPI and a MSSQL database. They are
sending text files from a Macintosh application.
I noticed on the documentation for fgetcsv() that it cannot read the end
of line character on Mac files. I have not been able to find a good work
around for this issue. When I grab the entire contents of the file then
try doing a string replacement on the "\r" or even "\t" for that matter
it does not work.
Has anyone found a good solution for dealing with Mac files?

_______________________________________________________________
Sterling Anderson
Systems Analyst              email: [EMAIL PROTECTED]
Heartland Business Systems
http://www.hbs.net



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I forgot the password it administrator: / he has as obte it again?
I wait Reply,
Hermes Alves

--
Atenciosamente,
Hermes Alves
× TemporadaImoveis.com ×


begin 666 huh.gif
M1TE&.#EA#P`6`/<``````"DI`#$I`#$I"#$Q"+6U`+V]`,;&`,;&QL[.`-;6
M`-[>`.?G`._O`/?W`/__________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
M_____________________R'Y! $```@`+ `````/`!8```B8`!$@`"!0(,&"
M!P<J5'B08,*%!@M"?$A1HL6+$BLBQ,@18X"/'SE^+$"29$B)`4J6-, R0,&4
M)%G*E.D2P0"6``#(S'G@@("!.W7VY)D@00"A!GHF.%"T:0(!`)0Z+:J@J@*H
M4ZU67< 5:P*M"KB*9> 2P-:<:!<P8/!S(%<`7-<R`+"VK5NY:QOHM6L0@-Z_
*`OAF!!!8<$ `.P``
`
end

--- End Message ---
--- Begin Message ---
Thank you... my register_globals were turned off... now that I have turned
it on.. it's working


Elvin Certeza
www.alphalink.com.au/~certeza/
-----Original Message-----
From: Stephen Edmonds [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 9:48 AM
To: PHP Helplist Windows
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] newbie question (forms)

Its just a warning. It tells you that you are using a variable which has no
value. Just ignore the notice, or turn down error reporting to exclude
notices.

All it means is that the variable of $test which you have included in your
script HAS NO VALUE. If you were to write something like
$test = "I Have A Value Now!";
then the 'error' message would disappear. Most of the time, you DO NOT WANT
to give a variable a value, such as when a user submits a form to your
script. The $Variables are filled by the user, not the php script. If the
user misses out a field, they would see the error message you mentioned.

To turn it off...
go to your php.ini
Search for
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
and change the line which looks like (Make sure there is no ; at the start
of the line, if there is then its the wrong line to change!)
error_reporting = E_ALL
to
error_reporting  = E_ALL & ~(E_NOTICE | E_USER_NOTICE) ; display all errors
and warnings
This will make php only show the errors which affect the running of your
scripts, not the notices such as 'Empty Variables'

Hope this helps

Stephen

*** This is a quote from a mail I posted earlier. it seems a lot of people
ask the same question :-) ***

----- Original Message -----
From: "Elvin Certeza" <[EMAIL PROTECTED]>
To: "php" <[EMAIL PROTECTED]>
Sent: Thursday, December 12, 2002 9:52 PM
Subject: [PHP-WIN] newbie question (forms)


> I have just recently installed apache and php into my system (win98).
>
> The system test is ok....(showing php pages)
>
> Now for the question...
>
> I've created a form.. (rather cut and paste a form). This form works
online
> I have tested it myself.. but locally it gives me an error..
>
> When my php page loads it tells me  "Notice: Undefined variable" at line
> whatever.. etc..
>
> So what I've done it tested it online to see if it's the code...(full
> knowing that code works..since it's a cut out from a tutorial showing it's
> samples).. and it does work..
>
>
> So the question is .. is there anything missing from my local server ???
>
>
>
> Elvin
>
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--- End Message ---
--- Begin Message ---
The following chunk of code may be included at the top of a file in
order to do its own syntax highlighting. It's looking pretty good so
far, except for a mysterious space before the first opening PHP tag in
the output. Does anyone know why that space is there?

<?
   print '<html><head><style>'; // _ignore_
   print 'body,font{font-family:Fixedsys} body{margin:0px}'; // _ignore_
   print
'.ln{margin:0px;margin-right:4px;padding:0px;padding-right:2px;text-alig
n:right;color:#ffffff;background-color:#666666;width:45px;font-family:Fi
xedsys;}'; // _ignore_
   print '</style></head><body>'; // _ignore_
   $contents = highlight_file(basename($_SERVER['PHP_SELF']), true); //
_ignore_
   $contents = explode('<br />', $contents); // _ignore_
   $ln = 1; // _ignore_
   foreach($contents as $line) if(!strstr($line, '_ignore_')) { print
"<span class=ln>$ln</span>$line<br>"; $ln++; } // _ignore_
   print '</body></html>'; // _ignore_
   exit; // _ignore_
   print 'Hello, cruel world. ';
   while(true)
      print 'God I love PHP. ';
?>

If you want, put the above code in an include file (minus the "Hello,
cruel world" stuff). Just don't forget to write "// _ignore_" after the
include() or require() statement at the top of the target script.

Matt

--- End Message ---
--- Begin Message ---
Hi,
    Im trying to compile php under win32 with EAPI option, but it seems VC++
is not recoginising the preprocessor option. I dont even think it is going
through the steps.
    Anyone have any ideas or know where i could possibly get a binary with
EAPI enabled for 4.2.3 ?


--- End Message ---

Reply via email to