OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 11 Feb 2004 18:17:59 -0000 Issue 2584

php-general-digest-helplists.php.net
Date: Wed Feb 11 2004 - 12:17:59 CST


php-general Digest 11 Feb 2004 18:17:59 -0000 Issue 2584

Topics (messages 177349 through 177435):

Re: Simple PHP Encoder
        177349 by: Nadim Attari
        177351 by: Adrian Teasdale

array data
        177350 by: Imran Asghar
        177358 by: Richard Davey
        177385 by: pete M
        177415 by: Shaunak Kashyap

please test PEAR DB 1.6.0RC6
        177352 by: Daniel Convissor

Re: Revised: RE: [PHP] Re: Can I do this?
        177353 by: John Taylor-Johnston

Re: Working with a Front Page developer
        177354 by: rush

Re: phpMyAdmin Problems
        177355 by: John Taylor-Johnston
        177356 by: John Taylor-Johnston
        177357 by: Freedomware
        177359 by: Jason Wong
        177361 by: Freedomware
        177377 by: Marek Kilimajer

Re: PHp Books
        177360 by: Stuart
        177374 by: memoimyself.yahoo.com.br

Re: [Q] Problems invoking a PHP script - Have no hair left to pull - Please help [:-)
        177362 by: Richard Davey
        177365 by: Tony
        177366 by: Richard Davey

Re: parse error, unexpected $
        177363 by: Bruno Mattarollo

Problem with XSLT Sablotron
        177364 by: Juan Torres

Problem with Parameter Passing in PHP. Can anyone help
        177367 by: Tony
        177368 by: Jay Blanchard

Set_time_limit ( )
        177369 by: Angelina
        177370 by: Jay Blanchard

Re: Nested include(...)'s take relative paths not intuitively
        177371 by: Ford, Mike [LSS]
        177397 by: Alex Hogan
        177403 by: Richard Davey
        177404 by: John W. Holmes
        177406 by: John W. Holmes
        177407 by: Richard Davey
        177409 by: John W. Holmes
        177411 by: Richard Davey
        177412 by: Alex Hogan
        177413 by: Richard Davey
        177416 by: Samuel Ventura

[Newbie Guide] For the benefit of new members
        177372 by: Ma Siva Kumar

Help with ldap_add
        177373 by: Chakravarthy Cuddapah

limit run time of a function?
        177375 by: Anthony
        177376 by: Richard Davey

Undefined function
        177378 by: Dominique ANOKRE
        177380 by: Richard Davey
        177398 by: Dominique ANOKRE
        177402 by: John Nichel

Math Question
        177379 by: Jeremy Schroeder
        177381 by: Richard Davey
        177382 by: Vincent Jansen
        177383 by: Richard Davey
        177384 by: Jay Blanchard
        177386 by: Vincent Jansen
        177390 by: Jeremy Schroeder
        177393 by: John Nichel

replace ' with "
        177387 by: Diana Castillo
        177388 by: Stuart
        177389 by: Angelo Zanetti
        177394 by: John Nichel

uploaded files are corrupted
        177391 by: Donpro
        177401 by: Jason Wong
        177405 by: Richard Davey
        177410 by: John W. Holmes

str_replace not replacing
        177392 by: Aaron Merrick
        177395 by: Richard Davey
        177396 by: Jason Wong
        177399 by: Aaron Merrick
        177400 by: Michael Nolan

question
        177408 by: Meramec Challenge Paintball, LLC
        177434 by: Chris W. Parker

Sessions on Win2k
        177414 by: Donpro
        177417 by: Alex Hogan
        177418 by: Ford, Mike [LSS]
        177427 by: Alex Hogan

Newbie questions
        177419 by: James Marcinek

Zlib - Insert files?
        177420 by: Till Krüss

Using a perl regex
        177421 by: Verdon Vaillancourt
        177422 by: Richard Davey
        177423 by: Verdon Vaillancourt
        177424 by: Verdon Vaillancourt
        177425 by: Kelly Hallman
        177426 by: Verdon Vaillancourt
        177435 by: Michal Migurski

Getting image size for a compressed flash movie
        177428 by: Shaunak Kashyap

[Q]PHP not taking input values from forms
        177429 by: Dan Aloma
        177430 by: John Nichel
        177431 by: Richard Davey
        177432 by: Shaunak Kashyap
        177433 by: Dan Aloma

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


http://turck-mmcache.sourceforge.net/

attached mail follows:


There are various:

www.sourceguardian.com
www.zend.com
www.ioncube.com

The turck-mmcache one is good too and it also comes with (or the main
purpose is) an accelerator

Ade

attached mail follows:


Hi,
 
Is not working, is it correct way????

File1.php
       <? $colors = array('red','blue','green','yellow'); ?>
       <form action="file2.php" method="post">
      <input type="hidden" type" name="colors" value="<?=$colors?>">
      </fomr>

File2.php
 
<?
 echo $colors[0];
 echo $colors[1];
 echo $colors[2];
 echo $colors[4];
?>

imee

attached mail follows:


Hello Imran,

Wednesday, February 11, 2004, 8:17:11 PM, you wrote:

IA> Is not working, is it correct way????

IA> File1.php
IA> <? $colors = array('red','blue','green','yellow'); ?>
IA> <form action="file2.php" method="post">
IA> <input type="hidden" type" name="colors" value="<?=$colors?>">
IA> </fomr>

You can't do it like this. Rather, do the following:

<form action="whatever.php" method="post">

<input type="hidden" name="colors[]" value="red">
<input type="hidden" name="colors[]" value="blue">
<input type="hidden" name="colors[]" value="green">

Or if you prefer you can use some PHP code to write out the input tags
based on a colors array:

<?
        $colors = array('red','blue','green','yellow');

        foreach ($colors as $color)
        {
                echo "<input type=hidden name=colors[] value=\"$color\">";
        }
?>

--
Best regards,
 Richard mailto:richlaunchcode.co.uk

attached mail follows:


Think this is what u want

Imran Asghar wrote:
> Hi,
>
> Is not working, is it correct way????
>
> File1.php
> <? $colors = array('red','blue','green','yellow'); ?>
> <form action="file2.php" method="post">
> <input type="hidden" type" name="colors" value="<?=$colors?>">
> </fomr>

<?php $colors = array('red','blue','green','yellow'); ?>
<form action="file2.php" method="post">
<?php
foreach $colors as $k => $v
{
?>
<input type="hidden" type" name="colors[<?php echo $k; ?>]"
  value="<?php echo $v; ?>">
<?php } ?>
</form>

>
> File2.php
>
> <?
> echo $colors[0];
> echo $colors[1];
> echo $colors[2];
> echo $colors[4];
> ?>
<?php
        echo $_POST['colors'][0];
        etc ....
?>
>
>
>
> imee
>

attached mail follows:


It is not the correct way because $colors being an array, the HTML code for
the hidden input element will look like this (once the HTML has been
generated by PHP):

[code]
<input type="hidden" name="colors" value="Array">
[/code]

What you probably want to do instead is something like this:

[code]
<?

foreach ($colors as $color) {

?>
<input type="hidden" name="colors[]" value="<?= $color ?>">
<?

}

?> // close loop
[/code]

This will create the following HTML (for the given example)...

[code]
<input type="hidden" name="colors[]" value="red">
<input type="hidden" name="colors[]" value="blue">
<input type="hidden" name="colors[]" value="green">
<input type="hidden" name="colors[]" value="yellow">
[/code]

... and File2.php will do its job as desired.

Shaunak

> -----Original Message-----
> From: Imran Asghar [mailto:imranpak-vision.com]
> Sent: Wednesday, February 11, 2004 3:17 PM
> To: Php-GeneralLists.Php.Net
> Subject: [PHP] array data
>
>
> Hi,
>
> Is not working, is it correct way????
>
> File1.php
> <? $colors = array('red','blue','green','yellow'); ?>
> <form action="file2.php" method="post">
> <input type="hidden" type" name="colors" value="<?=$colors?>">
> </fomr>
>
> File2.php
>
> <?
> echo $colors[0];
> echo $colors[1];
> echo $colors[2];
> echo $colors[4];
> ?>
>
>
>
> imee
>

attached mail follows:


Hello Yet Again:

Sorry to be crying wolf so many times over the past week, but another
release of PEAR DB was made yesterday, 1.6.0RC6.

The biggest improvement in this release is better mapping of error
codes. Several DBMS's now properly report duplicate key constraint
violations as DB_ERROR_CONSTRAINT. The DB_PORTABILITY_ERRORS
portability option was added to ensure consistent codes between
different database systems.

Several bugs related to limitQuery() were found and quashed.

tableInfo() was added for Informix and bugs fixed for InterBase. Plus, I
eliminated bug I introduced in 1.6.0RC5 that caused 'undefined function'
errors when lowercasing portability was off.

Please download the package and test it out. File bug reports
if stuff doesn't work or is unclear.

Download: http://pear.php.net/get/DB
Change Log: http://pear.php.net/package-changelog.php?package=DB
Manual: http://pear.php.net/manual/en/package.database.php
Report Bugs: http://pear.php.net/bugs/report.php?package=DB
Home Page: http://pear.php.net/package/DB

Oh, and if you like the new features, the tons of bug fixes,
and/or the documentation improvements that have happened since
1.5.0RC2, share your happiness via my "Wishlist" page at
http://www.analysisandsolutions.com/donate/donate.htm

If you're curious why there have been so many release candidates, it's
because the initial RC was pushed out ahead of schedule in order to
get something into PHP 4.3.5RC2 so more people could test it.

Thanks,

--Dan

PS: I'm not on the list. Just posting this as an announcement.

--
 T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
            data intensive web and database programming
                http://www.AnalysisAndSolutions.com/
 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409

attached mail follows:


This thread is still alive? :)

What you see is what you include. André was mistaken. That is the lesson. And there is no danger. If there was, folks would have stopped using PHP long ago.

In my case, I'm hijacking my own script on another server. I'm doing it only because I don't have access to MySQL on server #1 so I hijack my script on server #2 to permit server #1 to output to screen what I wanted to be able to do in the first place. I screamed loud enough and ISP finally gave me access to MySQL, at no extra cost. Because of a very handy firewall, I cannot access server #2's mysql server from #1. No regrets.

Raditha Dissanayake wrote:

> Nope i see the server parsed output. Try loading the url directly in
> your browser!! what you see is what you get when you include.
>
> Adam Bregenzer wrote:
>
> >On Sun, 2004-02-08 at 08:27, Andrew Séguin wrote:
> >
> >
> >>A test to confirm that, is to point the browser to the address being
> >>included. See the source? vulnerable. See the results? not vulnerable.
> >>
> >>
> >
> >If you do not see 'source' then what are you including? For example the
> >following script could be included remotely:
> >
> ><?php
> >echo <<EOF
> ><?php
> >\$sql = "SELECT * FROM table WHERE id = $number";
> >?>
> >EOF;
> >?>
> >
> >If you were able to do include the above source with:
> >include("http://somewhere.com/file.php?number=123");
> >You could include and see php code. Not the original but something that
> >is still useful. include() includes php code, if you can include a file
> >from a remote source you can view it with a browser. What you say is
> >true:
> >"See the source? vulnerable. See the results? not vulnerable."
> >Of course if you can not see it you also can not include it remotely.
> >
> >As a side note it is safer to put includes outside the web path. An
> >overflow or some other bug may be found that would bypass processing of
> >.php files (or a different bug could be exploited to write a .htaccess
> >file in that directory). If you have the option to move includes to a
> >different directory it is more secure.

attached mail follows:


"Chris De Vidal" <chrisdevidal.tv> wrote in message
news:53948.216.140.242.88.1076434214.squirrellogixhosting.com...
> Can anyone recommend some template engines? Or tips on using PHP to parse
> an HTML doc, replacing it with real data?

You could also try TemplateTamer, and I would be glad to help you out if
with it if needed.

rush
--
http://www.templatetamer.com/

attached mail follows:


Simplest is to go into your config file and turn that on.

Freedomware wrote:

> I've been using both phpMyAdmin and EMS MySQL Manager to work with MySQL
> tables and PHP. Things are generally going OK, but I'm still ironing out
> a few kinks. I suspect some of my problems might be related to an error
> message I get when I click on a Database in phpMyAdmin:
>
> "Error: The additional Features for working with linked Tables have been
> deactivated. To find out why click here."
>
> When I click the link, I get a page that lists six different problems,
> each linked to a pretty complex solution in the phpMyAdmin Manual. Does
> anyone here know if there's an easier solution? Would fixing one or two
> key problems automatically fix the others? Can you download files that
> have already been "fixed," add your username and password and paste them
> into the proper folders?
>
> I put a couple screenshots that illustrate what I described online at
> http://geowebworks.geobop.org/test/phpmyadmin/index.php
>
> Thanks.

--
John Taylor-Johnston
-----------------------------------------------------------------------------
"If it's not Open Source, it's Murphy's Law or broken."

  ' ' ' Collège de Sherbrooke
 ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/
   - Université de Sherbrooke
          http://compcanlit.ca/
          819-569-2064

attached mail follows:


Helpful, isn't he. If you can't find it in your config file, post again and I'll show you what i have in mine.
John

Jason Wong wrote:

> This has nothing to do with PHP. Please ask on the relevant list/forum.

attached mail follows:


John Taylor-Johnston wrote:

> Helpful, isn't he. If you can't find it in your config file, post again and I'll show you what i have in mine.
> John
>
> Jason Wong wrote:
>
>>This has nothing to do with PHP. Please ask on the relevant list/forum.

Thanks. Actually, I have another question: Can someone recommend a
relevant list/forum? I visited phpmyadmin.net and finally found their
help forum (listed under "Feedback"), but it's temporarily out of
commission. The relevant newsgroup appears to be out of action, too.

In the meantime, I posted my question on a general web design forum and
was told to not worry about it because "you probably won't need those
functions anyway." If true, then I won't complain; saves a lot of time.

I did fix the DATE problem I referenced in the URL I provided. It was
just a matter of changing it to NOT NULL, though my table still isn't
working properly.

I'm not sure what the "it" I'm supposed to find in my config file is,
but I'd love to see what you have in yours! :) You could either post it
here or e-mail me at david_blomstromREMOVETHISyahoo.com

I've been thinking it might be kind of cool to start a new website that
features nothing but properly tweaked scripts that people can check out
- the infamous Apache conf file, PHP config, etc. Most are probably
available somewhere or other, but bringing them together under one roof
could be a big help.

Thanks again.

attached mail follows:


On Wednesday 11 February 2004 16:42, John Taylor-Johnston wrote:

> Helpful, isn't he. If you can't find it in your config file, post again and
> I'll show you what i have in mine. John

It's hardly helpful asking your tailor about a problem with your leaky roof is
it? Ask the right questions at the right place and hopefully you'll get the
right answer.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Take your Senator to lunch this week.
*/

attached mail follows:


Jason Wong wrote:

> On Wednesday 11 February 2004 16:42, John Taylor-Johnston wrote:
>
>
>>Helpful, isn't he. If you can't find it in your config file, post again and
>>I'll show you what i have in mine. John
>
>
> It's hardly helpful asking your tailor about a problem with your leaky roof is
> it?

It is if my landlord's married to a tailor! :)

attached mail follows:


Freedomware wrote:

> I've been using both phpMyAdmin and EMS MySQL Manager to work with MySQL
> tables and PHP. Things are generally going OK, but I'm still ironing out
> a few kinks. I suspect some of my problems might be related to an error
> message I get when I click on a Database in phpMyAdmin:
>
> "Error: The additional Features for working with linked Tables have been
> deactivated. To find out why click here."
>
> When I click the link, I get a page that lists six different problems,
> each linked to a pretty complex solution in the phpMyAdmin Manual. Does
> anyone here know if there's an easier solution? Would fixing one or two
> key problems automatically fix the others? Can you download files that
> have already been "fixed," add your username and password and paste them
> into the proper folders?
>
> I put a couple screenshots that illustrate what I described online at
> http://geowebworks.geobop.org/test/phpmyadmin/index.php
>
> Thanks.
>

You can happily work with phpmyadmin with the features turned off. You
did not tell us what the kicks are - no help.

attached mail follows:


Rajani Anand Iyer wrote:
> Can someone recommend some good books on PHP Advanced topics.

http://php.net/books

--
Stuart

attached mail follows:


Hello Rajani,

On 10 Feb 2004 at 12:36, Rajani Anand Iyer wrote:

> Can someone recommend some good books on PHP Advanced topics.

Well, I can advise you on what not to buy, which should help, too.

Don't spend your money on Professional PHP4 (Argerich, Choi, Coggeshall, Egervari,
Geisler, Greant, Hill, Hubbard, Moore, O'Dell, Parise, Rawat, Sani, Scollo, Thomas &
Ullman): it's mostly badly written and the really relevant stuff is not clearly explained;
you get the feeling (probably pretty accurate) that the book was banged out by a bunch
of programmers who cannot write good English and have no experience teaching or
explaining things to others — or even building a logical argument, for that matter.

Don't go near XML and PHP (Vaswani), either. Also badly written and already outdated.
In addition, the book doesn't give you any information that you could not easily find on
the web. If you already know the basics about manipulating XML with PHP, you won't
learn anything new from this book, either.

I recently bought Secure PHP Development (Kabir) and it seems to be interesting, but I
haven't yet found the time to get past the introduction and a first browse, so I can't really
recommend it. But you might want to have a look at its table of contents and a few
reviews.

Cheers,

Erik

attached mail follows:


Hello Michael,

Wednesday, February 11, 2004, 2:48:00 AM, you wrote:

MTP> Again, no are any errors displayed or logged. Any help would be greatly
MTP> appreciated.

Your code is fine (well, the code you posted anyway) so I'd bet the
problem is Apache related regarding the config of PHP on your system.

Simple test, stick this page on your server:

<?php
     echo phpinfo();
?>

and call it via your browser - do you get to see all the PHP settings?

If you do, then you need to check if it's just form data that isn't
being passed, again a simple script like:

<?php
     echo $_GET['value'];
?>

and call the script with: script.php?value=something

If that works, try the same thing only for POST values.

Many things to test!

--
Best regards,
 Richard mailto:richlaunchcode.co.uk

attached mail follows:


Hello,

I have a similar problem whereby in the receiving PHP program the variable
$Myname doesn't contain anything (i.e. echo $Myname returns nothing) however
$_GET['Myname'] returns the correct value. How can this be?

I attach the two short files. I'd appreciate it if anyone can tell me why
this is happening. It seems to me that I'm following the right conventions.
I'm running this under Apache on a Windows XP system. I sent another news
item today but became more enlightened by the response to this similar
problem. Apologies for the superfluous item.

Regards

Tony

"Richard Davey" <richlaunchcode.co.uk> wrote in message
news:1838927883.20040211101614launchcode.co.uk...
> Hello Michael,
>
> Wednesday, February 11, 2004, 2:48:00 AM, you wrote:
>
> MTP> Again, no are any errors displayed or logged. Any help would be
greatly
> MTP> appreciated.
>
> Your code is fine (well, the code you posted anyway) so I'd bet the
> problem is Apache related regarding the config of PHP on your system.
>
> Simple test, stick this page on your server:
>
> <?php
> echo phpinfo();
> ?>
>
> and call it via your browser - do you get to see all the PHP settings?
>
> If you do, then you need to check if it's just form data that isn't
> being passed, again a simple script like:
>
> <?php
> echo $_GET['value'];
> ?>
>
> and call the script with: script.php?value=something
>
> If that works, try the same thing only for POST values.
>
> Many things to test!
>
> --
> Best regards,
> Richard mailto:richlaunchcode.co.uk

begin 666 prog.html
M/"%$3T-465!%($A434P4%5"3$E#("(M+R]7,T,O+T141"!(5$U,(#0N,#$
M5')A;G-I=&EO;F%L+R]%3B(^#0H-"CQH=&UL/T*/&AE860^#0H)/'1I=&QE
M/E5N=&ET;&5D/"]T:71L93X-"CPO:&5A9#X-"CQB;V1Y/T*/$9/4DT;65T
M:&]D/5!/4U004-424]./2)P<F]G,BYP:' B/T*(" \24Y05503D%-13TB
M37EN86UE(B!465!%/2)415A4(CX-"B /$E.4%54(%194$4]4U5"34E4/T*
;/"]&3U)-/T*/"]B;V1Y/T*/"]H=&UL/T*
`
end

begin 666 prog2.php
M/#]P:' -"T*)&YA;64](E1O;GDB.PT*/SX-"T*/"%$3T-465!%($A434P
M4%5"3$E#("(M+R]7,T,O+T141"!(5$U,(#0N,#$5')A;G-I=&EO;F%L+R]%
M3B(^#0H-"CQH=&UL/T*/&AE860^#0H)/'1I=&QE/E5N=&ET;&5D/"]T:71L
M93X-"CPO:&5A9#X-"T*/&)O9'D^#0H\5$%"3$40D]21$52/3$^#0H-"CP_
M<&AP( T*(" 96-H;R B/% ^/%12/CQ41#Y087-S9604&%R86UE=&5R/"]4
M1#X\5$0^37D;F%M92!I<R!\(B N("1->6YA;64+B B?#PO5$0^/"]44CX\
M+U ^(CL-"B (&5C:&\(CQ0/CQ44CX\5$0^3&]C86P5F%R:6%B;&4\+U1$
M/CQ41#Y->2!N86UE(&ES('PB("X)&YA;64+B B?#PO5$0^/"]44CX\+U ^
M(CL-"B (&5C:&\(CQ0/CQ44CX\5$0^27,=&AE('9A<FEA8FQE(&UY;F%M
M92!E;7!T>2 H,2!M96%N<R!Y97,I/"]41#X\5$0^(B N(&5M<'1Y*"1M>6YA
M;64I("X(CPO5$0^/"]44CX\+U ^(CL( T*(" 96-H;R B/% ^/%12/CQ4
M1#Y#:&5C:VEN9R!'9705F%L=65S/"]41#X\5$0^(B N("1?1T546R=->6YA
M;64G72 N("(\+U1$/CPO5%(^/"]0/B([#0H("!E8VAO("(\4#X\5%(^/%1$
M/D-H96-K:6YG(%!O<W05F%L=65S/"]41#X\5$0^(B N("1?4$]35%LG37EN
M86UE)UT+B B/"]41#X\+U12/CPO4#XB.PT*#0H_/T*#0H\+V)O9'D^#0H\
(+VAT;6P^#0H`
`
end

attached mail follows:


Hello Tony,

Wednesday, February 11, 2004, 11:18:49 AM, you wrote:

T> I have a similar problem whereby in the receiving PHP program the variable
T> $Myname doesn't contain anything (i.e. echo $Myname returns nothing) however
T> $_GET['Myname'] returns the correct value. How can this be?

Because you have register_globals turned off in your php.ini file
(which is the default setting I believe and for security reasons,
should be left this way).

Get used to using super globals ($_GET, $_POST, etc) because I bet at
some stage the register globals will vanish.

--
Best regards,
 Richard mailto:richlaunchcode.co.uk

attached mail follows:


Hello Raditha and all,

Thanks for the replies ... I reviewed all my code with Zend Studio and
the syntax was correct everywhere ... so I tried running the
application from the command line:

$ php donate.php

and it worked fine, so looking through the code we saw that there was a
"short-tag" in one place and that was the problem since the
"short-tags" is off on the server (Apache) as we also process
(read/write/etc) XML files ...

Anyways, thanks for the replies :)

/B

On Feb 10, 2004, at 16:38, Raditha Dissanayake wrote:

> The line number is misleading the error is generally above the line
> that's reffered to. try commenting out sections of the code. If you
> have an IDE it will be able to point out the error. If you don't have
> an IDE some text editor that is capable of syntax highlighting will
> also help.
>
--
Bruno Mattarollo <bruno.mattarollodiala.greenpeace.org>
Head of IT - Greenpeace International
[ http://www.greenpeace.org/ ]

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (Darwin)

iEYEARECAAYFAkAqCR0ACgkQkmxbmUVwE0P7PACeJYTqc23QeeiENvNJoKK62FgK
OiUAoIzuj8jk2WvmcZOlNv8KGDzWPNfE
=XhMa
-----END PGP SIGNATURE-----

attached mail follows:


Hi,

I have got this XML file:

<!--
<?xml version="1.0" encoding="UTF-16"?>

<DOC>
   <PARA>texto 1</PARA>
   <PARA>texto 2</PARA>
   <PARA>texto 3</PARA>
   <PARA>texto 4</PARA>
   <PARA>texto 5</PARA>
</DOC>
-->

and this XSL file:

<!--
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:user="urn:star-xslt-lib-namespace"
   xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<xsl:output method="html" encoding="UTF-8" indent="yes"/>

<xsl:template match="/">
   <html>
      <head>
         <title>xsl</title>
      </head>
      <body>
         <xsl:apply-templates select="DOC" />
      </body>
   </html>
</xsl:template>

<xsl:template match="DOC">
   <table border="1" cellspacing="0" cellpadding="0">
      <tr>
         <td align="center" valign="top">
            <b>
               <xsl:value-of select="user:EscapeURL('DOC')"/>
            </b>
         </td>
      </tr>
      <tr>
         <td>
            <xsl:apply-templates select="PARA"/>
         </td>
      </tr>
   </table>
</xsl:template>

<xsl:template match="PARA">
   <table border="0" cellspacing="0" cellpadding="0">
      <tr>
         <td align="center" valign="top">
            <i>
               PARA:
            </i>
         </td>
         <td style="color: green">
            <xsl:value-of select="."/>
         </td>
      </tr>
   </table>
</xsl:template>

<xsl:template match="text()">
   <xsl:copy-of select="."/>
</xsl:template>

<msxsl:script language="JScript" implements-prefix="user">
<![CDATA[

   function EscapeURL(selection) {
     if (selection(0) == null)
       return "";
     else if (selection(0).hasChildNodes())
       return escape(selection(0).childNodes(0).nodeTypedValue);
     else
       return escape(selection(0).nodeTypedValue);
   }

]]>
</msxsl:script>

</xsl:stylesheet>
-->

finally, my PHP file is:
<!--

-->
<?
   // Allocate a new XSLT processor
   $xh = xslt_create();

   // Process the document
   if ($result = xslt_process($xh, 'projects_php/testing/sample.xml',
'projects_php/testing/sample.xsl')) {
      echo ($result);
   }
   else {
      echo "Sorry, sample.xml could not be transformed by sample.xsl into";
      echo " result.xml the reason is that " . xslt_error($xh) . " and the
";
      echo "error code is " . xslt_errno($xh);
   }
   xslt_free($xh);
?>
-->

When I run my php file, this error message is shown:
Warning: Sablotron error on line 27: function 'user:EscapeURL' not supported
in c:\inetpub\wwwroot\projects_php\testing\test_xsl.php on line 7
Sorry, sample.xml could not be transformed by sample.xsl into result.xml the
reason is that function 'user:EscapeURL' not supported and the error code is
51

Can anybody help me? I cann't solve this error.

Thanks very much!
Juan Torres.

PS: Excuse me, my english is bad :(

attached mail follows:


Hello,

I've recently installed Apache 1.3.28 on my Windows XP system. I have then
installed php 4.3.4 as a module.

Everything seems to work except for one thing. PARAMETER PASSING.

The following program should work but doesn't. Can anyone tell me what I'm
doing wrong. I can't see why $myname doesn't contain a value in the php
file.

Thank you

Tony

begin 666 prog.html
M/"%$3T-465!%($A434P4%5"3$E#("(M+R]7,T,O+T141"!(5$U,(#0N,#$
M5')A;G-I=&EO;F%L+R]%3B(^#0H-"CQH=&UL/T*/&AE860^#0H)/'1I=&QE
M/E5N=&ET;&5D/"]T:71L93X-"CPO:&5A9#X-"CQB;V1Y/T*/$9/4DT;65T
M:&]D/4=%5"!!0U1)3TX](G!R;V<R+G!H<"(^#0H(#Q)3E!55"!.04U%/2)-
M>6YA;64B(%194$4](E1%6%0B/T*(" \24Y05505%E013U354)-250^#0H\
:+T9/4DT^#0H\+V)O9'D^#0H\+VAT;6P^#0H`
`
end

begin 666 prog2.php
M/#]P:' -"T*)&YA;64](E1O;GDB.PT*/SX-"T*/"%$3T-465!%($A434P
M4%5"3$E#("(M+R]7,T,O+T141"!(5$U,(#0N,#$5')A;G-I=&EO;F%L+R]%
M3B(^#0H-"CQH=&UL/T*/&AE860^#0H)/'1I=&QE/E5N=&ET;&5D/"]T:71L
M93X-"CPO:&5A9#X-"T*/&)O9'D^#0H\5$%"3$40D]21$52/3$^#0H-"CP_
M<&AP( T*(" 96-H;R B/% ^/%12/CQ41#Y087-S9604&%R86UE=&5R/"]4
M1#X\5$0^37D;F%M92!I<R!\(B N("1->6YA;64+B B?#PO5$0^/"]44CX\
M+U ^(CL-"B (&5C:&\(CQ0/CQ44CX\5$0^3&]C86P5F%R:6%B;&4\+U1$
M/CQ41#Y->2!N86UE(&ES('PB("X)&YA;64+B B?#PO5$0^/"]44CX\+U ^
M(CL-"B (&5C:&\(CQ0/CQ44CX\5$0^27,=&AE('9A<FEA8FQE(&UY;F%M
M92!E;7!T>2 H,2!M96%N<R!Y97,I/"]41#X\5$0^(B N(&5M<'1Y*"1M>6YA
M;64I("X(CPO5$0^/"]44CX\+U ^(CL( T*/SX-"T*/"]B;V1Y/T*/"]H
&=&UL/T*
`
end

attached mail follows:


[snip]
I've recently installed Apache 1.3.28 on my Windows XP system. I have
then
installed php 4.3.4 as a module.

Everything seems to work except for one thing. PARAMETER PASSING.

The following program should work but doesn't. Can anyone tell me what
I'm
doing wrong. I can't see why $myname doesn't contain a value in the php
file.
[/snip]

Please do not send two different e-mails to the list describing the same
problem. Be patient, you will get an answer, probably several. Please do
not send attachements, as most here will either not receive them or they
will not open them. Post any relevant code in the body of the e-mail.

attached mail follows:


hello, plz someone help me out for this script

set_time_limit ();

I have problem with :

Fatal error: Maximum execution time of 30 seconds exceeded in
D:\hshome\angelina\ud-clan.net\forum\posting.php on line 23

I can't fix php.ini coz my hosting company not allow, and they don't adjust
php.ini setting for it.

so, i only have way to use set_time_limit () : to fix max execution error
on my forum
www.ud-clan.net/forum

my members need to post much bigger files,
so max execution time 30 sec is too short.
it must be at least 3 mins.

my hosting company asked me to fix

/forum/templates/subsilber/subsilber.cfg

add set_time_limit (); to next of <?php ..

I did it as follow. but still not working,

I asked my members to test.. but when they posting files, it still showing
max execution error. !!!!

thk you ^^

attached mail follows:


[snip]
set_time_limit ();
[/snip]

set_time_limit(0);

This will remove all time limits from scripts unless PHP is running in
safe mode

http://us4.php.net/set_time_limit

attached mail follows:


On 11 February 2004 00:38, Adam Bregenzer contributed these pearls of
wisdom:

> On Tue, 2004-02-10 at 19:06, Richard Davey wrote:
>> This is slightly off-topic, but related to the include()
>> function. What is the given "standard" regarding when you
>> should or shouldn't use braces on a function.
>
> [snip]
>
>> Both work just fine. The manual includes examples of both
>> methods. So which do most people consider "the right way" ?
>
> I always use parens on function calls, I think it is more
> readable. Also, some syntax highlighters look for it.

So you don't use parens on include? (Because it's a language construct and
not a function ;)

That's my take on it -- for language constructs such as include, require,
echo, return, which don't require parentheses, I leave them off. Including
the parens make them look like functions and, as a general rule, they don't
behave like functions, so the parens are misleading.

Mind you, there are exceptions: exit(), for example, is a language construct
but requires the parens (at least, that's what the fine manual appears to
say, and I've not tested it without!).

Cheers!

Mike

--
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.fordleedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


Hi Richard,

> Why not just set a $basedir value somewhere and always use that in an
> include/require function: include "$basedir/sub/whatever" - then no
> matter where it's called from it'll never be wrong.

That makes sense...

Is it also recommended that an application local config file be used to set
all the globals that will be used throughout? Right now I'm using the db to
hold all the vars that I want to make available for all apps. Is this
something that shouldn't be done this way? Is there a performance factor
that I should be aware of? The tests I have done so far show an improvement
in the performance from what I am upgrading from, but.... (that's another
story):-]

alex

******************************************************************
The contents of this e-mail and any files transmitted with it are
confidential and intended solely for the use of the individual or
entity to whom it is addressed. The views stated herein do not
necessarily represent the view of the company. If you are not the
intended recipient of this e-mail you may not copy, forward,
disclose, or otherwise use it or any part of it in any form
whatsoever. If you have received this e-mail in error please
e-mail the sender.
******************************************************************

attached mail follows:


Hello Alex,

Wednesday, February 11, 2004, 3:08:02 PM, you wrote:

AH> Is it also recommended that an application local config file be used to set
AH> all the globals that will be used throughout? Right now I'm using the db to
AH> hold all the vars that I want to make available for all apps. Is this
AH> something that shouldn't be done this way? Is there a performance factor

When using SQL there will always be overhead that could otherwise be
avoided. Personally I use a file called common.inc which is basically
my global include file - it has nothing but variables I need set (no
functions, etc - they are held elsewhere) and files I need to include.
It sits at the root of my project and is included on every page. It's
the only file that needs to be included.

This is a matter of personal preference though - others will do it
like this, infact that is how .NET works to a degree via the
web.config file, but you may find a way which works best for you.
No-one can say if its wrong or right, but it would definitely be
quicker than a SQL query :)

--
Best regards,
 Richard mailto:richlaunchcode.co.uk

attached mail follows:


From: "Ford, Mike [LSS]" <M.Fordleedsmet.ac.uk>

> Mind you, there are exceptions: exit(), for example, is a language
construct
> but requires the parens (at least, that's what the fine manual appears to
> say, and I've not tested it without!).

Only if you want to pass an exit value, i.e. exit(101); otherwise just plain
'ole exit; works fine.

---John Holmes...

attached mail follows:


From: "Richard Davey" <richlaunchcode.co.uk>

> Personally I use a file called common.inc which is basically
> my global include file - it has nothing but variables I need set (no
> functions, etc - they are held elsewhere) and files I need to include.
> It sits at the root of my project and is included on every page. It's
> the only file that needs to be included.

I hope you are also denying access to .inc files otherwise we could view
your file as plain text. Same goes for INI files used with parse_ini_file()
that are stored in the webroot.

---John Holmes...

attached mail follows:


Hello John,

Wednesday, February 11, 2004, 3:25:23 PM, you wrote:

JWH> I hope you are also denying access to .inc files otherwise we could view
JWH> your file as plain text.

Please.. try ;)

I used to call the file common.php until we had a rather large debate
about the correct naming convention for PHP include files on the PHP
Community list where various people convinced me that .inc is the
correct standard for include files.

--
Best regards,
 Richard mailto:richlaunchcode.co.uk

attached mail follows:


From: "Richard Davey" <richlaunchcode.co.uk>

> JWH> I hope you are also denying access to .inc files otherwise we could
view
> JWH> your file as plain text.
>
> Please.. try ;)
>
> I used to call the file common.php until we had a rather large debate
> about the correct naming convention for PHP include files on the PHP
> Community list where various people convinced me that .inc is the
> correct standard for include files.

Heh.. I was just giving a heads up, not threatening.

I personally don't care for .inc files that are in the web root. The ways to
deny access to them vary across web servers and platforms, so it makes
distributing your code a hassle. I know the issues with giving it a .php
extension, also, but at least those issues I can control and fix and are not
related to the OS or webserver.

---John Holmes...

attached mail follows:


Hello John,

Wednesday, February 11, 2004, 3:42:39 PM, you wrote:

JWH> Heh.. I was just giving a heads up, not threatening.

:)

JWH> I personally don't care for .inc files that are in the web root. The ways to
JWH> deny access to them vary across web servers and platforms, so it makes
JWH> distributing your code a hassle. I know the issues with giving it a .php

True.. except I don't distribute my code. It sits on the servers owned
by the company I work for. I know it's different for others though.

--
Best regards,
 Richard mailto:richlaunchcode.co.uk

attached mail follows:


How large can that file be?

I have a func.php file that I'm putting all my reusable functions in but I
can see that getting pretty large if this project starts getting eaten up
with feature creep, er.., I mean additional functionality. (I know that'll
never happen...;->)

So how large is too large? I have about 50 constants and globals right now
and it's probably going to get a little larger. At what point do you break
up the files for performance versus convenience and maintainability?

I read the article that someone posted the other day about "good php coding
practices" and found that it contradicted a lot of what I have seen not only
on php.net but in this forum. Some of what was written though made a
tremendous amount of sense. Other was just common sense, like not putting
function calls in loops.

I think I need more coffee.......

> -----Original Message-----
> From: Richard Davey [mailto:richlaunchcode.co.uk]
> Sent: Wednesday, February 11, 2004 9:28 AM
> To: php-generallists.php.net
> Subject: Re[6]: [PHP] HELP: Nested include(...)'s take relative paths not
> int uitively
>
> Hello John,
>
> Wednesday, February 11, 2004, 3:25:23 PM, you wrote:
>
> JWH> I hope you are also denying access to .inc files otherwise we could
> view
> JWH> your file as plain text.
>
> Please.. try ;)
>
> I used to call the file common.php until we had a rather large debate
> about the correct naming convention for PHP include files on the PHP
> Community list where various people convinced me that .inc is the
> correct standard for include files.
>
> --
> Best regards,
> Richard mailto:richlaunchcode.co.uk
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

******************************************************************
The contents of this e-mail and any files transmitted with it are
confidential and intended solely for the use of the individual or
entity to whom it is addressed. The views stated herein do not
necessarily represent the view of the company. If you are not the
intended recipient of this e-mail you may not copy, forward,
disclose, or otherwise use it or any part of it in any form
whatsoever. If you have received this e-mail in error please
e-mail the sender.
******************************************************************

attached mail follows:


Hello Alex,

Wednesday, February 11, 2004, 3:47:09 PM, you wrote:

AH> How large can that file be?

How long is a piece of string? :)
It's as long as you need it to be.

AH> I have a func.php file that I'm putting all my reusable functions in but I
AH> can see that getting pretty large if this project starts getting eaten up
AH> with feature creep, er.., I mean additional functionality. (I know that'll
never happen...;->>)

Are you using classes? If so that should naturally break your project
down into more meaningful chunks.. i.e. you could have a user class,
an order class, etc etc.

If not then you'll end up with hundreds of functions in a single file
which will become a nightmare, so split them into more sensible groups.

AH> So how large is too large? I have about 50 constants and globals right now
AH> and it's probably going to get a little larger. At what point do you break
AH> up the files for performance versus convenience and maintainability?

Bear in mind that it is PHP that has to load and use the file, not the
web browser. So to be honest I would say you can easily fit all of
those constants in a single file - my common include at the moment is
35k.

AH> I read the article that someone posted the other day about "good php coding
AH> practices" and found that it contradicted a lot of what I have seen not only
AH> on php.net but in this forum. Some of what was written though made a
AH> tremendous amount of sense. Other was just common sense, like not putting
AH> function calls in loops.

There is no "standard" so you have to find your own middle ground. I
don't know which article you are referring to though. Some things make
sense, some make you think "now that's a good idea" and others are
just downright stupid. Trust me, you will NEVER find two PHP
developers who do things the *exact* same way. That doesn't mean write
bad, poorly formatted code - it just means no-one can turn around and
tell you "it's wrong".

--
Best regards,
 Richard mailto:richlaunchcode.co.uk

attached mail follows:


Hi there again people,

I looks like this thread turned into a 'include' usage
discussion. Well, nothing wrong with that.

The conclusion seems to be that ALL level of nested
included inherit current directory reference for
relative paths from the very first script ( that in
$_SERVER[SCRIPT_NAME] ) that calls them.

I just wanted to clarify my need, even I know some one
may think it is not a good idea to depend in nested
includes in higher level subdirs for default/inherited
script behaviour.

I came to this question when trying to design a
framework for my personal site with the following
requirements.

1. Full frame integration (for frame I mean same menu,
links, etc.. around the content of a specific seccion,
no the html frame tag)
2. Full modularity of subseccions, it means to me, put
a subseccion in a subdirectory an it should be ready
to go. Of course I need to make some includes standar
for this to work.

All this is cleanly implemented with includes for
inherited defaults up to 1 level of subseccion depth.

Since I want second-level-depth (or subsubseccions)
not to know about what is above them, I came to need
this NESTED includes and that is where all started to
fall apart with the problem I already described.

I will start looking for a diferent aproach.

Thanxs to u all.

__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

attached mail follows:


=======================================
This message is for the benefit of new subscribers
and those new to PHP. Please feel free to add
more points and send to the list.
=======================================
1. If you have any queries/problems about PHP try
http://www.php.net/manual/en first. You can
download a copy and use it offline also.

Please also try http://www.php.net/manual/faq.php
for answers to frequently answered questions
about PHP (added by Christophe Chisogne).

2. Try http://www.google.com next. Searching for
"php YOUR QUERY" may fetch you relevant
information within the first 10 results.

3. There is a searchable archive of the mailing
list discussion at
http://phparch.com/mailinglists. Many of the
common topics are discussed repeatedly, and you
may get answer to your query from the earlier
discussions.

For example: One of the repeatedly discussed
question in the list is "Best PHP editor".
Everyone has his/her favourite editor.
You can get all the opinions by going through the
list archives. If you want a chosen list try this
link : http://phpeditors.linuxbackup.co.uk/
(contributed by Christophe Chisogne).

4. Not sure if PHP is working or you want find out
what extensions are available to you?

Just put the following code into a file with a
.php extension and access it through your
webserver:

<?php
        phpinfo();
?>

If PHP is installed you will see a page with a lot
of information on it. If PHP is not installed (or
not working correctly) your browser will try
to download the file.

(contributed by Teren and reworded by Chris W
Parker)

5. If you are stuck with a script and do not
understand what is wrong, instead
of posting the whole script, try doing some
research yourself. One useful trick is to print
the variable/sql query using print or echo
command and check whether you get what you
expected.

After diagnosing the problem, send the details of
your efforts (following steps 1, 2 & 3) and ask
for help.

6. PHP is a server side scripting language.
Whatever processing PHP does takes
place BEFORE the output reaches the client.
Therefore, it is not possible to access
users' computer related information (OS, screen
size etc) using PHP. Nor can you modify any the
user side settings. You need to go for
JavaScript and ask the question in a JavaScript
list.

On the other hand, you can access the information
that is SENT by the user's browser when a client
requests a page from your server. You can
find details about browser, OS etc as reported by
this request. - contributed by Wouter van Vliet
and reworded by Chris W Parker.

7. Provide a clear descriptive subject line. Avoid
general subjects like "Help!!", "A Question" etc.
Especially avoid blank subjects.

8. When you want to start a new topic, open a new
mail composer and enter the mailing list address
php-generallists.php.net instead of replying to
an existing thread and replacing the subject and
body with your message.

9. It's always a good idea to post back to the
list once you've solved your problem. People
usually add [SOLVED] to the subject line of their
email when posting solutions. By posting your
solution you're helping the next person with the
same question. [contribued by Chris W Parker]

10. Ask smart questions
http://catb.org/~esr/faqs/smart-questions.html
[contributed by Jay Blanchard)

Hope you have a good time programming with PHP.

Best regards,

--
Integrated Management Tools for leather industry
----------------------------------
http://www.leatherlink.net

Ma Siva Kumar,
BSG LeatherLink (P) Ltd,
Chennai - 600106

attached mail follows:


I am using RedHat Enterprise Linux (ES). Installed openldap, php, apache
latest versions. All except ldap_add functions are working. When I use
ldapadd at the terminal it works adding entries to ldap. But when I use php
ldap_add , error code shows it is Success. But does not add any entires to
ldap. I am using the form uid-xxx, cn=xxx,ou=xxx,o=xxxxx. It works for
cn=xxx,ou=xxx,o=xxx. When I try to add uid=xxx, cn=xxx,ou=xxx,o=xxxxx it
fails. slapd log shows err=0. Appreciate any help.

_________________________________________________________________
Get some great ideas here for your sweetheart on Valentine's Day - and
beyond. http://special.msn.com/network/celebrateromance.armx

attached mail follows:


I have a function in my application that does a large query on my database.
In certain instances the query will take to long to return and will reach
the max execution time set in PHP.ini. This is ok though, it's already set
to 90 secs and I don't want it any longer than that. What I would like is
to have a way that I can time a function. If the function takes to long to
return data, kill it and follow some other path in my app to let the user
know what's going on. What I'm trying to avoid is the warning from PHP
saying that the script reached max execution time. The user gets all
confused and then I get help desk calls. There has got to be another way.
Any ideas?

- Anthony

attached mail follows:


Hello Anthony,

Wednesday, February 11, 2004, 1:43:29 PM, you wrote:

A> I have a function in my application that does a large query on my database.
A> In certain instances the query will take to long to return and will reach
A> the max execution time set in PHP.ini. This is ok though, it's already set
A> to 90 secs and I don't want it any longer than that. What I would like is
A> to have a way that I can time a function. If the function takes to long to
A> return data, kill it and follow some other path in my app to let the user
A> know what's going on. What I'm trying to avoid is the warning from PHP

There may be a more elegant way, but this technique should certainly
work (in theory anyway! you'll have to test it for yourself):

Split your script up, so you have the "processing" script (i.e. the
one that actually does the query that might time out) and a handler
script.

The user is sent to the handler script (via say a form post, or
however you are doing this) and the handler script calls the
processing script via fsockopen().

Using this function you can specify a time-out value - either you'll
be able to stream the results of your processing script back into the
handler (and just echo them out perhaps? depends what it does) or you
can catch the time out and inform the user accordingly.

I probably made this sound more complicated than it really is :)

--
Best regards,
 Richard mailto:richlaunchcode.co.uk

attached mail follows:


I use php with interbase.
But when i try the code below i get this eror message :

Fatal error: Call to undefined function: ibase_connect() in c:\inetpub\wwwroot\index.php on line 12

I want to know what is wrong with the code or if i have to do
with php in order to run with Interbase ?

Please help !!!!!!!!

---------------begin---------------------

<html>
 <head>
  <title>Test connexion Interbase</title>
 </head>
 <body>
 <?php echo "Affichage des informations de Interbase<p>";

$host = "C:\Program Files\Borland\InterBase\BDCENTRALE.GDB";
$username = "SYSDBA";
$password = "masterkey";

$db = ibase_connect($host, $username, $password);

ibase_close($db);
echo "Connexion réussie";
?>
</body>
</html>

------------------end-------------------------

attached mail follows:


Hello Dominique,

Wednesday, February 11, 2004, 1:58:17 PM, you wrote:

DA> Fatal error: Call to undefined function: ibase_connect() in
DA> c:\inetpub\wwwroot\index.php on line 12

DA> I want to know what is wrong with the code or if i have to do
DA> with php in order to run with Interbase ?

You don't have Interbase support enabled in the version of PHP you
are using.

See the InterBase functions manual page for details on how to enable
it on Win32 machines. Here's the most important part of it:

Note to Win32 Users: In order to enable this module on a Windows
environment, you must copy gds32.dll from the DLL folder of the
PHP/Win32 binary package to the SYSTEM32 folder of your windows
machine. (Ex: C:\WINNT\SYSTEM32 or C:\WINDOWS\SYSTEM32). In case you
installed the InterBase database server on the same machine PHP is
running on, you will have this DLL already. Therefore you don't need
to copy gds32.dll from the DLL folder.

--
Best regards,
 Richard mailto:richlaunchcode.co.uk

attached mail follows:


ok ,

i install the good php windows installer (with interbase) and now i think my
function is recognized.
But the message displayed is :

Warning: ibase_connect(): unavailable database in
c:\inetpub\wwwroot\index.php on line 12

But i can connect to the database whitout any problems via interbase console
.....

So what'is wrong ??????

----- Original Message -----
From: "Richard Davey" <richlaunchcode.co.uk>
To: "Dominique ANOKRE" <dominique.anokrebull.ci>
Cc: "Php List" <php-generallists.php.net>
Sent: Wednesday, February 11, 2004 2:04 PM
Subject: Re: [PHP] Undefined function

> Hello Dominique,
>
> Wednesday, February 11, 2004, 1:58:17 PM, you wrote:
>
> DA> Fatal error: Call to undefined function: ibase_connect() in
> DA> c:\inetpub\wwwroot\index.php on line 12
>
> DA> I want to know what is wrong with the code or if i have to do
> DA> with php in order to run with Interbase ?
>
> You don't have Interbase support enabled in the version of PHP you
> are using.
>
> See the InterBase functions manual page for details on how to enable
> it on Win32 machines. Here's the most important part of it:
>
> Note to Win32 Users: In order to enable this module on a Windows
> environment, you must copy gds32.dll from the DLL folder of the
> PHP/Win32 binary package to the SYSTEM32 folder of your windows
> machine. (Ex: C:\WINNT\SYSTEM32 or C:\WINDOWS\SYSTEM32). In case you
> installed the InterBase database server on the same machine PHP is
> running on, you will have this DLL already. Therefore you don't need
> to copy gds32.dll from the DLL folder.
>
> --
> Best regards,
> Richard mailto:richlaunchcode.co.uk
>
>

attached mail follows:


Dominique ANOKRE wrote:

> ok ,
>
> i install the good php windows installer (with interbase) and now i think my
> function is recognized.
> But the message displayed is :
>
> Warning: ibase_connect(): unavailable database in
> c:\inetpub\wwwroot\index.php on line 12
>
> But i can connect to the database whitout any problems via interbase console
> .....
>
> So what'is wrong ??????

Without seeing the code, I can only guess that the problem is either a)
your code, b) database configuration, c) network connectivity, d) etc,
or e) between the monitor and chair. ;)

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

attached mail follows:


Hey group

Is there a function that when you divide 2 numbers you drop the
remainder and are left with the whole number.

--

Blake

attached mail follows:


Hello Jeremy,

Wednesday, February 11, 2004, 2:00:32 PM, you wrote:

JS> Is there a function that when you divide 2 numbers you drop the
JS> remainder and are left with the whole number.

round($number1 / $number2)

See the manual for the precision value if you need it.

--
Best regards,
 Richard mailto:richlaunchcode.co.uk

attached mail follows:


Seems to me you need

floor($number1 / $number2)

Vincent

-----Original Message-----
From: Richard Davey [mailto:richlaunchcode.co.uk]
Sent: woensdag 11 februari 2004 15:07
To: Jeremy Schroeder
Cc: php-generallists.php.net
Subject: Re: [PHP] Math Question

Hello Jeremy,

Wednesday, February 11, 2004, 2:00:32 PM, you wrote:

JS> Is there a function that when you divide 2 numbers you drop the
JS> remainder and are left with the whole number.

round($number1 / $number2)

See the manual for the precision value if you need it.

--
Best regards,
 Richard mailto:richlaunchcode.co.uk

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

attached mail follows:


Hello Vincent,

Wednesday, February 11, 2004, 2:15:15 PM, you wrote:

VJ> Seems to me you need
VJ> floor($number1 / $number2)

Only if you always want to round *down* the equation. For example
flooring a result of 4.99 will give you an integer of 4 whereas
round() (or ceil()) will give you 5. It depends on the situation as to
which is most useful.

--
Best regards,
 Richard mailto:richlaunchcode.co.uk

attached mail follows:


[snip]
VJ> Seems to me you need
VJ> floor($number1 / $number2)

Only if you always want to round *down* the equation. For example
flooring a result of 4.99 will give you an integer of 4 whereas
round() (or ceil()) will give you 5. It depends on the situation as to
which is most useful.
[/snip]

you can also try number_format($a / $b, 0, '', '');

and test for the result as some rounding does occur. (I prbably have the
syntax wrong this AM)

attached mail follows:


Hi Richard

I agree....
But you always want to round down ;)

Blake> Is there a function that when you divide 2 numbers you drop the
Blake> remainder and are left with the whole number.

Still seems floor() to me

Vincent

-----Original Message-----
From: Richard Davey [mailto:richlaunchcode.co.uk]
Sent: woensdag 11 februari 2004 15:23
To: Vincent Jansen
Cc: php-generallists.php.net
Subject: Re[2]: [PHP] Math Question

Hello Vincent,

Wednesday, February 11, 2004, 2:15:15 PM, you wrote:

VJ> Seems to me you need
VJ> floor($number1 / $number2)

Only if you always want to round *down* the equation. For example
flooring a result of 4.99 will give you an integer of 4 whereas
round() (or ceil()) will give you 5. It depends on the situation as to
which is most useful.

--
Best regards,
 Richard mailto:richlaunchcode.co.uk

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

attached mail follows:


Thanks for all the help, floor() was the correct choice for this problem .

-Blake

Vincent Jansen wrote:

>Hi Richard
>
>I agree....
>But you always want to round down ;)
>
>Blake> Is there a function that when you divide 2 numbers you drop the
>Blake> remainder and are left with the whole number.
>
>Still seems floor() to me
>
>Vincent
>
>
>
>-----Original Message-----
>From: Richard Davey [mailto:richlaunchcode.co.uk]
>Sent: woensdag 11 februari 2004 15:23
>To: Vincent Jansen
>Cc: php-generallists.php.net
>Subject: Re[2]: [PHP] Math Question
>
>
>Hello Vincent,
>
>Wednesday, February 11, 2004, 2:15:15 PM, you wrote:
>
>VJ> Seems to me you need
>VJ> floor($number1 / $number2)
>
>Only if you always want to round *down* the equation. For example
>flooring a result of 4.99 will give you an integer of 4 whereas
>round() (or ceil()) will give you 5. It depends on the situation as to
>which is most useful.
>
>
>

attached mail follows:


Jeremy Schroeder wrote:

> Hey group
>
> Is there a function that when you divide 2 numbers you drop the
> remainder and are left with the whole number.
>

A whole section of the manual dedicated to mathematical functions!

http://us4.php.net/manual/en/ref.math.php

floor()
ceil()
round()

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

attached mail follows:


How do I replace all single quotes with double quotes in a string for
echoing it with the double quotes?

--
Diana Castillo
Global Reservas, S.L.
C/Granvia 22 dcdo 4-dcha
28013 Madrid-Spain
Tel : 00-34-913604039 ext 214
Fax : 00-34-915228673
email: dianahotelkey.com
Web : http://www.hotelkey.com
      http://www.destinia.com

attached mail follows:


Diana Castillo wrote:
> How do I replace all single quotes with double quotes in a string for
> echoing it with the double quotes?

$text = str_replace("'", '"', $text);

http://php.net/str_replace and please at least RTFM before posting here
in future.

--
Stuart

attached mail follows:


str_replace(''',"'", $StringToReplace);

should work

-----Original Message-----
From: Diana Castillo [mailto:dianainterhotel.com]
Sent: Wednesday, February 11, 2004 4:33 PM
To: php-generallists.php.net
Subject: [PHP] replace ' with "

How do I replace all single quotes with double quotes in a string for
echoing it with the double quotes?

--
Diana Castillo
Global Reservas, S.L.
C/Granvia 22 dcdo 4-dcha
28013 Madrid-Spain
Tel : 00-34-913604039 ext 214
Fax : 00-34-915228673
email: dianahotelkey.com
Web : http://www.hotelkey.com
      http://www.destinia.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--------------------------------------------------------------------
Disclaimer
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is
intended for the attention and use only of the addressee.
Should you have received this e-mail in error, please delete
and destroy it and any attachments thereto immediately.
Under no circumstances will the Cape Technikon or the sender
of this e-mail be liable to any party for any direct, indirect,
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

attached mail follows:


Diana Castillo wrote:

> How do I replace all single quotes with double quotes in a string for
> echoing it with the double quotes?

By looking here...

http://us4.php.net/str_replace

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

attached mail follows:


Hi,
 
I have a script that allows the user to browse his/her local hard drive for
a file and email it as an attachment. Text files come through OK but any
binary type file, e.g., JPEG or PDF arrive broken. JPEG will show as a red
X in my browser and Adobe will complain about the PDF. I don't know why???
 
A code sample of my form is:
 
<form enctype="multipart/form-data" action="formmail.php" method="post">
Send this file: <input name="userfile" type="file">
<input type="submit" value="Send your file" name="submit">
</form>
 
 
Thanks,
Don

attached mail follows:


On Wednesday 11 February 2004 22:58, Donpro wrote:

> A code sample of my form is:
>
> <form enctype="multipart/form-data" action="formmail.php" method="post">
> Send this file: <input name="userfile" type="file">
> <input type="submit" value="Send your file" name="submit">
> </form>

Try the example(s) in manual > Handling file uploads. If they work, then
figure out what you're doing differently in your code that makes it not work.

If the examples don't work, and you have read the above chapter thoroughly and
still can't get them to work then post back here.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
If I promised you the moon and the stars, would you believe it?
                -- Alan Parsons Project
*/

attached mail follows:


Hello Donpro,

Wednesday, February 11, 2004, 2:58:20 PM, you wrote:

D> I have a script that allows the user to browse his/her local hard drive for
D> a file and email it as an attachment. Text files come through OK but any
D> binary type file, e.g., JPEG or PDF arrive broken. JPEG will show as a red
D> X in my browser and Adobe will complain about the PDF. I don't know why???
 
D> A code sample of my form is:

There's nothing wrong with the small bit of html you posted so the
error lies elsewhere. Use the example code in the PHP manual and see
what happens - check your PHP upload settings.

--
Best regards,
 Richard mailto:richlaunchcode.co.uk

attached mail follows:


From: "Donpro" <donprolclnav.com>

> I have a script that allows the user to browse his/her local hard drive
for
> a file and email it as an attachment. Text files come through OK but any
> binary type file, e.g., JPEG or PDF arrive broken. JPEG will show as a
red
> X in my browser and Adobe will complain about the PDF. I don't know
why???

How are you viewing the attachments? It's hard to tell where the issue is
with that description.

Look at the source code of a regular email with attachments and then compare
it to the source code of the email and attachments you create with PHP.

---John Holmes...

attached mail follows:


I'm reading in to a variable $section1 an entire php file that creates a
mysql table. I can output the variable in a new file just fine (figured out
what all had to be escaped in the original file).

My problem is, I want to replace the table name in the original file with a
new table name before I output it to the new file. But the str_replace has
no effect. Neither does an ereg_replace. Is there something in the content
of the file that is foiling the replace?

Here is what I have right now. It produces the same file content as is read
in.

<?php

$search = "item";
$replace = "poem";

mkdir($replace, 0777);
$section1 = file_get_contents("table_create.php");
str_replace($search, $replace, $section1);
chdir($replace);
$table_create = fopen($replace."_table_create.php","w+");
fwrite($table_create,$section1);

?>

The file I'm reading in is as follows:

<?php session_start(); ?>

<?php $title = "$PHP_SELF"; ?>

<?php include ("../resources/header.php"); ?>

<?php include("../resources/db_connect.php"); ?>

<?

// build the query

$sql = "CREATE TABLE item (
                            i_item_id int primary key not null default
'0' auto_increment,
                            i_client varchar(30),
                            i_project varchar(30),
                            i_category varchar(30),
                            i_phase varchar(30),
                            i_type varchar(30),
                            i_priority decimal(8,2),
                            i_author varchar(30),
                            i_created date,
                            i_owner varchar(30),
                            i_due date,
                            i_status varchar(30),
                            i_title varchar(50),
                            i_file varchar(50),
                            i_url varchar(100),
                            i_detail mediumtext,
                            FULLTEXT (i_title,i_url,i_file,i_detail)
                        )";

// execute the query

$result = mysql_query($sql,$connection)
    or die(mysql_error());

    if ($result)
        {
            $msg = "<p>The table has been created.</p>";
        }
    else
        {
            $msg = "<p>echo mysql_error()</p>";
        }

// reveal what happened

echo "$msg"; ?>

<?php include("../resources/footer.php"); ?>

attached mail follows:


Hello Aaron,

Wednesday, February 11, 2004, 3:00:47 PM, you wrote:

AM> $section1 = file_get_contents("table_create.php");
AM> str_replace($search, $replace, $section1);

You need to assign the output of str_replace to something:

$new_section = str_replace($search, $replace, $section1)

--
Best regards,
 Richard mailto:richlaunchcode.co.uk

attached mail follows:


On Wednesday 11 February 2004 23:00, Aaron Merrick wrote:

> My problem is, I want to replace the table name in the original file with a
> new table name before I output it to the new file. But the str_replace has
> no effect.

[snip]

> str_replace($search, $replace, $section1);

str_replace() returns a value, use it.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
A bit of talcum
Is always walcum
                -- Ogden Nash
*/

attached mail follows:


Richard,

Thank you so much. That works perfectly. I knew it had to be something
simple.

Aaron

> From: Richard Davey <richlaunchcode.co.uk>
> Reply-To: Richard Davey <richlaunchcode.co.uk>
> Date: Wed, 11 Feb 2004 15:04:44 +0000
> To: Aaron Merrick <amerrickmac.com>
> Cc: php-generallists.php.net
> Subject: Re: [PHP] str_replace not replacing
>
> Hello Aaron,
>
> Wednesday, February 11, 2004, 3:00:47 PM, you wrote:
>
> AM> $section1 = file_get_contents("table_create.php");
> AM> str_replace($search, $replace, $section1);
>
> You need to assign the output of str_replace to something:
>
> $new_section = str_replace($search, $replace, $section1)
>
> --
> Best regards,
> Richard mailto:richlaunchcode.co.uk
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


Aaron Merrick wrote:
> I'm reading in to a variable $section1 an entire php file that creates a
> mysql table. I can output the variable in a new file just fine (figured out
> what all had to be escaped in the original file).
>
> My problem is, I want to replace the table name in the original file with a
> new table name before I output it to the new file. But the str_replace has
> no effect. Neither does an ereg_replace. Is there something in the content
> of the file that is foiling the replace?
>
> Here is what I have right now. It produces the same file content as is read
> in.
>
> <?php
>
> $search = "item";
> $replace = "poem";
>
> mkdir($replace, 0777);
> $section1 = file_get_contents("table_create.php");
> str_replace($search, $replace, $section1);
> chdir($replace);
> $table_create = fopen($replace."_table_create.php","w+");
> fwrite($table_create,$section1);
>
> ?>
>

str_replace() doesn't affect $section1; it returns the subject with the
replacements, so you'd need:

$section1 = str_replace($search, $replace, $section1);

Of course, you'd know this if you had RTFM ;-)

http://www.php.net/str_replace

Mike

attached mail follows:


I have tried for a long time now on various forums to get help. Every one
says to come to you for support. I looked for a forum on your site but did
not see one.

 

I had to turn the Enable account activation by admin feature. In doing so
when someone tries to create an account when they hit submit they get this
error:

 

[code]Failed sending email :: PHP ::

 

DEBUG MODE

 

Line : 234

File : /home/mcpain36/public_html/forum/includes/emailer.php[/code]

 

It does not send them an email about how the admin has to turn on the
account. How can I fix this?

 

Thanks,

 

Russ

 

P.S. Sorry if this is a nuisance.

attached mail follows:


Meramec Challenge Paintball, LLC <mailto:infoMCPaintball.com>
    on Wednesday, February 11, 2004 7:40 AM said:

I'm glad you put "question" in your subject line because for a minute
there I thought you were sending me a note of praise. I realized you
weren't once I read your informative subject line.

> I have tried for a long time now on various forums to get help. Every
> one says to come to you for support. I looked for a forum on your
> site but did not see one.

On my site??

;)

> I had to turn the Enable account activation by admin feature. In
> doing so when someone tries to create an account when they hit submit
> they get this error:

You assume anyone here knows what you're talking about. What program is
this that you're using?

> Line : 234
>
> File : /home/mcpain36/public_html/forum/includes/emailer.php[/code]

What exactly is the error?

> It does not send them an email about how the admin has to turn on the
> account. How can I fix this?

By answering the above two questions and showing us what is on line 234
of /home/mcpain36/public_html/forum/includes/emailer.php. That will at
least give us a starting point.

Chris.

attached mail follows:


Hi,
 
I've searched the archives and note that many have probelms using session on
a Win2K server. I am getting a
 
Undefined index: sessions in
D:\inetpub\mydomain\www\forms\formmail\formmail.php on line 768
 
error. Line 768 is: session_start();
 
It works Ok on Linux; is there any "special" Windows configuration?
 
Thanks,
Don
 

attached mail follows:


Session_start() has to be the first thing at the top of the page before
anything else. Even header info.

I just got this answered for me about two weeks ago....

> -----Original Message-----
> From: Donpro [mailto:donprolclnav.com]
> Sent: Wednesday, February 11, 2004 10:20 AM
> To: php list
> Subject: [PHP] Sessions on Win2k
>
> Hi,
>
> I've searched the archives and note that many have probelms using session
> on
> a Win2K server. I am getting a
>
> Undefined index: sessions in
> D:\inetpub\mydomain\www\forms\formmail\formmail.php on line 768
>
> error. Line 768 is: session_start();
>
> It works Ok on Linux; is there any "special" Windows configuration?
>
> Thanks,
> Don
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

******************************************************************
The contents of this e-mail and any files transmitted with it are
confidential and intended solely for the use of the individual or
entity to whom it is addressed. The views stated herein do not
necessarily represent the view of the company. If you are not the
intended recipient of this e-mail you may not copy, forward,
disclose, or otherwise use it or any part of it in any form
whatsoever. If you have received this e-mail in error please
e-mail the sender.
******************************************************************

attached mail follows:


On 11 February 2004 16:39, Alex Hogan contributed these pearls of wisdom:

> Session_start() has to be the first thing at the top of the
> page before
> anything else. Even header info.

Er, no. session_start() itself generates headers, so it doesn't matter whether it goes before or after other headers. It also doesn't matter how much code is before your session_start(), so long as none of it generates any actual page content of any kind (and that includes whitespace).

So it could be perfectly valid to have a session_start() on line 768, if everything preceding it is PHP initializations and logic -- and the error message isn't about headers being output at the wrong place, so I'm guessing that isn't it.

Unfortunately, I don't have any real idea what *could* be the problem here, but I wanted to stop the OP haring off on a wild goose chase...!

Cheers!

Mike

--
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.fordleedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


Sorry..., my bad....

I was just relating what I thought had been related to me for the same
question.

I think I'll stick to the asking and not the answering for a while longer...

Gotta go.... goose is waiting......

> -----Original Message-----
> From: Ford, Mike [LSS] [mailto:M.Fordleedsmet.ac.uk]
> Sent: Wednesday, February 11, 2004 11:00 AM
> To: 'Alex Hogan'; php list
> Subject: RE: [PHP] Sessions on Win2k
>
> On 11 February 2004 16:39, Alex Hogan contributed these pearls of wisdom:
>
> > Session_start() has to be the first thing at the top of the
> > page before
> > anything else. Even header info.
>
> Er, no. session_start() itself generates headers, so it doesn't matter
> whether it goes before or after other headers. It also doesn't matter how
> much code is before your session_start(), so long as none of it generates
> any actual page content of any kind (and that includes whitespace).
>
> So it could be perfectly valid to have a session_start() on line 768, if
> everything preceding it is PHP initializations and logic -- and the error
> message isn't about headers being output at the wrong place, so I'm
> guessing that isn't it.
>
> Unfortunately, I don't have any real idea what *could* be the problem
> here, but I wanted to stop the OP haring off on a wild goose chase...!
>
> Cheers!
>
> Mike
>
> --
> Mike Ford, Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Beckett Park, LEEDS, LS6 3QS, United Kingdom
> Email: m.fordleedsmet.ac.uk
> Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

******************************************************************
The contents of this e-mail and any files transmitted with it are
confidential and intended solely for the use of the individual or
entity to whom it is addressed. The views stated herein do not
necessarily represent the view of the company. If you are not the
intended recipient of this e-mail you may not copy, forward,
disclose, or otherwise use it or any part of it in any form
whatsoever. If you have received this e-mail in error please
e-mail the sender.
******************************************************************

attached mail follows:


Hey Everyone,

I have a couple of questions I'd like to ask:

1.) Are there built in libraries to connect to DB2?
Nothings clear from the documentation I've read. I see
that there's libraries for Oracle, Informix, MySQL.

2.) If there is a DB2 library(support or whatever its
called, someone enlighten me please with the correct
term!) does anyone know if the Red Hat rpm comes with
the option to support this turned on?

3.) I'm just coming across some information about
PEAR. My question to this: Is it better to use PEAR
than the regular libraries included?

Anything else anyone could tell me would be great!

Thanks,

James
RHCE

__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

attached mail follows:


    Hi there!

        I'm trying to make a GZip compressed file with some files in it.
        But i'm only getting a foo.gz with a file foo in it an foo contains
the data of
        all files in $this->_Files. I need foo.gz with a file and its
content for each $this->_Files.

        $fp = gzopen('foo.gz', 'wb9')