php-general Digest 5 Nov 2005 18:23:11 -0000 Issue 3777

Topics (messages 225136 through 225166):

Re: No forums?
        225136 by: Robert Cummings
        225138 by: GamblerZG
        225139 by: GamblerZG
        225140 by: GamblerZG
        225141 by: Robert Cummings
        225143 by: GamblerZG
        225145 by: Robert Cummings
        225156 by: James Benson
        225158 by: Pranav Negandhi (concept-I)
        225159 by: Larry E. Ullman
        225161 by: Death Gauge

match by relevancy
        225137 by: John Taylor-Johnston
        225142 by: GamblerZG

Re: dependable combo boxes with mysql database
        225144 by: Bhoomi Vora
        225157 by: Pranav Negandhi (concept-I)

How to read Byte Stream
        225146 by: kumar kumar

Re: Sessions and register_long_arrays
        225147 by: Marcus Bointon

How can I track the value in php
        225148 by: shining
        225153 by: James Benson

Re: Register Globals (more)
        225149 by: Bogdan Ribic

Adding to a numeric variable, how?
        225150 by: Dotan Cohen
        225151 by: Paul Waring
        225152 by: Dotan Cohen

Re: to the freelancers!!
        225154 by: James Benson

Re: PHP 4.4.1 on Apache 2.0.x issue
        225155 by: James Benson
        225160 by: Max Belushkin
        225162 by: James Benson
        225166 by: Max Belushkin

Re: Register Globals
        225163 by: Unknown Unknown

Re: PGP 5 start up issue
        225164 by: Unknown Unknown
        225165 by: Unknown Unknown

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 ---
On Sat, 2005-11-05 at 00:56, GamblerZG wrote:
> Miles Thompson wrote:
> > You missed the most important:   This list works, why break it?
> 
> Nope, I did not miss it. It's just not a proper reply to the message. I 
> did not suggest to disable mailing lists or change them in any way, so 
> the "break" factor does not apply.

Then you suggest fragmenting the list into 3 factions, those who would
continue to use the list, those who would use the forum, and those who
would use both. By such a fragmentation of the list, solutions and
advice would be spread across multiple locations thus diluting the
efficacy of the list.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
Larry E. Ullman wrote:
> One of the fallacies in your argument is that the lack of an official
> forum on php.net implies "such distaste for message boards". I don't
> have a big screen TV but I have anything but distaste for them!

Well, let me give you a different example. I don't have a TV at all, even though I could buy one. Knowing this, would you assume that I don't like watching it?

The same thing with forum. It's a usual feature, just like website is. Would you be surprised if PHP had no website? Would you ask why it doesn't?

> Also, you should realize that your question could be rephrased as "Why
> hasn't someone else done all this extra work (creating and  managing a
> forum) because I would prefer it?"

Are you saying that I'm the only PHP user that might like discussing things on a forum? Again, forums are very common. Some people like them, other people like mailing lists. In case of PHP, I find the lack of forum weird, because it's a web development language.

Besides, you're implying that maintaining forum is "extra work", while maintaining mailing lists isn't. Extra work for extra users you can live without, eh?

> In any case, if you are sincerely interested in either a support Web
> forum or a legitimate answer to your question, you may have better  luck
> if your inquiry were more "I would appreciate it if..." or "has  an
> official forum been considered?" and less "this system that you've been
> using for years sucks and this is why I'm right".

I do not see anything horrible in my message. It's not like I'm _demanding_ something, or suggesting to tear down mailing lists. Neither did I suggest that mailing lists suck. In case of php.internals they totally make sense. But I _do_ think that forum efficient in case of high-volume messaging.

--
Best regards,
Roman S.I.

http://sf.net/projects/naturalgine/

--- End Message ---
--- Begin Message ---
Robert Cummings wrote:
> On Sat, 2005-11-05 at 00:56, GamblerZG wrote:
>
>>Miles Thompson wrote:
>>
>>>You missed the most important:   This list works, why break it?
>>
>>Nope, I did not miss it. It's just not a proper reply to the message. I
>>did not suggest to disable mailing lists or change them in any way, so
>>the "break" factor does not apply.
>
>
> Then you suggest fragmenting the list into 3 factions, those who would
> continue to use the list, those who would use the forum, and those who
> would use both. By such a fragmentation of the list, solutions and
> advice would be spread across multiple locations thus diluting the
> efficacy of the list.

I seriously doubt that giving people a choice over communication methods would reduce efficiency. It's like saying that having multiple OSes reduces efficiency of programming.

--
Best regards,
Roman S.I.

http://sf.net/projects/naturalgine/

--- End Message ---
--- Begin Message --- PS: Sorry for missing verbs and articles in my last message. I have a good excuse: it't 2:22 AM here. *smilie*

--
Best regards,
Roman S.I.

http://sf.net/projects/naturalgine/

--- End Message ---
--- Begin Message ---
On Sat, 2005-11-05 at 02:17, GamblerZG wrote:
> Robert Cummings wrote:
>  > On Sat, 2005-11-05 at 00:56, GamblerZG wrote:
>  >
>  >>Miles Thompson wrote:
>  >>
>  >>>You missed the most important:   This list works, why break it?
>  >>
>  >>Nope, I did not miss it. It's just not a proper reply to the message. I
>  >>did not suggest to disable mailing lists or change them in any way, so
>  >>the "break" factor does not apply.
>  >
>  >
>  > Then you suggest fragmenting the list into 3 factions, those who would
>  > continue to use the list, those who would use the forum, and those who
>  > would use both. By such a fragmentation of the list, solutions and
>  > advice would be spread across multiple locations thus diluting the
>  > efficacy of the list.
> 
> I seriously doubt that giving people a choice over communication methods 
> would reduce efficiency. It's like saying that having multiple OSes 
> reduces efficiency of programming.

I didn't use the word efficiency, I used the word efficacy (feel free to
look it up).

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
Robert Cummings wrote:
On Sat, 2005-11-05 at 02:17, GamblerZG wrote:

Robert Cummings wrote:
> On Sat, 2005-11-05 at 00:56, GamblerZG wrote:
>
>>Miles Thompson wrote:
>>
>>>You missed the most important:   This list works, why break it?
>>
>>Nope, I did not miss it. It's just not a proper reply to the message. I
>>did not suggest to disable mailing lists or change them in any way, so
>>the "break" factor does not apply.
>
>
> Then you suggest fragmenting the list into 3 factions, those who would
> continue to use the list, those who would use the forum, and those who
> would use both. By such a fragmentation of the list, solutions and
> advice would be spread across multiple locations thus diluting the
> efficacy of the list.

I seriously doubt that giving people a choice over communication methods would reduce efficiency. It's like saying that having multiple OSes reduces efficiency of programming.


I didn't use the word efficiency, I used the word efficacy (feel free to
look it up).

Cheers,
Rob.

They're synonyms, and I do not see a big difference in their meanings. Feel free to disambiguate.

--
Best regards,
Roman S.I.

http://sf.net/projects/naturalgine/

--- End Message ---
--- Begin Message ---
On Sat, 2005-11-05 at 02:37, GamblerZG wrote:
> Robert Cummings wrote:
> > 
> > I didn't use the word efficiency, I used the word efficacy (feel free to
> > look it up).
> 
> They're synonyms, and I do not see a big difference in their meanings. 
> Feel free to disambiguate.

Efficiency is about output versus input. Efficacy is about the ability
to produce an effect regardless of input. While there is obviously a
degree of overlap in their meaning, and while they can be considered
synonyms due to that overlap, they are not the same. Just as gargantuan
and large are synonyms, they are hardly the same thing in context. As
any English teacher will tell you, rampantly replacing words in an essay
with synonyms will quickly devolve the meaning into drivel.

So now that I've cleared that up, the point I was making in a lot less
words, is that by splitting the list into multiple places, one could
expect less solutions to be in either place, and while the sum of the
parts will probably be equal to the whole, the information would be
dispersed and diluted thus reducing the effectiveness (not efficiency
though I'm sure that would be reduced also) of both locations.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message --- Since when is a forum more efficent than this newsgroup, forums tend to be more images/content and require more maintainance, this newsgroup is perfect for me and many other people I imagine.







GamblerZG wrote:
AFAIK, there are no "official" forums for PHP. Considering the fact that PHP is a web development tool, such distaste for message boards is ironic at the least. So why exactly there aren't any forums on php.net?

I've monitored this list long enough to predict the most probable replies to this message. To save everybody some time, I will ansver them here, without waiting someone to key them in.

Reply: There are forums on zend.com.
My Reply: zend.com != php.com.


lol, too right, php.com is nothing to do with PHP or zend.com is nothing to do with php.com :-)



R: There is a web interface for this mailing list.
MR: You cant' post new messages there, and it's just another way of showing emails anyway.

R: There is a newsgroup interface.
MR: Yeah, I'm using it right now. But it requires special software, and is terribly slow, unless you have very good connection and moderately powerful PC.



Most desktop systems come with an email client as standard so what special software is required!


R: Forums suck, mailing lists rule.
MR: Not if you don't like receiving 200 messages + spam every day.



If you bother to look when suscribing you would notice two choices,

1. Digest
2. Normal
The first being the one where you get emails, the second is for those who just open their mail client at their own leisure,



R: Synchronizing mail lists and forums is very difficult and nobody will do it.
MR: There is no need to synchronize anything.


--- End Message ---
--- Begin Message --- Funny. I _ditched_ forums in order to sign onto this list. It's way too much of an effort for me to log in to a website every time. Lists work with quiet efficiency (not efficacy, I suppose) in the background without needing me to refresh the page every 5 minutes.

My $0.2.

Pranav
www.concept-i.co.in

GamblerZG wrote:
AFAIK, there are no "official" forums for PHP. Considering the fact that PHP is a web development tool, such distaste for message boards is ironic at the least. So why exactly there aren't any forums on php.net?

I've monitored this list long enough to predict the most probable replies to this message. To save everybody some time, I will ansver them here, without waiting someone to key them in.

Reply: There are forums on zend.com.
My Reply: zend.com != php.com.

R: There is a web interface for this mailing list.
MR: You cant' post new messages there, and it's just another way of showing emails anyway.

R: There is a newsgroup interface.
MR: Yeah, I'm using it right now. But it requires special software, and is terribly slow, unless you have very good connection and moderately powerful PC.

R: Forums suck, mailing lists rule.
MR: Not if you don't like receiving 200 messages + spam every day.

R: Synchronizing mail lists and forums is very difficult and nobody will do it.
MR: There is no need to synchronize anything.


--- End Message ---
--- Begin Message ---
> One of the fallacies in your argument is that the lack of an official
> forum on php.net implies "such distaste for message boards". I don't
> have a big screen TV but I have anything but distaste for them!

Well, let me give you a different example. I don't have a TV at all, even though I could buy one. Knowing this, would you assume that I don't like watching it?

No, I wouldn't, as my point is that the lack of something doesn't imply _any_one_thing_. There are many reasons why something may or may not exist. Assuming that there is "such distaste for message boards" is fallacious (as would be my assuming you don't like TV).

The same thing with forum. It's a usual feature, just like website is. Would you be surprised if PHP had no website?

Yes, I would, particularly as I've been going to it for years. Finding out that PHP had no website would definitely mess with my perception of reality. But I disagree with your theory that having a forum is implied by the technology. PHP is open source, so the fact that ANYBODY freely supports it in any way is just plain nice.

> Also, you should realize that your question could be rephrased as "Why > hasn't someone else done all this extra work (creating and managing a
> forum) because I would prefer it?"

Are you saying that I'm the only PHP user that might like discussing things on a forum?

I'm pretty sure I didn't say that but I'll have to check my notes. I'm saying that you seem to be incredulous over the lack of something which you think makes sense. But my point is that there can be any number of reasons why php.net does not have a forum so the lack need not be "ironic". In fact, that lack may even make sense (at least to those that run the Web site).

Besides, you're implying that maintaining forum is "extra work", while maintaining mailing lists isn't. Extra work for extra users you can live without, eh?

Eh? What? Well, it IS extra work. The mailing list exists and, many believe, work just fine. Doing more than what is currently being done is "extra", right? Or "more"? I'm almost positive about that.

Larry

--- End Message ---
--- Begin Message --- Forums and mailinglists like this are about the same. Forums has image content though while mailing lists just have text content. You get the same replies as you would with the other so be happy that they at least have this mailing list and don't just say "Here is PHP and have fun learning it without our help."

Side question: Larry Ullman: You wouldn't happen to be the same Mr. Ullman that wrote the PHP&MySQL For Dynamic Web Sites?

--Death Gauge
"How do you gauge your death?!"

_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement
--- End Message ---
--- Begin Message --- I'm using PHP Version 4.3.9 and MySQL 4.1.12. I recently upgraded from PHP 4.1.x and MySQL 4.0.x. Basically my SQL below now render empty set. It worked until my upgrade. Basically "ORDER BY relevancy DESC" no longer works, I think!?

I got help building this $SQL here, so I'm hoping Sgt./Corporal what's his name, who answered my original question, is still around. Sorry to be off topic. I see no inpsiration in the relevant part of the Doc: http://dev.mysql.com/doc/refman/4.1/en/fulltext-search.html nor http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html

Desperately looking for an answer. Any thoughts?

SELECT *,MATCH (AU,ST,SD)
AGAINST ('johnston' IN BOOLEAN MODE)
AS relevancy FROM ccl.ccl_main
WHERE MATCH (AU,ST,SD)
AGAINST ('johnston' IN BOOLEAN MODE)
ORDER BY relevancy DESC;

John

--- End Message ---
--- Begin Message ---
John Taylor-Johnston wrote:
I'm using PHP Version 4.3.9 and MySQL 4.1.12. I recently upgraded from PHP 4.1.x and MySQL 4.0.x. Basically my SQL below now render empty set. It worked until my upgrade. Basically "ORDER BY relevancy DESC" no longer works, I think!?

I got help building this $SQL here, so I'm hoping Sgt./Corporal what's his name, who answered my original question, is still around. Sorry to be off topic. I see no inpsiration in the relevant part of the Doc: http://dev.mysql.com/doc/refman/4.1/en/fulltext-search.html nor http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html

Desperately looking for an answer. Any thoughts?

SELECT *,MATCH (AU,ST,SD)
AGAINST ('johnston' IN BOOLEAN MODE)
AS relevancy FROM ccl.ccl_main
WHERE MATCH (AU,ST,SD)
AGAINST ('johnston' IN BOOLEAN MODE)
ORDER BY relevancy DESC;

John

Hm... You're using literal string 'johnston' for matching. Shouldn't quotes be replaced with backticks (`)?

--
Best regards,
Roman S.I.

http://sf.net/projects/naturalgine/

--- End Message ---
--- Begin Message ---
Hello,

Thanks for the reply. But I do not know how to
integrate javascript with php and mysql. I mean
javascript can be written using <script
language=javascript>....code....</script> and fetching
data from mysql is using $query,$result and
$mysql_fetch_array. I am confused how to integrate
this in php page.

If anybody can help on this i will highly appreciate
it, otherwise if this is not the proper question for
this list then i have to go for other options.

Thanks and regards,

Bhoomi

--- "Pranav Negandhi (concept-I)"
<[EMAIL PROTECTED]> wrote:

> This might be slightly OT on this list, but here
> goes nothing.
> 
> 1. Submit the form when the user shifts focus from
> D1 using Javascript's 
> onBlur event
> 2. On the server side, use PHP to retrieve the
> values for D2 and 
> generate the page again
> 3. Repeat 1 & 2 when the value of D2 changes.
> 
> HTH
> Pranav
> www.concept-i.co.in
> 
> 
> Bhoomi Vora wrote:
> > Hello All,
> > 
> > I have a php page which contains three combo
> boxes.
> > The first one will have the value 
> > 
> > from the mysql database table on page load itself.
> > 
> > Then depending upon the value selected in the
> first
> > combobox the second combo box 
> > 
> > should be populated with the respective values
> from
> > another mysql database table, and 
> > 
> > once again depending upon the value selected in
> second
> > combobox the third combobox 
> > 
> > should be populated with the respective values
> from
> > one more different database table.
> > 
> > I have read through mailing list and also searched
> in
> > google and found that it can be 
> > 
> > done with javascript onblur function but nothing
> is
> > working. Here is the code:
> .....d similarly
> > D3 should be populated on event like 'onblur' to
> D2.
> > 
> > Pl. give me the exact code or proper guideline how
> > should I accomplish this on the same page.
> > 
> > Appreciate your replies.
> > 
> > Thanks and regards.
> > 
> > BJV
> > 
> > 
> >             
> > __________________________________ 
> > Yahoo! FareChase: Search multiple travel sites in
> one click.
> > http://farechase.yahoo.com
> > 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 



        
                
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

--- End Message ---
--- Begin Message --- It's simply a matter of echoing HTML/ JS statements in PHP. The easiest way to integrate JS into a PHP page is like this -

<?php
        // PHP CODE HERE
        print("<script src=""functions.js""/>")
        // CONTINUE PHP CODE HERE
?>

All your JS code is to be put into the functions.js file. Watch for the correct relative path.

You could also use this method -

<?php
        // PHP CODE HERE
?>
<script src="functions.js"/>
<?php
        // CONTINUE PHP CODE
?>

This is all email-code. There may be some syntax errors, which you'll have to fix at your end. But the gist remains the same. I'd suggest you also spend some time reading the HTML output from your PHP code. It's the best way to learn.

Regards,
Pranav
www.concept-i.co.in

Bhoomi Vora wrote:
Hello,

Thanks for the reply. But I do not know how to
integrate javascript with php and mysql. I mean
javascript can be written using <script
language=javascript>....code....</script> and fetching
data from mysql is using $query,$result and
$mysql_fetch_array. I am confused how to integrate
this in php page.

If anybody can help on this i will highly appreciate
it, otherwise if this is not the proper question for
this list then i have to go for other options.

Thanks and regards,

Bhoomi

--- "Pranav Negandhi (concept-I)"
<[EMAIL PROTECTED]> wrote:


This might be slightly OT on this list, but here
goes nothing.

1. Submit the form when the user shifts focus from
D1 using Javascript's onBlur event
2. On the server side, use PHP to retrieve the
values for D2 and generate the page again
3. Repeat 1 & 2 when the value of D2 changes.

HTH
Pranav
www.concept-i.co.in


Bhoomi Vora wrote:

Hello All,

I have a php page which contains three combo

boxes.

The first one will have the value
from the mysql database table on page load itself.

Then depending upon the value selected in the

first

combobox the second combo box
should be populated with the respective values

from

another mysql database table, and
once again depending upon the value selected in

second

combobox the third combobox
should be populated with the respective values

from

one more different database table.

I have read through mailing list and also searched

in

google and found that it can be
done with javascript onblur function but nothing

is

working. Here is the code:

.....d similarly

D3 should be populated on event like 'onblur' to

D2.

Pl. give me the exact code or proper guideline how
should I accomplish this on the same page.

Appreciate your replies.

Thanks and regards.

BJV


                
__________________________________ Yahoo! FareChase: Search multiple travel sites in

one click.

http://farechase.yahoo.com


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






        
                
__________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com


--- End Message ---
--- Begin Message ---
Hi

I am Software Engineer in hyderabad . if possible i
need some help in PHP.
 
we are developing one applet that will upload the
files/folders upto 2gb . the applet will send the file
in bytes stream via http . At server side the PHP has
to receive the file bytes stream and as to write the
file in server system . with the file path preserve .
 
 
i tried this code to get some idea
  
    $request  =  new
Java("javax.ServletRequest",$req);
    $request -> getInputStream();
  
  $in =  $new
Java("javax.servlet.ServletInputStream",$in);
    $byte[] =  new Java("java.lang.byte",$line);
    
    $bytes = 0;
   
    new Java("java.io.FileOutputStream", $fileOutS)
   
    $fileOutS = new Java(
FileOutputStream($dir$file));
     while(0 <($bytes = in ->read($line))){
    
     $fileOutS->write($line,0, $bytes);
     }    
its not working . and the requirment is also not to
use java extension . i have to develop it with out
java extension .
your Help is appreciated Greatly
 
Thanking you
With Regards
Praveen

 




        
                
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

--- End Message ---
--- Begin Message ---
On 5 Nov 2005, at 00:25, Unknown Unknown wrote:

how do you reference the sessions? do you refrence them *with* the old arrays? because that would obviously be a problem

No, obviously that would be dumb! There is no mention of the old style HTTP_*_VARS arrays anywhere in my code. Smarty does use them by default, but I've turned that off. I'm also avoiding old-style session_register, only using current functions like session_start, session_name, session_destroy and putting everything in $_SESSION.

Someone pointed me at his bug:

http://bugs.php.net/bug.php?id=34542

I've been trying to come up with a small test case but no luck so far (so the bug remains with feedback status). xdebug is now working under 5.1RC5-dev but it doesn't trace quite how I thought it did. I suspect we might have more bug reports if more people were turning register_long_arrays off!

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

--- End Message ---
--- Begin Message ---
Hi,
I am php beginner, I have a question:
in my index page, I firstly inlcude_once a A.php file, where i defined an
array, secondly I include another .php file named B.php, where I want to use
the array, I have claimed it as global type, but it seems I can't retrieve
any value from the array.
So I want to ask:
1. Is my use way right?
2. if I want to track a variable value how it changed between php functions,
besides I print out it's value, Is there any other way to do it?
 Any suggestion and solution welcomed!
Thanks in advance.

--- End Message ---
--- Begin Message --- Try reading the PHP manual, people put in lots of effort for newcomers to learn the PHP language.

http://php.net/array



To access a single array value:-

$myArray = array('email' => '[EMAIL PROTECTED]');

echo $myArray['email'];


Above would display:- [EMAIL PROTECTED]



James




shining wrote:
Hi,
I am php beginner, I have a question:
in my index page, I firstly inlcude_once a A.php file, where i defined an
array, secondly I include another .php file named B.php, where I want to use
the array, I have claimed it as global type, but it seems I can't retrieve
any value from the array.
So I want to ask:
1. Is my use way right?
2. if I want to track a variable value how it changed between php functions,
besides I print out it's value, Is there any other way to do it?
 Any suggestion and solution welcomed!
Thanks in advance.


--- End Message ---
--- Begin Message ---
John Taylor-Johnston wrote:


How do I rebuild this peice of code to be register_globals=off friendly?
Just when I thought I was getting good. This keeps up, I'm changing back the php.ini myself.

John


If your code absolutley needs register_globals and you don't have the time to rewrite it, do this:

@import_request_variables('GPC', '');

Note that @ is there to suppress error message about non-recommended usage of the function, ie no prefix.

--

   Open source PHP code generator for DB operations
   http://sourceforge.net/projects/bfrcg/

--- End Message ---
--- Begin Message ---
I have a number that I need to display, and itself plus 2:
<?php
$number=23;
$new_number=$number+2;
print $number." ".$new_number."\n";
?>
//
23 25
//

How can I shorten it to something like this:
<?php
print $number." ".$number+2."\n";
?>

Obviously, the above code doesn't do what I want, but I think that it
describes what I need! Thanks in advance.

Dotan Cohen
http://song-lirics.com/sl/artist/498/violent-femmes-lirics.php

--- End Message ---
--- Begin Message ---
On Sat, Nov 05, 2005 at 01:23:01PM +0200, Dotan Cohen wrote:
> How can I shorten it to something like this:
> <?php
> print $number." ".$number+2."\n";
> ?>

Try:

<?php
        print $number . ' ' . ($number + 2) . "\n";
?>

I think putting the $number + 2 in brackets will cause PHP to evaluate
that part of the expression before printing it.

Paul

-- 
Rogue Tory
http://www.roguetory.org.uk

--- End Message ---
--- Begin Message ---
On 11/5/05, Paul Waring <[EMAIL PROTECTED]> wrote:
> On Sat, Nov 05, 2005 at 01:23:01PM +0200, Dotan Cohen wrote:
> > How can I shorten it to something like this:
> > <?php
> > print $number." ".$number+2."\n";
> > ?>
>
> Try:
>
> <?php
>         print $number . ' ' . ($number + 2) . "\n";
> ?>
>
> I think putting the $number + 2 in brackets will cause PHP to evaluate
> that part of the expression before printing it.
>
> Paul
>
> --
> Rogue Tory
> http://www.roguetory.org.uk
>

Thanks, that did it!

Dotan
http://song-lirics.com/sl/artist/321/madonna-lirics.php

--- End Message ---
--- Begin Message --- Some companies charge for support and still make money from their open source projects!




bruce wrote:
Hi,

Just a quick question. Had a conversation with a person who works for a
non-profit, and she was describing some of her dealings with obtaining
grants for the development of 'open source' apps.Got me to thinking. If a
company sponsored the initial development of an 'open source' kind of app
(the exact licensing would need to be fleshed out) what do yout think would
be the response of people to work on the apps..

I started to wnoder if there would be a pool of talented people who would be
interested in working on projects that are initially funded. The funding
would go to pay the resources, set up the project, do initial grass roots
marketing, etc... The idea would be to focus in on the
projects/technologies/apps that a given business would agree to initially
support/fund.

Thoughts/comments/etc...

-bruce
[EMAIL PROTECTED]

ps. I'm not talking about a freshmeat.net/sourceforge kind of environment.
The obvious goal of this kind of process would be to turn small
applications/projects into profitable applications. My curiousity is whether
you could then create applications/services that could be built along the
same model as nagios/mysql/etc.. where you have a free/open version, as well
as a fee based application/service.

--- End Message ---
--- Begin Message ---
Try using require_once or include_once



Max Belushkin wrote:
   Hi list,

after upgrading to PHP 4.4.1, I'm having the following problem: Apache is running in prefork mode. index.php includes func.php, which defines some functions and connects to MySQL. For a while (1-2 requests) everything runs ok, except mysql sockets keep stacking up. And then - wham, suddenly, I'm getting errors:


Perhaps your using persistent connections, Ive had problems like this so turn off persistent connection in php.ini and it goes away - could be your prob!


Cannot redeclare mquery() (previously declared in /home/test/func.php:9) in /home/test/func.php on line 9

If I wait a few seconds, it "works" for a couple of requests again. And then the error is back.

What on EARTH is happening? My wild guess is, somehow the memory gets shared, and the previous script is still loaded into a thread when the new one is called, but how can this be happening?

  I would greatly appreciate any advice...

--- End Message ---
--- Begin Message ---
> Try using require_once or include_once
Well, here's all the fun starting. This is relatively long, but please bear 
with me.
First of all, yes, I did include_once, require_once, even resorted to "if (!
$inc_done) include_once("func.php")", and setting $inc_done in func.php. 
No-go, was still getting the "Cannot redefine mquery()" error message.
Now for the fun.
I've had a different set of scripts employing a different "func.php". Let's 
say, for simplicity, /home/test1/index.php included /home/test1/func.php, 
and /home/test2/index.php included /home/test2/func.php. However, in both of 
those, mquery() is defined. But they do *not* include anything else, and the 
paths where set as written above. And, what do you know? If I worked inside 
test1 for a while, and went to test2, I'd get:
Cannot redefine mquery() in /home/test2/func.php line 9 (first defined 
in /home/test1/func.php on line 9). Voila.

  Going through PHP 4.4.1 release notes, I noticed the change stating "fixed a 
memory corruption bug in include()". Now, I don't know how FreeBSD ported the 
PHP code into it's ports tree, but for me, on FreeBSD 5.1, PHP 4.4.1 
*introduced* a memory corruption bug in include.

  I downgraded to 4.4.0, and everything works perfectly fine again.

  I've written to the freebsd-questions mailing list, but got no sensible 
reply so far (only one was "upgrade the ports that use PHP to newer versions, 
but my own simple set of scripts exhibits this very strange behaviour, so 
it's not a solution).

  I'll wait a few days to see if anyone else in FreeBSD experiences the same 
behaviour (the port was only introduced 2-3 days ago) before posting a bug 
report, else if no one else sees the same thing I did, I'll have to dig 
through PHP code to see what was modified in the include()-related code, I 
guess, and see what influences the behaviour I'm seeing...

  Comments?

--- End Message ---
--- Begin Message ---


Max Belushkin wrote:
Try using require_once or include_once

Well, here's all the fun starting. This is relatively long, but please bear with me.
First of all, yes, I did include_once, require_once, even resorted to "if (!
$inc_done) include_once("func.php")", and setting $inc_done in func.php. No-go, was still getting the "Cannot redefine mquery()" error message.
Now for the fun.
I've had a different set of scripts employing a different "func.php". Let's say, for simplicity, /home/test1/index.php included /home/test1/func.php, and /home/test2/index.php included /home/test2/func.php. However, in both of those, mquery() is defined. But they do *not* include anything else, and the


So you defined mquery() in both files and one include's or require's the other file?


If so thats your problem, you cannot re-define functions



paths where set as written above. And, what do you know? If I worked inside test1 for a while, and went to test2, I'd get: Cannot redefine mquery() in /home/test2/func.php line 9 (first defined in /home/test1/func.php on line 9). Voila.

Going through PHP 4.4.1 release notes, I noticed the change stating "fixed a memory corruption bug in include()". Now, I don't know how FreeBSD ported the PHP code into it's ports tree, but for me, on FreeBSD 5.1, PHP 4.4.1 *introduced* a memory corruption bug in include.

  I downgraded to 4.4.0, and everything works perfectly fine again.

I've written to the freebsd-questions mailing list, but got no sensible reply so far (only one was "upgrade the ports that use PHP to newer versions, but my own simple set of scripts exhibits this very strange behaviour, so it's not a solution).

I'll wait a few days to see if anyone else in FreeBSD experiences the same behaviour (the port was only introduced 2-3 days ago) before posting a bug report, else if no one else sees the same thing I did, I'll have to dig through PHP code to see what was modified in the include()-related code, I guess, and see what influences the behaviour I'm seeing...

  Comments?

--- End Message ---
--- Begin Message ---
On Saturday 05 November 2005 17:49, James Benson wrote:
> > I've had a different set of scripts employing a different "func.php".
> > However, in both of those, mquery() is defined. But
> > they do *not* include anything else, and the

> So you defined mquery() in both files and one include's or require's the
> other file?

  I'm sorry, but what wasn't clear in my post? A *separate* set of scripts 
includes a *separate* "func.php", and even not by relative, but by absolute 
paths! Example:
/home/test1/index.php:
<?php include ("/home/test1/func.php"); ?>
/home/test2/index.php:
<?php include ("/home/test2/func.php"); ?>

Both func.php are the same, defining a function mquery, which connects to 
mysql, and returns.

  After working with the index.php in Test1 until I get the "Cannot redefine 
error", I go to test2, and I get the error that *that function was defined 
in /home/test1/func.php". Test1, while I'm in Test2, and that never ever ever 
ever (...) includes *anything* from Test1. So the *Test1* func.php is still 
sitting somewhere in memory in the thread test2 is being loaded on - thus, 
include_once does not help, as the test2 func.php is NOT included. The weird 
thing is, $inc_done isn't defined either for the PHP thread, as when I tried 
the piece of code I quoted in my last message, the include_once still went 
through.

  How can this be happening? I do not know, but since a downgrade to 4.4.0 
fixed it all back proper, I am seriously beginning to suspect a problem or 
undocumented (widely documented, at least) change in PHP 4.4.1 on FreeBSD 
ports.

--- End Message ---
--- Begin Message ---
why not
extract($_POST);
and use your old code or somthing like that,
same thing really if code don't work

--- End Message ---
--- Begin Message ---
On 11/4/05, Vizion <[EMAIL PROTECTED]> wrote:
>
> php 5 on windows xp with apache 2 and mysql 5.
>
> Php start up unable to load dynamic library:
> E:\php\ext\php_bz2.dll with error 'The specified module could not be
> found'
> same for and php_yaz.dll
> I have php5ts.dll in both E:\php\ and E:\php\ext
>
> I had a similar problem for php_mcrypt which was solved by installing
> libmcrypt.dll in E:\windows\system32 but I just cannot seem to solve the
> problems with these two.
>
> I tried copying versions of yaz.dll and php_yaz.dll from
> http://www.indexdata.dk/phpyaz but to no avail. That only screwed up php 5
> because those versions seemed to be looking for php4ts.dll rather than
> php5ts.dll so I seemed to have got stumped.
>
> Can anyone help out?
>
> Thanks in advance
>
> david
>
>
>
> --
> 40 yrs navigating and computing in blue waters.
> English Owner & Captain of British Registered 60' bluewater Ketch S/V
> Taurus.
> Currently in San Diego, CA. Sailing bound for Europe via Panama Canal
> after
> completing engineroom refit.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>  i recommend you change php.ini and make the extensions folder e:\php\ or
whatever you use, it would probably fix the problem

--- End Message ---
--- Begin Message ---
On 11/5/05, Unknown Unknown <[EMAIL PROTECTED]> wrote:
>
>
>
> On 11/4/05, Vizion <[EMAIL PROTECTED]> wrote:
> >
> > php 5 on windows xp with apache 2 and mysql 5.
> >
> > Php start up unable to load dynamic library:
> > E:\php\ext\php_bz2.dll with error 'The specified module could not be
> > found'
> > same for and php_yaz.dll
> > I have php5ts.dll in both E:\php\ and E:\php\ext
> >
> > I had a similar problem for php_mcrypt which was solved by installing
> > libmcrypt.dll in E:\windows\system32 but I just cannot seem to solve the
> >
> > problems with these two.
> >
> > I tried copying versions of yaz.dll and php_yaz.dll from
> > http://www.indexdata.dk/phpyaz but to no avail. That only screwed up php
> > 5
> > because those versions seemed to be looking for php4ts.dll rather than
> > php5ts.dll so I seemed to have got stumped.
> >
> > Can anyone help out?
> >
> > Thanks in advance
> >
> > david
> >
> >
> >
> > --
> > 40 yrs navigating and computing in blue waters.
> > English Owner & Captain of British Registered 60' bluewater Ketch S/V
> > Taurus.
> > Currently in San Diego, CA. Sailing bound for Europe via Panama Canal
> > after
> > completing engineroom refit.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >  i recommend you change php.ini and make the extensions folder e:\php\
> or whatever you use, it would probably fix the problem
>
  oh and also check spelling and if windows has read/write/execute
permissions make sure there is proper persmissions

--- End Message ---

Reply via email to