php-general Digest 16 Dec 2004 14:18:23 -0000 Issue 3173

Topics (messages 204452 through 204488):

php and flash
        204452 by: Dustin Krysak
        204455 by: Manuel Lemos
        204458 by: Greg Donald
        204461 by: daniel.electroteque.org
        204462 by: daniel.electroteque.org
        204463 by: daniel.electroteque.org

Re: php graph?
        204453 by: Jonathan

Possible to make $$ distributing PHP as Shareware?
        204454 by: Jonathan
        204456 by: Greg Donald
        204457 by: Lars B. Jensen
        204473 by: Robby Russell

Database Framework
        204459 by: Jonel Rienton
        204468 by: Matthew Weier O'Phinney
        204471 by: daniel.electroteque.org
        204486 by: Jay Blanchard

Re: logic with arrays
        204460 by: Greg Donald
        204464 by: Jeffery Fernandez

Re: Good and free encoder for PHP5
        204465 by: Greg Donald
        204467 by: Manuel Lemos
        204469 by: Matthew Weier O'Phinney
        204470 by: tg-php.gryffyndevelopment.com
        204483 by: Greg Donald

Re: Can't install PHP 5.02 with Apache2
        204466 by: Sandy Keathley
        204472 by: Michael Leung

Problem with array
        204474 by: Ahmed Abdel-Aliem
        204475 by: Jason Wong

counting chars..
        204476 by: Louie Miranda
        204477 by: Jake Press
        204479 by: Robby Russell
        204481 by: M. Sokolewicz
        204488 by: Sebastian

Re: PHP &Apache Upload file Permission denied
        204478 by: Michael Leung

Re: Using constructs like unset() in expressions like ()&&()
        204480 by: Ian Firla

Buffering
        204482 by: Lorderon
        204487 by: Jason Wong

fsockopen to own server
        204484 by: Doc

Re: Question in posting form-data
        204485 by: Erwin Kerk

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 --- Can anyone point to some good tutorials on using PHP with flash? I am mostly interested in displaying info from a database in the flash movie, as well as loading movies and pictures into the flash file (referenced in the database).

thanks!

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

on 12/16/2004 12:40 AM Dustin Krysak said the following:
Can anyone point to some good tutorials on using PHP with flash? I am mostly interested in displaying info from a database in the flash movie, as well as loading movies and pictures into the flash file (referenced in the database).

Not really a tutorial as there is a lot to say about that, but this book provides information on most of what you need to know:


http://www.phpclasses.org/reviews/id/095792187X.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 ---
On Wed, 15 Dec 2004 18:40:17 -0800, Dustin Krysak
<[EMAIL PROTECTED]> wrote:
> displaying info from a database in the flash movie

If you mean like graphs..

http://www.infosoftglobal.com/FusionCharts/


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

--- End Message ---
--- Begin Message ---
> Can anyone point to some good tutorials on using PHP with flash? I am
> mostly interested in displaying info from a database in the flash
> movie, as well as loading movies and pictures into the flash file
> (referenced in the database).
>
> thanks!
>

Yes dude, I have been implementing data via mysql using Flash Remoting and
another extensioncalled PHPObject, both use php as a server for executing php 
methods which
does the sql queryand returns an array back to flash which is serialized in 
very funky.

www.amfphp.org

http://ghostwire.com/go/28

PHPObject is updated regularly, amfphp ran oujt of steam possibly coz of
legal matters withmacromedia the punks, its ok to support highend languages but 
when someone
has the balls tocome up with an alternative for PHP all hell breaks loose :|

--- End Message ---
--- Begin Message ---
> Can anyone point to some good tutorials on using PHP with flash? I am
> mostly interested in displaying info from a database in the flash
> movie, as well as loading movies and pictures into the flash file
> (referenced in the database).
>
> thanks!
>

Yes dude, I have been implementing data via mysql using Flash Remoting and
another extensioncalled PHPObject, both use php as a server for executing php 
methods which
does the sql queryand returns an array back to flash which is serialized in 
very funky.

www.amfphp.org

http://ghostwire.com/go/28

PHPObject is updated regularly, amfphp ran oujt of steam possibly coz of
legal matters withmacromedia the punks, its ok to support highend languages but 
when someone
has the balls tocome up with an alternative for PHP all hell breaks loose :|

--- End Message ---
--- Begin Message ---
> On Wed, 15 Dec 2004 18:40:17 -0800, Dustin Krysak
> <[EMAIL PROTECTED]> wrote:
>> displaying info from a database in the flash movie
>
> If you mean like graphs..
>
> http://www.infosoftglobal.com/FusionCharts/
>
>


There is also the option of generating xml using pear XML_Tree and loading
the php script in asyou would with xml.

--- End Message ---
--- Begin Message ---
Thanks. Just downloaded it and tested it and it look great !!!

Quite easy to implement also.

Cheers,

Jonathan

"Jonathan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> Me new to PHP.
>
> Is there any good and free php graph scripts/class that I can use to
> generate graph like bar chart, pie chart and plots.
>
> If you have any good recommendation, can email me at
> [EMAIL PROTECTED]
>
> Thanks.
>
> Jonathan

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

I have developed a full email marketing application (using php, mysql) which
supports tracking technology (i.e. whether the recipient has read the email,
view online, unsubscribe, click on any of the link etc), bounce mail
management, backend engine.

Is it possible to make some $$ if I distribute the application as a
shareware or should I just sell it as an commercial package.

If you have any experience with this, kindly enlighten me.

Thanks,

Jonathan

--- End Message ---
--- Begin Message ---
On Thu, 16 Dec 2004 10:50:52 +0800, Jonathan <[EMAIL PROTECTED]> wrote:
> Is it possible to make some $$ if I distribute the application as a
> shareware

Probably not.

> or should I just sell it as an commercial package.

If you plan to make any money, yes.

> If you have any experience with this, kindly enlighten me.

In my experience, people aren't going to pay unless they have to.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

--- End Message ---
--- Begin Message ---
If you have any experience with this, kindly enlighten me.
In my experience, people aren't going to pay unless they have to.

... and spending money for some application, which more than likely is going to be filtered hard by spam filters, might not be what I want to spend my pennies on


--
Lars B. Jensen, Internet Architect

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

http://www.careercross.com
--- End Message ---
--- Begin Message ---
On Thu, 2004-12-16 at 10:50 +0800, Jonathan wrote:
> Hi,
> 
> I have developed a full email marketing application (using php, mysql) which
> supports tracking technology (i.e. whether the recipient has read the email,
> view online, unsubscribe, click on any of the link etc), bounce mail
> management, backend engine.
> 
> Is it possible to make some $$ if I distribute the application as a
> shareware or should I just sell it as an commercial package.
> 
> If you have any experience with this, kindly enlighten me.
> 
> Thanks,
> 
> Jonathan
> 

You have three options. 

1. Sell it as a commercial product ($)..and hope people don't build a
free version

2. Give it out..and hope that people come to you for customizations and
enhancements ($)

3. Don't sell it like regular software. Sell it as a service that you
completely control and support..and have your users pay you to utilize
your service. ($$)

..depending on what your goal is with it, those are generally the three
ways you can make money with your app.

Cheers,

-Robby

-- 
/***************************************
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*    --- Now supporting PHP5 ---
****************************************/

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

Is there an on-going initiative as far as creating a PHP framework somewhat the same as .Net's framework implementation? Like for instance, the System.Data namespace where PHP developer can just create something like a DataAdapter which can connect to a datastore and fill a DataSet object? I think that would make our life a little easier? This post is by not any means a way to start a flame war or something, I just thought about it and I think it makes sense.

regards,

http://jonel.road14.com
--
I not know English well, but I know 7 computer languages.
                                                                ----anonymous

--- End Message ---
--- Begin Message ---
* Jonel Rienton <[EMAIL PROTECTED]>:
> Is there an on-going initiative as far as creating a PHP framework 
> somewhat the same as .Net's framework implementation? Like for 
> instance, the System.Data namespace where PHP developer can just create 
> something like a DataAdapter which can connect to a datastore and fill 
> a DataSet object?  I think that would make our life a little easier? 
> This post is by not any means a way to start a flame war or something, 
> I just thought about it and  I think it makes sense.

You might want to look at PEAR (http://pear.php.net) in general and
PEAR's DataObject/DataGrid classes in specific.

-- 
Matthew Weier O'Phinney           | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist       | http://www.garden.org
National Gardening Association    | http://www.kidsgardening.com
802-863-5251 x156                 | http://nationalgardenmonth.org

--- End Message ---
--- Begin Message ---
> Hi guys,
>
> Is there an on-going initiative as far as creating a PHP framework
> somewhat the same as .Net's framework implementation? Like for
> instance, the System.Data namespace where PHP developer can just create
>  something like a DataAdapter which can connect to a datastore and fill
>  a DataSet object?  I think that would make our life a little easier?
> This post is by not any means a way to start a flame war or something,
> I just thought about it and  I think it makes sense.
>
> regards,

Tonnes of different initiatives, no one standard which would be great, I
am forced to build alot ofmy own components, because there are so many 
different ones i dont know
what to choose. Asthe problem with Java, J2EE is a specification not a 
framework therefore
there are millions outthere :|

--- End Message ---
--- Begin Message ---
[snip]
Is there an on-going initiative as far as creating a PHP framework 
somewhat the same as .Net's framework implementation? Like for 
instance, the System.Data namespace where PHP developer can just create 
something like a DataAdapter which can connect to a datastore and fill 
a DataSet object?  I think that would make our life a little easier? 
This post is by not any means a way to start a flame war or something, 
I just thought about it and  I think it makes sense.
[/snip]

If you think so, write it.

--- End Message ---
--- Begin Message ---
On Thu, 16 Dec 2004 13:11:02 +1100, Jeffery Fernandez
<[EMAIL PROTECTED]> wrote:
> I am trying to build a html menu dynamically from data sitting in an
> array. I have been successful so far until it came to the point of
> populating the sub-menu of the system. Can someone help me out with the
> logic or is there a simpler way of doing it? Thanks

Hierarchical menus made easy:

http://www.sitepoint.com/article/hierarchical-data-database


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

--- End Message ---
--- Begin Message ---
Wee Keat wrote:

Hey Jeff,

How are you mate? Was lazying around and saw your email to the list. :)

What exactly do you need help with? Is it the following line?

// Stuck here
$html_menu .= "<li><a href=\"Need to get value\">$sub_page</a></li>";
}
$html_menu .= '</ul>';


Do you need to get the value of the link and the name of the link? If so, try this:

===== begin snippet =======

$html_menu .= '<ul id="subnav">';
     foreach ($menu_page[$menu_name[1]] as $sub_page => $sub_link)
       {
         // Stuck here
         $html_menu .= "<li><a href=\"$sub_link\">$sub_page</a></li>";
       }
       $html_menu .= '</ul>';
     }


===== end snippet =========


What about using recursive functions? I think it's easier as you can create unlimited numbers of sub-menus. It's slow though.




Ah Thanks Keat long time no hear/see ...... it works now. :-)

How are you keeping anyway ? You totally ignore us now at phpMelb :-(

Come along to our next meeting on 13th Jan 2005

cheers,
Jeffery

--- End Message ---
--- Begin Message ---
On Wed, 15 Dec 2004 22:38:16 -0200, Manuel Lemos <[EMAIL PROTECTED]> wrote:
> > I have all kinds of old software that doesn't work anymore.
> 
> That is because you changed the environment on which it was working.

Exactly my point.  I don't control when M$ depricates their operating
systems.  I don't control when my favorite Linux distro upgrades their
glibc.  You have to upgrade at some point or be vulnerable to the
security issues that follow.

> The point is that if you do not need to use the latest version, just
> stick to the one you have and works for you.

Well, I'm not gonna run windows 95 just to play Afterlife.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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

on 12/16/2004 01:27 AM Greg Donald said the following:
I have all kinds of old software that doesn't work anymore.
That is because you changed the environment on which it was working.

Exactly my point. I don't control when M$ depricates their operating systems. I don't control when my favorite Linux distro upgrades their glibc. You have to upgrade at some point or be vulnerable to the security issues that follow.

>>The point is that if you do not need to use the latest version, just >>stick to the one you have and works for you. > > Well, I'm not gonna run windows 95 just to play Afterlife.

The point is that old software versions that work on old environment versions do not need you to upgrade the environment version even the vendor deprecates the old version. While you think that newer versions will not have old bugs that probably were not affecting you, chances are that newer versions have newer bugs that may break your applications, especially if you upgrade right after those new versions are released.

What I am trying to tell you is that you need to use your brain before you make an upgrade, eventually leaving a reasonable amount of time since it was released because most bugs are only discovered when early adopters break their faces trying the just released versions. In the case of PHP 5, I do not recommend jumping to it before 1 year after 5.0.0 release. Then your upgrade risk will be much smaller.

--

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 ---
* Manuel Lemos <[EMAIL PROTECTED]>:
> Hello,
>
> on 12/16/2004 01:27 AM Greg Donald said the following:
> > > >I have all kinds of old software that doesn't work anymore.
> > >That is because you changed the environment on which it was working.
> > 
> > Exactly my point.  I don't control when M$ depricates their operating
> > systems.  I don't control when my favorite Linux distro upgrades their
> > glibc.  You have to upgrade at some point or be vulnerable to the
> > security issues that follow.
>
> > >The point is that if you do not need to use the latest version, just
> > >stick to the one you have and works for you.
> >
> > Well, I'm not gonna run windows 95 just to play Afterlife.
>
> The point is that old software versions that work on old environment 
> versions do not need you to upgrade the environment version even the 
> vendor deprecates the old version. While you think that newer versions 
> will not have old bugs that probably were not affecting you, chances are 
> that newer versions have newer bugs that may break your applications, 
> especially if you upgrade right after those new versions are released.

Greg's point is that sometimes you *must* upgrade because the "old",
possibly unnoticed bugs create may security vulnerabilities that you
can't live with. If a library your application depends on (and that
library could be PHP) has a security flaw that could allow permission
escalation, for instance, and a patch exists for it, you'd be crazy or
stupid not to perform the upgrade.  If the upgrade breaks the
application that depends on it...  well, that's why we're coding in PHP,
right? So that we have the freedom to fix these things, instead of
relying on vendors. (Man, I love OSS!)

You *do* make valid points about making needless upgrade -- if no
security vulnerabilities exist, the application works fine, and you
don't need features from the new version, there really is no reason to
upgrade. But when a security vulnerability *does* exist, and it *could*
affect your application, you've got another issue entirely on your
hands. The trick is learning to distinguish between the two.

-- 
Matthew Weier O'Phinney           | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist       | http://www.garden.org
National Gardening Association    | http://www.kidsgardening.com
802-863-5251 x156                 | http://nationalgardenmonth.org

--- End Message ---
--- Begin Message ---
Well, you could try XP's "Compatibility Mode", I think my girlfriend got 
Afterlife to run under XP doing that.  She got it to run somehow..haha.. 
because we just found a copy of Afterlife for like $1 somewhere and she picked 
it up.

Or, if you happen to be blessed with VMWare, there's always that.  I've used 
VMWare to succesfully set up DOS 6.22 and some games that didn't work under 
DOSBox and Windows 95 to run some games that Win98 and XP didn't like so much.

So there's always options..  if you have time and/or money :)    You might be 
able to use Wine or something to run an older version of Windows to get 
Afterlife to work as well.

In general, yes.. software gets old and rusty on the new OS's... but if you're 
ingenuity is adequate, you can figure out a way to have your cake and eat it 
too.

Where there's a will (and a search engine and maybe $200 for VMWare)....  
there's an emulation of some kind.

-TG
*** new email address [EMAIL PROTECTED]
*** old email address [EMAIL PROTECTED]  YAY CHAPTER 11!





= = = Original message = = =

On Wed, 15 Dec 2004 22:38:16 -0200, Manuel Lemos <[EMAIL PROTECTED]> wrote:
> > I have all kinds of old software that doesn't work anymore.
> 
> That is because you changed the environment on which it was working.

Exactly my point.  I don't control when M$ depricates their operating
systems.  I don't control when my favorite Linux distro upgrades their
glibc.  You have to upgrade at some point or be vulnerable to the
security issues that follow.

> The point is that if you do not need to use the latest version, just
> stick to the one you have and works for you.

Well, I'm not gonna run windows 95 just to play Afterlife.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/


___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

--- End Message ---
--- Begin Message ---
On Thu, 16 Dec 2004 01:57:42 -0200, Manuel Lemos <[EMAIL PROTECTED]> wrote:
> The point is that old software versions that work on old environment
> versions do not need you to upgrade the environment version even the
> vendor deprecates the old version.

Wrong.  Security issues force upgrades.  Operating systems being
depricated forces upgrades.

> While you think that newer versions
> will not have old bugs that probably were not affecting you, chances are
> that newer versions have newer bugs that may break your applications,
> especially if you upgrade right after those new versions are released.

I never said anything of the sort.  

> What I am trying to tell you is that you need to use your brain

Yeah, I probably never use my brain, thanks for that.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

--- End Message ---
--- Begin Message ---
> On Wed, 15 Dec 2004 11:21:42 -0500, Don <[EMAIL PROTECTED]> wrote: >
> and am getting a compile error: > "apxs was not found." > > There is
> no file: /usr/sbin/apxs
> 
> Mine is /usr/sbin/apxs2


Some versions of Redhat install a package of Apache2 without 
either apxs or apxs2, presumably to keep you from installing 
unsupported versions of (for example) PHP.  

                                Sandy Keathley

--- End Message ---
--- Begin Message ---
PHP 5.0.3 just released.

--- End Message ---
--- Begin Message ---
Hi
i am retrieving records from database and putting each row in a array
here is the code 
@ $db = mysql_connect ($server, $user, $pass);
mysql_select_db($database);
$query = "SELECT Game_ID FROM games WHERE Game_Category='$Game_Category'";
$result= mysql_query($query);
$total_numbers = mysql_num_rows($result);
$startingID=$_GET['startingID'];
$startingID = ($startingID) ? $startingID : 0; //if rec is passed in, use it,
$row = array();
$test_tr = mysql_query("select * from games WHERE
Game_Category='$Game_Category' order by Game_ID desc LIMIT
$startingID,
$items_numbers_list");
$num = mysql_num_rows($test_tr);
while ($record=mysql_fetch_array($test_tr)){
        $record[Game_ID] = stripslashes($record[Game_ID]);
        $record[Game_Picture_Small] = stripslashes($record[Game_Picture_Small]);
        $record[Game_Name] = stripslashes($record[Game_Name]);
        $record[Game_Title] = stripslashes($record[Game_Title]);
        $record[Game_Description] = stripslashes($record[Game_Description]);
        $record[Game_Full_Story] = stripslashes($record[Game_Full_Story]);
        $record[Game_Screen_Shot_1] = stripslashes($record[Game_Screen_Shot_1]);
        $record[Game_Screen_Shot_2] = stripslashes($record[Game_Screen_Shot_2]);
        $record[Game_Screen_Shot_3] = stripslashes($record[Game_Screen_Shot_3]);
        $record[Game_Status] = stripslashes($record[Game_Status]);
        $record[Game_Play_Score] = stripslashes($record[Game_Play_Score]);
        $record[Game_Category] = stripslashes($record[Game_Category]);
        $Game_Esrb_Rating = intval($record[Game_Esrb_Rating]);
        echo $record[Game_Esrb_Rating];
        if($Game_Esrb_Rating < 1){ 
        $Esrb_Rate_Pic = "bar_rating_star_0.gif";
        }elseif ($Game_Esrb_Rating < 2){
                $Esrb_Rate_Pic = "bar_rating_star_1.gif";
        }elseif ($Game_Esrb_Rating < 3){
                $Esrb_Rate_Pic = "bar_rating_star_2.gif";
        }elseif ($Game_Esrb_Rating < 4){
                $Esrb_Rate_Pic = "bar_rating_star_3.gif";
        }elseif ($Game_Esrb_Rating < 5){
                $Esrb_Rate_Pic = "bar_rating_star_4.gif";
        }elseif ($Game_Esrb_Rating = 5){
                $Esrb_Rate_Pic = "bar_rating_star_5.gif";
        }
        $row[] = $record;
        $row[Esrb_Rate_Pic] = $Esrb_Rate_Pic;
}

my problem is with $Esrb_Rate_Pic, i can't put its value to the array
, i used $row[Esrb_Rate_Pic] = $Esrb_Rate_Pic; but it didn't work
can anyone help?

--- End Message ---
--- Begin Message ---
On Thursday 16 December 2004 13:33, Ahmed Abdel-Aliem wrote:

Put this at the beginning of all your code:

    error_reporting(E_ALL);
    ini_set('display_errors', TRUE);

Then run your code to see all the errors and warnings and notices that it 
generates. Then incorporate the changes below:

> i am retrieving records from database and putting each row in a array
> here is the code
> @ $db = mysql_connect ($server, $user, $pass);

Remove all '@'. Put in error checking and make use of mysql_error(), see 
examples in manual.

> while ($record=mysql_fetch_array($test_tr)){
>  $record[Game_ID] = stripslashes($record[Game_ID]);

This whole stripslashes() business may not be needed. In general you should 
only use it if magic_quotes_runtime is enabled in php.ini.

Also the correct syntax is:

  $record['Game_ID'] = stripslashes($record['Game_ID']);

And if you find that you really do need to use stripslashes() because 
magic_quotes_runtime is enabled then use this instead:

  foreach ($record as $key => $val) {
    $record[$key] = stripslashes($record[$val];
  }

>  echo $record[Game_Esrb_Rating];
>  if($Game_Esrb_Rating < 1){
>     $Esrb_Rate_Pic = "bar_rating_star_0.gif";

If you can be certain that $Game_Esrb_Rating is within 0-5 (ie you have 
validated your data properly before inserting into the database) then you can 
simply do 

  $Esrb_Rate_Pic = "bar_rating_star_{$Game_Esrb_Rating}.gif";

> my problem is with $Esrb_Rate_Pic, i can't put its value to the array
> , i used $row[Esrb_Rate_Pic] = $Esrb_Rate_Pic; but it didn't work

That's because it should be:

  $row['Esrb_Rate_Pic'] = $Esrb_Rate_Pic;

-- 
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
------------------------------------------
/*
Robot, n.:
 University administrator.
*/

--- End Message ---
--- Begin Message ---
<?php
$string = "function yes good";
$display = count_chars($string);

echo $display;
?>

i know this is wrong, but how can i count chars used here?

-- 
Louie Miranda
http://www.axishift.com

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

Excellent example! i wish more users would take the time to provide such clear examples.

The strlen() exists for you :)

ie.

<?php
$string = "function yes good";
$display = strlen($string);

echo $display;
?>

:)

Best Regards
Jake Press

Louie Miranda wrote:

<?php
$string = "function yes good";
$display = count_chars($string);

echo $display;
?>

i know this is wrong, but how can i count chars used here?




--- End Message ---
--- Begin Message ---
On Thu, 2004-12-16 at 14:28 +0800, Louie Miranda wrote:
> <?php
> $string = "function yes good";
> $display = count_chars($string);
> 
> echo $display;
> ?>
> 
> i know this is wrong, but how can i count chars used here?

php.net/strlen ?

-Robby
-- 
/***************************************
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*    --- Now supporting PHP5 ---
****************************************/

--- End Message ---
--- Begin Message ---
Louie Miranda wrote:

<?php
$string = "function yes good";
$display = count_chars($string);

echo $display;
?>

i know this is wrong, but how can i count chars used here?

strlen()
--- End Message ---
--- Begin Message ---
strlen is not accurate unless its a raw string, meaning just alpha chars, or
numbers..
otherwise you should run trim, strip_tags and the likes first.

----- Original Message ----- 
From: "M. Sokolewicz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 16, 2004 6:09 AM
Subject: [PHP] Re: counting chars..


> Louie Miranda wrote:
>
> > <?php
> > $string = "function yes good";
> > $display = count_chars($string);
> >
> > echo $display;
> > ?>
> >
> > i know this is wrong, but how can i count chars used here?
> >
> strlen()
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

--- End Message ---
--- Begin Message ---
Hi All,
   My problem is finally solved by totally off SELinux Security
Policies. Thank you very verry much the helps from yours! I know this
is not very safe solution, but at the leasy my script can work


yours,
Michael

--- End Message ---
--- Begin Message ---
Ciao Tomas,

I'm not sure if I followed your question completely but do you mean to
test a variable or an array element and unset it if it matches a certain
type?

If so, then maybe:

http://it.php.net/is_int

is_bool(), is_float(), is_numeric(), is_string(), is_array(), and
is_object()

will be of help?

Ian

On Wed, 2004-12-15 at 22:36 +0100, Tomas Tintera wrote:
> Hi all.
> 
> Is there some construct, which evaluates any type of its parameter (like 
> t_echo, t_unset) and returns some value with normal type (like 0)? What?
> 
> I would like to unset a variable in an operation like ()?unset():() and 
> I can not use "if" because "if" does not return normal type of value 
> (like 0 or 'a') and can not be used in operations like () && ().
> 
> Tomas Tintera
> 

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

"Richard Lynch" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Lorderon wrote:
> > What I want to do is "catch" the output buffer, but do not delay the
> > buffer
>
> It occurs to me that maybe you should tell us WHY you want this, because
> there could be existing alternatives outside the scope of PHP that we
> could recommend...
>
I need to store chunks of output into files. I can get the chunk output by
using ob_get_contents(), but after calling ob_start() the output is only
buffered and not sent till flushing. The delay from echoing to flushing is
exactly what I want to avoid. I want to echo the output imediatly and not
just on flushing, but still be able to buffer the chunk and get the output
into variable.

I hope it's clearer now..

thanks,
    Lorderon.

--- End Message ---
--- Begin Message ---
On Thursday 16 December 2004 19:25, Lorderon wrote:

> I need to store chunks of output into files. I can get the chunk output by
> using ob_get_contents(), but after calling ob_start() the output is only
> buffered and not sent till flushing. The delay from echoing to flushing is
> exactly what I want to avoid. I want to echo the output imediatly and not
> just on flushing, but still be able to buffer the chunk and get the output
> into variable.

If you can't get want you want by manipulating the ob_*() functions then try 
to structure your program so that all output is the result of explicit 
echo/print. Then it's just a simple matter to store them into a string before 
you output 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
------------------------------------------
/*
Happiness, n.:
 An agreeable sensation arising from contemplating the misery of another.
  -- Ambrose Bierce, "The Devil's Dictionary"
*/

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

I'm having a problem with fsockopen and was wondering has anyone ever
noticed a case where it will work from machine1 (dev machine) to machine2.
But when the was placed onto machine2 it wouldn't work connecting to it's
own ip address; 

when connecting via telnet it returns:

 Escape character is '^]'.
* OK [CAPABILITY IMAP4REV1 LOGIN-REFERRALS AUTH=LOGIN]
serverip IMAP4rev1 2003.339-cpanel at Wed, 15 Dec 2004
19:33:27 +0000 (GMT)

so I don't think it's the firewall. the error it returns is "No such file
or directory". So it seems that when it connects (which it does without
failing), the file seems to be deleted, as the file the variable refers to
doesn't exist on the fs either.

if(($s = fsockopen($id["sockname"], 0, $errno, $errstr)) === FALSE)

$id["sockname"] is in the format /tmp/filename with the filename changing
based on a random value and there are no files with that format in /tmp 

it always returns false for some reason on this server.

Thanks in advance for your help.
Dave

--- End Message ---
--- Begin Message --- Yao, Minghua wrote:
Hi, all,

I am testing how to post form-data to a host using the following code 
(test.php):

<?php
        function PostToHost($host, $path, $name, $value) {  // Test of posting 
form-data
                $fp = fsockopen($host,80);              

                fputs($fp, "POST $path HTTP/1.1\n");
                fputs($fp, "Host: $host\n");
                fputs($fp, "Content-Type: multipart/form-data\n");
                fputs($fp, "content-disposition: form-data; name=$name\n");
                fputs($fp, "Connection: close\n\n");

                fputs($fp, "$value\n");

                $res = "";
                while(!feof($fp)) {
                $res .= fgets($fp, 128);
                }
                
                fclose($fp);

                return $res;
        }

Check your function carefully. Where are you using the $name of the value?

Nowhere! Therefore the receiving script cannot identify the value as x.

Try: fputs($fp, "$name=$value\n");



Erwin
--- End Message ---

Reply via email to