OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 5 Dec 2003 22:21:09 -0000 Issue 2456

php-general-digest-helplists.php.net
Date: Fri Dec 05 2003 - 16:21:09 CST


php-general Digest 5 Dec 2003 22:21:09 -0000 Issue 2456

Topics (messages 171960 through 172031):

move_uploaded_file
        171960 by: Guido Schwab
        171962 by: Burhan Khalid

Re: Max Upload FIle Size
        171961 by: Burhan Khalid
        171963 by: David Otton

Re: Problem with references
        171964 by: Terry

converting string into array with regex
        171965 by: Adam i Agnieszka Gasiorowski FNORD
        171966 by: Jason Wong
        171967 by: Burhan Khalid
        171969 by: Wouter van Vliet
        172027 by: Adam i Agnieszka Gasiorowski FNORD
        172029 by: John W. Holmes

php2c
        171968 by: Volvo
        171978 by: Nathan Taylor

Handling Database errors in php
        171970 by: manoj nahar
        172005 by: Justin Patrin

XML & XSLT
        171971 by: Nick Wilson
        171974 by: Burhan Khalid
        171989 by: Nick Wilson

Re: how to determine if shopping cart has been abandoned?
        171972 by: Jay Blanchard
        171983 by: David T-G
        171984 by: David T-G

Re: What do you say to someone who says...
        171973 by: Jay Blanchard
        171976 by: Andrei Reinus

Re: Not able to Linux binary
        171975 by: Karam Chand
        171986 by: Jason Wong

preg_match
        171977 by: pete M
        171980 by: John W. Holmes
        171981 by: Marek Kilimajer

Re: Changing User Agent for fopen
        171979 by: Stuart
        171990 by: Nick Wilson
        172000 by: Stuart

R: [PHP] Handling Database errors in php
        171982 by: Alessandro Vitale

Re: Using exim with mail()
        171985 by: King Pochacoo

Apache 2 + PHP
        171987 by: Yves Arsenault
        171993 by: Martin Hudec
        172008 by: Yves Arsenault

PHP5 XSLT how to.
        171988 by: William Bailey
        171999 by: Marek Kilimajer
        172007 by: William Bailey
        172014 by: Anas Mughal

Re: unpack question
        171991 by: John J Foerch

simple php search
        171992 by: Paul Duggan
        171994 by: Sophie Mattoug
        171995 by: Dimitri Marshall
        171996 by: Eric Bolikowski
        171997 by: Eric Bolikowski
        171998 by: Paul Duggan
        172002 by: Paul Duggan
        172012 by: Blake Schroeder

PHP opensourcexperts.com
        172001 by: Mark Pratt
        172003 by: Ryan A
        172010 by: Mark Pratt

Re: International Addresses and Telephones
        172004 by: Pablo

CGI script not running under suexec
        172006 by: Anas Mughal

PHP Dynamic menu building
        172009 by: K. Praveen Kumar
        172021 by: Lowell Allen

Re: Not able to execute Linux binary
        172011 by: Karam Chand
        172015 by: Jason Wong

PHP RSS sites and SlashDot
        172013 by: Ryan A
        172016 by: Matt Matijevich
        172017 by: Mark Pratt
        172018 by: Ryan A
        172019 by: Ajai Khattri
        172020 by: Ryan A
        172022 by: Manuel Lemos

Re: SMTP vs POP3
        172023 by: Manuel Lemos

PHP on a Domino Web Server
        172024 by: Jonathan Villa
        172025 by: Pablo Gosse
        172026 by: Jonathan Villa

Regular expression assistance...
        172028 by: Jas

Spamming bastardly problem, please help
        172030 by: Ryan A
        172031 by: Eric Bolikowski

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


Hi!

I'm using the function move_uploaded_file in order to upload images on a
server.
My problem: It's not possible to upload a *.bmp file. Maybe this is not
possible with PHP's HTTP POST method, but I can't find a documentation.
Does anybody knows, if it's possible to configure PHP, that it's
possible to upload bitmaps?

Thnx,
Guido

attached mail follows:


Guido Schwab wrote:

> Hi!
>
> I'm using the function move_uploaded_file in order to upload images on a
> server.
> My problem: It's not possible to upload a *.bmp file. Maybe this is not
> possible with PHP's HTTP POST method, but I can't find a documentation.
> Does anybody knows, if it's possible to configure PHP, that it's
> possible to upload bitmaps?

I think the problem might be that the .bmp files you are trying to
upload exceed the upload_max_filesize or maybe post_max_size (php.ini
directives) and your script times out.

As far as I know, there is no file extension restriction directive in
php (as far as uploads go).

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
-----------------------
"Documentation is like sex: when it is good,
  it is very, very good; and when it is bad,
  it is better than nothing."

attached mail follows:


Steve Vernon wrote:
> Hello,
>
> I have search google, and PHP but I cannot find properly how to set the
> maximum post upload size as 200Kb?

Amazing what you can find in the manual these days
http://www.php.net/manual/en/configuration.directives.php#ini.post-max-size

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
-----------------------
"Documentation is like sex: when it is good,
  it is very, very good; and when it is bad,
  it is better than nothing."

attached mail follows:


On Fri, 05 Dec 2003 13:41:03 +0300, you wrote:

>Steve Vernon wrote:

>> I have search google, and PHP but I cannot find properly how to set the
>> maximum post upload size as 200Kb?

>Amazing what you can find in the manual these days
>http://www.php.net/manual/en/configuration.directives.php#ini.post-max-size

You snipped the important bit of the question:

"Do I use 200K or 200KB for post_max_size?"

Which that page doesn't answer.

Steve: the answer, from memory, is K - but set it to both and test it. Or
just set it to 102400.

Guido: you're probably running into the max file size problem with your
bitmap. The above link should help you.

attached mail follows:


Sorry if the title implies that I have a problem that needs solving. The
title was meant to imply that I think PHP may have a 'problem' (or at least
a shortcoming) with references.

I am currently in the detailed design phase of a project. There are many
possible ways to do things. One of the possible designs relies on object
references being returned in a function parameter, it would appear that you
can return anything in a function parameter EXCEPT a reference to an object.
So I will drop that particular alternative!

I was just seeking clarification that this was the case or whether I had
just overlooked some function (e.g. dereference($Ref) =& $Object).

As for the bizarre function, well that was just an illustration of what I
meant. It indicates that I can't just return copies of objects (which would
be the default case) because the returned sub-object would not be related to
the returned main object.

Thanks for the tip about returning arrays. I think that's where the final
design lies :)

"David Otton" <phpmailjawbone.freeserve.co.uk> wrote in message
news:ve1vsv89has36sdajq3e8f9oaevvuldthc4ax.com...
> On Thu, 4 Dec 2003 09:58:09 -0800, you wrote:
>
> >David Otton <phpmailjawbone.freeserve.co.uk>
> > on Thursday, December 04, 2003 3:43 AM said:
> >
> >> function f()
> >> {
> >> return (array (7, 5));
> >> }
> >>
> >> list ($a, $b) = f();
> >
> >Hey cool! I never knew about that.
>
> Yeah, compared with returning a pointer to an array of pointers to
> structs... well, scripting languages make you lazy :)
>
> But without some feedback, I have no idea whether it solved his problem or
> not :(

attached mail follows:


        How would you specify a regex to
 convert string into array using preg_split?
 Is there some symbol specyfying a place
 between letters ?

        s t r i n g => array('s', 't', 'r', 'i', 'n', 'g')
         ^ ^ ^ ^ ^

 , like this...

--
Seks, seksię, seksolatki... news:pl.soc.seks.moderowana
http://hyperreal.info { iWanToDie } WiNoNa ) (
http://szatanowskie-ladacznice.0-700.pl foReVeR( * )
Poznaj jej zwiewne kszta³ty... http://www.opera.com 007

attached mail follows:


On Friday 05 December 2003 19:08, Adam i Agnieszka Gasiorowski FNORD wrote:
> How would you specify a regex to
> convert string into array using preg_split?
> Is there some symbol specyfying a place
> between letters ?
>
> s t r i n g => array('s', 't', 'r', 'i', 'n', 'g')
> ^ ^ ^ ^ ^

RTFM!

--
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
------------------------------------------
/*
A journey of a thousand miles must begin with a single step.
                -- Lao Tsu
*/

attached mail follows:


Adam i Agnieszka Gasiorowski FNORD wrote:

> How would you specify a regex to
> convert string into array using preg_split?
> Is there some symbol specyfying a place
> between letters ?
>
> s t r i n g => array('s', 't', 'r', 'i', 'n', 'g')
> ^ ^ ^ ^ ^

You can access a string's characters with an index without declaring it
as an array.

$string = "foo";
echo $string{0}; //outputs f

http://www.php.net/substr (has an example)

Maybe this will solve your problem without using preg_split?

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
-----------------------
"Documentation is like sex: when it is good,
  it is very, very good; and when it is bad,
  it is better than nothing."

attached mail follows:


On vrijdag 5 december 2003 12:23 Burhan Khalid told the butterflies:
> Adam i Agnieszka Gasiorowski FNORD wrote:
>
> > How would you specify a regex to
> > convert string into array using preg_split?
> > Is there some symbol specyfying a place between letters ?
> >
> > s t r i n g => array('s', 't', 'r', 'i', 'n', 'g')
> > ^ ^ ^ ^ ^
>
> You can access a string's characters with an index without declaring
> it as an array.
>
> $string = "foo";
> echo $string{0}; //outputs f
>
> http://www.php.net/substr (has an example)
>
> Maybe this will solve your problem without using preg_split?
>
> --
> Burhan Khalid
> phplist[at]meidomus[dot]com
> http://www.meidomus.com
> -----------------------
> "Documentation is like sex: when it is good,
> it is very, very good; and when it is bad,
> it is better than nothing."

You kinda need to realize that

        $String = 'FooBar';
        print $String[4];

also prints out an 'B'. But this is adviced AGAINST because it is the same
syntax as you do for array elements.

To get a real array, do something like this:

        $Array = Array();
        for($i=0;$i<strlen($String);$i++) $Array[] = $String{$i};

But if you have a string with char-space-char stuff, split(' ', $String);
would do too.

Wouter

attached mail follows:


Wouter van Vliet wrote:
 
> On vrijdag 5 december 2003 12:23 Burhan Khalid told the butterflies:
> > Adam i Agnieszka Gasiorowski FNORD wrote:
> >
> > > How would you specify a regex to
> > > convert string into array using preg_split?
> > > Is there some symbol specyfying a place between letters ?
> > >
> > > s t r i n g => array('s', 't', 'r', 'i', 'n', 'g')
> > > ^ ^ ^ ^ ^
> >
> > You can access a string's characters with an index without declaring
> > it as an array.
> >
> > $string = "foo";
> > echo $string{0}; //outputs f
> >
> > http://www.php.net/substr (has an example)
> >
> > Maybe this will solve your problem without using preg_split?
> >
> > --
> > Burhan Khalid
> > phplist[at]meidomus[dot]com
> > http://www.meidomus.com
> > -----------------------
> > "Documentation is like sex: when it is good,
> > it is very, very good; and when it is bad,
> > it is better than nothing."
>
> You kinda need to realize that
>
> $String = 'FooBar';
> print $String[4];
>
> also prints out an 'B'. But this is adviced AGAINST because it is the same
> syntax as you do for array elements.
>
> To get a real array, do something like this:
>
> $Array = Array();
> for($i=0;$i<strlen($String);$i++) $Array[] = $String{$i};
>
> But if you have a string with char-space-char stuff, split(' ', $String);
> would do too.

        No, no spaces between letters (otherways
 it would be very easy, indeed). So there is
 no way to match the "space between alphanumeric
 chars" and split on it? I was trying to avoid
 the loop solution.

--
Seks, seksię, seksolatki... news:pl.soc.seks.moderowana
http://hyperreal.info { iWanToDie } WiNoNa ) (
http://szatanowskie-ladacznice.0-700.pl foReVeR( * )
Poznaj jej zwiewne kszta³ty... http://www.opera.com 007

attached mail follows:


From: "Adam i Agnieszka Gasiorowski FNORD" <agquarxvenus.ci.uw.edu.pl>

> No, no spaces between letters (otherways
> it would be very easy, indeed). So there is
> no way to match the "space between alphanumeric
> chars" and split on it? I was trying to avoid
> the loop solution.

Of course there is. In fact, this example, direct from the manual, does
exactly what you want...

<?php
$str = 'string';
$chars = preg_split('//', $str, -1, PREG_SPLIT_NO_EMPTY);
print_r($chars);
?>
Imagine that!---John Holmes...

attached mail follows:


Hi,

Is there any project going on transfering the PHP code into C++?

I found http://binaryphp.sf.net/ but when I run the convert.php on Windows
machine I get an error as below

C:\servers\binaryPHP>convert.php --if examples/helloworld.php --of hello

PHP Notice: Undefined index: argc in C:\servers\binaryPHP\convert.php on
line 9
Content-type: text/html
X-Powered-By: PHP/4.3.2

<br />
<b>Notice</b>: Undefined index: argc in
<b>C:\servers\binaryPHP\convert.php</b
> on line <b>9</b><br />
Usage: convert.php --if <inputfile.php> --of <output> [-v | --verbose] [-h
| --h
elp]
Too Few Arguments

any help?

Volvo

attached mail follows:


Hello,

BinaryPHP is still at a dev state and is incomplete, if you're having specific problems try stopping by #binaryphp on freenode and talking to Daeken there regarding them.

Best Wishes,
Nathan
  ----- Original Message -----
  From: Volvo
  To: php-generallists.php.net
  Sent: Friday, December 05, 2003 6:33 AM
  Subject: [PHP] php2c

  Hi,

  Is there any project going on transfering the PHP code into C++?

  I found http://binaryphp.sf.net/ but when I run the convert.php on Windows
  machine I get an error as below

  C:\servers\binaryPHP>convert.php --if examples/helloworld.php --of hello

  PHP Notice: Undefined index: argc in C:\servers\binaryPHP\convert.php on
  line 9
  Content-type: text/html
  X-Powered-By: PHP/4.3.2

  <br />
  <b>Notice</b>: Undefined index: argc in
  <b>C:\servers\binaryPHP\convert.php</b
> on line <b>9</b><br />
  Usage: convert.php --if <inputfile.php> --of <output> [-v | --verbose] [-h
  | --h
  elp]
  Too Few Arguments

  any help?

  Volvo

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

attached mail follows:


Hi guys,

Column of table defined as primary key. there is violation and error
message from database.

1) First way is to check if the value is already in database and then
contuninue with insert
        (this invloes an extra select for every insert and leaves
defined primary key redundant)
                 

What is the best approach to be followed for this scenario.?
what if there are several constrains defined on a table?

cheers

Manoj

attached mail follows:


If you want to get database errors back in a meaningful format, I'd
suggest using PEAR::DB or another of the DB abstraction classes. They
can return an error which you can then check and handle appropriately.
In addition, it can let you use the same code for multiple database
types (should you even want to do the same thing on another DB backend).

Manoj Nahar wrote:
> Hi guys,
>
> Column of table defined as primary key. there is violation and error
> message from database.
>
> 1) First way is to check if the value is already in database and then
> contuninue with insert
> (this invloes an extra select for every insert and leaves defined
> primary key redundant)
>
> What is the best approach to be followed for this scenario.?
> what if there are several constrains defined on a table?
>
> cheers
>
> Manoj

attached mail follows:


Hi all,

under 4.3 is there any way to work with XSLT and XML that *does not*
require additional modules etc to be installed? Perhaps a set of classes
or somesuch?

Many thanks...
--
Nick W

attached mail follows:


Nick Wilson wrote:

> Hi all,
>
> under 4.3 is there any way to work with XSLT and XML that *does not*
> require additional modules etc to be installed? Perhaps a set of classes
> or somesuch?
>
> Many thanks...

http://pear.php.net
http://www.phpclasses.org

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
-----------------------
"Documentation is like sex: when it is good,
  it is very, very good; and when it is bad,
  it is better than nothing."

attached mail follows:


* and then Burhan Khalid declared....
> >under 4.3 is there any way to work with XSLT and XML that *does not*
> >require additional modules etc to be installed? Perhaps a set of classes
> >or somesuch?
> >
> >Many thanks...
>
> http://pear.php.net
> http://www.phpclasses.org

Thanks, hard to beleive I've not looked at those pages before ;-)
I found this: http://www.anter.com.ua/myXML/

Anyone using it?

--
Nick W

attached mail follows:


[snip]
> Of course, now you have to deal with putting inventory back on the
> shelf when the session expires....and you have no way of knowing when
> that would happen unless you're storing *something*.

A good point, if that's the way he wants to do things...

In which case, SC needs to be stored SOMEWHERE (DB), and a cron job
garbage cleanout could take place every 1/15/30/60 minutes to remove
SC's without matching sessions, or something similar.
[/snip]

How about a session identified limbo table?

attached mail follows:


Chris, et al --

...and then Chris W. Parker said...
%
% Hey there everyone.

Hiya!

%
...
% How do you determine if a shopping cart has been abandoned or not?
...
%
% The problem I see is that a cart could be considered abandoned for 4
% days but then become active again because the customer has come back to
% it and has added more products to it. In this case I'd say it was never
% abandoned in the first place and in which case it would be innacurate to
% include it your abandoned cart total.

If you go with the ideas of keeping the cart in a session (and not
decrementing the stock until purchase time) then it's easy; when the
session goes away the cart does and it's abandoned. Have a simple table
of all carts created or even a counter of carts and reference that
against completed carts to get your ratio.

If you go with the ideas of storing the cart in the DB, then either
implement the simple table above for your count as carts get deleted
or just add an 'abandoned' field and keep the cart forever or perhaps
combine the two and note old carts that are due to be wiped as such and
include that analysis in the math against the cart_total_count table.

HTH & HAND

:-D
--
David T-G * There is too much animal courage in
(play) davidtgjustpickone.org * society and not sufficient moral courage.
(work) davidtgworkjustpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQE/0IoSGb7uCXufRwARAspAAJ9+WQhxk2aQlhp9IGYYX2x+ItyRQQCfUxP1
pZJwlTMmh4zTgTl0ysDW6cE=
=vK4K
-----END PGP SIGNATURE-----

attached mail follows:


Chris, et al --

...and then Chris W. Parker said...
%
...
%
% Would it be too complicated to say "5 in inventory, 2 of those are in
% customer shopping carts"? Or something along those lines?

I shouldn't think so; it would be a bit of extra work, but not a big
deal. If you did, then I'd have a notice somewhere that an item in an
old cart might get sold out from under the buyer (especially if there's
any real or implied guarantee of availability).

I would imagine that Amazon, from another example, has at least this
level or perhaps even doesn't note the stock as "gone". Surely it would
kill them if I ordered 432 copies of my buddy's book, waited until they
said that they had stock again, and then repeated the process.

%
% Chris.
%
% p.s. Does anyone know of any mailing lists that deal with e-commerce and
% shopping cart design (code/implementation/logic/etc.)???

I don't, but if you find one I'd be interested.

HTH & HAND

:-D
--
David T-G * There is too much animal courage in
(play) davidtgjustpickone.org * society and not sufficient moral courage.
(work) davidtgworkjustpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQE/0IrgGb7uCXufRwARAmjqAKC8kNXMVxgPhFpYkacCU7qSEalKJQCfUeFO
L34eQ7dWEyjuZ0XlM0CHfHk=
=Mdji
-----END PGP SIGNATURE-----

attached mail follows:


[snip]
> <snip>
> "Jay Blanchard" <jay.blanchardniicommunications.com> wrote in message
>
news:C8F323573C030A448F3E5A2B6FE2070B01AFAC39nemesis.niicommunications.
com...
>
> There are several
> large complex projects using PHP as the language, jsut as there are
> several large projects out there using C++, JAVA, Fortran, Cobol
> etc.etc.etc.
> </snip>
>
> I'm cringeing! Did you just compare C++, Java, PHP, Fortran and ...
>
> COBOL?

If he would have thrown in PASCAL, I would feel that my education at LSU

in the 80's wasn't a total waste. ;)
[/snip]

OMG ... ROFLLMFAO! Totally forgot PASCAL, who'd you take it with?

attached mail follows:


http://www.zend.com/customers.php

Do all these companies think that
        "PHP is just a kiddie language"?

just my 0.02$

attached mail follows:


Hello

I am a astudent and my domain area is C++ I am and new
to PHP and all other scripting language. Couldnt hire
a PHP programmer coz of lack of funds :)

The program I wrote was just to learn how to execute a
binary from PHP. My actuall program takes a Name as
the first parameter and generates a registration code
for my software. I wanted a web based interface
wherein a user gives a Name and I can generate a Reg
Code for them and show it as output.

Therefore I do something like this -

./myapp "Karam"

output

a3fdgt567vcx75

Thats it. It only outputs the regcode and nothing
else. This is using some algorithm which is not
possible in PHP so cant use PHP out here :)

I have set the error reporting to full but nothing
happens. The PHP page loads up blank.

Ideally I should be doing something like this -

exec ( "myapp \"Karam\"");

and it should output the regcode?

I dont have any idea about safe mode. My PHP is loaded
up in my Host's server. Can I change the settings? If
yes then what should I do?

Thanks for your help.

Karam

--- Jason Wong <php-generalgremlins.biz> wrote:
> On Friday 05 December 2003 14:04, Karam Chand wrote:
>
> > I created a linux binary using GCC. Whenever you
> > execute it reads a file from the current directory
> and
> > outputs the contents. e.g. -
> >
> > ./myapp
> >
> > output
> >
> > hello world.
>
> If that is all it does, and that is all you need,
> why not implement it in PHP
> code?
>
> > Now I want to execute it from php() so that I can
> > output the content on a HTML page or get the data
> in a
> > variable. Reading thru the manuals i came across
> > passtrhu() and exec().
> >
> > I tried passthru
> >
> > passthru("myapp");
> > and
> > passthru("./myapp");
> >
> > but nothing is outputted. What is wronf?
>
> 1) enable FULL error reporting
> 2) check safe mode settings
>
> --
> 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
> ------------------------------------------
> /*
> Win98 is called Win98 because you need 98 MB RAM to
> install it.
> */
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

attached mail follows:


On Friday 05 December 2003 20:43, Karam Chand wrote:

> I have set the error reporting to full but nothing
> happens. The PHP page loads up blank.

Put the following lines at the top of your program:

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

That will force ALL errors to be displayed. Now do you see any errors?

Do you have any debugging code to confirm that your code is running? Eg:

  echo "Start";
  exec ( "myapp \"Karam\"");
  echo "End";

> I dont have any idea about safe mode. My PHP is loaded
> up in my Host's server. Can I change the settings? If
> yes then what should I do?

Before even contemplating changing the settings, read the relevant chapter in
the manual then check its current settings by using phpinfo().

--
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
------------------------------------------
/*
Your mode of life will be changed to EBCDIC.
*/

attached mail follows:


could someone explain what this bit of code does please...

if (!preg_match("/^".$thumbname."/",$item))
{
}

tia
PEte

attached mail follows:


pete M wrote:

> could someone explain what this bit of code does please...
>
> if (!preg_match("/^".$thumbname."/",$item))

Determines if $item begins with $thumbname.

Same as, but probably slower than this:

if(substr($item,0,strlen($thumbname)) == $thumbname)

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

attached mail follows:


If $thumbname does not contain any regular expression syntax characters,
it mean $item must begin with $thumbname to match the expression. Even a
dot is a syntax character, the code should better be:

if (!preg_match("/^".preg_quote($thumbname)."/",$item))

preg_quote will escape special characters. But John's suggestion is better.

pete M wrote:

> could someone explain what this bit of code does please...
>
> if (!preg_match("/^".$thumbname."/",$item))
> {
> }
>
> tia
> PEte
>

attached mail follows:


Gohaku wrote:
> There are some pages I would like to extract links from but I can't
> access the page using the following:
> ini_set('php.user_agent', 'Mozilla/5.0');
> $url = "http://www.google.com/search?q=php";
> $fp = fopen($url,"r");
> $buffer = fread($fp,1000000);
> echo $buffer;

1) The php.ini option is user_agent, not php.user_agent. Changing that
has the desired effect.

2) If you want to query google you're better off using the google SOAP
API - it's legal for a start. See the following for more info...

http://www.google.com/apis/
http://www.devshed.com/Server_Side/PHP/GoogleAPI/page1.html

> Also, what is the best number to use when allocating Buffer space for a
> URL?
> Is 1000000 too much?
> Thanks.
> -Gohaku

3) You're better off looping to get the full contents than trying to
'guess' how big the file will be. Try the following...

<?php
     ini_set('user_agent', 'Mozilla/5.0');
     $url = 'http://www.google.com/search?q=php';
     $fp = fopen($url, "r");
     while (!feof($fp))
     {
         $buffer = fread($fp, 1024);
         echo $buffer;
     }
?>

--
Stuart

attached mail follows:


* and then Stuart declared....
> 2) If you want to query google you're better off using the google SOAP
> API - it's legal for a start. See the following for more info...
>
> http://www.google.com/apis/
> http://www.devshed.com/Server_Side/PHP/GoogleAPI/page1.html

and
http://dietrich.ganx4.com/nusoap/index.php

An excellent SOAP tookit.

--
Nick W

attached mail follows:


Nick Wilson wrote:
> * and then Stuart declared....
>
>>2) If you want to query google you're better off using the google SOAP
>>API - it's legal for a start. See the following for more info...
>>
>>http://www.google.com/apis/
>>http://www.devshed.com/Server_Side/PHP/GoogleAPI/page1.html
>
> and
> http://dietrich.ganx4.com/nusoap/index.php
>
> An excellent SOAP tookit.

Indeed, as used in the DevShed article :)

--
Stuart

attached mail follows:


I am not sure if this could match you requirements but I often use this
pattern:

"INSERT IGNORE... SET VAR=0"
"UPDATE..."

the first query will do the insert if not present a record with a same
unique index key
the second will be redundand if the first succeed and will do the job if the
first fails

both of the query should be designed for not to raise any error

cheers.

alessandro

-----Messaggio originale-----
Da: manoj nahar [mailto:manojmail15.com]
Inviato: venerdģ 5 dicembre 2003 13.07
A: php-generallists.php.net
Oggetto: [PHP] Handling Database errors in php

Hi guys,

Column of table defined as primary key. there is violation and error
message from database.

1) First way is to check if the value is already in database and then
contuninue with insert
        (this invloes an extra select for every insert and leaves
defined primary key redundant)

What is the best approach to be followed for this scenario.?
what if there are several constrains defined on a table?

cheers

Manoj

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

attached mail follows:


For 1,
I have checked the exim doc, it is ok to call exim directly.
  
For 2,
 
How can I deal with this ???
Would you tell in details, pls.

Martin Cameron <cameroncameron.co.nz> wrote:
I see two problems here:
1. The standard installation of exim requires you to make a symlink from
sendmail to exim and so you don't call exim directly;
2. If exim is owned by user 'mail' or 'exim' - the defaults - and
you're trying to call it with user 'nobody' or 'www' or whatever your
default apache user is, you're going to have a problem, aren't you?

On Fri, 2003-12-05 at 18:17, King Pochacoo wrote:
> Hi all,
>
> I set
> sendmail_path = /usr/sbin/exim -ti
> in php.ini
>
> But when I call to mail(), it displays
> Fatal error: Call to undefined function: mail() in /home/society/info/public_html/forum/include/userlogin.php on line 361
>
> What's wrong with my setting in php.ini ??? I am sure my code is working normally.
>
> Is anyone using exim v4 ? How do you set sendmail_path ???
>
>
> Thx for you advance
>
> Shining Friends?å„½åæƒå„½?±ć€ę­²?ˆå?ę­?..
> 浪漫?“聲 ?…å???¹«
> http://ringtone.yahoo.com.hk/

--
This message has been scanned for viruses and
dangerous content by WebNet Internet Services, and is
believed to be clean.
WebNet Internet Services .

Shining Friends”B¦n¤ß¦n³ų”B·³¤ė¦pŗq...
®öŗ©¹aĮn ±”¤ß³sĆ“
http://ringtone.yahoo.com.hk/

attached mail follows:


Hello,

This may be very old, but I thought I would ask.

Is this warning outdated?
http://www.php.net/manual/en/install.apache2.php
"Do not use Apache 2.0 and PHP in a production environment neither on Unix
nor on Windows."
I'm running RedHat 9.

I've got Apache 2.0.48 running and was ready to install the latest php
4.3.x..
Just thought I would check.

Thanks,

Yves Arsenault
5, Acadian Dr
Charlottetown, PEI
C1C 1M2
902.368.1895 ext.227
902.566.5989 FAX
ICQ # 117650823

attached mail follows:


Hi there,

when I had Gentoo Linux, I was using Apache 2.0.48 with PHP 4.3.4 installed
from Gentoo portage. It was running <10 smallscale php/mysql based
virtualhosts without any difficulties.

On Friday 05 December 2003 15:24, Yves Arsenault wrote:
> Is this warning outdated?
> http://www.php.net/manual/en/install.apache2.php
> "Do not use Apache 2.0 and PHP in a production environment neither on Unix
> nor on Windows."
> I'm running RedHat 9.
>
> I've got Apache 2.0.48 running and was ready to install the latest php
> 4.3.x..
> Just thought I would check.
--
:
:. kind regards
:.. Martin Hudec
:.:
:.: =w= http://www.aeternal.net
:.: =m= +421.907.303393
:.: == corwinaeternal.net
:.:
:.: "When you want something, all the universe
:.: conspires in helping you to achieve it."
:.: - The Alchemist (Paulo Coelho)

attached mail follows:


Would anyone know of the issues that might affect PHP 4.3.4 and Apache
2.0.48 ?

Thanks,

Yves

-----Original Message-----
From: Martin Hudec [mailto:corwinaeternal.net]
Sent: 5 décembre 2003 10:52
To: PHP-General
Subject: Re: [PHP] Apache 2 + PHP

Hi there,

when I had Gentoo Linux, I was using Apache 2.0.48 with PHP 4.3.4 installed
from Gentoo portage. It was running <10 smallscale php/mysql based
virtualhosts without any difficulties.

On Friday 05 December 2003 15:24, Yves Arsenault wrote:
> Is this warning outdated?
> http://www.php.net/manual/en/install.apache2.php
> "Do not use Apache 2.0 and PHP in a production environment neither on Unix
> nor on Windows."
> I'm running RedHat 9.
>
> I've got Apache 2.0.48 running and was ready to install the latest php
> 4.3.x..
> Just thought I would check.
--
:
:. kind regards
:.. Martin Hudec
:.:
:.: =w= http://www.aeternal.net
:.: =m= +421.907.303393
:.: == corwinaeternal.net
:.:
:.: "When you want something, all the universe
:.: conspires in helping you to achieve it."
:.: - The Alchemist (Paulo Coelho)

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

attached mail follows:


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello again.

        I am currently testing the php5 beta and really like the new DOM
objects but i am haveing trouble finding out how i can apply a XSLT
template to a DOM document. Does anybody know how i can do this?

I have tried looking at the DOM documentation in the online php manual
but am finding it to be all out of date in respect to the php5
implementation so if anybody could also point me to the correct
information i would be very happy.

- --
Regards,
        William Bailey.
        Pro-Net Internet Services Ltd.
        http://www.pro-net.co.uk/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE/0JaxzSfrYDJMXmERAqxMAKCaScLStKA/0+TMMZRONmVHlVy14ACgw4l6
TkqlC7o1M7mu0cJxbJLVaCo=
=evdC
-----END PGP SIGNATURE-----

attached mail follows:


<snip>
XML support has been completely redone in PHP 5, all extensions are now
focused around the excellent libxml2 library (http://www.xmlsoft.org/).
</snip>

Try libxml2 documentation.

William Bailey wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello again.
>
> I am currently testing the php5 beta and really like the new DOM
> objects but i am haveing trouble finding out how i can apply a XSLT
> template to a DOM document. Does anybody know how i can do this?
>
> I have tried looking at the DOM documentation in the online php manual
> but am finding it to be all out of date in respect to the php5
> implementation so if anybody could also point me to the correct
> information i would be very happy.
>
> - --
> Regards,
> William Bailey.
> Pro-Net Internet Services Ltd.
> http://www.pro-net.co.uk/
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.1 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQE/0JaxzSfrYDJMXmERAqxMAKCaScLStKA/0+TMMZRONmVHlVy14ACgw4l6
> TkqlC7o1M7mu0cJxbJLVaCo=
> =evdC
> -----END PGP SIGNATURE-----
>

attached mail follows:


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ok Just incase anybody else would like to know how to do it i found that
the following works:

PHP Code ----

$dom = new DomDocument();
$aboutNode = $dom->appendChild($dom->createElement('about'));
$aboutNode->setAttribute('name', 'My Application');
$versionNode = $aboutNode->appendChild($dom->createElement('version'));
$versionNode->setAttribute('major', 0);
$versionNode->setAttribute('minor', 1);
$versionNode->setAttribute('revision', 5);
$versionNode->appendChild($dom->createTextNode('Its a test'));

$xsl = new domDocument();
$xsl->load('loading.xsl');

$proc = new xsltprocessor;
$proc->importStylesheet($xsl);

print($proc->transformToXml($dom));

loading.xsl ---

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<title>About</title>
</head>
<body>
~ <h1 style="text-align:center; margin: 0; padding: 0;">
<xsl:value-of select="/about/name"/>
~ v<xsl:value-of select="/about/version/major"/>.<xsl:value-of
select="/about/version/minor"/>.<xsl:value-of
select="/about/version/revision"/> (<xsl:value-of
select="/about/version"/>)</h1>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

- ---

Regards,
        William Bailey.
        Pro-Net Internet Services Ltd.
        http://www.pro-net.co.uk/

| William Bailey wrote:
|
| Hello again.
|
| I am currently testing the php5 beta and really like the new DOM
| objects but i am haveing trouble finding out how i can apply a XSLT
| template to a DOM document. Does anybody know how i can do this?
|
| I have tried looking at the DOM documentation in the online php manual
| but am finding it to be all out of date in respect to the php5
| implementation so if anybody could also point me to the correct
| information i would be very happy.
|
| --
| Regards,
| William Bailey.
| Pro-Net Internet Services Ltd.
| http://www.pro-net.co.uk/
|>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE/0MLkzSfrYDJMXmERAuTIAKCXEXZz/du+27Gvs8H5AYlOnA8zPgCfYjdb
W4hfTj5ah+a57Cn9kp01rLQ=
=MUEY
-----END PGP SIGNATURE-----

attached mail follows:


http://trash.chregu.tv/phpconf2003/examples/

Hope it helps...
--
Anas Mughal

William Bailey wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello again.
>
> I am currently testing the php5 beta and really like the new DOM
> objects but i am haveing trouble finding out how i can apply a XSLT
> template to a DOM document. Does anybody know how i can do this?
>
> I have tried looking at the DOM documentation in the online php manual
> but am finding it to be all out of date in respect to the php5
> implementation so if anybody could also point me to the correct
> information i would be very happy.
>
> - --
> Regards,
> William Bailey.
> Pro-Net Internet Services Ltd.
> http://www.pro-net.co.uk/
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.1 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQE/0JaxzSfrYDJMXmERAqxMAKCaScLStKA/0+TMMZRONmVHlVy14ACgw4l6
> TkqlC7o1M7mu0cJxbJLVaCo=
> =evdC
> -----END PGP SIGNATURE-----
>

attached mail follows:


Thanks. Neat trick with the printf command. I'll use that for now.

John

> I suppose it is a bug. It seems that all unsigned unpacks dont
> honor this, as the documentation on unpack does note.
>
> I did, however, write a patch that will enable the returning of
> unsigned values. It still needs approval and is currently only for
> the cvs version of php:
>
> http://zirzow.dyndns.org/patches/pack.patch
>
> A work around on this is you'll have to use s/printf() to obtain the
> correct unsigned value:
>
> $array = unpack('Llongvalue', -1);
> printf("%lu", $array['longvalue']);

attached mail follows:


if I create a text box:

<body>

<form action="nextpage.html" method="GET" name="myform">

 <input type="Text" name="surname" align="TOP" size="25"><br>

 <input type="Submit" value="Submit" align="MIDDLE">

</form>

how do I go about extracting a surname from a mysql database?

will it be something along the lines?

select firstname,surname
from employees
where surname = textbox.surname;

new to this so im trying to get my head around it, basically i just want to
search a mysql database by someones surname.

cheers!

attached mail follows:


Paul Duggan wrote:

>if I create a text box:
>
><body>
>
><form action="nextpage.html" method="GET" name="myform">
>
> <input type="Text" name="surname" align="TOP" size="25"><br>
>
> <input type="Submit" value="Submit" align="MIDDLE">
>
></form>
>
>
>how do I go about extracting a surname from a mysql database?
>
>
>
>will it be something along the lines?
>
>select firstname,surname
>from employees
>where surname = textbox.surname;
>
>

"SELECT firstname, surname FROM employees WHERE surname =
'{$_GET['surname']}'"

>
>new to this so im trying to get my head around it, basically i just want to
>search a mysql database by someones surname.
>
>cheers!
>
>
>
>

attached mail follows:


"Sophie Mattoug" <sophiesitadelle.com> wrote in message
news:3FD09C24.7070101sitadelle.com...
> Paul Duggan wrote:
>
> >if I create a text box:
> >
> ><body>
> >
> ><form action="nextpage.html" method="GET" name="myform">
> >
> > <input type="Text" name="surname" align="TOP" size="25"><br>
> >
> > <input type="Submit" value="Submit" align="MIDDLE">
> >
> ></form>
> >
> >
> >how do I go about extracting a surname from a mysql database?
> >
> >
> >
> >will it be something along the lines?
> >
> >select firstname,surname
> >from employees
> >where surname = textbox.surname;
> >
> >
>
> "SELECT firstname, surname FROM employees WHERE surname =
> '{$_GET['surname']}'"

You might also want to do it this way...

"SELECT firstname, surname FROM employees WHERE surname =
\"{$_GET['surname']}\""

Just in case their name is something like O'Neil, it won't interfere with
your script.

Good luck,
Dimitri Marshall

>
> >
> >new to this so im trying to get my head around it, basically i just want
to
> >search a mysql database by someones surname.
> >
> >cheers!
> >
> >
> >
> >

attached mail follows:


"Dimitri Marshall" <webmasterdyntdesign.com> wrote in message
news:20031205150013.69144.qmailpb1.pair.com...
>
> "Sophie Mattoug" <sophiesitadelle.com> wrote in message
> news:3FD09C24.7070101sitadelle.com...
> > Paul Duggan wrote:
> >
> > >if I create a text box:
> > >
> > ><body>
> > >
> > ><form action="nextpage.html" method="GET" name="myform">
> > >
> > > <input type="Text" name="surname" align="TOP" size="25"><br>
> > >
> > > <input type="Submit" value="Submit" align="MIDDLE">
> > >
> > ></form>
> > >
> > >
> > >how do I go about extracting a surname from a mysql database?
> > >
> > >
> > >
> > >will it be something along the lines?
> > >
> > >select firstname,surname
> > >from employees
> > >where surname = textbox.surname;
> > >
> > >
> >
> > "SELECT firstname, surname FROM employees WHERE surname =
> > '{$_GET['surname']}'"
>
> You might also want to do it this way...
>
> "SELECT firstname, surname FROM employees WHERE surname =
> \"{$_GET['surname']}\""
>
> Just in case their name is something like O'Neil, it won't interfere with
> your script.
>

An even better way is this

//process the surname, add slashes
$surname = addslashes($_GET['surname']);

//make the query
$sqlquery = "SELECT firstname, surname FROM employees WHERE surname =
'$surname'";

This makes sure that if there is signs like " or ', they will be escaped ;-)

> Good luck,
> Dimitri Marshall
>
> >
> > >
> > >new to this so im trying to get my head around it, basically i just
want
> to
> > >search a mysql database by someones surname.
> > >
> > >cheers!
> > >
> > >
> > >
> > >

attached mail follows:


"Eric Bolikowski" <ericbroadpark.no> wrote in message
news:20031205154115.28657.qmailpb1.pair.com...
>
> "Dimitri Marshall" <webmasterdyntdesign.com> wrote in message
> news:20031205150013.69144.qmailpb1.pair.com...
> >
> > "Sophie Mattoug" <sophiesitadelle.com> wrote in message
> > news:3FD09C24.7070101sitadelle.com...
> > > Paul Duggan wrote:
> > >
> > > >if I create a text box:
> > > >
> > > ><body>
> > > >
> > > ><form action="nextpage.html" method="GET" name="myform">
> > > >
> > > > <input type="Text" name="surname" align="TOP" size="25"><br>
> > > >
> > > > <input type="Submit" value="Submit" align="MIDDLE">
> > > >
> > > ></form>
> > > >
> > > >
> > > >how do I go about extracting a surname from a mysql database?
> > > >
> > > >
> > > >
> > > >will it be something along the lines?
> > > >
> > > >select firstname,surname
> > > >from employees
> > > >where surname = textbox.surname;
> > > >
> > > >
> > >
> > > "SELECT firstname, surname FROM employees WHERE surname =
> > > '{$_GET['surname']}'"
> >
> > You might also want to do it this way...
> >
> > "SELECT firstname, surname FROM employees WHERE surname =
> > \"{$_GET['surname']}\""
> >
> > Just in case their name is something like O'Neil, it won't interfere
with
> > your script.
> >
>
> An even better way is this
>
> //process the surname, add slashes
> $surname = addslashes($_GET['surname']);
>
> //make the query
> $sqlquery = "SELECT firstname, surname FROM employees WHERE surname =
> '$surname'";
>
> This makes sure that if there is signs like " or ', they will be escaped
;-)
>

Forgot one other thing that improves it even more:

//process the surname, add slashes
$surname = addslashes($_GET['surname']);

//make the query
$sqlquery = "SELECT firstname, surname FROM employees WHERE surname LIKE
'%$surname%'";

You can add these percent signs( % ), in case you want to ensure that we get
results where the surname in the db is somewhat the same as the search
input.

If for example the surname in the database is "neill", and the user using
the search types "neil", then the extra %-signs will ensure that you find
this entry.

> > Good luck,
> > Dimitri Marshall
> >
> > >
> > > >
> > > >new to this so im trying to get my head around it, basically i just
> want
> > to
> > > >search a mysql database by someones surname.
> > > >
> > > >cheers!
> > > >
> > > >
> > > >
> > > >
>

attached mail follows:


is anyone away of any tutorials as I'm having difficulty constructing the
remainder of my code. Thanks for the replies!
"Paul Duggan" <pauldugganf2s.com> wrote in message
news:20031205144538.36940.qmailpb1.pair.com...
> if I create a text box:
>
> <body>
>
> <form action="nextpage.html" method="GET" name="myform">
>
> <input type="Text" name="surname" align="TOP" size="25"><br>
>
> <input type="Submit" value="Submit" align="MIDDLE">
>
> </form>
>
>
> how do I go about extracting a surname from a mysql database?
>
>
>
> will it be something along the lines?
>
> select firstname,surname
> from employees
> where surname = textbox.surname;
>
>
> new to this so im trying to get my head around it, basically i just want
to
> search a mysql database by someones surname.
>
> cheers!
>

attached mail follows:


thanks all for the help, I substituted GET for POST in

\"{$_GET['surname']}\""

figured that I needed a 2nd php file which was invoked from the submit
button on the first and hey presto it works :)

"Paul Duggan" <pauldugganf2s.com> wrote in message
news:20031205155436.54226.qmailpb1.pair.com...
> is anyone away of any tutorials as I'm having difficulty constructing the
> remainder of my code. Thanks for the replies!
> "Paul Duggan" <pauldugganf2s.com> wrote in message
> news:20031205144538.36940.qmailpb1.pair.com...
> > if I create a text box:
> >
> > <body>
> >
> > <form action="nextpage.html" method="GET" name="myform">
> >
> > <input type="Text" name="surname" align="TOP" size="25"><br>
> >
> > <input type="Submit" value="Submit" align="MIDDLE">
> >
> > </form>
> >
> >
> > how do I go about extracting a surname from a mysql database?
> >
> >
> >
> > will it be something along the lines?
> >
> > select firstname,surname
> > from employees
> > where surname = textbox.surname;
> >
> >
> > new to this so im trying to get my head around it, basically i just want
> to
> > search a mysql database by someones surname.
> >
> > cheers!
> >

attached mail follows:


I liked this one

http://hotwired.lycos.com/webmonkey/programming/php/tutorials/tutorial4.html

Paul Duggan wrote:

>is anyone away of any tutorials as I'm having difficulty constructing the
>remainder of my code. Thanks for the replies!
>"Paul Duggan" <pauldugganf2s.com> wrote in message
>news:20031205144538.36940.qmailpb1.pair.com...
>
>
>>if I create a text box:
>>
>><body>
>>
>><form action="nextpage.html" method="GET" name="myform">
>>
>> <input type="Text" name="surname" align="TOP" size="25"><br>
>>
>> <input type="Submit" value="Submit" align="MIDDLE">
>>
>></form>
>>
>>
>>how do I go about extracting a surname from a mysql database?
>>
>>
>>
>>will it be something along the lines?
>>
>>select firstname,surname
>>from employees
>>where surname = textbox.surname;
>>
>>
>>new to this so im trying to get my head around it, basically i just want
>>
>>
>to
>
>
>>search a mysql database by someones surname.
>>
>>cheers!
>>
>>
>>
>
>
>

--

+-----------------+-----------------+----------------+
| Blake Schroeder | Owner/Developer | lhwd.net |
+--(http://www.lhwd.net)------------+--/3174026352\--+

attached mail follows:


Hi,

We would like to announce to PHP Users and Developers that:

http://www.opensourcexperts.com

has added a category for PHP and several other PHP related projects
like: PHP Collab, PostNuke, Drupal.

Our site allows for the micro and macro payment of support and for the
collaborative funding of Feature Requests for Open Source
software.

Additionally when Individuals or Companies register (its free) they can
select multiple Open Source technologies they support and be
listed in an index for each.

An example:

http://www.opensourcexperts.com/Index/index_html/PHP/index.html

All indices are made available as RSS Feeds.

For a more detailed overview of what opensourcexperts does (these are
only a few of the features on our site) please see our Tour:

http://www.opensourcexperts.com/Tour/index.html

Regards,

Mark

attached mail follows:


Very nice, except please put a OT in the subject when posting something like
this.

-Ryan

> Hi,
>
> We would like to announce to PHP Users and Developers that:
>
> http://www.opensourcexperts.com
>
> has added a category for PHP and several other PHP related projects
> like: PHP Collab, PostNuke, Drupal.
>
> Our site allows for the micro and macro payment of support and for the
> collaborative funding of Feature Requests for Open Source
> software.
>
> Additionally when Individuals or Companies register (its free) they can
> select multiple Open Source technologies they support and be
> listed in an index for each.
>
> An example:
>
> http://www.opensourcexperts.com/Index/index_html/PHP/index.html
>
> All indices are made available as RSS Feeds.
>
> For a more detailed overview of what opensourcexperts does (these are
> only a few of the features on our site) please see our Tour:
>
> http://www.opensourcexperts.com/Tour/index.html
>
> Regards,
>
> Mark
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

attached mail follows:


Duly noted.

Thanks,

Mark
On Dec 5, 2003, at 6:12 PM, Ryan A wrote:

> Very nice, except please put a OT in the subject when posting
> something like
> this.
>
> -Ryan
>
>
>
>> Hi,
>>
>> We would like to announce to PHP Users and Developers that:
>>
>> http://www.opensourcexperts.com
>>
>> has added a category for PHP and several other PHP related projects
>> like: PHP Collab, PostNuke, Drupal.
>>
>> Our site allows for the micro and macro payment of support and for the
>> collaborative funding of Feature Requests for Open Source
>> software.
>>
>> Additionally when Individuals or Companies register (its free) they
>> can
>> select multiple Open Source technologies they support and be
>> listed in an index for each.
>>
>> An example:
>>
>> http://www.opensourcexperts.com/Index/index_html/PHP/index.html
>>
>> All indices are made available as RSS Feeds.
>>
>> For a more detailed overview of what opensourcexperts does (these are
>> only a few of the features on our site) please see our Tour:
>>
>> http://www.opensourcexperts.com/Tour/index.html
>>
>> Regards,
>>
>> Mark
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

attached mail follows:


On 12/04/2003 9:53 AM, Rankin, Randy <randy.rankininvensys.com> wrote:

> I have a form which captures US addresses ( address, city, state ) and
> telephone numbers ( 10 digit ) and am writing this data to a MySQL table. I
> need to expand this to capture non-US info, so I was hoping for some
> guidance on forms and table structures. I have googled this to death and
> still haven't come up with anything.

While not directly related to your question, this site has good information
about international addresses:

http://www.columbia.edu/kermit/postal.html

Pablo

attached mail follows:


I had been running a CGI version of PHP version 3 for many months with
no issues. (I had custom extensions in the CGI version.)

Well, my hosting company decided to enable suexec on Apache (running on
Redhat Linux). As I understand, with suexec enabled, only the owner of a
particular CGI script can execute that script.

Well, we have made sure that the script is owned by the appropriate user
and group. Unfortunately, we keep on getting the following error:

>>>
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.

Please contact the server administrator, webmasterislamicvalley.com and
inform them of the time the error occurred, and anything you might have
done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use
an ErrorDocument to handle the request.
<<<

suexec_log has the following log message:

[2003-12-05 09:22:52]: info: (target/actual) uid: (islamicv/islamicv)
gid: (islamicv/islamicv) cmd: iv_php
[2003-12-05 09:22:52]: error: cannot stat program: (iv_php)

apache error_log file has the following message:

[Fri Dec 5 09:26:06 2003] [error] [client 67.85.201.18] Premature end
of script headers: /web/islamicv/public_html/cgi-bin/iv_php

Could someone please advise as to what is going wrong?
(I did NOT modify this script for months. It works fine when suexec is
swithced off.)

Thank you very much.

attached mail follows:


Dear list,
     I have been facing problems while building dynamic menu. I am using
database to store the Menu items. I am having two fields in the database
table called ParentID, ChildID.
Parent Child
1 0
2 0
3 0
4 1
5 1
6 1
7 3
8 3
9 4
10 8
I want to build menu from this. Please suggest me the way to do so.

Thanks in Advance

--
Thanks & Regards
Praveen Kumar
SoftPro Systems Ltd

-----------------------SOFTPRO DISCLAIMER------------------------------

Information contained in this E-MAIL and any attachments are
confidential being proprietary to SOFTPRO SYSTEMS is 'privileged'
and 'confidential'.

If you are not an intended or authorised recipient of this E-MAIL or
have received it in error, You are notified that any use, copying or
dissemination of the information contained in this E-MAIL in any
manner whatsoever is strictly prohibited. Please delete it immediately
and notify the sender by E-MAIL.

In such a case reading, reproducing, printing or further dissemination
of this E-MAIL is strictly prohibited and may be unlawful.

SOFTPRO SYSYTEMS does not REPRESENT or WARRANT that an attachment
hereto is free from computer viruses or other defects.

The opinions expressed in this E-MAIL and any ATTACHEMENTS may be
those of the author and are not necessarily those of SOFTPRO SYSTEMS.
------------------------------------------------------------------------

attached mail follows:


> Dear list,
> I have been facing problems while building dynamic menu. I am using
> database to store the Menu items. I am having two fields in the database
> table called ParentID, ChildID.
> Parent Child
> 1 0
> 2 0
> 3 0
> 4 1
> 5 1
> 6 1
> 7 3
> 8 3
> 9 4
> 10 8
> I want to build menu from this. Please suggest me the way to do so.
>
> Thanks in Advance

The following will build a two-level menu as an unordered list, with the
second level appearing if its parent is selected. The variable "$gpid" is
grandparent id for a third level, which is not displayed in this menu. Some
checks are done in order to display a menu item differently if it is the
current page or an ancestor of the current page. (In the design I took this
example from, third level menus are shown in a different place.)

// build menu array
$menu_sql = "SELECT id, parentid, menuname, FROM pages";
$menu_result = mysql_query($menu_sql);
if (mysql_num_rows($menu_result) > 0) {
    while ($menu_row = mysql_fetch_array($menu_result)) {
        $menu_array[] = array($menu_row["id"], $menu_row["parentid"],
$menu_row["menuname"]);
    }
}

// home id is 10
$id = isset($_GET["id"]) ? $_GET["id"] : 10;
$pid = isset($_GET["pid"]) ? $_GET["pid"] : 0;
$gpid = isset($_GET["gpid"]) ? $_GET["gpid"] : "";

// display menu
echo("<ul>");
foreach ($menu_array as $menu) {
    // if the parent id is 0, menu item is main level
    if ($menu[1] == "0") {
        if ($menu[0] == $id || $menu[0] == $pid || $menu[0] == $gpid) {
            echo("<li><a class=\"selected\" href=\"" . $PHP_SELF . "?id=" .
$menu[0] . "&amp;pid=0\">" . $menu[2] . "</a>");
            foreach ($menu_array as $menu2) {
                if ($menu2[1] == $menu[0]) {
                    $subcount[] = $menu2[1];
                }
            }
            if (count($subcount) > 0) {
                echo("<ul>");
                foreach ($menu_array as $menu3) {
                    if ($menu3[1] == $menu[0]) {
                        if ($menu3[0] == $id || $menu3[0] == $pid) {
                            echo("<li><a class=\"selected\" href=\"" .
$PHP_SELF . "?id=" . $menu3[0] . "&amp;pid=" . $menu3[1] . "\">" .
                                $menu3[2] . "</a></li>");
                        } else {
                            echo("<li><a href=\"" . $PHP_SELF . "?id=" .
$menu3[0] . "&amp;pid=" . $menu3[1] . "\">" . $menu3[2] . "</a></li>");
                        }
                    }
                }
                echo("</ul>");
            }
            echo("</li>");
        } else {
            echo("<li><a href=\"" . $PHP_SELF . "?id=" . $menu[0] .
"&amp;pid=0\">" . $menu[2] . "</a></li>");
        }
    }
}
echo("</ul>\n");

HTH

--
Lowell Allen

attached mail follows:


Hello

The output is

StartEnd

I am sure that the linux binary is ok. coz if in the
sheel you just do

./myapp

it outputs

error

seems that the binary is not getting executred. I
think there is some permission info.

if i do phpinfo() i get the following output for safe
stuff -

safe_mode Off Off
safe_mode_exec_dir no value no value
safe_mode_gid Off Off
safe_mode_include_dir no value no value

Thanks for the help.

Karam

--- Jason Wong <php-generalgremlins.biz> wrote:
> On Friday 05 December 2003 20:43, Karam Chand wrote:
>
> > I have set the error reporting to full but nothing
> > happens. The PHP page loads up blank.
>
> Put the following lines at the top of your program:
>
> error_reporting (E_ALL);
> ini_set('display_errors', 1);
>
> That will force ALL errors to be displayed. Now do
> you see any errors?
>
> Do you have any debugging code to confirm that your
> code is running? Eg:
>
> echo "Start";
> exec ( "myapp \"Karam\"");
> echo "End";
>
> > I dont have any idea about safe mode. My PHP is
> loaded
> > up in my Host's server. Can I change the settings?
> If
> > yes then what should I do?
>
> Before even contemplating changing the settings,
> read the relevant chapter in
> the manual then check its current settings by using
> phpinfo().
>
> --
> 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
> ------------------------------------------
> /*
> Your mode of life will be changed to EBCDIC.
> */
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

attached mail follows:


On Saturday 06 December 2003 02:44, Karam Chand wrote:

> The output is
>
> StartEnd

Good, that shows your PHP program is being executed.

> I am sure that the linux binary is ok. coz if in the
> sheel you just do
>
> ./myapp
>
> it outputs
>
> error
>
> seems that the binary is not getting executred. I
> think there is some permission info.

Not necessarily. Now it's time to check the manual entry for exec() to see
what *exactly* that function does. You'll find that you're using it
incorrectly (or it doesn't do what *you* think it should do).

> if i do phpinfo() i get the following output for safe
> stuff -
>
> safe_mode Off Off

Good, that rules out a lot of other possibilities as to why your program isn't
working.

--
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
------------------------------------------
/*
The doctrine of human equality reposes on this: that there is no man
really clever who has not found that he is stupid.
                -- Gilbert K. Chesterson
*/

attached mail follows:


Hi,
I am totally new to using RSS feeds and need a little help.

I downloaded a few good classes to use RSS but dont know where to get the
feeds from...

our site is going to be totally PHP geared:
eg:
PHP Articles
Program snippets
(forum (maybe))
etc

Any idea how I can get a feed from Slashdot? or any other good
programming\tech sites

am basically trying to get a feed from around 4 sites for around 5 links
each...

Thanks in advance.

Cheers,
-Ryan

attached mail follows:


<snip>
Any idea how I can get a feed from Slashdot? or any other good
programming\tech sites

am basically trying to get a feed from around 4 sites for around 5
links
each...
</snip>

http://slashdot.org/slashdot.rss

try google, there is a bunch of good ones.

attached mail follows:


Hello Ryan,

For fun you might also want to try our XML/RSS Feed for PHP Solution
Providers.

http://www.opensourcexperts.com/Index/rdfrss/PHP.xml

You might even earn a couple of EUROs because we put into a system an
offer
for someone to write a how-to on how to integrate this feed in a PHP
site.

Regards,

Mark

On Dec 5, 2003, at 8:34 PM, Ryan A wrote:

> Hi,
> I am totally new to using RSS feeds and need a little help.
>
> I downloaded a few good classes to use RSS but dont know where to get
> the
> feeds from...
>
> our site is going to be totally PHP geared:
> eg:
> PHP Articles
> Program snippets
> (forum (maybe))
> etc
>
> Any idea how I can get a feed from Slashdot? or any other good
> programming\tech sites
>
> am basically trying to get a feed from around 4 sites for around 5
> links
> each...
>
> Thanks in advance.
>
> Cheers,
> -Ryan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

attached mail follows:


Hi,
Thanks for that, the only reason I dont use that though is coz they include
one of they products in the feed...

http://phparch.com/shop_product.php?itemid=23

Cheers,
-Ryan
http://Bestwebhosters.com

> here's one...
>
> http://www.phparch.com/syndicate.php
>
>
> Eddie
>
> -----Original Message-----
> From: Ryan A [mailto:ryancoinpass.com]
> Sent: Friday, December 05, 2003 2:34 PM
> To: php-generallists.php.net
> Subject: [PHP] PHP RSS sites and SlashDot
>
>
> Hi,
> I am totally new to using RSS feeds and need a little help.
>
> I downloaded a few good classes to use RSS but dont know where to get the
> feeds from...
>
> our site is going to be totally PHP geared:
> eg:
> PHP Articles
> Program snippets
> (forum (maybe))
> etc
>
> Any idea how I can get a feed from Slashdot? or any other good
> programming\tech sites
>
> am basically trying to get a feed from around 4 sites for around 5 links
> each...
>
> Thanks in advance.
>
> Cheers,
> -Ryan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>

attached mail follows:


On Fri, Dec 05, 2003 at 08:34:15PM +0100, Ryan A wrote:

> I downloaded a few good classes to use RSS but dont know where to get the
> feeds from...

Basically RSS is just an XML file that you can retrieve from a site using
HTTP. Sites that make feeds available generally have a link to them somewhere
on the site.

In the case of Slashdot, the link is at the bottom of their home page and is
labelled "rss".

Im assuming you have some code to parse the XML...?

--
Aj.
Sys. Admin / Developer

attached mail follows:


Hi,
Thanks for replying.

 just had a look at your feed, pretty good but I dont think it will be
useful to the people who visit my site as its too commercial and basically I
want nothing but useful stuff to the visitor who will be a programmer or a
newbie.

The site is going to be "commercially untouched" (no graphics for
advertising etc), something I searched long and hard for but could not find
on the net other than in very few places.

Cheers,
-Ryan

http://Bestwebhosters.com

> Hello Ryan,
>
> For fun you might also want to try our XML/RSS Feed for PHP Solution
> Providers.
>
> http://www.opensourcexperts.com/Index/rdfrss/PHP.xml
>
> You might even earn a couple of EUROs because we put into a system an
> offer
> for someone to write a how-to on how to integrate this feed in a PHP
> site.
>
> Regards,
>
> Mark
>
> On Dec 5, 2003, at 8:34 PM, Ryan A wrote:
>
> > Hi,
> > I am totally new to using RSS feeds and need a little help.
> >
> > I downloaded a few good classes to use RSS but dont know where to get
> > the
> > feeds from...
> >
> > our site is going to be totally PHP geared:
> > eg:
> > PHP Articles
> > Program snippets
> > (forum (maybe))
> > etc
> >
> > Any idea how I can get a feed from Slashdot? or any other good
> > programming\tech sites
> >
> > am basically trying to get a feed from around 4 sites for around 5
> > link