php-general Digest 12 Feb 2006 01:33:00 -0000 Issue 3958
Topics (messages 230250 through 230260):
Re: SQL request on DBase file...
230250 by: David BERCOT
Re: Oracle buying out Zend ... how does that affect PHP?
230251 by: Kevin Kinsey
Re: how to learn php
230252 by: tedd
230254 by: phpnet.sanctuarytech.com
230256 by: Weber Sites LTD
230257 by: Kevin Kinsey
scope of classes in PHP
230253 by: Stuart Bailey
Re: Weirdness with PHP FreeBSD/OSX/Linux headers already sent
230255 by: Eric Butera
Re: <Newbie Question> Can't insert values into MySQL DB via PHP
230258 by: Duggles Temple
Re: Clone of the concurrent users limit of Zend Encoder 4.0 ?
230259 by: Curt Zirzow
unsupported binary characters in database,
230260 by: Mark Steudel
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
> >Hi,
> >
> >I have to rewrite an application from ASP. In this application, I
> >receive DBase files which may be saved into Oracle.
> >In ASP, I used a generic driver and I made SQL requests on these files.
> >It is possible with PHP on Linux ?
> >Do you have some examples ?
> >
> >Thank you very much.
> >
> >David.
>
> Come on -- read the manual. There's a section .dbf files.
Of course I read the manual !!! In fact, there's a section on .dbf
files, but the request mode is sequentiel one...
But I want to do SQL request !!!
And my question is : is it possible with PHP on Linux ? It's easy on
Windows with ASP but I don't know with PHP on Linux. I search a little
bit before sending a mail on the list ;-)
Thank you.
David.
signature.asc
Description: Ceci est une partie de message numériquement signée
--- End Message ---
--- Begin Message ---
Marc G. Fournier wrote:
http://www.businessweek.com/technology/content/feb2006/tc20060209_810527.htm
"Also in Oracle's crosshairs: closely held Zend, based in Cupertino,
Calif.
Zend's PHP software language is one of the most prevalent on the Web,
present in more than 18 million Web sites. The company, which snared
headlines last year when Netscape co-founder Marc Andreessen joined
its board, has been trying to extend its success with the Web into
business applications. Zend could sell for $200 million, according to one
source."
----
Marc G. Fournier Hub.Org Networking Services
(http://www.hub.org)
Email: [EMAIL PROTECTED] Yahoo!: yscrappy ICQ:
7615664
Well, we'd run the risk of <losing?> a good support company and
optimizer.
But the language above is misleading: PHP isn't owned, per se,
by Zend, although Zend is owned or at least was founded by some
pretty big guns on the PHP Devel Team. So the effects might not
be much beyond what I mention above.
It's kind of interesting to speculate, though; and it's good news for
the Zend guys --- nice (for them anyway) when you start "looking
that juicy to the big players", as a friend of mine says.
Makes you wonder if this really isn't a jab against the other DB
companies/orgs --- I could foresee Zend pushing some PHP/Oracle
interface/optimization products within a year or so if this happens....
Kevin Kinsey
--
Reality -- what a concept!
-- Robin Williams
--- End Message ---
--- Begin Message ---
hello
i have been trying to learn php.
what is the best approach to learning php for someone who has no
programming experience?
-snip-
any advice and/or opinions would be greatly appreciated.
thanks.
First, welcome to the language.
Second, I suggest that you find a beginner's book -- if not
hard-copy, then try this:
http://www.unf.edu/~rita0001/eresources/php_tutorials/index.htm
-- and go through all the examples. Write a program that deals with
each example and get it to work.
Now, realize that this is not lost effort because those examples will
become your references for future development. Until those examples
become second nature to you, you'll be looking back at them time and
time again.
I've found that as I code, I build bigger and more specialized
routines/libraries that I incorporate into other projects.
Third, develop a style and stick with it. There are different styles
that help us in reviewing code. Some programmers have the ability to
look at cryptic code and understand it's meaning immediately, while
others require more natural language or verbose syntax. Also, even
the way you indent can help you in reviewing code. There are several
different ways to do that, but you pick something that makes sense to
you and be consistent in it's application.
Fourth, and IMO most important, is to develop a manner of
documentation. This is simply writing notes to the person who will be
reading your code at some point in the future -- which usually is a
smarter you. So, do yourself a favor and impress your future self, by
documenting what you're doing now.
Now, go forth and be fruitful in your coding.
tedd
--
--------------------------------------------------------------------------------
http://sperling.com/
--- End Message ---
--- Begin Message ---
tedd wrote:
hello
i have been trying to learn php.
what is the best approach to learning php for someone who has no
programming experience?
-snip-
any advice and/or opinions would be greatly appreciated.
thanks.
Here's a tutorial I found useful, and would be good for someone without
a programming background as it has good explanations of not only the
code, but the concepts.
http://www.brainbell.com/tutors/php/php_mysql/index.html. I found it
when I started to try to learn authentication. I was having a hard time
wrapping my head around it, and this site took me over the hump!!
This is also on that site, but I haven't really looked at this section.
http://www.brainbell.com/tutorials/php/
Another thing I did was to download the php reference manual to my desk
top so I can easily pull it up. I typically look there first, and if I
still need some help, I will google for code snippets. Then I ask for
help on one of the lists. I don't remember where I got the manual, but
I'm sure someone here can give you a link. Or you can google for it.
jimmy
--- End Message ---
--- Begin Message ---
Btw, if we are talking about tutorials :)
PHP 101 (part 1): Down The Rabbit Hole
http://www.weberdev.com/ViewArticle/433
PHP 101 (part 2): Calling All Operators
http://www.weberdev.com/ViewArticle/435
PHP 101 (part 3): Looping The Loop
http://www.weberdev.com/ViewArticle/436
PHP 101 (part 4): The Food Factor
http://www.weberdev.com/ViewArticle/438
PHP 101 (part 5): Rank And File
http://www.weberdev.com/ViewArticle/440
PHP 101 (part 6): Function-ally Yours
http://www.weberdev.com/ViewArticle/443
PHP 101 (part 7): The Bear Necessities
http://www.weberdev.com/ViewArticle/445
PHP 101 (part 8): Databases and Other Animals
http://www.weberdev.com/ViewArticle/449
More will come...
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Saturday, February 11, 2006 8:28 PM
To: tedd; [email protected]
Subject: Re: [PHP] how to learn php
tedd wrote:
>> hello
>>
>> i have been trying to learn php.
>>
>> what is the best approach to learning php for someone who has no
>> programming experience?
>> -snip-
>>
>> any advice and/or opinions would be greatly appreciated.
>>
>> thanks.
Here's a tutorial I found useful, and would be good for someone without a
programming background as it has good explanations of not only the code, but
the concepts.
http://www.brainbell.com/tutors/php/php_mysql/index.html. I found it when I
started to try to learn authentication. I was having a hard time wrapping
my head around it, and this site took me over the hump!!
This is also on that site, but I haven't really looked at this section.
http://www.brainbell.com/tutorials/php/
Another thing I did was to download the php reference manual to my desk top
so I can easily pull it up. I typically look there first, and if I still
need some help, I will google for code snippets. Then I ask for help on one
of the lists. I don't remember where I got the manual, but I'm sure someone
here can give you a link. Or you can google for it.
jimmy
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
tedd wrote:
hello
i have been trying to learn php.
what is the best approach to learning php for someone who has no
programming experience?
-snip-
any advice and/or opinions would be greatly appreciated.
thanks.
First, welcome to the language.
Second, I suggest that you find a beginner's book --
<snip>
1. If you can do any learning from books (e.g. you were/are
a decent student in whatever educational system you
did/are attend/attending), by all means follow tedd's "Second,"....
Somewhat contrary to the advise "get a book with everything
in it", I found Larry Ullman's "PHP & The World Wide Web"
(PeachPit Press) to be "da bomb" when I decided to learn PHP.
I'll plug him for readability, his explanations, and he was a
fellow Missourian (think he's in California now). I get no
money from PeachPit or Larry for that, though ... ;-)
Keep in mind that there is no way that books can keep up
with real-time development on a language like PHP; the need
for the online manual (or the Windows .chm help files) is also
great.
In particular, I found that Larry's book was mostly
written from a PHP3 POV, but PHP4 was out by the time I
got my hands on it. There were a few differences; sometimes
he made mention of that.
2. Write some code:
<?php
echo "Hello, world!";
?>
3. Read the source code of scripts you can download for free
at sites like hotscripts.com. Then, write something better
(be sure to adhere to any licensing restrictions you find)!
Then, you can start reading source code for bigger projects,
and see how the "big boys" work....
4. Get involved in a PHP developer community (PHPBuilder.com's
forum gets my vote, and, of course, you've joined this mail-list,
I suppose...) and read, read, read, and ask sensible questions.
Read Eric S. Raymond's essay 'How to ask questions the smart
way", if you've not already done so.
So, it's "read, code, and read code; then, ask for help nicely
if you need it!"
Good luck with PHP,
Kevin Kinsey
--
Chicagoan: So, wherere you from?"
Hoosier: "Whats wrong with Indiana?
--- End Message ---
--- Begin Message ---
Hi
I'm developing an app to administer LDAP (phpLdapAdmin is too complex for the
customer).
I have created an LDAP class, in a file class_ldap.php. It include methods for
connecting to the server, binding a DN (effectively login), and adding posix
groups.
I have an index.php with include_once 'class_ldap.php', which allows me to
login using the HTTP authentication mechanism.
The connect method stores the resulting connection resource in a global
variable (included in a config.php file).
When I then go to add the posix group (from add_group.php, that also includes
class_ldap.php), I find that the global connection variable is not valid.
My question is, do I need to connect and authenticate with the LDAP server
every time I want to perform an action, or is there a way to establish a
connection for the user's session, that is cleared when the user logs out.
Many thanks,
Stuart.
--
---------------------------------------
Stuart Bailey BSc (hons) CEng CITP MBCS
LinuSoft (Proprietor)
Linux Specialist
(01953) 601294
(07778) 383739
http://www.linusoft.co.uk
----------------------------------------
--- End Message ---
--- Begin Message ---
To respond I do know the paths to the php.ini for all of the servers I
used. In all of my scripts I turn error_reporting to E_ALL and use a custom
error handler script to deal with errors. I was just looking for the
setting that could cause the problem and its the ouput_buffering directive.
I thought it was something to do with output buffering because the scripts
had been showing random behavior to when it would show the "headers already
sent" message or not. I just didn't realize such a thing existed in the
php.ini because I never hack on it since that is the job of our sysadmin.
Suppose I ought to read up on it to see what other things can or cannot
happen.
I looked at the phpinfo() for the company webserver versus my own and
noticed the output buffer lines are like this:
server:
output_buffering 4096 4096
mine:
output_buffering 0 0
Thanks for the replies!
--- End Message ---
--- Begin Message ---
An update to my (former) problem:
Hi,
I've taken all your advice on debuggin, netequitte and the like.
It works now and I would like to thank you all for your help in my stupidly
newbie question.
Thanks :)
--- End Message ---
--- Begin Message ---
On Sat, Feb 11, 2006 at 12:48:50PM +0800, HoWang Wang wrote:
> HoWang Wang wrote:
> > Hi all,
> >
> > The Zend Encoder 4.0 (beta) have a new function in the license manager
> > which can limit the number of concurrent users. I have wriiten something
> > to work like it. But I found a problem. My script can limit the number
> > of concurrent running script only. When the script ends, there is some
> > data remain in the buffer (of Apache, I think) and the client connection
> > is still active! How can I solve this? Please help, Thanks.
> >
> > Regards
>
> Is it really impossible? Can I do it with Connection Handling?
It is really unclear on exactly what you are doing and i have no
clue what data is remaining in what buffer you think might be the
problem.
> <?php
> set_time_limit(0);
> ignore_user_abort(true);
> // add 1 to the number of concurrent users
> // the rest of code
> while (!connection_aborted()) {
> // keep on locking
> } else {
> // release lock
> }
> ?>
You really dont want to do this. By doing that while loop, you will
do a couple of bad things:
- eating up a lot of CPU usage, of course a sleep in the loop
would probably prevent cpu abuse but still not the ideal way
to do it.
- You will most likely run out of available slots that http has
available.
Curt.
--
cat .signature: No such file or directory
--- End Message ---
--- Begin Message ---
I have the following encryption function:
function RC4( $data) { //ecncrypt $data with the key in $keyfile with an rc4
algorithm
$pwd = implode('', file(/key.php'));
$pwd_length = strlen($pwd);
for ($i = 0; $i < 255; $i++) {
$key[$i] = ord(substr($pwd, ($i % $pwd_length)+1, 1));
$counter[$i] = $i;
}
for ($i = 0; $i < 255; $i++) {
$x = ($x + $counter[$i] + $key[$i]) % 256;
$temp_swap = $counter[$i];
$counter[$i] = $counter[$x];
$counter[$x] = $temp_swap;
}
for ($i = 0; $i < strlen($data); $i++) {
$a = ($a + 1) % 256;
$j = ($j + $counter[$a]) % 256;
$temp = $counter[$a];
$counter[$a] = $counter[$j];
$counter[$j] = $temp;
$k = $counter[(($counter[$a] + $counter[$j]) % 256)];
$Zcipher = ord(substr($data, $i, 1)) ^ $k;
$Zcrypt .= chr($Zcipher);
}
return $Zcrypt;
}
source: zend code gallery
When I encrypt a string that ends in e it shows up as a space in the
database, when I pull it back out of the database, the string is missing the
e. I tried converting the field in the database to a blob and that didn't
work either. My next idea is to add a bin2hex and then a hex2bin:
function hex2bin($hexdata) {
$bindata="";
for ($i=0;$i<strlen($hexdata);$i+=2) {
$bindata.=chr(hexdec(substr($hexdata,$i,2)));
}
return $bindata;
}
source: phil at internetprojectmanagers dot com
I was hoping to get some feedback if this is a good way to go about this.
Thanks, Mark
--- End Message ---