php-general Digest 15 Feb 2005 14:38:35 -0000 Issue 3287

Topics (messages 208700 through 208721):

base32/62 mcrypted data
        208700 by: Gary C. New
        208720 by: Marek Kilimajer

Re: PHP book recommendations>
        208701 by: C.F. Scheidecker Antunes
        208703 by: Manuel Lemos

Extension Help
        208702 by: Chris Cranford

PHP 5 with Apache 2.0
        208704 by: Neal Schilling
        208705 by: Lars B. Jensen
        208713 by: Lester Caine

Re: Fancy Form processing Ideas
        208706 by: Matt M.

Many forms in one php file
        208707 by: NSK
        208714 by: James Taylor

php products licensing system
        208708 by: Jad Madi
        208718 by: Jad Madi
        208721 by: Jason Barnett

Running PHP from inside another application!
        208709 by: Mikael Andersson

mediator between PHP and Perl (with sessions)
        208710 by: Eli
        208711 by: Eli

Re: User Passwords: checking for unique chars
        208712 by: Burhan Khalid

Re: who's on-line application - php
        208715 by: Stefan Dengscherz

Image Creation
        208716 by: Aaron Todd

test
        208717 by: Giulio
        208719 by: NSK

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 ---
I am currently storing mcrypted data as a base64 encoded string.

I now need to store the mcrypted data as a base32 or base62 string, because of problems occurring due to the '+', '/', and '=' characters.

It seems that there is only the base64_en/decode default function.

Does anyone know of a method or a sample piece of code that can achieve the desired effect?

Thank you for your assistance.

Respectfully,


Gary
--- End Message ---
--- Begin Message --- Gary C. New wrote:
I am currently storing mcrypted data as a base64 encoded string.

I now need to store the mcrypted data as a base32 or base62 string, because of problems occurring due to the '+', '/', and '=' characters.

It seems that there is only the base64_en/decode default function.

Does anyone know of a method or a sample piece of code that can achieve the desired effect?

http://sk2.php.net/manual/en/function.base-convert.php
--- End Message ---
--- Begin Message --- I've enjoyed Schlossnagle as I have it on my personal library.
Also I am finishing to read PHP 5 Power Programming from Prentice Hall and the creators of PHP.
If you want to learn coding style and coding good practices check out this book.
A cheap place to get books here in the US is bookpool.com


Jason Barnett wrote:

Dave Bosky wrote:

I'm looking for an easy to read PHP book that will help me learn a solid
foundation in PHP.

I'm already familiar with the language but want to make sure I'm coding in
the most efficient manner.

What's a few of the better books out there?



HTC Disclaimer: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you.


Advanced PHP Programming by George Schlossnagle is for you.

--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://www.php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins


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

on 02/14/2005 02:37 PM Dave Bosky said the following:
I'm looking for an easy to read PHP book that will help me learn a solid
foundation in PHP.

I'm already familiar with the language but want to make sure I'm coding in
the most efficient manner.

What's a few of the better books out there?

It depends on your is your criteria of a better book.

Here you may find reviews of many books of interest to PHP users:

http://www.phpclasses.org/reviews/

Here you may find the latest reviews that were published:

http://www.phpclasses.org/reviews/latest/latest.html

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

--- End Message ---
--- Begin Message ---
I'm trying to write a PHPv4 extension and I am needing some assistance.  I
wish to have a function exported from my extension return a value which
consists of a set of properties and functions much like so:

  // Gets user record from database store.
  $MyUser = GetUser();
  echo "Your name is: ".$MyUser->name;
  // Update name field to something else
  $MyUser->name = "We've changed your name";
  // Invoke an update function to save the data to
  // database.
  $MyUser->update();

Could someone please illustrate how my extension should create/register this
$MyUser return_value and how I would go about coding the update() function
on that object?

Thanks in advance!

--- End Message ---
--- Begin Message --- I know this question probably gets asked a lot, but I'm setting up a Web Server shortly and am debating going with PHP 5 on Apache 2.0 or 1.3. In short, is PHP 5, when combined with either Apache 1.3 or 2.0 on Linux or FreeBSD, ready for a production environment? This is, of course, an opinion, but back your opinion with as much fact as possible.

Also, if PHP 5 is NOT ready, do you feel PHP 4.3 is ready for production with Apache 2.0?
--- End Message ---
--- Begin Message --- I've been running FreeBSD 5.3, Apache 2.0.53, PHP 5.0.3 with mySQL 4.1.8 without any issues in production. Unless you rely on some spooky extentions, I wouldnt think you should have any problems running - that you ask this question here, tells me you aint running any such spooky things.

I'm facing about 100k unique users a month running some 5 million pageviews with extensive load for the database - this backed on a single server with a Xeon processor and 2gb of memory.

So from here, go for it mate

--
Lars B. Jensen, Internet Architect

CareerCross Japan
Japan's premier online career resource for english speaking professionals

http://www.careercross.com

----- Original Message ----- From: "Neal Schilling" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, February 15, 2005 2:28 PM
Subject: [PHP] PHP 5 with Apache 2.0


I know this question probably gets asked a lot, but I'm setting up a Web Server shortly and am debating going with PHP 5 on Apache 2.0 or 1.3. In short, is PHP 5, when combined with either Apache 1.3 or 2.0 on Linux or FreeBSD, ready for a production environment? This is, of course, an opinion, but back your opinion with as much fact as possible.

Also, if PHP 5 is NOT ready, do you feel PHP 4.3 is ready for production with Apache 2.0?

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



--- End Message ---
--- Begin Message ---
Lars B. Jensen wrote:

So from here, go for it mate

Same here. The more of us running it the sooner it will become the norm ;)

--
Lester Caine
-----------------------------
L.S.Caine Electronic Services

--- End Message ---
--- Begin Message ---
> I am looking for interesting approaches to form submissions and error
> checking in the forms.

http://pear.php.net/package/HTML_QuickForm

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

I want to create a single php file which will be able to display multiple html 
forms.

Like this: Form1 -> Form2 -> Form3.

After the user completes and submits Form1, the script will process it and 
display a different form. etc...

I am new to php, I would need some detailed instructions, or point me to an 
opensource php script which already does that so that I can analyse it.

-- 
NSK
http://portal.wikinerds.org

--- End Message ---
--- Begin Message --- Nsk wrote:
Hi

I want to create a single php file which will be able to display multiple html forms.

Like this: Form1 -> Form2 -> Form3.

After the user completes and submits Form1, the script will process it and display a different form. etc...

I am new to php, I would need some detailed instructions, or point me to an opensource php script which already does that so that I can analyse it.


In a single script it could be a little nasty if you want more then one or two phases - its common to have a submit and view result on the same script, but multiple stages can become a maintaince nightmare, but you can do it like this:

You could use a "mode" indicator and a session settings. Look for start_session() in the manual.

Something like:

<?php
start_session();

if(!isset($_SESSION['mode'])){
 $_SESSION['mode'] = 0;  // first time round, on first screen
}

// function to test if mode is 0 AND button pressed (ie a submission,
// deal (store) the information and increment mode

if($_SESSION['mode'] == 0){
?>
 <form 1> </form 1>
<?php
} else if ($_SESSION['mode'] == 1) {
?>
<form 2> </form2>
<?php
 }
?>

--- End Message ---
--- Begin Message ---
Hi folks
 I hardly convince my company to have their PHP products open source,
now the challenge is to protect their products from being stolen and
used illegally so we may Encode only one or two files to keep the use
of our products on Certain domain or IP address. Any idea how to
accomplish this ?

if its a must to encode some files to achive our goal then we prefer
to stick with opensource/free encoder, our choice now is mmCache
Encoder, but since dl() gonna be depracted in the mean of removed in
php5, we will not be able to offer our products for shared hosting
clients

any idea how to protect our products, keeping it open souce as much as
possible ?

-- 
Web standards Planet 
http://www.w3planet.info/
Personal Blogger
http://www.EasyHTTP.com/jad/
EasyHTTP Network
http://www.EasyHTTP.com

--- End Message ---
--- Begin Message ---
as I said, we are willing to have our product open source, but No
free. and that fair enough, thats why I'm asking about a good method
to protect our products from being used illegaly and keeping it open
source


On Tue, 15 Feb 2005 13:05:52 +0200, Jad Madi <[EMAIL PROTECTED]> wrote:
> as I said, we are willing to have our product open source, but No
> free. and that fair enough, thats why I'm asking about a good method
> to protect our products from being used illegaly and keeping it open
> source
> 
> 
> On Tue, 15 Feb 2005 10:11:59 +0000, timothy johnson
> <[EMAIL PROTECTED]> wrote:
> > So you want to use open source to make it so people cant use your
> > code. Does just doesnt sound right, but whatever
> >
> >
> > On Tue, 15 Feb 2005 09:48:44 +0200, Jad Madi <[EMAIL PROTECTED]> wrote:
> > > Hi folks
> > >  I hardly convince my company to have their PHP products open source,
> > > now the challenge is to protect their products from being stolen and
> > > used illegally so we may Encode only one or two files to keep the use
> > > of our products on Certain domain or IP address. Any idea how to
> > > accomplish this ?
> > >
> > > if its a must to encode some files to achive our goal then we prefer
> > > to stick with opensource/free encoder, our choice now is mmCache
> > > Encoder, but since dl() gonna be depracted in the mean of removed in
> > > php5, we will not be able to offer our products for shared hosting
> > > clients
> > >
> > > any idea how to protect our products, keeping it open souce as much as
> > > possible ?
> > >
> > > --
> > > Web standards Planet
> > > http://www.w3planet.info/
> > > Personal Blogger
> > > http://www.EasyHTTP.com/jad/
> > > EasyHTTP Network
> > > http://www.EasyHTTP.com
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> 
> --
> Web standards Planet
> http://www.w3planet.info/
> Personal Blogger
> http://www.EasyHTTP.com/jad/
> EasyHTTP Network
> http://www.EasyHTTP.com
> 


-- 
Web standards Planet 
http://www.w3planet.info/
Personal Blogger
http://www.EasyHTTP.com/jad/
EasyHTTP Network
http://www.EasyHTTP.com

--- End Message ---
--- Begin Message --- Jad Madi wrote:
as I said, we are willing to have our product open source, but No
free. and that fair enough, thats why I'm asking about a good method
to protect our products from being used illegaly and keeping it open
source


It's a tough balancing act. Encoding / closing the source with one of the packages out there is an option. The license that you use is important and always be certain that LICENSE is included in every code distribution.

Without knowing a little more about the exact product you sell it's
tough to give good advice, but some things that I have seen:
- Open up part of the source, but keep the valuable code closed
- Different licenses for different parts of the code
- Open source it all and charge for 24/7 support services
- Open source it all and charge for consulting / specialty services
- Open source it all, but only for a client application.  Then you have
the client connect to a server side app on your site and you charge per
usage.

My advice: look at some of the *successful* and more importantly
*profitable* open source companies out there.

--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://www.php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins

Attachment: signature.asc
Description: OpenPGP digital signature


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

I've a case where I have to run a lots of php-scrips, in a short time, from 
inside a delphi-application. Every script connects to the same databas.
Today I use CreateProcess to start php.exe and then I'm using pipes to get 
the php-result. I'm doing this for each php-script I want to run, and it's 
timeexpensive because every script has to establish a database-connection.

I'm new in the PHP-world, but I'm sure that there is a better way to solve 
this case.

I would prefer NOT to run php.exe all the time and of course I want to use 
the same databasconnectio, but I don't know how.

It's not an option to put all the scripts into one big script.

Thanks in advance

Best Regards
Mike 

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

I got a shared lib API written in PHP, that depends on sessions for its operation.
I took a prepared system in Perl that I want integrate with the shared lib API in PHP.

What I thought about is, to write a mediator class in Perl that will define the same API functions as I got in the shared lib API in PHP. I do not want to imitate the API functions workflow in Perl, but instead call the shared lib API in PHP from Perl (this way I don't have to maintain 2 class APIs in different languages).

I thought of making a PHP script that can run on shell and return serialized output of any API function in the shared lib. Then call that script from Perl and process the returned output in Perl.
Problem in this way is, that the shared lib in PHP uses sessions which are un-accessable from a shell script. And I cannot put that script on the web, since it returns sensitive data.
Is there a way to use sessions variables in PHP shell script (without reading the session file and parse it in the script)?

If anyone is familiar with any other implementation of such a mediator, please tell.

-thanks, Eli.
--- End Message ---
--- Begin Message ---
Hi...

I got a shared lib API written in PHP, that depends on sessions for its operation.
I took a prepared system in Perl that I want integrate with the shared lib API in PHP.

What I thought about is, to write a mediator class in Perl that will define the same API functions as I got in the shared lib API in PHP. I do not want to imitate the API functions workflow in Perl, but instead call the shared lib API in PHP from Perl (this way I don't have to maintain 2 class APIs in different languages).

I thought of making a PHP script that can run on shell and return serialized output of any API function in the shared lib. Then call that script from Perl and process the returned output in Perl.
Problem in this way is, that the shared lib in PHP uses sessions which are un-accessable from a shell script. And I cannot put that script on the web, since it returns sensitive data.
Is there a way to use sessions variables in PHP shell script (without reading the session file and parse it in the script)?

If anyone is familiar with any other implementation of such a mediator, please tell.

-thanks, Eli.
--- End Message ---
--- Begin Message --- [ snipped ]


Oh!  You're so mean!!  ;)

A lot of people are making some great points. I feel I must strighten
this out a little. While I may not be the best coder in the world I
do have my reasons. I originally made the passwords automatically
generated and emailed to the user. Nice complicated ones! I was
immediately shot down for doing this because no one here liked the
idea of having complicated passwords! I was told to allow the user to
chose their own so I merely wanted to make sure no one could have
stupid passwords like "aaa". So I just added a few limitations. Besides, my small website doesn't hold any sensitive information about
anyone so it wouldn't be the end of the world if some cracked it!

Try something like http://sourceforge.net/projects/pwgen/ which generates passwords that are easy for humans to remember, yet not that "dumb".
--- End Message ---
--- Begin Message ---
Hello,

usually you can not determine clearly who is online on your website at the
moment because http is a session-less protocol (thus php implements a session
mechanism through cookies or session id). However you can use the following
approach:

- add a 'last_seen' field to the users table of your website
- update that field for the user everytime he calls a page on your site
  (e.g. include("updatels.php"); on every page)
- to get the number of (probably still) online users do a 'select from
  user_table where now()-lastseen < 3 minutes'

another method would be changing the session handler to store session data in
the database and query the sessiontable appropriately.


best regards,

Stefan Dengscherz


On Mon, Feb 14, 2005 at 04:30:32PM +0200, Jacques wrote:
> I would like to indicate the particulars (from a MySQL database) of all
> those users that are currently on-line (those whom have successfully signed
> in). How should I go about achieving this? Does it have something to do with
> Sessions?
> 
> I am developing in PHP.
> 
> Regards
> 
> Jacques
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
I just wrote a little script to play around with the GD library but I am 
having a problem displaying it in the browser.  I have not problem at all 
when I just run the script.  But I was trying to make the image in a custom 
function which will return the image when its called.  All I end up getting 
is a bunch of weird characters.

Here's my code:
function makepie($slice, $total){
    $height = 150;
    $width = 150;
    $im = ImageCreate($width, $height);
    $bck = ImageColorAllocate($im, 255,255,255);
    $black = ImageColorAllocate($im, 0, 0, 0);
    $red = ImageColorAllocate($im, 255, 0, 0);
    imagefilledellipse($im, 75, 75, 125, 125, $red);
    imageellipse($im, 75, 75, 125, 125, $black);

    //Making the Slice
    $pieslice = (($slice / $total) * 360) + 315;
    imagefilledarc($im, 75, 75, 125, 125, 315, $pieslice, $black, 
IMG_ARC_PIE);

    //Return
    header("Content-type: image/png");
    echo ImagePNG($im);
  }

Anyone have any idea why I cant return the image?

Thanks 

--- End Message ---
--- Begin Message ---
only a test.

    sorry


Cantoberon Multimedia srl http://www.cantoberon.it Tel. 06 39737052

--- End Message ---
--- Begin Message ---
On Tuesday 15 February 2005 14:54, Giulio wrote:
> only a test.

Your test was successful

-- 
NSK
http://portal.wikinerds.org

--- End Message ---

Reply via email to