php-windows Digest 9 Nov 2003 12:36:10 -0000 Issue 1991
Topics (messages 22048 through 22050):
Re: Win32 API
22048 by: Eric COLINET
Re: I can't make a 'read_tag.php' file
22049 by: Nathan Perkins
Re: gallery
22050 by: Tommy Ipsen
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 ---
Hi,
As you know the extension is buggy but i've heard of a new extension called
ffi that will be part of PECL (http://pecl.php.net) in a few days.
So you have to wait some days to solve your problem ...
Eric
At 10:49 08/11/2003, Nathan Perkins wrote:
Two questions about the win 32 api extension:
1) Is it still supported by php 5 beta 2? Or is there a new way to access
DLL functionality from PHP 5? If not, is there a plan for there to be?
2) Does any one know whateer happened to the win 32 api extension? It is
only able to lead two external functions, then causes a fatal error. I know
many people have already acknoledged this bug, but I found no suggestions of
a solution. Any suggestions or thoughts about solving the problem would be
helpful. One thing I tried was registering a function just for it to be
called, then unregistering it. When making the second call to a function,
PHP fully crashes on the computer, causing IIS to return a CGI error.
Any help would be infitly appreciated,
Nathan
Specs:
For question 2, I am using PHP 4.3.3 on IIS4 on Windows 2000.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
To fix this code, just change lengthofstr to: $lengthofstr =
$posofend - $lengthoftag;
The whole function can be made much simpilar:
function readTag($filename,$tagtype) {
$filedata = file_get_contents($filename);
$tagrealname = '<bttag=' . $tagtype . '>';
$tagdata = substr(stristr($filedata, $tagrealname),strlen($tagrealname));
return substr($tagdata,0,strpos($tagdata,'</bttag>'));
}
Hope that helps,
Nathan
"Bas" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have found that this script doesn't work:
>
> read_tag.php
>
> ---
> <?php
>
> function readTag($filename, $tagtype, $debug = 0) {
> $filedata = file_get_contents($filename);
> $tagrealname = "<bttag=";
> $tagrealname .= $tagtype;
> $tagrealname .= ">";
>
> $tagdata = stristr($filedata, $tagrealname);
> $posofend = strpos($tagdata, "</bttag>");
> $length = strlen($tagdata);
> $lengthoftag = strlen($tagrealname);
> $lengthofend = strlen("</bttag>");
> $lengthofstr = $length - $posofend - $lengthoftag;
> $returndata = substr($tagdata, $lengthoftag, $lengthofstr);
> if ($debug == 1) {
> echo "<br>Length = " . $length;
> echo "<br>Of Tag = " . $lengthoftag;
> echo "<br>Of Str = " . $lengthofstr;
> echo "<br>Of End = " . $posofend;
> echo "<br>TagData:<br>" . $tagdata;
> }
> return $returndata;
> }
> ?>
>
> <HTML>
> <BODY>
> <h1>Test readTag-functie</h1>
> <?php echo readTag("test.tag", "bassie", 1); ?>
> </body>
> </html>
>
> ---
> And with this, it needs the file 'test.tag'
> ---
> <bttag=bassie>
> I am myself!!
> </bttag>
> <bttag=test>
> This is a test!!!
> </bttag>
> <bttag=welcome>
> Welcome!!!
> </bttag>
> <bttag=close>
> Closing!!!
> </bttag>
> ---
> The first parameter of the readTag function is the filename of the tag
file.
> The second is the tag to search for an the third is the debug mode.
>
> The error is that if i load this, the readTag function returns everything
> except for the Closing!!!
>
> What's wrong?
--- End Message ---
--- Begin Message ---
Paul Fritzsche wrote:
I am loking for a good and relatively easy gallery-program for php. I have
about 2500 photos I wanna publish and make subcategories and so on =)
Any suggestions? Maybe with site included?
I would suggest "Gallery" - a sourceforge project:
http://gallery.menalto.com/modules.php?op=modload&name=News&file=index
Regards,
Tommy Ipsen
--- End Message ---