[PHP] [Newbie Guide] For the benefit of new members

2004-04-12 Thread Ma Siva Kumar
===
This message is for the benefit of new 
subscribers and those new to PHP.  Please 
feel free to add more points and send to the 
list.
===
1. If you have any queries/problems about PHP 
try http://www.php.net/manual/en first. You 
can download a copy and use it offline also. 

Please also try 
http://www.php.net/manual/faq.php 
for answers to frequently answered questions 
about PHP (added by Christophe Chisogne).

2. Try http://www.google.com next. Searching 
for "php YOUR QUERY" may fetch you relevant 
information within the first 10 results.

3. There is a searchable archive of the 
mailing list discussion at 
http://phparch.com/mailinglists. Many of the 
common topics are discussed repeatedly, and 
you may get answer to your query from the 
earlier discussions. 

For example: One of the repeatedly discussed 
question in the list is "Best PHP editor". 
Everyone has his/her favourite editor. 
You can get all the opinions by going through 
the list archives. If you want a chosen list 
try this link : 
http://phpeditors.linuxbackup.co.uk/ 
(contributed by Christophe Chisogne).

4. Not sure if PHP is working or you want 
find out what extensions are available to 
you?

Just put the following code into a file with 
a .php extension and access it through your 
webserver:

 

If PHP is installed you will see a page with 
a lot of information on it. If PHP is not 
installed (or not working correctly) your 
browser will try to download the file.

(contributed by Teren and reworded by Chris W 
Parker)

5. If you are stuck with a script and do not 
understand what is wrong, instead of posting 
the whole script, try doing some research 
yourself. One useful trick is to print 
the variable/sql query using print or echo 
command and check whether you get what you 
expected. 

After diagnosing the problem, send the 
details of your efforts (following steps 1, 
2 & 3) and ask for help.

6. PHP is a server side scripting language. 
Whatever processing PHP does takes place 
BEFORE the output reaches the client. 
Therefore, it is not possible to access 
users'  computer related information (OS, 
screen size etc) using PHP. Nor can you 
modify any the user side settings. You need 
to go for JavaScript and ask the question in 
a JavaScript list.

On the other hand, you can access the 
information that is SENT by the user's 
browser when a client requests a page from 
your server. You can find details about 
browser, OS etc as reported by 
this request. - contributed by Wouter van 
Vliet and reworded by Chris W Parker.

7. Provide a clear descriptive subject line. 
Avoid general subjects like "Help!!", "A 
Question" etc.  Especially avoid blank 
subjects. 

8. When you want to start a new topic, open a 
new mail composer and enter the mailing list 
address [EMAIL PROTECTED] instead of 
replying to an existing thread and replacing 
the subject and body with your message.

9. It's always a good idea to post back to 
the list once you've solved your problem. 
People usually add [SOLVED] to the subject 
line of their email when posting solutions. 
By posting your solution you're helping the 
next person with the same question. 
[contribued by Chris W Parker]

10. Ask smart questions  
http://catb.org/~esr/faqs/smart-questions.html
[contributed by Jay Blanchard)

11. Do not send your email to the list with 
attachments. If you don't have a place to 
upload your code, try the many pastebin 
websites (such as www.pastebin.com).
[contributed by Burhan Khalid]


Hope you have a good time programming with 
PHP.

-- 
Integrated Management Tools for leather 
industry
--
http://www.leatherlink.net

Ma Siva Kumar,
BSG LeatherLink (P) Ltd,
Chennai - 600106

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



[PHP] Re: How do you handle device detection?

2004-04-12 Thread DvDmanDT
But afaik that function is broken, and PHP isn't allowed to use that
browscap.ini so.. Better make a list of user_agents that are devices..

-- 
// DvDmanDT
MSN: dvdmandt¤hotmail.com
Mail: dvdmandt¤telia.com
"Lukasz Karapuda" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Richard,
>
> You would do that by looking at the user_agent parameter that is being
send
> by the browser to the server. PHP automatically places the user_agent
> information in the superglobal: $_SERVER['HTTP_USER_AGENT']. The
user_agent
> string might seems cryptic, therefore PHP provides you a built-in function
> for representing the user agent information in an object with properties
> representing the features of the browser. The function is get_browser().
> Link to documentation of this function:
>
> http://www.php.net/manual/en/function.get-browser.php
>
> Good luck,
>
> Lukasz Karapuda
>
>
>
>
> "Richard Davey" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi all,
> >
> > This is just a general question to get some ideas from the "wider
> > world" as it were.
> >
> > Say you've finished your site. It looks lovely and works perfectly.
> > You have a CSS file for modern browsers and one that degrades for
> > text-only devices also. You even have a special "small width" version
> > for PDAs and the like.
> >
> > So how do you go about detecting just what is looking at your site?
> > How would you handle detecting and then serving the same site for a
> > standard browser, a screen-reader, a PDA device or a WAP/mobile
> > device?
> >
> > Any tips/suggestions gratefully listened to.
> >
> > --
> > Best regards,
> >  Richard Davey
> >  http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP] using $_SESSION inside of user functions

2004-04-12 Thread Jason Wong
On Monday 12 April 2004 08:23, Andy B wrote:
> didnt know if it was possible to use $_SESSION vars in that function or any
> user defined functions for that matter...

Why didn't you waste one minute of your time to try it out?

-- 
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
--
/*
printk("ufs_read_super: fucking Sun blows me
");
2.0.38 /usr/src/linux/fs/ufs/ufs_super.c
*/

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



[PHP] After calling a Function the Script aborts without any error :-\

2004-04-12 Thread Ben
Hi Folks,

i got a big problem. I have a script which includes some other script i
tried include, require and require once. The problem is, if i do a
function call to a function in one of these included files, the script
aborts but without any error. The strange thing is, normally require
should give an error if it can't include any file. But the files are
accessible, error reporting is E_ALL. Some functions are callable but
others not and still no error. the only way how i came to this was
putting some die()s to see where 

the script is aborting.

I hope anybody can help me because i have no idea what that could be.

tia.

Ben


---
__
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.656 / Virus Database: 421 - Release Date: 09.04.2004
 


[PHP] Using only PHP is it possible (multiple re-directs)?

2004-04-12 Thread Jay Blanchard
I'd like to do something like this...

a. click submit button in window A
b. open window B with stuff
c. have window A go to another location

It was just a thought I had this morning while working with some of our
intranet forms.

THANKS!

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



[PHP] requests per s with php and mysql queries

2004-04-12 Thread Merlin
Hi there,

I am trying to stress my LAMP app with MS stress tool for web applications.
It simulates about 100 threads.
It looks like the LAMP app is only able to handel about 6 requests per second :-(
Is this normal für php with database queries?
Thanx for any info,

Merlin

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


Re: [PHP] After calling a Function the Script aborts without any error :-\

2004-04-12 Thread John Nichel
Ben wrote:
Hi Folks,

i got a big problem. I have a script which includes some other script i
tried include, require and require once. The problem is, if i do a
function call to a function in one of these included files, the script
aborts but without any error. The strange thing is, normally require
should give an error if it can't include any file. But the files are
accessible, error reporting is E_ALL. Some functions are callable but
others not and still no error. the only way how i came to this was
putting some die()s to see where 

the script is aborting.

I hope anybody can help me because i have no idea what that could be.

tia.

Ben
You can see if the function exists in you main script...

if ( function_exists ( "functionName" ) ) {
echo ( "Function Exists." );
} else {
echo ( "Function Does Not Exists." );
}
Or you can echo out something in the function you're trying to call...

function whatever() {
echo ( "" );
//  More Code
}
--
***
*  _  __   __  __   _  * John  Nichel *
* | |/ /___ __ \ \/ /__ _ _| |__ ___  __ ___ _ __  * 716.856.9675 *
* | ' http://www.KegWorks.com[EMAIL PROTECTED] * 14203 - 1321 *
***
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Using only PHP is it possible (multiple re-directs)?

2004-04-12 Thread John Nichel
Jay Blanchard wrote:
I'd like to do something like this...

a. click submit button in window A
b. open window B with stuff
c. have window A go to another location
It was just a thought I had this morning while working with some of our
intranet forms.
THANKS!

I don't think this is possible with just PHP.  I think you can target 
the form action to open in the new page, but the original page is going 
to stay the same without some JavaScript.

--
***
*  _  __   __  __   _  * John  Nichel *
* | |/ /___ __ \ \/ /__ _ _| |__ ___  __ ___ _ __  * 716.856.9675 *
* | ' http://www.KegWorks.com[EMAIL PROTECTED] * 14203 - 1321 *
***
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] requests per s with php and mysql queries

2004-04-12 Thread John W. Holmes
From: "Merlin" <[EMAIL PROTECTED]>

> I am trying to stress my LAMP app with MS stress tool for web
applications.
> It simulates about 100 threads.
>
> It looks like the LAMP app is only able to handel about 6 requests per
second :-(
> Is this normal für php with database queries?

Every application is different. You can't ask a question like this. Even if
people said Yes or No, how is that going to help you?

---John Holmes...

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



Re: [PHP] requests per s with php and mysql queries

2004-04-12 Thread William Lovaton
I have never used any kind of stress tool in my web app.  Right now it
is in production under heavy load and some statistics are:

Authenticated users: 520 (this are the active sessions)
Dynamic requests per second: 25 Average
Max. Dynamic requests per second: 60 to 80 (these are peak values)

When I say dynamic requests I mean just PHP scripts.  Static content
(js, css, images, etc) is not registered here but it is usually 3 to 4
times dynamic requests... so, do the math. ;-)

For this app I'm using Apache 1.3, PHP 4.3 and Oracle 8.1.7

The server is an old compaq with RedHat Linux 9, 2 GB RAM and 4
proccessor with 550MHz each.

I hope it can serve you as a reference.


Regards,


-William


El lun, 12-04-2004 a las 08:37, Merlin escribió:
> Hi there,
> 
> I am trying to stress my LAMP app with MS stress tool for web applications.
> It simulates about 100 threads.
> 
> It looks like the LAMP app is only able to handel about 6 requests per second :-(
> Is this normal für php with database queries?
> 
> Thanx for any info,
> 
> Merlin

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



Re: [PHP] After calling a Function the Script aborts without any error :-\

2004-04-12 Thread John W. Holmes
From: "Ben" <[EMAIL PROTECTED]>

> i got a big problem. I have a script which includes some other script i
> tried include, require and require once. The problem is, if i do a
> function call to a function in one of these included files, the script
> aborts but without any error. The strange thing is, normally require
> should give an error if it can't include any file. But the files are
> accessible, error reporting is E_ALL. Some functions are callable but
> others not and still no error. the only way how i came to this was
> putting some die()s to see where 

Do you have display_errors turned on?

---John Holmes...

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



Re: [PHP] ADOdb Operator question

2004-04-12 Thread Gabe
That helps, thanks!


"Curt Zirzow" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> * Thus wrote Gabe ([EMAIL PROTECTED]):
> > If you're using ADOdb, what is the name, purpose, and function of this
> > operator?
> >
> > ->
> >
> > e.g. $conn->Connect(false, 'scott', 'tiger', $oraname);
>
> The $conn variable is a adodb object that has methods and
> properties associated with it.  The -> tells php to access the
> property or method of the object.
>
>
> Curt
> -- 
> "I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] After calling a Function the Script aborts without any error :-\

2004-04-12 Thread William Lovaton
Hi,

El lun, 12-04-2004 a las 09:27, John W. Holmes escribió:
> From: "Ben" <[EMAIL PROTECTED]>
> 
> > i got a big problem. I have a script which includes some other script i
> > tried include, require and require once. The problem is, if i do a
> > function call to a function in one of these included files, the script
> > aborts but without any error. The strange thing is, normally require
> > should give an error if it can't include any file. But the files are
> > accessible, error reporting is E_ALL. Some functions are callable but
> > others not and still no error. the only way how i came to this was
> > putting some die()s to see where 
> 
> Do you have display_errors turned on?

Sometimes I have this problems too, no matter if that setting is on.


-William

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



[PHP] Re: PHP/MySQL difficulties on WindowsXP

2004-04-12 Thread Gabe
I don't know if this is the root of your problem or not, but I tried running
PHP 4.3.5 on my Win2K box and it crashed a lot.  I found out that if you
have PHP configured to run as a SAPI module there are stability issues with
that version (this bug has been reported).  I think the CGI install should
be good though.  I reverted back to version 4.3.4 and don't have any
problems yet with the SAPI module.


<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello;
>
> We are having a miserable time with MySQL on a Windows/IIS server with
PHP.
> Here's the version numbers:
>
> MySQL 3.23.58-nt
> PHP 4.35
> Windows XP (although we previously experienced the same problems w/ Server
> 2000), 1gb RAM
>
> The site is for academics to submit scientific "papers" (data) for their
> organization.  In addition to submitting data, they can browse and search
the
> database.
>
> The problem is that one or more times per day, they whole thing grinds to
a
> halt.  Not sure that the server is completely locking up, but response
times
> are so slow it might was well be.  Restarting MySQL corrects the problem,
but
> that may be a symptom rather than the disease.  At one time we had IIS
running
> on one server and MySQL on another.  In this configuration, the IIS server
> would lock up, and reloading MySQL on *that* machine fixed the problem,
> according to my administrator.  That server was remote, and the admin
drove out
> to it to observe and noted that there were virtual RAM errors - running
out -
> which motivated us to move it to the XP box in the office.
>
> There's really not much complicated going on here.  The paper submission
engine
> is session based, and some data is stuffed into session variables until it
can
> be validated in later steps, then saved to the database.  I've optimized
the
> queries as much as possible, checked that MySQL connections are being
closed
> and result resources freed, and php session variables unset and the
session
> destroyed when appropriate.
>
> We're stuck, and the client is getting upset.
>
> Ideas?
>
> TIA
>
> Rob

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



[PHP] XML Parser Functions - problem interpreting an xml file

2004-04-12 Thread Kai Hackemesser
Hello,

I have created my own handler following the examples in the manual. It works
fine for XML files I created for myself. Now I tried one file given by
someone else, but I get as result always following error:
"junk after document element" in line 1, column 0.
I send you a part of the XML file (- content), maybe you can tell me why it
cant be interpreted. It looks like it doesn't like the 




http://www.x.net";>
News
x
-red-
12.04.2004 16:14:00
x









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



Re: [PHP] requests per s with php and mysql queries

2004-04-12 Thread Merlin
Hello William,

how do you messure your statistics? I would be interested in comparing
those numbers. Do you use a special tool?
Thanx

Merlin

William Lovaton wrote:

I have never used any kind of stress tool in my web app.  Right now it
is in production under heavy load and some statistics are:
Authenticated users: 520 (this are the active sessions)
Dynamic requests per second: 25 Average
Max. Dynamic requests per second: 60 to 80 (these are peak values)
When I say dynamic requests I mean just PHP scripts.  Static content
(js, css, images, etc) is not registered here but it is usually 3 to 4
times dynamic requests... so, do the math. ;-)
For this app I'm using Apache 1.3, PHP 4.3 and Oracle 8.1.7

The server is an old compaq with RedHat Linux 9, 2 GB RAM and 4
proccessor with 550MHz each.
I hope it can serve you as a reference.

Regards,

-William

El lun, 12-04-2004 a las 08:37, Merlin escribió:

Hi there,

I am trying to stress my LAMP app with MS stress tool for web applications.
It simulates about 100 threads.
It looks like the LAMP app is only able to handel about 6 requests per second :-(
Is this normal für php with database queries?
Thanx for any info,

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


[PHP] Wanted: login and CMS system with a twist

2004-04-12 Thread David T-G
Hi, all --

A client of mine wishes to create a web site which does more than just
the typical CMS functions in that what you can see not only depends on
whether or not you have an account but also how old your account is?).
Of course, I'd prefer that it is written in PHP :-)

Any recommendations?


TIA & HAND

:-D
-- 
David T-G
[EMAIL PROTECTED]
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


[PHP] varible

2004-04-12 Thread edwardspl
Dear You,

Is there a solution ( without open global ) , then send the value of the
varible of list.php to view.php ?

list.php :

$headers[$idx]";
? }
?>

view.php :

");

? echo(imap_fetchheader($link,$num));
? echo("");
? echo(imap_body($link,$num));

? echo("");

?>

Thank for your help so much !

Ed.

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



Re: [PHP] XML Parser Functions - problem interpreting an xml file

2004-04-12 Thread Chris Boget
> I send you a part of the XML file (- content), maybe you can tell me why
it
> cant be interpreted. It looks like it doesn't like the http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: commercial autoresponses (was "Re: [PHP] Wanted: ...")

2004-04-12 Thread David T-G
Hi again, all --

...and then David T-G said...
% 
...
% Any recommendations?

I was amazed to receive from this

  - an entirely-in-German post apparently wishing me a happy Easter
  - a note from Credit Suisse letting me know they'd process my request
  - a promise from Astral Security and Finance to get back to me

and wondered for a moment if I'd really sent it to the right place!  Have
I really missed so much in a month of being too busy to post on the list?


TIA & HAND

:-D
-- 
David T-G
[EMAIL PROTECTED]
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


[PHP] Problems with mail and php

2004-04-12 Thread Luis Lebron
I have a development box that uses our company's Exchange server as an smtp
host. All of a sudden, the php mail function has stopped working.
I can, however, send a message using mutt. 

Here's the output of the maillog: 

Apr 12 10:38:51 localhost sendmail[11879]: i3CFckaV011877:
to=<[EMAIL PROTECTED]>, ctladdr=<[EMAIL PROTECTED]> (48/48),
delay=00:00:04, xdelay=00:00:04, mailer=relay, pri=30323,
relay=sigma2.localdomain. [192.168.168.4], dsn=2.0.0, stat=Sent (OK)

As far as I can tell the message is being sent by sendmail. Any ideas on
where to look?

thanks,

Luis R. Lebron
Project Manager
Sigmatech, Inc


[PHP] Re: php 5 install

2004-04-12 Thread Jason Barnett
Andy B wrote:
if i install php5 will it affect any of the php4.3.3 code that i have
running at all...?? i want to install 5 and see what they have new going on
and stuff but i dont want to crash my 4.3.3 running code any
and where would i be able to read a list of stuff that is new in 5??
You _can_ run both PHP 5 and PHP 4 on the same server (and even at the 
same time), but I wouldn't recommend that.  If you want to see an update 
on what all changed in PHP 5 just check out www.zend.com, they have 
articles with all the changes there.

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


[PHP] Preg_match_all problem

2004-04-12 Thread Jeff McKeon
Can anyone see why I'm getting this error message:

"Warning: No ending delimiter '^' found in
C:\Inetpub\wwwMIS_DEV\import_mvs.inc.php on line 126"

>From this line:

if(preg_match_all("^([00])?.*$",$called,$found))
{
substring($called,2,9);
}

I basically have a phone bill that sometimes has the phone number
preceeded by "00" and sometimes not.

When it has the "00" I want to trim it with the substring command.

Thanks,

Jeff 

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



Re: [PHP] Preg_match_all problem

2004-04-12 Thread John Nichel
Jeff McKeon wrote:
Can anyone see why I'm getting this error message:

"Warning: No ending delimiter '^' found in
C:\Inetpub\wwwMIS_DEV\import_mvs.inc.php on line 126"
From this line:
if(preg_match_all("^([00])?.*$",$called,$found))
{
substring($called,2,9);
}
I basically have a phone bill that sometimes has the phone number
preceeded by "00" and sometimes not.
When it has the "00" I want to trim it with the substring command.

Thanks,

Jeff 

You need to enclose your regex in /regex/

if ( preg_match_all ( "/^([00])?.*$/", $called, $found ) )

--
***
*  _  __   __  __   _  * John  Nichel *
* | |/ /___ __ \ \/ /__ _ _| |__ ___  __ ___ _ __  * 716.856.9675 *
* | ' http://www.KegWorks.com[EMAIL PROTECTED] * 14203 - 1321 *
***
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] htmlentities, links, javascript

2004-04-12 Thread Beau Hartshorne
hi all,

i have a script that calls a popup like this:

Choices

the & is there to make sure the page validates. the problem is that
some browsers seem to be incorrectly translating this to:

[REQUEST_URI] => /popup.php?name=Choices&product_id=15

instead of:

[REQUEST_URI] => /popup.php?name=Choices&product_id=15

a couple of browsers that have choked on this:

[HTTP_USER_AGENT] => Mozilla/4.0 (compatible; MSIE 4.0; Windows 95)
[HTTP_USER_AGENT] => Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us)
AppleWebKit/103u (KHTML, like Gecko) Safari/100

i have safari 1.2.1 installed on one of my development machines, and
have had no trouble with the bad REQUEST_URIs. does anyone have some
insight into the problem?

i've posted a demonstration here:

http://hartshorne.ca/sandbox.php

you'll have to view the source of the popup to see if the & was
translated properly.

thanks,

beau

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



[PHP] Re: commercial autoresponses (was "Re: [PHP] Wanted: ...")

2004-04-12 Thread Jason Barnett
David T-G wrote:
Hi again, all --

...and then David T-G said...
% 
...
% Any recommendations?

I was amazed to receive from this

  - an entirely-in-German post apparently wishing me a happy Easter
  - a note from Credit Suisse letting me know they'd process my request
  - a promise from Astral Security and Finance to get back to me
and wondered for a moment if I'd really sent it to the right place!  Have
I really missed so much in a month of being too busy to post on the list?
TIA & HAND

:-D


No David, I receive those messages also when I post.  Just block them in 
your mail reader.  As for your CMS question, don't know anything off 
hand that does it, but you can track timestamps in your database and 
show the "special" page for members that joined at a certain date/time 
or earlier.

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


php-general Digest 12 Apr 2004 16:03:02 -0000 Issue 2701

2004-04-12 Thread php-general-digest-help

php-general Digest 12 Apr 2004 16:03:02 - Issue 2701

Topics (messages 183140 through 183166):

[Newbie Guide] For the benefit of new members
183140 by: Ma Siva Kumar

Re: How do you handle device detection?
183141 by: DvDmanDT

Re: using $_SESSION inside of user functions
183142 by: Jason Wong

After calling a Function the Script aborts without any error :-\
183143 by: Ben
183146 by: John Nichel
183150 by: John W. Holmes
183152 by: William Lovaton

Using only PHP is it possible (multiple re-directs)?
183144 by: Jay Blanchard
183147 by: John Nichel

requests per s with php and mysql queries
183145 by: Merlin
183148 by: John W. Holmes
183149 by: William Lovaton
183155 by: Merlin
183156 by: Merlin

Re: ADOdb Operator question
183151 by: Gabe

Re: PHP/MySQL difficulties on WindowsXP
183153 by: Gabe

XML Parser Functions - problem interpreting an xml file
183154 by: Kai Hackemesser
183159 by: Chris Boget

Wanted: login and CMS system with a twist
183157 by: David T-G

varible
183158 by: edwardspl.ita.org.mo

Re: commercial autoresponses (was "Re: [PHP] Wanted: ...")
183160 by: David T-G
183166 by: Jason Barnett

Problems with mail and php
183161 by: Luis Lebron

Re: php 5 install
183162 by: Jason Barnett

Preg_match_all problem
183163 by: Jeff McKeon
183164 by: John Nichel

htmlentities, links, javascript
183165 by: Beau Hartshorne

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 ---
===
This message is for the benefit of new 
subscribers and those new to PHP.  Please 
feel free to add more points and send to the 
list.
===
1. If you have any queries/problems about PHP 
try http://www.php.net/manual/en first. You 
can download a copy and use it offline also. 

Please also try 
http://www.php.net/manual/faq.php 
for answers to frequently answered questions 
about PHP (added by Christophe Chisogne).

2. Try http://www.google.com next. Searching 
for "php YOUR QUERY" may fetch you relevant 
information within the first 10 results.

3. There is a searchable archive of the 
mailing list discussion at 
http://phparch.com/mailinglists. Many of the 
common topics are discussed repeatedly, and 
you may get answer to your query from the 
earlier discussions. 

For example: One of the repeatedly discussed 
question in the list is "Best PHP editor". 
Everyone has his/her favourite editor. 
You can get all the opinions by going through 
the list archives. If you want a chosen list 
try this link : 
http://phpeditors.linuxbackup.co.uk/ 
(contributed by Christophe Chisogne).

4. Not sure if PHP is working or you want 
find out what extensions are available to 
you?

Just put the following code into a file with 
a .php extension and access it through your 
webserver:

 

If PHP is installed you will see a page with 
a lot of information on it. If PHP is not 
installed (or not working correctly) your 
browser will try to download the file.

(contributed by Teren and reworded by Chris W 
Parker)

5. If you are stuck with a script and do not 
understand what is wrong, instead of posting 
the whole script, try doing some research 
yourself. One useful trick is to print 
the variable/sql query using print or echo 
command and check whether you get what you 
expected. 

After diagnosing the problem, send the 
details of your efforts (following steps 1, 
2 & 3) and ask for help.

6. PHP is a server side scripting language. 
Whatever processing PHP does takes place 
BEFORE the output reaches the client. 
Therefore, it is not possible to access 
users'  computer related information (OS, 
screen size etc) using PHP. Nor can you 
modify any the user side settings. You need 
to go for JavaScript and ask the question in 
a JavaScript list.

On the other hand, you can access the 
information that is SENT by the user's 
browser when a client requests a page from 
your server. You can find details about 
browser, OS etc as reported by 
this request. - contributed by Wouter van 
Vliet and reworded by Chris W Parker.

7. Provide a clear descriptive subject line. 
Avoid general subjects like "Help!!", "A 
Question" etc.  Especially avoid blank 
subjects. 

8. When you want to start a new topic, open a 
new mail composer and enter the mailing list 
address [EMAIL PROTECTED] instead of 
replying to an existing thread and replacing 
the subject and body with your message.

9. It's always a good idea to post back to 
the list once you've solved your problem. 
People usually add [SOLVED] to the subject 
line of their email

Re: [PHP] Preg_match_all problem

2004-04-12 Thread John W. Holmes
From: "Jeff McKeon" <[EMAIL PROTECTED]>

> Can anyone see why I'm getting this error message:
>
> "Warning: No ending delimiter '^' found in
> C:\Inetpub\wwwMIS_DEV\import_mvs.inc.php on line 126"
>
> From this line:
>
> if(preg_match_all("^([00])?.*$",$called,$found))

Because you do not have an ending delimiter. In fact, you don't have a
starting delimiter, either, but preg assumes you meant the ^ character to be
your delimiter.

This is explained in all of the examples in the manual, but you must
surround your regular expression by a delimiter such as the / or #
character. This is because you can include modifiers after the delimiters to
further create your regex.

if(preg_match_all("/^([00])?.*$",$called,$found))

Although I doubt that'll work like you want it since [00] matches a zero, or
another zero. It only matches one character.

> I basically have a phone bill that sometimes has the phone number
> preceeded by "00" and sometimes not.
>
> When it has the "00" I want to trim it with the substring command.

I wouldn't even use preg for this. Just use ltrim() or
if(substr($called,0,2)=='00')...

---John Holmes...

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



RE: [PHP] varible

2004-04-12 Thread Chris W. Parker
[EMAIL PROTECTED] 
on Monday, April 12, 2004 8:32 AM said:

> Is there a solution ( without open global ) , then send the value of
> the varible of list.php to view.php ?

you can put the variables in $_SESSION or pass them via the querystring.



hth,
chris.

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



[PHP] Re: How do you handle device detection?

2004-04-12 Thread Jason Barnett
Yep, I'd agree with the above comments.  If you're interested in one 
solution, check out HAWHAW, it has a proxy server for detecting/serving 
web pages via regular browsers and mobile devices.  I haven't tried it 
in a long time though, so it might need updating but can still show you 
an example of how to detect mobile devices versus webpages.

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


Re: [PHP] Preg_match_all problem

2004-04-12 Thread John W. Holmes
From: "John W. Holmes" <[EMAIL PROTECTED]>
> From: "Jeff McKeon" <[EMAIL PROTECTED]>
>
> > Can anyone see why I'm getting this error message:
> >
> > "Warning: No ending delimiter '^' found in
> > C:\Inetpub\wwwMIS_DEV\import_mvs.inc.php on line 126"
> >
> > From this line:
> >
> > if(preg_match_all("^([00])?.*$",$called,$found))
>
> Because you do not have an ending delimiter. In fact, you don't have a
> starting delimiter, either, but preg assumes you meant the ^ character to
be
> your delimiter.
>
> This is explained in all of the examples in the manual, but you must
> surround your regular expression by a delimiter such as the / or #
> character. This is because you can include modifiers after the delimiters
to
> further create your regex.
>
> if(preg_match_all("/^([00])?.*$",$called,$found))

damn... i left out the ending delimiter, too.. :)

if(preg_match_all("/^([00])?.*$/",$called,$found))

---John Holmes...

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



Re: [PHP] Preg_match_all problem

2004-04-12 Thread John Nichel
John W. Holmes wrote:
damn... i left out the ending delimiter, too.. :)
Chalk one up to Monday. ;)

--
***
*  _  __   __  __   _  * John  Nichel *
* | |/ /___ __ \ \/ /__ _ _| |__ ___  __ ___ _ __  * 716.856.9675 *
* | ' http://www.KegWorks.com[EMAIL PROTECTED] * 14203 - 1321 *
***
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: The Smarty Aftermath

2004-04-12 Thread Justin Patrin
Justin French wrote:

In the aftermath of the Smarty debate (which turned from intelligent to 
stupid very quickly), I decided to look closely at templating again 
(though not smarty), and I've found one are where these excel in 
comparison to PHP.

Textpattern [1] is a gamma release CMS/blog tool which uses XML 
templating very effectively -- and I can't see an easy way to reproduce 
this with straight PHP.

something might translate 
to the following PHP code:
'cat','b'=>'dog','c'=>'mouse'),'something'); ?> OR


Easy enough, except this is where the XHTML wins:
For the PHP versions, the template designer must have an in-depth 
knowledge of the functions.  He/she must get the parameters in the right 
order, know which ones have default values, etc etc.  Making a mistake 
will generate errors and break code.

The XHTML version on the other hand doesn't ask any more or less of the 
designer than XHTML does.  I can switch the order of the arguments, 
leave some out, etc etc, leaving the hard work to the PHP function on 
the other end to sort it all out.

So, my question is:

Am I missing something in regards to PHP's functions that would give us 
some more simplicity?  The closest I can think of is to pass the 
attributes in any order using 'attr=value', then using funct_get_args() 
to sort it all out:


But this is STILL less intuitive than:
something
Any ideas?  John

---
Justin French
http://indent.com.au
Wellthat seems a bit hard to understand to me. Why did you choose 
not to go with Smarty? Or, say, another templating system?

You could do a few things, depending on how much PHP you want in there. 
You could use this kind of syntax:

Where the first parameter is the "key" and the next is the value. Or, 
morre explicitly:
 'dog', 'a' => 'cat'))?>

Or you could even use XML and use XSL or PHP to convert it yourself.

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


[PHP] Re: Problems with mail and php

2004-04-12 Thread Justin Patrin
Luis Lebron wrote:

I have a development box that uses our company's Exchange server as an smtp
host. All of a sudden, the php mail function has stopped working.
I can, however, send a message using mutt. 

Here's the output of the maillog: 

Apr 12 10:38:51 localhost sendmail[11879]: i3CFckaV011877:
to=<[EMAIL PROTECTED]>, ctladdr=<[EMAIL PROTECTED]> (48/48),
delay=00:00:04, xdelay=00:00:04, mailer=relay, pri=30323,
relay=sigma2.localdomain. [192.168.168.4], dsn=2.0.0, stat=Sent (OK)
As far as I can tell the message is being sent by sendmail. Any ideas on
where to look?
thanks,

Luis R. Lebron
Project Manager
Sigmatech, Inc
Have you asked your Exchange admins if they changed something? They 
might have turned off relaying.

Also, those domains look a little fishy. localhost.localdomain and 
sigma2.localdomain...you may wa tto look into that.

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


[PHP] Win2003 Slow

2004-04-12 Thread Ataxia
Just installed PHP on a brand new W2k3 Server, and it works flawlessly, but
all the scripts are EXTREMELY slow.

Migrating the site from a Win2000 box, and everything was perfect, so I
don't believe it's the code.

Anyone else run into this?

-- 
AtaxiA

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



Re: [PHP] Re: commercial autoresponses

2004-04-12 Thread David T-G
Jason, et al --

...and then Jason Barnett said...
% 
% David T-G wrote:
% >
% >and wondered for a moment if I'd really sent it to the right place!  Have
% >I really missed so much in a month of being too busy to post on the list?
% 
% No David, I receive those messages also when I post.  Just block them in 

Bleah.  What a pain!


% your mail reader.  As for your CMS question, don't know anything off 
% hand that does it, but you can track timestamps in your database and 
% show the "special" page for members that joined at a certain date/time 
% or earlier.

That's what I figured.  I want to avoid reinventing the wheel if
possible, though.


Thanks & HAND

:-D
-- 
David T-G
[EMAIL PROTECTED]
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


[PHP] help!! Double-byte character problem

2004-04-12 Thread Kelvin
Hi all,
Is there any function/method in PHP to convert a double-byte character into
its ascii code?

for example, the traditional Chinese charater "§A" is equal to 20320. In ASP
there is a function AscW() to do so. Don't know if we have similar function
in PHP.

thanks,
Kelvin

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



Re: [PHP] requests per s with php and mysql queries

2004-04-12 Thread William Lovaton
Hi Merlin,

I use some tools made by my self.  So, I have done some PHP scripts to
gather this info.

The information I gave to you regarding concurrency (requests per sec)
are obtained simply by analyzing the apache logs.  Look at the left, you
will see the date and time of the request, just group all the requests
that are in the very same second.

The active users were obtained analyzing the sess_* files and looking
for a special session var directly in the serialized data.  Ofcorse,
this session var has to be setted by the corresponding app in the user
session.

There are others measures you can get.  One of the most useful ones is
the execution time of the script.  For this, you will have to modify the
apache log format in this way:

LogFormat "%h %l %u %t \"%r\" %>s %b %T %P" mycustomlog

and then tell apache to use it:

CustomLog /usr/local/apache/logs/access_log mycustomlog

This format adds the last two parameters, %T indicates the execution
time of the request and %P is the proccess id of the server that served
the request. Note1: %P is not mandatory, it is just nice ;-).  Note2:
pay attention to the case, it is case-sensitive.

The important one is %T, the time is in seconds and it includes
everything, from PHP input processing to database interaction and PHP
output processing.  As you can see, this is the total execution time of
a PHP script.  The only thing that is not included obviously is the
network transfer time from the web server to the user's web browser.

So, a PHP script digest all the apache log and generates something like
this: (An example of the execution times from my app)


| Seconds  |  Requests  | Percentage (%) | Accumulated (%) |

|0 |2003346 |76.4794 |   76.4794   |
|1 | 554878 |21.1829 |   97.6623   |
|2 |  43392 | 1.6565 |   99.3188   |
|3 |  11247 | 0.4294 |   99.7482   |
|4 |   3437 | 0.1312 |   99.8794   |
|5 |   1371 | 0.0523 |   99.9317   |
|6 |573 | 0.0219 |   99.9536   |
|7 |300 | 0.0115 |   99.9650   |
|8 |171 | 0.0065 |   99.9716   |
|9 |113 | 0.0043 |   99.9759   |
|   10 | 66 | 0.0025 |   99.9784   |
|   11 | 26 | 0.0010 |   99.9794   |
|   12 | 25 | 0.0010 |   99.9803   |
|   13 | 17 | 0.0006 |   99.9810   |
|   14 | 10 | 0.0004 |   99.9814   |
|   15 | 15 | 0.0006 |   99.9819   |
|   16 | 10 | 0.0004 |   99.9823   |
|   17 |  7 | 0.0003 |   99.9826   |
|   18 | 10 | 0.0004 |   99.9830   |
|   19 |  5 | 0.0002 |   99.9832   |
|   20 |  8 | 0.0003 |   99.9835   |
|  21+ |433 | 0.0165 |  100.   |

| Total Requests: 2619460  |



Another thing that I would suggest is that you should profile your
application. May be using something like Zend Debugger if you can or
writting your application with profiling in mind.

First of all, it is easier if your application was made thinking in
reuse of code with a reasonable architecture.  For example, your SQL
queries must be placed in a business loginc layer so you can reuse it
every time you need it.  Extra care must be taken when designing the
API.  Let's see an example of this:

function &getCustomerTransactions($customerId) {
// Here goes the SQL logic: 
// SELECT * from transactions where customer_id = $customerId
}

Inside this function you can take measures of the sql execution time or
the fetch times from the database.  Remember that fetching thousands and
thousands of records through the network takes a lot of time.

Just take an initial time, execute an operation and then take the final
time, do the math (a difference BTW) and log it in a file with the
format of your preference (CSV is a good option).  And finally you might
want to write an script to proccess the log file and show the results.

Ex:
$it = getmicrotime(); // the profiling starts
// Execute something here (usually, a query execution)
$ft = getmicrotime(); // the profiling ends
$totalTime = $ft - $it;
logThis(date("Y-m-d H:i:s"), "", $totalTime);

For high precision measures take a look of microtime().  Look at the
user comments too.
http://www.php.net/microtime

With this you will be able to see the most used functions (queries) and
how much time they take to execute.  Based on this information you will
know what you have to optimize first.

Just r

RE: [PHP] Problems with mail and php

2004-04-12 Thread jon roig
Take a look at the email address in the log... Seems to be missing a
.com.

Might that be your problem?

-- jon

-Original Message-
From: Luis Lebron [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 12, 2004 8:48 AM
To: Php-General (E-mail)
Subject: [PHP] Problems with mail and php 


I have a development box that uses our company's Exchange server as an
smtp host. All of a sudden, the php mail function has stopped working. I
can, however, send a message using mutt. 

Here's the output of the maillog: 

Apr 12 10:38:51 localhost sendmail[11879]: i3CFckaV011877:
to=<[EMAIL PROTECTED]>, ctladdr=<[EMAIL PROTECTED]> (48/48),
delay=00:00:04, xdelay=00:00:04, mailer=relay, pri=30323,
relay=sigma2.localdomain. [192.168.168.4], dsn=2.0.0, stat=Sent (OK)

As far as I can tell the message is being sent by sendmail. Any ideas on
where to look?

thanks,

Luis R. Lebron
Project Manager
Sigmatech, Inc

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.644 / Virus Database: 412 - Release Date: 3/26/2004
 
  

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.644 / Virus Database: 412 - Release Date: 3/26/2004
 

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



Re: [PHP] XML Parser Functions - problem interpreting an xml file

2004-04-12 Thread Kai Hackemesser
This didn't help, since the problem is in an file which doesn't pass the PHP
interpreter.
Next idea?

Regards,
Kai

"Chris Boget" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> > I send you a part of the XML file (- content), maybe you can tell me why
> > it cant be interpreted. It looks like it doesn't like the 
> Do you have short tags enabled?  If so, you might want to disable them.
> Just to test this theory, try to add the following at the top of your
script and
> see if the problem doesn't go away:
>
> ini_set( short_open_tag, '
> or something along those lines (anything other than  you may want to recompile with "--disable-short-tags".
>
> Chris

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



[PHP] SQLite /how can I install on an Apache virtual host?

2004-04-12 Thread Al
I've got a website on an Apache virtual host and would like to install 
the SQLite library.

Can someone give me a brief outline of what I need to do or point me to 
a good writeup?

My host makes it tough to run command line code to make files, etc.

I've found a a Linux binary [sqlite.so].   And, they provide a means to 
customize the php.ini.

Thanks.

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


Re: [PHP] After calling a Function the Script aborts without any error :-\

2004-04-12 Thread Don Read

On 12-Apr-2004 William Lovaton wrote:
> Hi,
> 
> El lun, 12-04-2004 a las 09:27, John W. Holmes escribió:
>> From: "Ben" <[EMAIL PROTECTED]>
>> 
>> > i got a big problem. I have a script which includes some other
>> > script i
>> > tried include, require and require once. The problem is, if i do a
>> > function call to a function in one of these included files, the
>> > script
>> > aborts but without any error. The strange thing is, normally
>> > require
>> > should give an error if it can't include any file. But the files
>> > are
>> > accessible, error reporting is E_ALL. Some functions are callable
>> > but
>> > others not and still no error. the only way how i came to this was
>> > putting some die()s to see where 
>> 
>> Do you have display_errors turned on?
> 
> Sometimes I have this problems too, no matter if that setting is on.
> 

If the error occurs within a table element on a web page, Mozilla won't
display because it's waiting for the '' to begin figuring
out the display properties.

Use 'View Source' if/when this happens.

Regards,

-- 
Don Read [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

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



AW: [PHP] After calling a Function the Script aborts without anyerror :-\

2004-04-12 Thread Ben
Its the same in my case.
That's the point why i was wondering because if the function
that i want to call wouldn't exist it would normally print an error...

And to this comment

>Or you can echo out something in the function you're trying to call...
>
>function whatever() {
>   echo ( "" );
>   //  More Code
>}

i can say that i did this but it didnt help in any way but i'll try this
function exists



-Ursprüngliche Nachricht-
Von: William Lovaton [mailto:[EMAIL PROTECTED] 
Gesendet: Montag, 12. April 2004 16:36
An: [EMAIL PROTECTED]
Betreff: Re: [PHP] After calling a Function the Script aborts without
anyerror :-\


Hi,

El lun, 12-04-2004 a las 09:27, John W. Holmes escribió:
> From: "Ben" <[EMAIL PROTECTED]>
> 
> > i got a big problem. I have a script which includes some other 
> > script i tried include, require and require once. The problem is, if

> > i do a function call to a function in one of these included files, 
> > the script aborts but without any error. The strange thing is, 
> > normally require should give an error if it can't include any file. 
> > But the files are accessible, error reporting is E_ALL. Some 
> > functions are callable but others not and still no error. the only 
> > way how i came to this was putting some die()s to see where
> 
> Do you have display_errors turned on?

Sometimes I have this problems too, no matter if that setting is on.


-William

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


---
__
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.656 / Virus Database: 421 - Release Date: 09.04.2004
 

---
__
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.656 / Virus Database: 421 - Release Date: 09.04.2004
 

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



Re: [PHP] After calling a Function the Script aborts without any error :-\

2004-04-12 Thread William Lovaton
El lun, 12-04-2004 a las 14:12, Don Read escribió:
> > Sometimes I have this problems too, no matter if that setting is on.
> > 
> 
> If the error occurs within a table element on a web page, Mozilla won't
> display because it's waiting for the '' to begin figuring
> out the display properties.

I know that but this is not the case, I dont mix HTML with PHP, I use
Smarty and the error is generated inside business logic functions.

Sometimes it occurs when calling a method in a null variable.  This
usually shows the error message, but sometimes it doesn't and I don't
know why.

I use allow_call_time_pass_reference = Off and sometimes this triggers
the problem:

$x = foo("bar");
$y = foo($obj->getBar());

With this setting in off he two lines of code sometimes fails and some
others doesn't fail.  But when it fails it does it completely silent.

To workaround the problem I have to do:

$tmp = "bar";
$x = foo($tmp);

or

$tmp = $obj->getBar();
$y = foo($tmp);


Regards,


-William

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



[PHP] looking for remote execution command

2004-04-12 Thread Zhang, Yanning
is there another command similar to 
ftp_exec(), but outside ftp? I tried ftp_exec() and it doesn't work ftp_exec($conn, 
'ls -al'): ERROR: SITE ls -al is not understood.

Thanks.
Yanning

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



AW: [PHP] After calling a Function the Script aborts without anyerror :-\

2004-04-12 Thread Ben
But what if the function you are callign doesn't need any passed
variable like

$bar = foo(); ???

the more strange thing is, on a lamp environment (SUSE 9.0, PHP 4.3.5),
 the scripts worked, on a wamp (win2k, same PHP) and on a LAMP RH9 same
PHP
it didn't work.


-Ursprüngliche Nachricht-
Von: William Lovaton [mailto:[EMAIL PROTECTED] 
Gesendet: Montag, 12. April 2004 22:33
An: [EMAIL PROTECTED]
Betreff: Re: [PHP] After calling a Function the Script aborts without
anyerror :-\


El lun, 12-04-2004 a las 14:12, Don Read escribió:
> > Sometimes I have this problems too, no matter if that setting is on.
> > 
> 
> If the error occurs within a table element on a web page, Mozilla 
> won't display because it's waiting for the '' to begin 
> figuring out the display properties.

I know that but this is not the case, I dont mix HTML with PHP, I use
Smarty and the error is generated inside business logic functions.

Sometimes it occurs when calling a method in a null variable.  This
usually shows the error message, but sometimes it doesn't and I don't
know why.

I use allow_call_time_pass_reference = Off and sometimes this triggers
the problem:

$x = foo("bar");
$y = foo($obj->getBar());

With this setting in off he two lines of code sometimes fails and some
others doesn't fail.  But when it fails it does it completely silent.

To workaround the problem I have to do:

$tmp = "bar";
$x = foo($tmp);

or

$tmp = $obj->getBar();
$y = foo($tmp);


Regards,


-William

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


---
__
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.656 / Virus Database: 421 - Release Date: 09.04.2004
 

---
__
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.656 / Virus Database: 421 - Release Date: 09.04.2004
 

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



Re: AW: [PHP] After calling a Function the Script aborts without anyerror :-\

2004-04-12 Thread William Lovaton
Mmmm... very strange...

can you print_r() the array returned by get_defined_functions(),
get_included_files() and get_declared_classes() and see if every thing
is going on right??  Use the last one if your included file define
classes too.

Can we review the code in the mailing list?? is it big?


-William



El lun, 12-04-2004 a las 17:51, Ben escribió:
> But what if the function you are callign doesn't need any passed
> variable like
> 
> $bar = foo(); ???
> 
> the more strange thing is, on a lamp environment (SUSE 9.0, PHP 4.3.5),
>  the scripts worked, on a wamp (win2k, same PHP) and on a LAMP RH9 same
> PHP
> it didn't work.
> 
> 
> -Ursprüngliche Nachricht-
> Von: William Lovaton [mailto:[EMAIL PROTECTED] 
> Gesendet: Montag, 12. April 2004 22:33
> An: [EMAIL PROTECTED]
> Betreff: Re: [PHP] After calling a Function the Script aborts without
> anyerror :-\
> 
> 
> El lun, 12-04-2004 a las 14:12, Don Read escribió:
> > > Sometimes I have this problems too, no matter if that setting is on.
> > > 
> > 
> > If the error occurs within a table element on a web page, Mozilla 
> > won't display because it's waiting for the '' to begin 
> > figuring out the display properties.
> 
> I know that but this is not the case, I dont mix HTML with PHP, I use
> Smarty and the error is generated inside business logic functions.
> 
> Sometimes it occurs when calling a method in a null variable.  This
> usually shows the error message, but sometimes it doesn't and I don't
> know why.
> 
> I use allow_call_time_pass_reference = Off and sometimes this triggers
> the problem:
> 
> $x = foo("bar");
> $y = foo($obj->getBar());
> 
> With this setting in off he two lines of code sometimes fails and some
> others doesn't fail.  But when it fails it does it completely silent.
> 
> To workaround the problem I have to do:
> 
> $tmp = "bar";
> $x = foo($tmp);
> 
> or
> 
> $tmp = $obj->getBar();
> $y = foo($tmp);
> 
> 
> Regards,
> 
> 
> -William
 

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



[PHP] Including a dynamic variable/file

2004-04-12 Thread Ryan A
Hi,
I created a "control panel" for a client, he wanted the option of changing
the template as whenever he pleases.
Since he knows HTML I made it very simple by adding a header and a footer.

He simple fills in 2 variables in Config.php:
$client_header
$client_footer

In my scripts I am calling it like this:


but it gives me this error:
Warning: main() [function.main]: Failed opening '' for inclusion
(include_path='.;C:/php/includes;C:/php/php/class') in
c:\php\www\project14342\client\index.php on line 3

Running tests I see taht Config.php IS getting included...

Any ideas?

Thanks,
-Ryan

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



Re: [PHP] Including a dynamic variable/file

2004-04-12 Thread Ryan A
Hi again,
Disregard the last post, i found the problemthe variable was being
overwritten by another one below
Cheers,
-Ryan

On 4/13/2004 1:50:07 AM, Ryan A ([EMAIL PROTECTED]) wrote:
> Hi,
> I created a "control panel" for a client, he wanted the option of
> changing
> the template as whenever he pleases.
> Since he knows HTML I made it very simple by adding a header and a footer.
>
>
> He simple fills in 2 variables in Config.php:
> $client_header
> $client_footer
>
> In my scripts I am calling it like this:
>  include "../Config.php";
> include "$client_header";
> ?>
>
> but it gives me this error:
> Warning: main() [function.main]: Failed opening '' for inclusion
> (include_path='.;C:/php/includes;C:/php/php/class') in
> c:\php\www\project14342\client\index.php on line 3
>
> Running tests I see taht Config.php IS getting included...
>
> Any ideas?
>
> Thanks,
> -Ryan
>
> --
> 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



Re: [PHP] Wanted: login and CMS system with a twist

2004-04-12 Thread David T-G
Justin, et al --

...and then Justin French said...
% 
% On 13/04/2004, at 1:10 AM, David T-G wrote:
% 
% >A client of mine wishes to create a web site which does more than just
% >the typical CMS functions in that what you can see not only depends on
% >whether or not you have an account but also how old your account is?).
% >Of course, I'd prefer that it is written in PHP :-)
% >
% >Any recommendations?
% 
% Any CMS / membership system that tracks when the user joined with some 
% form of timestamp should be customisable to meet your needs:

Right.


% 
%  $a) {
%   echo "a";
% } elseif($userJoinedStamp > $b)   {
%   echo "b";
% }
% ?>

Well, actually more like

  if ( mktime() - $user['joined']['stamp'] > a )
{ print "a\n" ; }

but I agree with the idea.


% 
% I'd look for a decent CMS that meets MOST of your needs, then tweak it 
% to match special needs like this one... there's no way you'll find 
% something that does everything.

Yeah, probably not.  But there's always hoping :-)  And I'm moderately
surprised nobody has yet had to invent this wheel (or has done so and not
told anyone).


% 
% Or, build it yourself, and cut out the overhead :)

My art ain't that great; I'd definitely want to start with something that
looked pretty and put on the controls :-)


Thanks & HAND

:-D
-- 
David T-G
[EMAIL PROTECTED]
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


RE: [PHP] Win2003 Slow

2004-04-12 Thread Jason Sheets
Did you install PHP as a module or as CGI?  What web serve are you using?

Jason 

-Original Message-
From: Ataxia [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 12, 2004 10:48 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Win2003 Slow

Just installed PHP on a brand new W2k3 Server, and it works flawlessly, but
all the scripts are EXTREMELY slow.

Migrating the site from a Win2000 box, and everything was perfect, so I
don't believe it's the code.

Anyone else run into this?

--
AtaxiA

--
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



Re: [PHP] SQLite /how can I install on an Apache virtual host?

2004-04-12 Thread Curt Zirzow
* Thus wrote Al ([EMAIL PROTECTED]):
> I've got a website on an Apache virtual host and would like to install 
> the SQLite library.
> 
> Can someone give me a brief outline of what I need to do or point me to 
> a good writeup?

some info on sqlite:
  http://php.net/sqlite

You can compile and install the extension from the source located
here:
  http://pecl.php.net/sqlite


> 
> My host makes it tough to run command line code to make files, etc.
> 
> I've found a a Linux binary [sqlite.so].   And, they provide a means to 
> customize the php.ini.

You found it on your virtual host machine? or somewhere on the
internet?

I wouldnt trust any old .so laying around somewhere. If its on your
virtual host machine already then you can just add this to your
php.ini (assuming its in your extension path)

  extension=sqlite.so


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



Re: [PHP] looking for remote execution command

2004-04-12 Thread Curt Zirzow
* Thus wrote Zhang, Yanning ([EMAIL PROTECTED]):
> is there another command similar to 
> ftp_exec(), but outside ftp? I tried ftp_exec() and it doesn't work ftp_exec($conn, 
> 'ls -al'): ERROR: SITE ls -al is not understood.
> 
iirc, that means that 'SITE' isn't supported by the server your
connected to.  ftp_rawlist() might get what you need.


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



RE: [PHP] looking for remote execution command

2004-04-12 Thread Vail, Warren
Depends on the machine you are connecting to, but there are a whole raft of
them.
rexec, rpc, rsh, ssh (I've even invoked perl under php to gain access to
perls telnet command, could never get one to work in PHP, seems there is
some handshaking missing (will/wont, can/cant, etc)).  Secure Shell (ssh) is
becoming the preferred method in lots of shops, but if connectivity is
behind a firewall, then any of the others should do just fine.

To find out what is available on the destination machine, signon to it and
look for the deamon processes (rexecd, rshd, etc [don't know them all]).
Note that none of these are PHP functions, you will need to code exec("rsh
...") or something like that to execute the appropriate client (and yes
windows versions of these clients are available if your server is a windows
platform).

BTW, I've never used the SITE command that way with FTP (maybe doesn't mean
much), but I have used SITE JES to connect ftp to mainframe reader/writer,
and followed it with a get specifying a JCL file on the mainframe to be
submitted and spool output to be retrieved as my resulting file.  Perhaps
this might provide a few clues.

hope this helps.

Warren Vail


-Original Message-
From: Zhang, Yanning [mailto:[EMAIL PROTECTED]
Sent: Monday, April 12, 2004 2:48 PM
To: [EMAIL PROTECTED]
Subject: [PHP] looking for remote execution command


is there another command similar to 
ftp_exec(), but outside ftp? I tried ftp_exec() and it doesn't work
ftp_exec($conn, 'ls -al'): ERROR: SITE ls -al is not understood.

Thanks.
Yanning

-- 
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



[PHP] how do I make a script wait ?

2004-04-12 Thread Damian Brown
I am writing a script that searches through a database table, and then there
is an array function below the searching, but the array function gets
executed before
the database table searching finishes and I want it to wait until
the database has been searched before executing the array code

Thanks in Advance

--
www.phpexpert.org/truefaith.htm
"True Faith is not just when you believe in God and yourself, it is when
others begin to believe in you as well" - Damian John Paul Brown 2004

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



RE: [PHP] Win2003 Slow

2004-04-12 Thread Jason Sheets
Also take a look at
http://forum.rackshack.net/printthread.php?threadid=30312, it sounds like
they had similar performance problems.

Jason 

>
> -Original Message-
> From: Hotmail [mailto:[EMAIL PROTECTED]
> Sent: Monday, April 12, 2004 8:27 PM
> To: Jason Sheets
> Subject: Re: [PHP] Win2003 Slow
>
> Using IIS6.0
>
> It's installed as CGI at the moment.
>
> Here's one of the sites installed on the server
http://63.238.105.106:8213
>
> It works perfectly...  just incredibly slow
>
> Thanks for taking a look,
> - Brad
>
>
>
> - Original Message -
> From: "Jason Sheets" <[EMAIL PROTECTED]>
> To: "'Ataxia'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Monday, April 12, 2004 8:00 PM
> Subject: RE: [PHP] Win2003 Slow
>
>
> > Did you install PHP as a module or as CGI?  What web serve are you
using?
> >
> > Jason
> >
> > -Original Message-
> > From: Ataxia [mailto:[EMAIL PROTECTED]
> > Sent: Monday, April 12, 2004 10:48 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Win2003 Slow
> >
> > Just installed PHP on a brand new W2k3 Server, and it works flawlessly,
> but
> > all the scripts are EXTREMELY slow.
> >
> > Migrating the site from a Win2000 box, and everything was perfect, so I
> > don't believe it's the code.
> >
> > Anyone else run into this?
> >
> > --
> > AtaxiA
> >
> > --
> > 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
> >
> >
> >
>
>


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



Re: [PHP] how do I make a script wait ?

2004-04-12 Thread Ryan A
Hey,
Use the sleep() function.

Cheers,
-Ryan

On 4/13/2004 4:42:56 AM, Damian Brown ([EMAIL PROTECTED]) wrote:
> I am writing a script that searches through a database table, and then
> there
> is an array function below the searching, but the array function gets
> executed before
> the database table searching finishes and I want it to wait until
> the database has been searched before executing the array code
> 
> Thanks in Advance
> 
> --
> www.phpexpert.org/truefaith.htm
> "True Faith is not just when you believe in God and yourself, it is when
> others begin to believe in you as well"
> - Damian John Paul Brown 2004
> 
> --
> 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



[PHP] I need some help And the people at the Bug section pointed me to you

2004-04-12 Thread Jbard888
Im a collage student 
And im trying to set up snort as a class project
I downloaded all needed files according to the instructions
Everything was going fine untill I got to the PHP installation. I typed

./configure --prefix=/www/php --with-apxs2=/www/bin/apxs
--with-config-file-path=/www/php --enable-sockets
--with-mysql=/usr/local/mysql --with-zlib-dir=/usr/local --with- gd

then make

then make install

on the make install is where I got the error

I checked the /www/modules/ dir. for libphp*.so
and it was not there
I started with 
PHP version 4.3.3
then I tried 4.3.5
then I tried 5.0.0RC1
all 3 had the same error 

Try to keep in mind that im new to linux
Iv only been useing it for about 6 mounths
I don't think its an EEOC error but then again
I only been using linux for 6 mounths 
so maby it is
Any help would be greatly apprecated

Reproduce code:
---
Installing PHP SAPI module:   apache2handler
/www/build/instdso.sh SH_LIBTOOL='/www/build/libtool' libphp5.la
/www/modules
/www/build/libtool --mode=install cp libphp5.la /www/modules/
cp .libs/libphp5.lai /www/modules/libphp5.la
cp .libs/libphp5.a /www/modules/libphp5.a
ranlib /www/modules/libphp5.a
chmod 644 /www/modules/libphp5.a
libtool: install: warning: remember to run `libtool --finish
/snort/php-5.0.0RC1/libs'
Warning!  dlname not found in /www/modules/libphp5.la.
Assuming installing a .so rather than a libtool archive.
chmod 755 /www/modules/libphp5.so
chmod: failed to get attributes of `/www/modules/libphp5.so': No such
file or directory
apxs:Error: Command failed with rc=65536
.
make: *** [install-sapi] Error 1


Re: [PHP] how do I make a script wait ?

2004-04-12 Thread Damian Brown
The code is shown below
there is now a delay before the page is displayed of 50 secs
it must be hitting the sleep command as it searches, and so stops searching
the database table
is there any workaround ?

echo "Your Search Results are as follows";
?>

  
Title
URL
Description
for Keyword
  

 $row[6] );
$key=$key + 1 ; ?>



 $b) ? -1 : 1;
}

// $a = array (0.10, 0.30, 5, 6, 1);

usort ($a, cmp);
echo "Bid Prices and Positions" ;
while (list ($key, $value) = each ($a)) {
   echo " Position $key: £$value > ";

   }
echo " http://www.phpexpert.org/ppcsearch/>Become a Bidder ";
?>




--
www.phpexpert.org/truefaith.htm
"True Faith is not just when you believe in God and yourself, it is when
others begin to believe in you as well" - Damian John Paul Brown 2004
"Ryan A" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hey,
> Use the sleep() function.
>
> Cheers,
> -Ryan
>
> On 4/13/2004 4:42:56 AM, Damian Brown ([EMAIL PROTECTED]) wrote:
> > I am writing a script that searches through a database table, and then
> > there
> > is an array function below the searching, but the array function gets
> > executed before
> > the database table searching finishes and I want it to wait until
> > the database has been searched before executing the array code
> >
> > Thanks in Advance
> >
> > --
> > www.phpexpert.org/truefaith.htm
> > "True Faith is not just when you believe in God and yourself, it is when
> > others begin to believe in you as well"
> > - Damian John Paul Brown 2004
> >
> > --
> > 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



[PHP] Re: Problems with mail and php

2004-04-12 Thread Manuel Lemos
Hello,

On 04/12/2004 12:48 PM, Luis Lebron wrote:
I have a development box that uses our company's Exchange server as an smtp
host. All of a sudden, the php mail function has stopped working.
I can, however, send a message using mutt. 

Here's the output of the maillog: 

Apr 12 10:38:51 localhost sendmail[11879]: i3CFckaV011877:
to=<[EMAIL PROTECTED]>, ctladdr=<[EMAIL PROTECTED]> (48/48),
delay=00:00:04, xdelay=00:00:04, mailer=relay, pri=30323,
relay=sigma2.localdomain. [192.168.168.4], dsn=2.0.0, stat=Sent (OK)
As far as I can tell the message is being sent by sendmail. Any ideas on
where to look?
This may be due to a bug in PHP mail() function that ended up making 
Exchange filter the message.

In that case you may want to try this class that comes with workarounds 
to avoid some of the mail() function problems. Just let me know if it 
still does not work:

http://www.phpclasses.org/mimemessage

--

Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] how do I make a script wait ?

2004-04-12 Thread David Risner
There is a default maximum run time for scripts of 30 seconds (it is
max_execution_time in the php.ini file), so unless you have changed this,
you might be running into the maximum run time.

-- David Risner

On Tue, 13 Apr 2004 04:06:51 +0100, "Damian Brown" <[EMAIL PROTECTED]>
said:
> The code is shown below
> there is now a delay before the page is displayed of 50 secs
> it must be hitting the sleep command as it searches, and so stops
> searching
> the database table
> is there any workaround ?
> 
> echo "Your Search Results are as follows";
> ?>
> 
>   
> Title
> URL
> Description
> for Keyword
>   
>  $result=mysql_query("SELECT * FROM `searchdata` WHERE 1 AND `keyword` = "
> .
> "'$thissearchterm'"  );
> $key=1 ;
> while ($row=mysql_fetch_row($result)){
> ?>
>  $row[5] ' , ' $row[6] ' )");
> $a = array( $key => $row[6] );
> $key=$key + 1 ; ?>
> 
>} ; //end of while loop
> ?>
> 
>  sleep (50) ;
> function cmp ($a, $b) {
> if ($a == $b) return 0;
> return ($a > $b) ? -1 : 1;
> }
> 
> // $a = array (0.10, 0.30, 5, 6, 1);
> 
> usort ($a, cmp);
> echo "Bid Prices and Positions" ;
> while (list ($key, $value) = each ($a)) {
>echo " Position $key: £$value > ";
> 
>}
> echo " http://www.phpexpert.org/ppcsearch/>Become a Bidder ";
> ?>
> 
> 
> 
> 
> --
> www.phpexpert.org/truefaith.htm
> "True Faith is not just when you believe in God and yourself, it is when
> others begin to believe in you as well" - Damian John Paul Brown 2004
> "Ryan A" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hey,
> > Use the sleep() function.
> >
> > Cheers,
> > -Ryan
> >
> > On 4/13/2004 4:42:56 AM, Damian Brown ([EMAIL PROTECTED]) wrote:
> > > I am writing a script that searches through a database table, and then
> > > there
> > > is an array function below the searching, but the array function gets
> > > executed before
> > > the database table searching finishes and I want it to wait until
> > > the database has been searched before executing the array code
> > >
> > > Thanks in Advance
> > >
> > > --
> > > www.phpexpert.org/truefaith.htm
> > > "True Faith is not just when you believe in God and yourself, it is when
> > > others begin to believe in you as well"
> > > - Damian John Paul Brown 2004
> > >
> > > --
> > > 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
> 

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



RE: [PHP] how do I make a script wait ?

2004-04-12 Thread Jason Sheets
Take a look at the set_time_limit function, it will allow you to set the
maximum execution time to a greater value, note that when you call the
function it sets the max time and resets the timer so if you set it to 100
seconds 20 seconds into the script the script will run for a maximum of 120
seconds.

http://us3.php.net/manual/en/function.set-time-limit.php

 Jason

-Original Message-
From: David Risner [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 12, 2004 9:42 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] how do I make a script wait ?

There is a default maximum run time for scripts of 30 seconds (it is
max_execution_time in the php.ini file), so unless you have changed this,
you might be running into the maximum run time.

-- David Risner

On Tue, 13 Apr 2004 04:06:51 +0100, "Damian Brown" <[EMAIL PROTECTED]>
said:
> The code is shown below
> there is now a delay before the page is displayed of 50 secs it must 
> be hitting the sleep command as it searches, and so stops searching 
> the database table is there any workaround ?
> 
> echo "Your Search Results are as follows"; ?>  border="2" cellspacing="0" cellpadding="1">
>   
> Title
> URL
> Description
> for Keyword
>   
>  $result=mysql_query("SELECT * FROM `searchdata` WHERE 1 AND `keyword` = "
> .
> "'$thissearchterm'"  );
> $key=1 ;
> while ($row=mysql_fetch_row($result)){ ?>  INTO searchsorting (username,bid) VALUES ( '
> $row[5] ' , ' $row[6] ' )");
> $a = array( $key => $row[6] );
> $key=$key + 1 ; ?>
> 
>} ; //end of while loop
> ?>
> 
>  sleep (50) ;
> function cmp ($a, $b) {
> if ($a == $b) return 0;
> return ($a > $b) ? -1 : 1;
> }
> 
> // $a = array (0.10, 0.30, 5, 6, 1);
> 
> usort ($a, cmp);
> echo "Bid Prices and Positions" ;
> while (list ($key, $value) = each ($a)) {
>echo " Position $key: £$value > ";
> 
>}
> echo " http://www.phpexpert.org/ppcsearch/>Become a Bidder 
> "; ?>
> 
> 
> 
> 
> --
> www.phpexpert.org/truefaith.htm
> "True Faith is not just when you believe in God and yourself, it is 
> when others begin to believe in you as well" - Damian John Paul Brown 
> 2004 "Ryan A" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
> > Hey,
> > Use the sleep() function.
> >
> > Cheers,
> > -Ryan
> >
> > On 4/13/2004 4:42:56 AM, Damian Brown ([EMAIL PROTECTED]) wrote:
> > > I am writing a script that searches through a database table, and 
> > > then there is an array function below the searching, but the array 
> > > function gets executed before the database table searching 
> > > finishes and I want it to wait until the database has been 
> > > searched before executing the array code
> > >
> > > Thanks in Advance
> > >
> > > --
> > > www.phpexpert.org/truefaith.htm
> > > "True Faith is not just when you believe in God and yourself, it 
> > > is when others begin to believe in you as well"
> > > - Damian John Paul Brown 2004
> > >
> > > --
> > > 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
> 

--
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



Re: [PHP] varible

2004-04-12 Thread edwardspl
"Chris W. Parker" wrote:

> [EMAIL PROTECTED] 
> ??on Monday, April 12, 2004 8:32 AM said:
>
> > Is there a solution ( without open global ) , then send the value of
> > the varible of list.php to view.php ?
>
> you can put the variables in $_SESSION or pass them via the querystring.
>
> hth,
> chris.

Dear Chris,

Would you mind to post me a sample about the useful of $_SESSION ?

Many thank for your help !

Edward.

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



[PHP] Form variable can't transfer to web page

2004-04-12 Thread Morris Law
Dear all PHP users,

I have installed a new web server for PHP scripting.
I wrote a PHP form page to submit some variables to
another PHP pages.  After submission, I found that the
variables cannot be echoed out.   The scripts are as simple
like these,



\n";
print "Name: \n";
print "\n\n";
?>


  \nWhat a bold move
this is!\n"); ?>  

What sort of problem relating to installation is it?

Thanks for any inputs and advice.

Morris Law
IT Coordinator
Science Faculty
Hong Kong Baptist University



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



[PHP] class design

2004-04-12 Thread Andy B
hi...

i was reading something on phppatterns website about class design. the
reading said that its best to take say a db extraction class that you might
want to write and instead of making one super huge class out of it called
"db" or whatever it would be called but to turn that "db" class into a bunch
of mini classes.
so instead of having:
class db {
//connect functions
//error functions
//query functions
//result functions
//so on...}
you should make:
classes: DbConnect, DbError, DbQuery, DbResult and so on...

was just wondering what the best way to do something like this is... i can
see writing different classes for different sections of db use but unless my
mind is super limmited right now that isnt really 100% possible or
reasonable  considering that some of those classes might only have 1 or 2
different functions in it... but then again i guess super small exact easy
to figure out classes are the best??

for example class DBQuery would have in it: Insert, Delete, Update, Select,
CheckTable, BackupTable, RestoreTable, TableList, DbList and so on... and
maybe that could even be broken down to 2 classes in itself: DbQuery and
DbInfo...

ok time to stop babbling i guess... just trying to figure out how i should
start going about this class writing deal and how to split the files/class
defines...

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



Re: [PHP] Form variable can't transfer to web page

2004-04-12 Thread Elfyn McBratney
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Tuesday 13 Apr 2004 06:11, Morris Law wrote:
> Dear all PHP users,
>
> I have installed a new web server for PHP scripting.
> I wrote a PHP form page to submit some variables to
> another PHP pages.  After submission, I found that the
> variables cannot be echoed out.   The scripts are as simple
> like these,
>
> 
> 
>  print "\n";
> print "Name: \n";
> print "\n\n";
> ?>

Unless register_globals is off, you need to use the $_GET/$_POST super-globals 
to access request data.

> 
>   \nWhat a bold move
> this is!\n"); ?>  

..so this would become:

  

See the manual () if you don't understand any 
of the above constructs.

> What sort of problem relating to installation is it?
>
> Thanks for any inputs and advice.

Elfyn

- -- 
Elfyn McBratney, EMCB
mailto:[EMAIL PROTECTED]
http://www.emcb.co.uk/

PGP Key ID: 0x456548B4
PGP Key Fingerprint:
  29D5 91BB 8748 7CC9 650F  31FE 6888 0C2A 4565 48B4

"When I say something, I put my name next to it." -- Isaac Jaffee

>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ <<
<< ~  Linux london 2.6.5-emcb-241 #2 i686 GNU/Linux  ~ >>
>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ <<
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAe5XsaIgMKkVlSLQRAj7kAJ9G6NjjofohXAjYSQc7UZ2H6qeCdQCfXlBG
eqykNp0EeSGn0oHlc+dXwx0=
=ZkLv
-END PGP SIGNATURE-

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