php-general Digest 10 Feb 2009 16:59:28 -0000 Issue 5951

Topics (messages 288053 through 288067):

Re: problem with sending data
        288053 by: Chris

Re: paging
        288054 by: Kevin Waterson
        288059 by: tedd
        288060 by: Jônatas Zechim
        288062 by: Richard Heyes

Re: Generate unique login token
        288055 by: Stuart

Re: require() causing strange characters ?
        288056 by: Nisse Engström

Re: PHP OOP
        288057 by: Ondrej Kulaty
        288058 by: Marcus Gnaß
        288061 by: Carlos Medina
        288063 by: Byron
        288065 by: Andrew Ballard

Looking for some PHP OO programming guides
        288064 by: Michael Kubler
        288066 by: Stuart

Re: Using DLL with PHP
        288067 by: Dan Shirah

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Mousa Masri wrote:
Dear

I have problem with writing large data (large text) in the database or any file 
.
If we try to do, the field in the DB or the file will be empty . (We lose the 
data) .
I mean by large data more them 60 Kbyte .
But if we try to write small text (less then 60K) , the text will be added 
normally in the DB or in the files .

Knowing that all settings are good : max_allowed_packet=10M ; Maximum size of POST data that PHP will accept. post_max_size = 8M
And the DB accept large text normally .

Do you have any Idea how we can solve this problem ?
Or is there any setting i must change it ?

What type of db is it (mysql, pgsql, firebird) ?

What type of field (text, varchar, char, blob) is the one you're trying to write to?

--
Postgresql & php tutorials
http://www.designmagick.com/


--- End Message ---
--- Begin Message ---
On Tue, 2009-02-10 at 03:26 +0000, Jim Douglas wrote:

http://phpro.org/tutorials/Pagination-with-PHP-and-PDO.html
> 
> 
> 
> 
> Does anyone have a link to any examples of paging?


Kevin
http://phpro.org


--- End Message ---
--- Begin Message ---
At 3:26 AM +0000 2/10/09, Jim Douglas wrote:
Does anyone have a link to any examples of paging?


Jim:

Sure.

http://webbytedd.com/bbb/paging/  <-- the code is there

different examples here:

http://webbytedd.com/ccc/pagination

Cheers,

tedd


--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
MySql or MsSql or other dB?

-----Mensagem original-----
De: tedd [mailto:tedd.sperl...@gmail.com] 
Enviada em: terça-feira, 10 de fevereiro de 2009 11:26
Para: Jim Douglas; php-gene...@lists.php.net
Assunto: Re: [PHP] paging

At 3:26 AM +0000 2/10/09, Jim Douglas wrote:
>Does anyone have a link to any examples of paging?


Jim:

Sure.

http://webbytedd.com/bbb/paging/  <-- the code is there

different examples here:

http://webbytedd.com/ccc/pagination

Cheers,

tedd


-- 
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

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


--- End Message ---
--- Begin Message ---
> ...

Hi,

Too lazy to actually read the email (tsk), but there's rather a nice
paging library in PEAR that may help. Imaginitively called "Pager".

-- 
Richard Heyes

HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari:
http://www.rgraph.org (Updated January 31st)

--- End Message ---
--- Begin Message ---
2009/2/10 sean greenslade <zootboys...@gmail.com>:
> I have a login system that I am coding. I need it to generate a unique token
> on login to be stored in the browser's cookie. I currently use a script that
> generates a MD5 hash of the current unix timestamp, then checks the mysql
> database to see if the token already exists. It loops this generate/check
> until it gets a unique token. Is there a better way to do this? I want a
> token that cannot be easiy predicted (i.e. not an auto-increment value).
> Thanks in advance!

I've never had a clash with this on a site with 20m PVPM...

$token = sha1($_SERVER['REMOTE_ADDR'].microtime(true));

-Stuart

-- 
http://stut.net/

--- End Message ---
--- Begin Message ---
On Mon, 9 Feb 2009 15:46:35 +0100, cr.vege...@gmail.com wrote:

> I've tested it again, from scratch with Notepad editor:
> 
> echoUTF8.php        <?php require("echoUTF8sub.php"); ?>
> echoUTF8sub.php   <?php echo "test"; ?>
> and keep getting strange characters.
> 
> Would you be so kind to run these 2 scripts on your pc ?

Works fine for me, probably because my copy of Notepad
is so old it has never heard of Unicode...

Here's another test:

echoUTF8.php:
-------------
<?php require 'echoUTF8sub.php';

echoUTF8sub.php:
----------------
<?php echo "\xef\xbb\xbf", "test\n";  // Manual BOM

When I run this from a browser, I get different output
depend on the server's and browser's default charset,
and PHP's "default_charset" setting.

I get consistent results when I add

  header ('Content-Type: text/plain; charset=utf-8');

to echoUTF8.php.


(When the scripts are run from command-line, the output
 would also depend on the shells ability to handle utf-8.)


/Nisse

--- End Message ---
--- Begin Message ---
I don't think that PHP is good language for teaching OOP as many folks above 
said. I have never programmed in OOP style but i plan to learn it. I started 
in PHP but i was little confused and i am used to program in procedural way 
in PHP, so i've decided to learn some pure OOP language. I am reading a book 
OOP Demystified, there are examples in both C++ and Java. And imo Java code 
is much more readable and understandable. So i think that Java is the best 
for learning OOP. I am also considering learning C#, if you dont mind that 
it's closely related to windows, it might be also a good choice.
-- 

"tedd" <t...@sperling.com> píse v diskusním príspevku 
news:p0624080dc5b5fff1c...@[192.168.1.101]...
> Hi gang:
>
> At the college where I teach, they are considering teaching OOP, but they 
> don't want to settle on a specific language.
>
> My thoughts are it's difficult to teach OOP without a language -- 
> while the general concepts of OOP are interesting, people need to see how 
> concepts are applied to understand how they work -- thus I think a 
> specific language is required
>
> I lean toward C++ because I wrote in it for a few years AND C++ appears to 
> be the most common, widespread, and popular OOP language.
>
> However, while I don't know PHP OOP, I am open to considering it because 
> of the proliferation of web based applications. My personal opinion is 
> that's where all programming is headed anyway, but that's just my opinion.
>
> With that said, what's the differences and advantages/disadvantages 
> between C++ and PHP OOP?
>
> Cheers,
>
> tedd
>
>
> -- 
> -------
> http://sperling.com  http://ancientstones.com  http://earthstones.com 



--- End Message ---
--- Begin Message ---
Paul M Foster wrote:
On Mon, Feb 09, 2009 at 11:02:37AM -0500, tedd wrote:
As a side note, I think students should learn a language like C before
learning something like Perl, Python or PHP. Having to deal with
defining/declaring variables and their storage methods before use I
think makes for more conscientious programmers. And pointers are an
education all on their own. ;-}
For teaching programming or OOP I would choose a language which concentrates on the topic. The hard stuff, which you have to deal with in C for example, can be learned later. I'm glad that I started programming in Pascal, not in C. If today I had to learn programming as such I would definitively opt for Python! My choice for learning OOP would be Python or even better Java cause you don't have the choice to do it in a procedural way.

Marcus

--- End Message ---
--- Begin Message ---
Marcus Gnaß schrieb:
Paul M Foster wrote:
On Mon, Feb 09, 2009 at 11:02:37AM -0500, tedd wrote:
  As a side note, I think students should learn a language like C before
learning something like Perl, Python or PHP. Having to deal with
defining/declaring variables and their storage methods before use I
think makes for more conscientious programmers. And pointers are an
education all on their own. ;-}
For teaching programming or OOP I would choose a language which concentrates on the topic. The hard stuff, which you have to deal with in C for example, can be learned later. I'm glad that I started programming in Pascal, not in C. If today I had to learn programming as such I would definitively opt for Python! My choice for learning OOP would be Python or even better Java cause you don't have the choice to do it in a procedural way.

Marcus
Hi @ all,
but this is a php list...

Regards

Carlos

--- End Message ---
--- Begin Message ---
Where I study, Intro to OOP is taught in C# using Visual Studio 2003 and
further OOP concepts are taught in Java, with the academic computer science
of OOP alongside.

On Wed, Feb 11, 2009 at 2:40 AM, Carlos Medina <i...@simply-networks.de>wrote:

> Marcus Gnaß schrieb:
>
>> Paul M Foster wrote:
>>
>>> On Mon, Feb 09, 2009 at 11:02:37AM -0500, tedd wrote:
>>>  As a side note, I think students should learn a language like C before
>>> learning something like Perl, Python or PHP. Having to deal with
>>> defining/declaring variables and their storage methods before use I
>>> think makes for more conscientious programmers. And pointers are an
>>> education all on their own. ;-}
>>>
>>>
>> For teaching programming or OOP I would choose a language which
>> concentrates on the topic. The hard stuff, which you have to deal with in C
>> for example, can be learned later. I'm glad that I started programming in
>> Pascal, not in C. If today I had to learn programming as such I would
>> definitively opt for Python! My choice for learning OOP would be Python or
>> even better Java cause you don't have the choice to do it in a procedural
>> way.
>>
>> Marcus
>>
> Hi @ all,
> but this is a php list...
>
> Regards
>
> Carlos
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
I'm going out to find myself, if you see me here, keep me here untill I can
catch up

If I haven't said so already,

Thanks
Byron

--- End Message ---
--- Begin Message ---
On Tue, Feb 10, 2009 at 8:40 AM, Carlos Medina <i...@simply-networks.de> wrote:
> Marcus Gnaß schrieb:
>>
>> Paul M Foster wrote:
>>>
>>> On Mon, Feb 09, 2009 at 11:02:37AM -0500, tedd wrote:
>>>  As a side note, I think students should learn a language like C before
>>> learning something like Perl, Python or PHP. Having to deal with
>>> defining/declaring variables and their storage methods before use I
>>> think makes for more conscientious programmers. And pointers are an
>>> education all on their own. ;-}
>>>
>>
>> For teaching programming or OOP I would choose a language which
>> concentrates on the topic. The hard stuff, which you have to deal with in C
>> for example, can be learned later. I'm glad that I started programming in
>> Pascal, not in C. If today I had to learn programming as such I would
>> definitively opt for Python! My choice for learning OOP would be Python or
>> even better Java cause you don't have the choice to do it in a procedural
>> way.
>>
>> Marcus
>
> Hi @ all,
> but this is a php list...
>
> Regards
>
> Carlos
>

Yes, it is, but the original question was about OOP and not
specifically about PHP. It seems fair enough to me for someone to ask
the question on this list since PHP was one of the languages being
considered, even if consensus among the list seems to be that PHP
would not be the best choice for teaching a course on OOP.

Andrew

--- End Message ---
--- Begin Message ---
Hi,
I'm just getting into programming in an Object Oriented fashion, and am looking for some guides, tutorials, hints, tips, etc...

I only just found out that you remove the $ from variables when calling them from $this->

e.g :
<?php
class People
{
private $person = "not set";
   function __construct()
   {
*$person* = "A person"; //This doesn't work (well it creates a variable $person that only has the scope of the current function from what I can gather)..
    $this->*person* = "A person"; //This works properly
    }
   function display_list()
   {
   echo $person; //This doesn't work
     echo $this->person; //This works.
   }
}

$person= new People;
$person->display_list();
?>


Instead of painstakingly working out most of the other mistakes I'm likely to make, I'd love to read about other peoples issues they had with learning OO so I can skip most of the hard stuff, and only make small mistakes (hopefully).
--

Michael Kubler
*G*rey *P*hoenix *P*roductions <http://www.greyphoenix.biz>


--- End Message ---
--- Begin Message ---
2009/2/10 Michael Kubler <mdk...@gmail.com>:
> Hi,
> I'm just getting into programming in an Object Oriented fashion, and am
> looking for some guides, tutorials, hints, tips, etc...
>
> I only just found out that you remove the $ from variables when calling them
> from $this->
>
> e.g :
> <?php
> class People
> {
> private $person = "not set";
>   function __construct()
>   {
>    *$person* = "A person"; //This doesn't work (well it creates a variable
> $person that only has the scope of the current function from what I can
> gather)..
>    $this->*person* = "A person"; //This works properly
>    }
>   function display_list()
>   {
>   echo $person; //This doesn't work
>     echo $this->person; //This works.
>   }
> }
>
> $person= new People;
> $person->display_list();
> ?>
>
>
> Instead of painstakingly working out most of the other mistakes I'm likely
> to make, I'd love to read about other peoples issues they had with learning
> OO so I can skip most of the hard stuff, and only make small mistakes
> (hopefully).

Ok, because it's you I'm going to offer you this ebook at the very
very very low limited time price of $49 and I'll throw in a free
watermelon.

Ahh, hell, I can't be arsed. It's in the frickin' manual: http://php.net/oop

-Stuart

-- 
http://stut.net/

--- End Message ---
--- Begin Message ---
 Alrighty, so I went a different route...

I created my own ActiveX DLL...one that I know I can register.

Starting out really simple:

//My VB code
Public Function hello() As String

    hello = "Hello World!"
End Function

//My PHP code
<?php
function Hello() {
$new_com = new COM("DMStoTIFF.conv");
$output=$new_com->hello();
echo $output;}
Hello();
?>

So, after I register the DLL on the server my PHP page is correctly
displaying the "Hello World!" dialog.

What I'm having problems with now is trying to pass a variable to the DLL.

Shouldn't I be able to do this just like any other PHP class/function?

--- End Message ---

Reply via email to