php-general Digest 23 Dec 2001 03:44:39 -0000 Issue 1068

Topics (messages 78563 through 78606):

Re: PostgreSQL query taking a long time
        78563 by: Papp Gyozo

Re: array_walk() + class methods
        78564 by: Jeff Levy

Help with select boxes
        78565 by: Sam
        78571 by: Andrew Brampton

Re: Config Problems
        78566 by: Brian Clark
        78572 by: Ben Ocean
        78573 by: Brian Clark
        78574 by: Ben Ocean
        78576 by: Brian Clark

PGP --> PHP
        78567 by: J.Mueller, pro.vider.de GmbH
        78579 by: Brian Clark

Premature EOS Header
        78568 by: Anthony F. Rodriguez
        78580 by: Brian Clark

Php & Directory structures
        78569 by: Martin Hughes
        78570 by: Bogdan Stancescu
        78578 by: George Nicolae

Re: ./configure error. won't let me continue...
        78575 by: Brian Clark

Re: Sendemail appends domain to mail function
        78577 by: Bogdan Stancescu

PHP software tool
        78581 by: LaserJetter
        78582 by: Cristian Graziano
        78583 by: Brian Clark
        78584 by: -BD-
        78586 by: LaserJetter
        78587 by: py
        78595 by: Mike

Re: "Talkback" or community type participation.....
        78585 by: Warren Vail

gd problem
        78588 by: Phillip B. Bruce
        78592 by: Brian Clark
        78600 by: Yoep

Re: Function definition: how to make default argument an empty array?
        78589 by: Michael Sims
        78591 by: Philip Olson

Re: Question about CREATE_FUNCTION
        78590 by: Emile Bosch

Re: spliti[SOLUTION]
        78593 by: Philip Olson

PEAR E-mail
        78594 by: Gerard Onorato
        78597 by: Richard Heyes

Image generation scripts
        78596 by: Step One
        78601 by: Yoep

strtoupper and HTML entities
        78598 by: mweb
        78603 by: Michael Sims

probably more of a mysql question
        78599 by: Yoep

what is pear email
        78602 by: Rambo Amadeus
        78604 by: Richard Heyes

Jpeg to Wbmp algorithm
        78605 by: Alex Vargas

accessing xml docs?
        78606 by: Shahin

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 ---
use EXPLAIN to get more information about how postgres executes this query.
I'm not sure about this, but there are some issues with fields of type int8.
It may help to cast explicitly the fields involved in join like:
    
     WHERE bible.book::int4 = books.id::int4

Ask it the postgres mailing list, too!
btw, what version of pg do you have?

----- Original Message ----- 
From: "K Old" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 21, 2001 5:51 PM
Subject: [PHP] PostgreSQL query taking a long time


| Hello all,
| 
| I have a PostgreSQL database that is storing The Bible.  It has 31,103 
| records in it and I have a PHP page executing this query:
| SELECT
| books.book_name, bible.chapter, bible.verse, bible.versetext
| FROM asv_bible bible, book_bible books WHERE bible.book = books.id ORDER BY 
| random() LIMIT 1
| 
| The database schema is:
| 
| /* --------------------------------------------------------
|   Sequences
| -------------------------------------------------------- */
| CREATE SEQUENCE "book_bible_seq" start 1 increment 1 maxvalue 2147483647 
| minvalue 1 cache 1;
| 
| /* --------------------------------------------------------
|   Table structure for table "asv_bible"
| -------------------------------------------------------- */
| CREATE TABLE "asv_bible" (
|    "id" int8 NOT NULL,
|    "book" int8,
|    "chapter" int8,
|    "verse" int8,
|    "versetext" text,
|    CONSTRAINT "asv_bible_pkey" PRIMARY KEY ("id")
| );
| 
| 
| 
| /* --------------------------------------------------------
|   Table structure for table "book_bible"
| -------------------------------------------------------- */
| CREATE TABLE "book_bible" (
|    "id" int4 DEFAULT nextval('book_bible_seq'::text) NOT NULL,
|    "book_name" varchar(20),
|    CONSTRAINT "book_bible_pkey" PRIMARY KEY ("id")
| );
| 
| Right now it takes 9 seconds to return the results.  I was wondering if 
| anyone could offer any help with lowering the time it takes to run?
| 
| Or if this is the normal runtime for a database of this size, I'd just like 
| confirmation.
| 
| Thanks,
| Kevin
| 
| 
| _________________________________________________________________
| Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
| 
| 
| -- 
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
| 
--- End Message ---
--- Begin Message ---
Much obliged, that did the trick.

On Fri, 21 Dec 2001 05:48:31 -0500, Papp Gyozo wrote:

> array_walk($ar, array(&$object, 'methodname'));
> 
> ----- Original Message -----
> From: "Jeff Levy" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>
> Sent: Thursday, December 13, 2001 1:17 PM Subject: [PHP] array_walk() +
> class methods
> 
> 
> | I'd like to call a class method with array_walk(). Is this possible? |
> | class widget {
> |   function sicballs($arg){
> |     print $arg;
> |   }
> | }
> |
> | $x = new widget();
> |
> | $ar = array('my','values');
> |
> | array_walk($ar, ???)
> |
> | ...
> |
> | the only way I've been able to get this (simplified) code to work the
> way | I want it is:
> |
> | function snafu($arg) {
> |   global $x;
> |   call_user_method("sicballs", $x, $arg); | } |
> | obviously, I want to call the method direcly, without writing this |
> function, snafu()...
> |
> | anyone know?
> |
> | --
> | PHP General Mailing List (http://www.php.net/) | To unsubscribe,
> e-mail: [EMAIL PROTECTED] | For additional commands,
> e-mail: [EMAIL PROTECTED] | To contact the list
> administrators, e-mail: [EMAIL PROTECTED] |
>
--- End Message ---
--- Begin Message ---
Hi all, 

I've a problem which I don't know how to get over, think it could more be an
HTML problem, but anyway.

I've a select box with long options names, this makes the box appear huge on
screen.
I was wondering how I can change the size of the box, so that when the user
clicks on the drop down, the options expand outwards.

Is this possible?


Thanks
Sam

Also I'm only on the digest so could you reply to me as well, cheers.
--- End Message ---
--- Begin Message ---
I don't think what you want to do is possible..
and it is a HTML problem :)..
Maybe JScript could do it by populating the dropdown once you click it, but
I don't know if thats possible...

Andrew
----- Original Message -----
From: "Sam" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, December 22, 2001 1:42 PM
Subject: [PHP] Help with select boxes


> Hi all,
>
> I've a problem which I don't know how to get over, think it could more be
an
> HTML problem, but anyway.
>
> I've a select box with long options names, this makes the box appear huge
on
> screen.
> I was wondering how I can change the size of the box, so that when the
user
> clicks on the drop down, the options expand outwards.
>
> Is this possible?
>
>
> Thanks
> Sam
>
> Also I'm only on the digest so could you reply to me as well, cheers.
>

--- End Message ---
--- Begin Message ---
* Ben Ocean ([EMAIL PROTECTED]) [Dec 22. 2001 03:22]:

> None of these suggestions worked. So...what's wrong with this config script 
> that it throws these errors?

This may make no difference what so ever, but try removing config.cache,
then use my suggestions and see if you get a different result.

(No need to CC me this time)

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
English is my second language, gibberish is my first.

--- End Message ---
--- Begin Message ---
Well, that got me headed in the right direction. I ended up combining all 
the commands on one line and removing the references to openssl (I'll mess 
with that later) and it worked. I have no_idea why...
Thanks,
BenO

At 09:03 AM 12/22/01 -0500, you wrote:
>* Ben Ocean ([EMAIL PROTECTED]) [Dec 22. 2001 03:22]:
>
> > None of these suggestions worked. So...what's wrong with this config 
> script
> > that it throws these errors?
>
>This may make no difference what so ever, but try removing config.cache,
>then use my suggestions and see if you get a different result.
>
>(No need to CC me this time)
>
>--
>Brian Clark | Avoiding the general public since 1805!
>Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
>English is my second language, gibberish is my first.
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
* Ben Ocean ([EMAIL PROTECTED]) [Dec 22. 2001 11:54]:

> Well, that got me headed in the right direction. I ended up combining all 
> the commands on one line and removing the references to openssl (I'll mess 
> with that later) and it worked. I have no_idea why...

If you installed openssl from something like an rpm or deb package, you
may need to get the -dev version which contains all the libraries
configure is looking for. You may only have the shared libraries and
configure is looking for the header files, etc. If you install those,
configure might properly pick up openssl.

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
$ mount -t neuro /dev/brain /mnt/head

--- End Message ---
--- Begin Message ---
At 12:24 PM 12/22/01 -0500, you wrote:
>* Ben Ocean ([EMAIL PROTECTED]) [Dec 22. 2001 11:54]:
>
> > Well, that got me headed in the right direction. I ended up combining all
> > the commands on one line and removing the references to openssl (I'll mess
> > with that later) and it worked. I have no_idea why...
>
>If you installed openssl from something like an rpm or deb package, you
>may need to get the -dev version which contains all the libraries
>configure is looking for. You may only have the shared libraries and
>configure is looking for the header files, etc. If you install those,
>configure might properly pick up openssl.

Yeah, I know. It's not an urgent matter, but I'll probably do with that 
what I'm doing with php and mysql, etc.: rip out the rpms (rpm -e) and 
install from source with my own config files, then symlink openssl-whatever 
openssl. Just so much more control that way :))
Thanks!
BenO


>--
>Brian Clark | Avoiding the general public since 1805!
>Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
>$ mount -t neuro /dev/brain /mnt/head
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
* Ben Ocean ([EMAIL PROTECTED]) [Dec 22. 2001 12:38]:

> Yeah, I know. It's not an urgent matter, but I'll probably do with that 
> what I'm doing with php and mysql, etc.: rip out the rpms (rpm -e) and 
> install from source with my own config files, then symlink openssl-whatever 
> openssl. Just so much more control that way :))

Wise choice. :)

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
STATUS QUO is Latin for the mess we're in.

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

we have a problem to implement a PGP-function into
a PHP-Script. PHP 4.0.6 as CGI, Apache 1.3.11, FeeBSD 4.2

a)
PGP from the command line works:
% pgps -ato test.sig test.txt -z passphrase

b)
Calling a little PHP Script
$kommando  = "/usr/local/bin/pgps -ato test.sig test.txt -z passphrase";
exec("$kommando",$antwort);

to do so, also everything works fine:

  % virtual /usr/local/bin/php /etc/test-pgp.php
  Creating output file test.sig
  X-Powered-By: PHP/4.0.6
  Content-type: text/html

c)
But when we use this very same PHP-code within a script, and call this
script through the web, it's not working anymore and the error_log
says

  Cannot open configuration file pgp.cfg
  Cannot open secret keyring "secring.skr"
  Cannot open public keyring "pubring.pkr"


Why is that and can this problem be solved ?

Thank you very much.
Juergen



--- End Message ---
--- Begin Message ---
* J.Mueller, pro.vider.de GmbH ([EMAIL PROTECTED]) [Dec 22. 2001 10:03]:

> Hello Everybody,

Hiya.

> we have a problem to implement a PGP-function into
> a PHP-Script. PHP 4.0.6 as CGI, Apache 1.3.11, FeeBSD 4.2

> a)
> PGP from the command line works:
> % pgps -ato test.sig test.txt -z passphrase

> b)
> Calling a little PHP Script
> $kommando  = "/usr/local/bin/pgps -ato test.sig test.txt -z passphrase";
> exec("$kommando",$antwort);

> to do so, also everything works fine:

>   % virtual /usr/local/bin/php /etc/test-pgp.php
>   Creating output file test.sig
>   X-Powered-By: PHP/4.0.6
>   Content-type: text/html

> c)
> But when we use this very same PHP-code within a script, and call this
> script through the web, it's not working anymore and the error_log
> says

>   Cannot open configuration file pgp.cfg
>   Cannot open secret keyring "secring.skr"
>   Cannot open public keyring "pubring.pkr"

> Why is that and can this problem be solved ?

This happens because when you run this from the shell, it's picking up 
your environment. Apache has a completely different environment.

You need to create a dummy keyring for Apache's user in the location
this may provide:

<?php
$effective_user = posix_getpwuid(posix_geteuid());
print 'Apache is: ' . $effective_user['name'];
print '<br>Home is: ' .  $effective_user['dir'];
?>


Or you can use putenv() to make apache temporarily use another $HOME 
that has the correct keyrings.

YMMV

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
I think you need to flash your brain's firmware.

--- End Message ---
--- Begin Message ---
When I call the following script, I get "Premature End of Script Header". Why?
<?php
// file: "root/reg/dis/dis_4.php", updated: 12/15/01
$connection=@mysql_connect("localhost","wagner","pw") or die ("No connection!");

$db=@mysql_select_db("sbwresearch",$connection) or die ("No database!");

$qry_1="select * from con_inf where username=\"$username\"";
$result_1=@mysql_query($qry_1,$connection) or die ("No query # 1!");
$row_1=@mysql_affected_rows();

// username

if ($row_1==0)
{
  @mysql_free_result($result_1);
  @mysql_close($connection);
  header ("location:dis_2.htm");
  exit;
}

// password

else
{
  $row_2=@mysql_fetch_array($result_1);
};

if ($password!=$row_2["password"])
{
  @mysql_free_result($result_1);
  @mysql_close($connection);
  header ("location:dis_3.htm");
  exit;
}

else

{
  echo "
  <html>
  <body>
  TEST
  </body>
  </html>
  ";
};

@mysql_free_result($result_1);
@mysql_close($connection);
exit;
?>

Thanks!

Anthony F. Rodriguez
([EMAIL PROTECTED])

--- End Message ---
--- Begin Message ---
* Anthony F. Rodriguez ([EMAIL PROTECTED]) [Dec 22. 2001 10:25]:

> When I call the following script, I get "Premature End of Script Header". Why?
> <?php

[...]

> if ($password!=$row_2["password"])
> {
>   @mysql_free_result($result_1);
>   @mysql_close($connection);
>   header ("location:dis_3.htm");

It may be because of that ^^^ line. Try this:

header("Location: dis_3.htm");

Or check your server's error_log (which is bound to give you the reason
why).

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
Common sense is not.

--- End Message ---
--- Begin Message ---
Heya,

Can PHP count the number of a certain ftile in a directory and then print
the result to the screen? I have articles on my site that are in XML/XSL
format like:

root/articles/00_head.xml
                    00_body.xml
                    01_head.xml
                    01_body.xml
                    02_head.xml
                    02_body.xml
                    etc... (with appropriate XSL stylesheets too...)

and I want to have a main "article page" with the head.xml info on it:

Article 00:
By: <author>
Date: <whatever date>
Subject: <subject>

and then a link to the article itself (which will be an XSL stylesheet
loading both the header info and the article body.xml).

Can php count the number of articles etc in the dir and then automatically
create the page? (or can anyone think of a better way of doing this???? :-))

Cheers,

Martin


--- End Message ---
--- Begin Message ---
Just a suggestion: use exec("ls -1 root/articles/??_head.xml",$article_files) to
find out the files -- then walk $article_files, parse the file and echo whatever
you please. :-)

Bogdan

Martin Hughes wrote:

> Heya,
>
> Can PHP count the number of a certain ftile in a directory and then print
> the result to the screen? I have articles on my site that are in XML/XSL
> format like:
>
> root/articles/00_head.xml
>                     00_body.xml
>                     01_head.xml
>                     01_body.xml
>                     02_head.xml
>                     02_body.xml
>                     etc... (with appropriate XSL stylesheets too...)
>
> and I want to have a main "article page" with the head.xml info on it:
>
> Article 00:
> By: <author>
> Date: <whatever date>
> Subject: <subject>
>
> and then a link to the article itself (which will be an XSL stylesheet
> loading both the header info and the article body.xml).
>
> Can php count the number of articles etc in the dir and then automatically
> create the page? (or can anyone think of a better way of doing this???? :-))
>
> Cheers,
>
> Martin
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
u can use the function

function GetDirArray($sPath)
{
//Load Directory Into Array
$handle=opendir($sPath);
while ($file = readdir($handle)) if(($file!=".")&($file!=".."))
$retVal[(isset($retVal))?count($retVal):0] = $file;
//Clean up and sort
closedir($handle);
sort($retVal);
return $retVal;
}
//and then
count($a=GetDirArray($sPath))


--


Best regards,
George Nicolae
IT Manager
___________________
X-Playin - Professional Web Design
www.x-playin.f2s.com



"Bogdan Stancescu" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Just a suggestion: use exec("ls -1
root/articles/??_head.xml",$article_files) to
> find out the files -- then walk $article_files, parse the file and echo
whatever
> you please. :-)
>
> Bogdan
>
> Martin Hughes wrote:
>
> > Heya,
> >
> > Can PHP count the number of a certain ftile in a directory and then
print
> > the result to the screen? I have articles on my site that are in XML/XSL
> > format like:
> >
> > root/articles/00_head.xml
> >                     00_body.xml
> >                     01_head.xml
> >                     01_body.xml
> >                     02_head.xml
> >                     02_body.xml
> >                     etc... (with appropriate XSL stylesheets too...)
> >
> > and I want to have a main "article page" with the head.xml info on it:
> >
> > Article 00:
> > By: <author>
> > Date: <whatever date>
> > Subject: <subject>
> >
> > and then a link to the article itself (which will be an XSL stylesheet
> > loading both the header info and the article body.xml).
> >
> > Can php count the number of articles etc in the dir and then
automatically
> > create the page? (or can anyone think of a better way of doing this????
:-))
> >
> > Cheers,
> >
> > Martin
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


--- End Message ---
--- Begin Message ---
* [EMAIL PROTECTED] ([EMAIL PROTECTED]) [Dec 22. 2001 02:59]:

> Hello. 

Howdy.

>I am trying to 
> ./configure
> and I have many options I want to add. I receive an error which is further 
> below. It comes after I type this endless ./configure which you see below as 
> shown via telnet:

[...]

> ***ERROR IS:***
> configure: error: can only configure for one host and one target at a time 

> What does this mean?

configure can't figure out what kind of machine it is. For example, on
this machine:

(/usr/local/src/php-4.1.0)% /bin/bash config.guess
i686-pc-linux-gnu

What do you get when you run `/bin/bash config.guess` in your php source
directory? (Judging by what you wrote, it'll tell you nothing, but just
try it and see. Make sure you are in the top level of the source directory).

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
It's OK to be paranoid when everyone is out to get you.

--- End Message ---
--- Begin Message ---
Or, better yet, try "From: XYZ company <xyz@mydomain>";

Bogdan

Alex Vargas wrote:

> That's because XYZ company isn't a valid email address and sendmail fixes
> the address with the name of the server. If you'd put
> [EMAIL PROTECTED], you'd see that address unchanged.
>
> Alex.
>
> ----- Original Message -----
> From: "Peter" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, December 21, 2001 11:48 AM
> Subject: [PHP] Sendemail appends domain to mail function
>
> > Hi,
> >
> > I have problem.
> >
> > Everytime that I want to send email using a PHP script from my server, it
> > automatically appends the domain name of my server to the "From:" line.
> >
> > else
> > {
> > $mailheaders .= "From: XYZ company\n";
> > $mailheaders .= "Reply-To: $email\r\n";
> > $mailheaders .= "Content-Type: text/html; charset=iso-8859-1\r\n";
> > $remarks .= "<br><br>$items";
> > mail("[EMAIL PROTECTED]", "quotation enquiry", $remarks, $mailheaders);
> > ?><img src="images/thank_you.gif"><?
> > }
> > }
> >
> > As you can see from the example above , I use XYZ company , but in the
> > email that I receive it comes out as XYZ [EMAIL PROTECTED]
> >
> > It automatically appended the domain name to the end of it.
> >
> > How can I avoid this?
> >
> > Thanks.
> >
> > Peter
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
Does anybody know of or can recommend any freeware text editing tools for
editing PHP code in Win32?
I can manage with Windows' Notepad but something with code highlighting etc
and of a similar footprint to notepad would be useful.


--- End Message ---
--- Begin Message ---
http://synedit.sourceforge.net
--
Cristian Graziano
Digimax Graphics
Mobile: 206.409.7132
www.digimaxgraphics.com
----- Original Message -----
From: "LaserJetter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, December 22, 2001 10:46 AM
Subject: [PHP] PHP software tool


> Does anybody know of or can recommend any freeware text editing tools for
> editing PHP code in Win32?
> I can manage with Windows' Notepad but something with code highlighting
etc
> and of a similar footprint to notepad would be useful.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
* LaserJetter ([EMAIL PROTECTED]) [Dec 22. 2001 13:49]:

> Does anybody know of or can recommend any freeware text editing tools for
> editing PHP code in Win32?
> I can manage with Windows' Notepad but something with code highlighting etc
> and of a similar footprint to notepad would be useful.

FAQ like you would not believe.

<http://www.itworks.demon.co.uk/phpeditors.htm>
<http://marc.theaimsgroup.com/?l=php-general>

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
HTML email needs a rant tag.

--- End Message ---
--- Begin Message ---
I use 1stpage from evrsoft.com  .. not a "real" php editor, but does a
pretty good job...

> Does anybody know of or can recommend any freeware text editing tools for
> editing PHP code in Win32?
> I can manage with Windows' Notepad but something with code highlighting
etc
> and of a similar footprint to notepad would be useful.


--- End Message ---
--- Begin Message ---
Does 1st page work well with PHP? The website says its good for Perl, HTML
and ASP but it doesnt mention PHP anywhere.
:-s



"-Bd-" <[EMAIL PROTECTED]> wrote in message
028901c18b1c$3c0e4d80$[EMAIL PROTECTED]">news:028901c18b1c$3c0e4d80$[EMAIL PROTECTED]...
> I use 1stpage from evrsoft.com  .. not a "real" php editor, but does a
> pretty good job...
>
> > Does anybody know of or can recommend any freeware text editing tools
for
> > editing PHP code in Win32?
> > I can manage with Windows' Notepad but something with code highlighting
> etc
> > and of a similar footprint to notepad would be useful.
>
>


--- End Message ---
--- Begin Message ---
It works does fine with PHP, but my favorite is EditPlus,
py

At 07:29 PM 12/22/2001 +0000, you wrote:
>Does 1st page work well with PHP? The website says its good for Perl, HTML
>and ASP but it doesnt mention PHP anywhere.
>:-s
>
>
>
>"-Bd-" <[EMAIL PROTECTED]> wrote in message
>028901c18b1c$3c0e4d80$[EMAIL PROTECTED]">news:028901c18b1c$3c0e4d80$[EMAIL PROTECTED]...
> > I use 1stpage from evrsoft.com  .. not a "real" php editor, but does a
> > pretty good job...
> >
> > > Does anybody know of or can recommend any freeware text editing tools
>for
> > > editing PHP code in Win32?
> > > I can manage with Windows' Notepad but something with code highlighting
> > etc
> > > and of a similar footprint to notepad would be useful.
> >
> >
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
TextPad is another good text editor for all types of programming languages.
Unforuntatly it is not free but the demo my work for you.
http://www.textpad.com

It supports multiple languages like PHP, JAVA and HTML


-Mike

"Laserjetter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Does anybody know of or can recommend any freeware text editing tools for
> editing PHP code in Win32?
> I can manage with Windows' Notepad but something with code highlighting
etc
> and of a similar footprint to notepad would be useful.
>
>


--- End Message ---
--- Begin Message ---
Deron,

By doing a Post to itself, this form will cause an error everytime someone
clicks the Back button on the browser (after the first post, of course).

What I do is have two forms, first invoked with a get via hot link or
redirect.

Form_1.php checks to see if variable $s has been passed (in the URL, of
course), if not it initializes and displays the form.  The Form action on
this displayed form indicates to "Post" to Form_2.php.

Form_2.php displays nothing, just processes variables on the form.  This one
would insert the row, and to avoid thread problems (multiple simultaneous
inserts, from multiple users) has a unique "autoincrement" variable as the
primary key to the table (MySQL will make the insert "thread safe").  When
the insert is successful this routine redirects the browser back to form_1
like so;

        Header("Location: Form_1.php?s=$insertid");
        Exit;

When control is passed to Form_1.php again, this time the variable $s is set
and the row is retrieved from the table (instead of using initialization
values) and displayed in the form giving confirmation of the updates that
were done.

Because Form_2 redirects to Form_1, Form_1 is the only one on the browser
history list(each separate instance is tracked, of course), and it is always
entered via a Get, meaning that the browser does include the passed variable
values in the history list (it doesn't do this with a Post). And the Back
button works.  In the Post error you are working toward, the browser
complains that it does not have a record of the "Post" variable values (the
Data Has Expired).

There may be other ways to deal with this, but this is one way that I have
found that works.

Good Luck,

Warren Vail

-----Original Message-----
From:   Deron [mailto:[EMAIL PROTECTED]]
Sent:   Friday, December 21, 2001 11:38 PM
To:     [EMAIL PROTECTED]
Subject:        [PHP] "Talkback" or community type participation.....

Hi there!

I have this script I just made based on a tutorial I found online and was
wondering if there was a better way to do this or not. Everything works
great so far except for a couple little things. Once the $submit is clicked
and runs the INSERT data into the table... I am looking to be able to have
the page auto refresh and display the new entry as well as the form again.
Here's my current code: (I have this built into the main review page via an
include. The entire page can be viewed here:

http://www.metalages.com/2002/reviews/reviews-test.php?band=Evergrey&album=I
n%20Search%20of%20Truth

Feel free to post a dummy message, nothing is live yet, all in test mode :)

you'll notice once the entry is submitted also, if you try to refresh the
page it wants to readd the data again. any help or guidance appreciated, I
am a self professed "still learning this stuff"! kinda guy.


<?php

  if ($submit) {

  // Process Form

  $DBconn = mysql_connect("localhost", "user", "pass");
  mysql_select_db("databasename", $DBconn);
  if (!$DBconn) {
    echo( "<p>Unable to connect to the " .
       "database server at this time.</p>" );
 exit();
  }

    $sql = "INSERT INTO talkback (band_id, album_id,
talkback_name,talkback_email,talkback_comments) VALUES
('$currentid[0]','$currentid[1]','$talkback_name','$talkback_email','$talkba
ck_comments')";
    $result = mysql_query($sql);
    echo "Thank you! Information entered.\n";
  } else {

  // display form

?>

  <form method="post" action="<?php echo "$PHP_SELF" . "?band=$band" .
"&album=$album"?>">
  <div align="center"><b>Name/Nickname:</b><br>
    <input type="Text" name="talkback_name"><br>
    <b>Email (optional):</b><br>
    <input type="Text" name="talkback_email"><br>
    <b>Comments:</b><br>
    <textarea name="talkback_comments" cols="50" rows="5"></textarea>
    <br>
    <input type="Submit" name="submit" value="Speak Your Metal!">
  </div>
</form>

  <?php

} // end if

?>


Deron
www.metalages.com



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


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

   How can I tell if a web server has gd library load properly. I'm
having problem with
   the imagecreatejpeg as the graphics does not want to come up. The
code is correct.
   As other images that doesn't use this are coming up ok.

--
************************************************************
*** Phillip B. Bruce                                     ***
*** http://pbbruce.home.mindspring.com                   ***
*** [EMAIL PROTECTED]                               ***
***                                                      ***
*** "Have you ever noticed? Anybody going slower than    ***
*** you is an idiot, and anyone going faster than you    ***
*** is a maniac." - George Carlin                        ***
************************************************************



--- End Message ---
--- Begin Message ---
* Phillip B. Bruce ([EMAIL PROTECTED]) [Dec 22. 2001 14:47]:

> Hi,

Hi.

>    How can I tell if a web server has gd library load properly. I'm
> having problem with
>    the imagecreatejpeg as the graphics does not want to come up. The
> code is correct.
>    As other images that doesn't use this are coming up ok.

Do this:

% echo '<?php phpinfo();?>' > /path/to/web/root/foo.php

(of course, change the path to taste)

Then open foo.php in your web browser. Look for the section titled `gd'

That should tell you everything you need to know about gd support in
your build of PHP.

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
Forget Napster. Why not really break the law?

--- End Message ---
--- Begin Message ---
I had a very hard trouble the other week trying to do a fresh installation
of the newest PHP and Apache on the newest Suse (I think 7.3)
with the GD libaries installed!! Everytime it compiled it refused to include
the imagejpeg or imagepng support GD provides.

I ended up just putting the newsest Mandrake that already has the PHP-GD
library rpm for their apache/php build that is defualt on their servers.
I just spent a lot of time on it and thought I would spare you the trouble
if you are indeed using the newest Suse.... It might also have the same bug
on other installations.

Yoep

"Phillip B. Bruce" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
>    How can I tell if a web server has gd library load properly. I'm
> having problem with
>    the imagecreatejpeg as the graphics does not want to come up. The
> code is correct.
>    As other images that doesn't use this are coming up ok.
>
> --
> ************************************************************
> *** Phillip B. Bruce                                     ***
> *** http://pbbruce.home.mindspring.com                   ***
> *** [EMAIL PROTECTED]                               ***
> ***                                                      ***
> *** "Have you ever noticed? Anybody going slower than    ***
> *** you is an idiot, and anyone going faster than you    ***
> *** is a maniac." - George Carlin                        ***
> ************************************************************
>
>
>


--- End Message ---
--- Begin Message ---
At 01:17 PM 12/22/2001 +0100, Michael Jurgens wrote:
>I'm now looking for a way to have the second (optional) argument be an array
>of strings. I can't get it to work though...
>
>In pseudo-code:
>
>function makeyogurt ($flavour, $type = 'EMPTY ARRAY')
>{ }

Does this work?

function makeyogurt ($flavour, $type = "") {

         $type = (array) $type;

         ...
}

or

function makeyogurt ($flavour, $type = "") {

         settype ($type, "array");

         ...
}

??

--- End Message ---
--- Begin Message ---
> In pseudo-code:
> 
> function makeyogurt ($flavour, $type = 'EMPTY ARRAY')
> { }

  function makeyogurt ($flavour, $type = array()) {
      ...
  }

  or

  function makeyogurt ($flavour, $type = array('a','b')) {
      ...
  }

regards,
Philip Olson

--- End Message ---
--- Begin Message ---
since you CAN'T create functions runtime, unles you are using an eval
expression
but that's even slower that create_function..

function bla() {
}

$test = "bla";
$test();

Is not solving the problem since, it doesn't create a function at RUNTIME it
only references a function..
(it references $test to the function pointer blä)

create_function <= Php command

creates a function runtime.
But thanks for all your time anyway!

Warm regards,
Emile


"Bogdan Stancescu" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Why do you draw the conclusion you're misunderstood? We are unable to
answer
> your question about speed -- so aren't we allowed to have a separate
discussion
> derrivated from your question?
>
> Bogdan
>
> Emile Bosch wrote:
>
> > thx for al the help but i need some help of a php developer i guess cuz
i am
> > misunderstood here..
>


--- End Message ---
--- Begin Message ---
I missed this thread but:

 a) split takes on regex, explode does not.
 b) spliti is case insensitive, spaces don't have cases.

So, in your example, might as well use explode.

  $words = explode(' ', trim($string));

Although, let's say the following existed (it will):

  $string = 'a b     c  d      e f g    ';

Then using regex might be appropriate, and trim() is always nice.  Let's
split the above string by spaces and basically treat multiple spaces as
one:

  $words = split('[ ]+', trim($string));

Otherwise many empty elements in $words will exist.  This will also make
for a more reliable word count although it won't be perfect.

For examples on posix regex (which is taken on by split), see:

  http://www.phpbuilder.com/columns/dario19990616.php3?print_mode=1

regards,
Philip Olson


On Sat, 22 Dec 2001, Bharath Bhushan Lohray wrote:

> <?php
> $line = "no more words to say";
> $word=spliti(" ",$line);
> echo "$word[0] $word[1] $word[3]";
> ?>
> 
> Tested and works
> 

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

I was wondering if anyone could point me towards some good documentation on the PEAR 
e-mail functions. I was unable to turn up anything.

Thanks,

G


--- End Message ---
--- Begin Message ---
> I was wondering if anyone could point me towards some good 
> documentation on the PEAR e-mail functions. I was unable to turn 
> up anything.

http://www.phpguru.org/pear/contents.html

Not complete yet, but better than nothing.

-- 
Richard Heyes
"If you have any trouble sounding condescending,
find a Unix user to show you how it's done." - Scott Adams 
--- End Message ---
--- Begin Message ---
Hi there! 

I'm writing some stuff for a non-profit site as voluntary help. Does somebody have any 
PHP image generation scripts (GD) that could be used to "pretty" up a statistics page. 
The produced image should be a chart, pie, bars or something similar that could 
visually represent various statistical information. It would be great if one could 
specify background images etc. 

The image should be a bit more beautiful from the pie chart at 
http://skydiving-org.freeservers.com/stats.htm
A bit more customization and visual attraction would be great. 

Thanks! 
Terry
--- End Message ---
--- Begin Message ---
Terry,

Their is a cool class someone has made to make it a snatch to add graphs
charts, and so forth.
Make a search for google for "PHP graph" its the first result JPGraph.

I highly recommend it for your project.

Regards,
Yoep

"Step One" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi there!
>
> I'm writing some stuff for a non-profit site as voluntary help. Does
somebody have any PHP image generation scripts (GD) that could be used to
"pretty" up a statistics page. The produced image should be a chart, pie,
bars or something similar that could visually represent various statistical
information. It would be great if one could specify background images etc.
>
> The image should be a bit more beautiful from the pie chart at
http://skydiving-org.freeservers.com/stats.htm
> A bit more customization and visual attraction would be great.
>
> Thanks!
> Terry


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

I know I can convert a string to all uppercases with the strtoupper()
function. However, what if the original string contains HTML entities?

EXAMPLE:

original string = "funkst&ouml;rung"
                        contains lowercase o with dieresis (&ouml;)
                        properly displayed by browsers
after strtoupper becomes:
                "FUNKST&OUML;RUNG" which is displayed by browsers
                                         literally, because capital O with dieresis
                                         is &Ouml;
The uppercase version correctly displayable in a browser should be:

        "FUNKST&Ouml;RUNG

How can I convert to uppercase everything except these entities? Is there a 
straightforward solution, or do I really put together a regex that puts in 
lowercase everything from the second letter after an ampersand to the first 
colon?

                Thanks,

                        mweb
                
--- End Message ---
--- Begin Message ---
At 11:32 PM 12/22/2001 +0100, mweb wrote:
>Hello,
>
>I know I can convert a string to all uppercases with the strtoupper()
>function. However, what if the original string contains HTML entities?
>
>EXAMPLE:
>
>original string = "funkst&ouml;rung"

Try this:

<?
function htmltoupper($str) {
         $trans = get_html_translation_table (HTML_ENTITIES);
         $trans = array_flip ($trans);
         $str = strtr ($str, $trans);
         $str = strtoupper($str);
         $str = htmlentities($str);
         return $str;
}

$string = "funkst&ouml;rung";

$string = htmltoupper($string);

echo $string;
?>

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

I am using mysql with PHP.
I have one table called inventory with an index field of:
Inventory_Id int(11) NOT NULL auto_increment

Now I want to create another inventory table, for a different type say
Royal_Inventory where it also has a
Royal_Inventory_Id int(11) NOT NULL auto_increment

However, in my script I want to be able to use the two index fields as one
(in another table) yet differintiate between the two Inventories.
I was thinking if I could make the Royal_Inventory table have one char and
then the auto-increcment value it would be a good solution; like r1 or
r20012121 while inventory (not royal) would have just 1 or 20010210 .

If any of you know how to do this in mysql just send me the line I need :-)
It would be most appreciated.

Thanks,
Yoed



--- End Message ---
--- Begin Message ---
i dont understand. What is pear email, and what is it used for?

--- End Message ---
--- Begin Message ---
> i dont understand. What is pear email, and what is it used for?

http://cvs.php.net/cvs.php/php4/pear/Mail.php

and

http://cvs.php.net/cvs.php/php4/pear/Mail

-- 
Richard Heyes
"If you have any trouble sounding condescending,
find a Unix user to show you how it's done." - Scott Adams 
--- End Message ---
--- Begin Message ---
Hi. I need to convert jpegs to wbmp. Unfortunately, the PHP build available
in my server wasn't compiled with the GD library, so I have no access to
JPEG2WBMP().

Is the source code of this function available somewhere? Or does anyone know
about a PHP class to make this task? At least an algorithm to do the
jpeg-wbmp conversion?

Thanks,

Alex.

--- End Message ---
--- Begin Message ---
i'm trying to use the following code to access a node w/ id=$idnum in
record.xml :

$doc=new DomDocument;
$doc=xmldocfile( "record.xml" );

$strXPath = "/Students[@id='$idnum']";
$context=xpath_new_context($doc);
$query = xpath_eval($context,$strXpath);
$node = $query->nodeset[0];
$strValue = $node->content;

problem is, it decides that DomDocument isn't a class, so i get a fatal
error...
when i try to skip the instantiation, it says that xmldocfile() is
undefined.

the documentation is for 4.0.0, it's an experimental function... does anyone
know how to open an XML file for data retrieval/editing in 4.0.6?  or if i'm
making a mistake in my code?  i'm pretty new to this, that could very well
be the case...

THANKS,
shahin-


--- End Message ---

Reply via email to