Re: [PHP] Re: Failed to Receive in E:\...\mailscript.php on line 25

2003-07-06 Thread Jason Wong
On Sunday 06 July 2003 03:25, Håkon Strandenes wrote:
 No, actually not. But i think so. This is the server to my ISP, so I
 cannot change it. But the SMTP server is set to localhost, so I THINK
 it's correct.

You're using some Windows system? Are you running an SMTP server on that 
machine? If not then you cannot use 'localhost' for your SMTP setting. Try 
changing it to the SMTP server provided by your ISP.

-- 
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
--
/*
Default, n.:
The hardware's, of course.
*/


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



RE: [PHP] Re: Failed to Receive in E:\...\mailscript.php on line 25

2003-07-06 Thread Håkon Strandenes
How do I specify witch SMTP server I shall use? I cannot set this in the
PHP.ini file, so I must specift this in the script.

Regards,
Håkon Strandenes

-Original Message-
From: Håkon Strandenes [mailto:[EMAIL PROTECTED] 
Sent: 5. juli 2003 21:25
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Re: Failed to Receive in E:\...\mailscript.php on
line 25


No, actually not. But i think so. This is the server to my ISP, so I
cannot change it. But the SMTP server is set to localhost, so I THINK
it's correct.

I have made a php script with only the phpinfo() tag in here:
http://grimstad.seilforening.no/Mailinglister/phpinfo.php

Regards,
Håkon Strandenes

-Original Message-
From: Thomas Seifert [mailto:[EMAIL PROTECTED] 
Sent: 5. juli 2003 22:17
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Failed to Receive in E:\...\mailscript.php on line 25


are you sure that the smtp-settings in php.ini are correct on your
host's server?


Thomas

On Sat, 5 Jul 2003 20:15:14 +0200 [EMAIL PROTECTED]
(Håkon strandenes) wrote:

 Hi,
 
 I am making a small PHP script for managing a simple mailing list. The

 PHP script is added in the bottom of this message.
 
 This PHP script works great on IIS 5.1 with PHP 4.3.0, witch I have
 installed locally on my system to test my scripts. But when I transfer

 the script over to my host server (With IIS and PHP 4.2.1), I get an
 error message when I'm trying to use it. The error message is like 
 this:
 
 Warning: Failed to Receive in
 E:\inetpub\wwwroot\grimstad.seilforening\Mailinglister\mailscript.php 
 on line 25 Kommandoen er nå sendt. Merk at det kan ta opp til 5 
 minutter før den trer i kraft.PHP Warning: Failed to Receive in 
 E:\inetpub\wwwroot\grimstad.seilforening\Mailinglister\mailscript.php 
 on line 25
 
 Is there any compatibility problems between 4.2.1 and 4.3.0 for the
 codes I have used in my script?
 
 Regards,
 Håkon Strandenes
 
 
 Here is the script (It get its inputs from this form:
 http://grimstad.seilforening.no/Mailinglister/Styreskjema.html):
 
 ?php
 
 @extract($_POST);
 
 $Liste = stripslashes($Liste);
 $Navn = stripslashes($Navn);
 $Email = stripslashes($Email);
 $Kommando = stripslashes($Kommando);
 
 if (!$Email)
 {
 echo (Du må fylle inn din e-mail adresse.);
 }
 else
 {
 if (!$Navn)
 {
 echo (Du må fylle inn navnet ditt.);
 }
 else
 {
 
 $Message = Automatisk generert styringsmail;
 $Headers = From: $Navn $Email;
 mail( $Liste, $Kommando, $Message, $Headers );
 
 echo (Kommandoen er nå sendt. Merk at det kan ta opp til 5 minutter
 før den trer i kraft.);
 
 }
 }
 ?
 
 



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

---
[This E-mail was scanned for viruses by Declude Virus]





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

---
[This E-mail was scanned for viruses by Declude Virus]





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



RE: [PHP] Re: Failed to Receive in E:\...\mailscript.php on line 25

2003-07-06 Thread Håkon Strandenes
This is not my server, so I cannot change the settings in php.ini. This
is my ISP's server, and I think they run SMPT om the same server. And
yes, this is a Windows 2000 server.

How do I set the SMTP server I shall use in the script? I have no access
to the php.ini...

I will contact my ISP at moonday and tell them about my problem.

Regards,
Håkon Strandenes

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED] 
Sent: 6. juli 2003 08:56
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Failed to Receive in E:\...\mailscript.php on
line 25


On Sunday 06 July 2003 03:25, Håkon Strandenes wrote:
 No, actually not. But i think so. This is the server to my ISP, so I 
 cannot change it. But the SMTP server is set to localhost, so I 
 THINK it's correct.

You're using some Windows system? Are you running an SMTP server on that

machine? If not then you cannot use 'localhost' for your SMTP setting.
Try 
changing it to the SMTP server provided by your ISP.

-- 
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
--
/*
Default, n.:
The hardware's, of course.
*/


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

---
[This E-mail was scanned for viruses by Declude Virus]





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



Re: [PHP] Re: Failed to Receive in E:\...\mailscript.php on line 25

2003-07-06 Thread Jason Wong
On Sunday 06 July 2003 14:55, Håkon Strandenes wrote:

Please trim your posts!

 How do I specify witch SMTP server I shall use? 

If you're using mail() then in php.ini.

 I cannot set this in the
 PHP.ini file, 

Why not? If it's on some hosting service then obviously the hosting service 
have gotten their settings wrong. And they should do something to rectify it!

so I must specift this in the script.

If all else fails, you have to abandon the use of mail(). There are several 
alternatives here: www.phpclasses.org, which allows you to specify an SMTP 
server at run-time.

-- 
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
--
/*
No sex with anyone in the same office
-- Murphy's Laws on Sex n8
*/


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



Re: [PHP] Re: Failed to Receive in E:\...\mailscript.php on line 25

2003-07-06 Thread Jason Wong
On Sunday 06 July 2003 14:59, Håkon Strandenes wrote:
 This is not my server, so I cannot change the settings in php.ini. This
 is my ISP's server, and I think they run SMPT om the same server. And
 yes, this is a Windows 2000 server.

A quick and easy way to check whether mail() would work is to use the 
error_log() function.

 How do I set the SMTP server I shall use in the script? I have no access
 to the php.ini...

I believe you can set that at run-time using ini_set().

 I will contact my ISP at moonday and tell them about my problem.

Good idea!

-- 
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
--
/*
Theory is gray, but the golden tree of life is green.
-- Goethe
*/


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



[PHP] does anyone know how to tell if a PHP scrip is being executed from the command line not a server HTTP request??

2003-07-06 Thread Jeffrey D. Means
I am trying to write a script but for security I need to verify that it is
not executed by a web server.  At this point I have just placed it outside
the htdocs tree but would like to build into the script a test to die if it
is being executed by a web server.

Thanks

Jeff Means
CIO for MeansPC
[EMAIL PROTECTED]


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



php-general Digest 6 Jul 2003 08:48:44 -0000 Issue 2159

2003-07-06 Thread php-general-digest-help

php-general Digest 6 Jul 2003 08:48:44 - Issue 2159

Topics (messages 154073 through 154114):

Re: Failed to Receive in E:\...\mailscript.php on line 25
154073 by: Håkon Strandenes
154109 by: Jason Wong
154110 by: Håkon Strandenes
154111 by: Håkon Strandenes
154112 by: Jason Wong
154113 by: Jason Wong

Sessions help needed!
154074 by: John Fuller

Re: Q on echo phpinfo() ;
154075 by: Philip Olson
154078 by: jsWalter

Re: Authentication system
154076 by: olinux

PHP crashing with using Oracle
154077 by: Reuben D. Budiardja

SSL POST problems, cURL, fsockopen, ipv6??
154079 by: af.ax-im.com

Re: Delimiter must not be alphanumeric or backslash
154080 by: Jaap van Ganswijk

looping through values from a field?  Need hellp.
154081 by: Micah Montoy
154082 by: Lars Torben Wilson
154085 by: Micah Montoy
154091 by: Giz
154095 by: Micah Montoy
154097 by: Lars Torben Wilson
154098 by: Micah Montoy

Re: Timing out fopen using https stream wrapper?
154083 by: Giz
154084 by: Giz
154099 by: Dan Anderson
154103 by: Giz
154104 by: Dan Anderson
154106 by: Giz

Re: Limit output of query field
154086 by: Giz

Re: Permission Problem
154087 by: Giz

Re: simple query help
154088 by: Giz
154089 by: Giz

Forms and PHP_SELF
154090 by: Beauford.2005
154093 by: Beauford.2005
154094 by: Alan D'Angelo
154100 by: Dan Anderson
154101 by: Leif K-Brooks
154102 by: Dan Anderson
154107 by: Leif K-Brooks

Compiling 4.2.3 with MySQL ... what does it look for?
154092 by: -{ Rene Brehmer }-

sqlite_seek() problem
154096 by: Alan D'Angelo

Re: [PHP-DB] Compiling 4.2.3 with MySQL ... what does it look for?
154105 by: olinux

instanceof on class (not objects) php 5
154108 by: Greg Beaver

does anyone know how to tell if a PHP scrip is being executed from the command line 
not a server HTTP request??
154114 by: Jeffrey D. Means

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]


--
---BeginMessage---
No, actually not. But i think so. This is the server to my ISP, so I
cannot change it. But the SMTP server is set to localhost, so I THINK
it's correct.

I have made a php script with only the phpinfo() tag in here:
http://grimstad.seilforening.no/Mailinglister/phpinfo.php

Regards,
Håkon Strandenes

-Original Message-
From: Thomas Seifert [mailto:[EMAIL PROTECTED] 
Sent: 5. juli 2003 22:17
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Failed to Receive in E:\...\mailscript.php on line 25


are you sure that the smtp-settings in php.ini are correct on your
host's server?


Thomas

On Sat, 5 Jul 2003 20:15:14 +0200 [EMAIL PROTECTED]
(Håkon strandenes) wrote:

 Hi,
 
 I am making a small PHP script for managing a simple mailing list. The

 PHP script is added in the bottom of this message.
 
 This PHP script works great on IIS 5.1 with PHP 4.3.0, witch I have 
 installed locally on my system to test my scripts. But when I transfer

 the script over to my host server (With IIS and PHP 4.2.1), I get an 
 error message when I'm trying to use it. The error message is like 
 this:
 
 Warning: Failed to Receive in 
 E:\inetpub\wwwroot\grimstad.seilforening\Mailinglister\mailscript.php 
 on line 25 Kommandoen er nå sendt. Merk at det kan ta opp til 5 
 minutter før den trer i kraft.PHP Warning: Failed to Receive in 
 E:\inetpub\wwwroot\grimstad.seilforening\Mailinglister\mailscript.php 
 on line 25
 
 Is there any compatibility problems between 4.2.1 and 4.3.0 for the 
 codes I have used in my script?
 
 Regards,
 Håkon Strandenes
 
 
 Here is the script (It get its inputs from this form:
 http://grimstad.seilforening.no/Mailinglister/Styreskjema.html):
 
 ?php
 
 @extract($_POST);
 
 $Liste = stripslashes($Liste);
 $Navn = stripslashes($Navn);
 $Email = stripslashes($Email);
 $Kommando = stripslashes($Kommando);
 
 if (!$Email)
 {
 echo (Du må fylle inn din e-mail adresse.);
 }
 else
 {
 if (!$Navn)
 {
 echo (Du må fylle inn navnet ditt.);
 }
 else
 {
 
 $Message = Automatisk generert styringsmail;
 $Headers = From: $Navn $Email;
 mail( $Liste, $Kommando, $Message, $Headers );
 
 echo (Kommandoen er nå sendt. Merk at det kan ta opp til 5 minutter 
 før den trer i kraft.);
 
 }
 }
 ?
 
 



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

---
[This E-mail was scanned for viruses by Declude Virus]




---End Message---
---BeginMessage---
On Sunday 06 July 2003 03:25, Håkon Strandenes wrote:
 No, actually not. But i think so. This is the server to my ISP, 

[PHP] Question

2003-07-06 Thread The.Rock
When is the relase date for php 5?



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



Re: [PHP] does anyone know how to tell if a PHP scrip is beingexecuted from the command line not a server HTTP request??

2003-07-06 Thread Robert Cummings
I don't know if it is a great way, but it has worked for me for a long
time now. I make the following test:

isset( $HTTP_SERVER_VARS['SERVER_PORT']

Cheers,
Rob.

On Sun, 2003-07-06 at 04:48, Jeffrey D. Means wrote:
 I am trying to write a script but for security I need to verify that it is
 not executed by a web server.  At this point I have just placed it outside
 the htdocs tree but would like to build into the script a test to die if it
 is being executed by a web server.
 
 Thanks
 
 Jeff Means
 CIO for MeansPC
 [EMAIL PROTECTED]
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



[PHP] Reading from remote file

2003-07-06 Thread Daniele Baroncelli
Hi guys,
I am trying to read from a remote file, by using an example reported at the
manual page for the fread function:

?php
$handle = fopen (http://www.php.net/;, rb);
$contents = ;
do {
$data = fread ($handle, filesize ($filename));
if (strlen($data) == 0) {
break;
}
$contents .= $data;
}
fclose ($handle);
?


Unfortunately this example is incorrect, as it gives me a parse error. The
mistake should be in the fact that there is a do keyword without a
while.
Would anyone suggest me the correct version?

Cheers

Daniele




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



Re: [PHP] Question

2003-07-06 Thread Tom Rogers
Hi,

Sunday, July 6, 2003, 3:15:56 AM, you wrote:
TR When is the relase date for php 5?




at this point I think the only digits filled in are

200x-xx-xx

-- 
regards,
Tom


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



Re: [PHP] Reading from remote file

2003-07-06 Thread Dan Anderson
Since you're using a break to determine when to leave why not...
 ?php
 $handle = fopen (http://www.php.net/;, rb);
 $contents = ;
  while (!(feof($handle)))
  {
 $data = fread ($handle, filesize ($filename));
 if (strlen($data) == 0) {
 break;
 }
 $contents .= $data;
 }
 fclose ($handle);
 ?



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



[PHP] mysql_query

2003-07-06 Thread Kevin Fradkin
hi... 1 question...
how can i show in a table the query i'm trying to make

this is what i want :
select * from my_table where var1='$val1' /* here comes the trouble  cause i
want to use 2 instead of only one... */  var2='$val2'

how you have to use it for more than one? where var1='$val1' ???
var2='$val2' ?

thanks in advance..



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



Re: [PHP] mysql_query

2003-07-06 Thread Sævar Öfjörð
SELECT * FROM my_table WHERE var1='$var1' AND var2='$var2'
--^
 
you use AND
 
-Original Message-
From: Kevin Fradkin [mailto:[EMAIL PROTECTED] 
Sent: 6. júlí 2003 13:43
To: [EMAIL PROTECTED]
Subject: [PHP] mysql_query
 
hi... 1 question...
how can i show in a table the query i'm trying to make
 
this is what i want :
select * from my_table where var1='$val1' /* here comes the trouble
cause i want to use 2 instead of only one... */  var2='$val2'
 
how you have to use it for more than one? where var1='$val1' ???
var2='$val2' ?
 
thanks in advance..
 
 
 
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 


RE: [PHP] mysql_query

2003-07-06 Thread Sævar Öfjörð
Hmm. Should have been like this..

-Original Message-
From: Sævar Öfjörð [mailto:[EMAIL PROTECTED] 
Sent: 6. júlí 2003 14:04
To: [EMAIL PROTECTED]
Subject: Re: [PHP] mysql_query

SELECT * FROM my_table WHERE var1='$var1' AND var2='$var2'


--^
 
you use AND
 
-Original Message-
From: Kevin Fradkin [mailto:[EMAIL PROTECTED] 
Sent: 6. júlí 2003 13:43
To: [EMAIL PROTECTED]
Subject: [PHP] mysql_query
 
hi... 1 question...
how can i show in a table the query i'm trying to make
 
this is what i want :
select * from my_table where var1='$val1' /* here comes the trouble
cause i want to use 2 instead of only one... */  var2='$val2'
 
how you have to use it for more than one? where var1='$val1' ???
var2='$val2' ?
 
thanks in advance..
 
 
 
-- 
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] Reading from remote file

2003-07-06 Thread Philip Olson

This is already fixed in CVS.  The entire example is bogus, 
it should not be using filesize($filename) either.

Here's what's in CVS (the manual will be rebuilt sometime
in the next week):

?php
$handle = fopen (http://www.example.com/;, rb);
$contents = ;
do {
$data = fread($handle, 8192);
if (strlen($data) == 0) {
break;
}
$contents .= $data;
} while(true);
fclose ($handle);
?

And the whole point is to demonstrate the following note:

 When reading from network streams or pipes, such as those 
  returned when reading remote files or from popen() and 
  proc_open(), reading will stop after a packet is available. 
  This means that you should collect the data together in 
  chunks as shown in the example below.

Have fun :)

Regards, 
Philip


On Sun, 6 Jul 2003, Daniele Baroncelli wrote:

 Hi guys,
 I am trying to read from a remote file, by using an example reported at the
 manual page for the fread function:
 
 ?php
 $handle = fopen (http://www.php.net/;, rb);
 $contents = ;
 do {
 $data = fread ($handle, filesize ($filename));
 if (strlen($data) == 0) {
 break;
 }
 $contents .= $data;
 }
 fclose ($handle);
 ?
 
 
 Unfortunately this example is incorrect, as it gives me a parse error. The
 mistake should be in the fact that there is a do keyword without a
 while.
 Would anyone suggest me the correct version?
 
 Cheers
 
 Daniele
 
 
 
 
 -- 
 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] echo not working!!!

2003-07-06 Thread aravandor
I'm setting up php on the apache server for the first time here running
Slackware linux, and I cannot get the echo command to display properly.

My source file is phptest.php and it looks like this:

html
head
titlePHP Test/title
/head
body bgcolor=#00 text=#FF
brbr
center
?php echo h1PHP is running./h1; ?
/center
/body
/html

When the page is displayed on my server, it doesn't show the text.
Altenatively, if I enclose the quoted string in parenthesis,

?php echo (h1PHP is running./h1); ?

it displays the string AND the closing double quote, paren, semicolon,
question mark, and  on a new line.  What the hell is going on here?

PHP is running.
);?



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



Re: [PHP] echo not working!!!

2003-07-06 Thread Tom Rogers
Hi,

Sunday, July 6, 2003, 3:55:39 PM, you wrote:
a I'm setting up php on the apache server for the first time here running
a Slackware linux, and I cannot get the echo command to display properly.

a My source file is phptest.php and it looks like this:

a html
a head
a titlePHP Test/title
a /head
a body bgcolor=#00 text=#FF
a brbr
a center
a ?php echo h1PHP is running./h1; ?
a /center
a /body
a /html

a When the page is displayed on my server, it doesn't show the text.
a Altenatively, if I enclose the quoted string in parenthesis,

a ?php echo (h1PHP is running./h1); ?

a it displays the string AND the closing double quote, paren, semicolon,
question mark, and  on a new line.  What the hell is going on here?

a PHP is running.
);?


make sure you have a line like

AddType application/x-httpd-php .php

in httpd.conf and that you restarted apache

-- 
regards,
Tom


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



Re: [PHP] echo not working!!!

2003-07-06 Thread David Nicholson
Hello,


This is a reply to an e-mail that you wrote on Sun, 6 Jul 2003 at 16:57,
lines prefixed by '' were originally written by you.
 ?php echo (h1PHP is running./h1); ?
 it displays the string AND the closing double quote, paren, semicolon,
 question mark, and  on a new line.  What the hell is going on here?
 PHP is running.
 );?

At a guess I would say that your PHP is not being parsed as PHP, if you
view the source of your output you will probably see ?php echo
(h1PHP is running./h1); ? but your browser is treating ?php
echo (h1PHP is running./h1 as a tag that it does not understand and
displaying the ); ? as text.

If this is the case you need to check your httpd.conf.

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

  Professional Web Development by David Nicholson
http://www.djnicholson.com/

QuizSender.com - How well do your friends actually know you?
 http://www.quizsender.com/
(developed entirely in PHP)

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



[PHP] mysql_query

2003-07-06 Thread Kevin Fradkin
and now.. if in one cell i have for example... John Matheus

when i do the query i have to put exactly john matheus to find it...
is there any way to just write jo and search in every cell that contains
those words?

example... i have  1 column with 5 rows each 6 numbers inside :
821554
821674
818937
819378
818977

and i want to query and show onmy begining with 821*

thnx in advance!

Kevin



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



Re: [PHP] mysql_query

2003-07-06 Thread Burhan Khalid
On Sunday, July 6, 2003, 7:26:06 PM, Kevin wrote:

KF and now.. if in one cell i have for example... John Matheus

KF when i do the query i have to put exactly john matheus to find it...
KF is there any way to just write jo and search in every cell that contains
KF those words?

try this SELECT * FROM table WHERE name = jo%

KF example... i have  1 column with 5 rows each 6 numbers inside :
KF 821554
KF 821674
KF 818937
KF 819378
KF 818977

KF and i want to query and show onmy begining with 821*

SELECT * FROM table WHERE number  821000

-- 
Regards,
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com


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



Re: [PHP] newbie query

2003-07-06 Thread rob
on 7/7/03 2:31 AM, Burhan Khalid at [EMAIL PROTECTED] wrote:
dear list
My server runs requires that if I want to write to file that I place my php
script in the cgi-bin and it treats it as a cgi script. I am new to this and
cannot get it to work. Would anyone know of a tutorial I could use to get
the hang of doing this. Apart from this my php pages work fine
Thanks
RB


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



Re: [PHP] mysql_query

2003-07-06 Thread Kevin Fradkin
the problem is if i put 821000 i will have as result all number  821000
including 83

and i only need numbers begining with the numbers i entered..

i will try now the other thing!.. thnx!




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



[PHP] fsockopen - returning results from port 80, 8080 and 443 requests

2003-07-06 Thread Dave [Hawk-Systems]
Creating a quick script where we can poll the services on a particular server to
verify if they are running or not.  this will be included in a larger scope
application once the details are worked out.

Am having a problem getting results from queries to web server ports though.
Port 80(std), 8080(FP), and 443(SSL) either timeout without returning any
results, or error with some of the other attempts at illiciting a response that
we have tried (like specifying ssl:// prior to the hostname).

Code and two smaple outputs below. Thoughts?

Dave

!-- begin socket.php --
?PHP
# get form submitted host
$host=$_POST['host'];
$portstring=array(Testing SSH:br\n,Testing TELNET:br\n,Testing
FTP:br\n,Testing HTTP:br\n,Testing HTTPS:br\n,Testing
SMTP:br\n,Testing POP3:br\n,Testing IMAP:br\n);
$portput=array(,,,GET / HTTP/1.1\r\nHost: $host\r\n\r\n,GET /
HTTP/1.1\r\nHost: $host\r\n\r\n,,,);
$portprepend=array(,,,tcp://,ssl://,,,);
$port=array(22,23,21,80,443,25,110,143);
for($i=0;$icount($port);$i++){
$result=date(H:i:s).-;
$fp = fsockopen($portprepend[$i].$host, $port[$i], $errno, $errstr,5);
if (!$fp){
$result=$portstring[$i].nbsp;nbsp;nbsp;Error($errno): $errstrbr\n;
}else{
# see if we have to nudge for a response
if(strlen($portput[$i]0)){
fputs ($fp, $portput[$i]);
}
#   get the response
$result.=$portstring[$i].nbsp;nbsp;nbsp;;
$result.= fgets($fp,1024);
fclose ($fp);
$result.=br\n;
$result=trim($result);
}
echo $result;
flush;
}
?
!--  end  socket.php --

!-- begin sample output with tcp:// for 80 and ssl:// for 443 --
12:20:13-Testing SSH:
   SSH-1.99-OpenSSH_3.5p1 FreeBSD-20030201
12:20:13-Testing TELNET:
   Error(61): Connection refused
12:20:13-Testing FTP:
   220 isp1.nexusinternetsolutions.net FTP server (Version 6.00LS) ready.
12:20:13-Testing HTTP:
   Error(0):
12:20:13-Testing HTTPS:
   Error(0):
12:20:13-Testing SMTP:
   220 isp1.nexusinternetsolutions.net ESMTP
12:20:13-Testing POP3:
   Error(61): Connection refused
12:20:13-Testing IMAP:
   Error(61): Connection refused
!--  end  sample output with tcp:// for 80 and ssl:// for 443 --

!-- begin sample output with  for 80 and  for 443 --
12:21:44-Testing SSH:
   SSH-1.99-OpenSSH_3.5p1 FreeBSD-20030201
12:21:44-Testing TELNET:
   Error(61): Connection refused
12:21:44-Testing FTP:
   220 isp1.nexusinternetsolutions.net FTP server (Version 6.00LS) ready.
12:21:44-Testing HTTP:

12:26:46-Testing HTTPS:

12:31:47-Testing SMTP:
   220 isp1.nexusinternetsolutions.net ESMTP
12:31:47-Testing POP3:
   Error(61): Connection refused
12:31:47-Testing IMAP:
   Error(61): Connection refused
!--  end  sample output with  for 80 and  for 443 --



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



Re: [PHP] mysql_query

2003-07-06 Thread Chris Knipe
- Original Message - 
From: Kevin Fradkin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, July 06, 2003 6:40 PM
Subject: Re: [PHP] mysql_query


 the problem is if i put 821000 i will have as result all number  821000
 including 83
 
 and i only need numbers begining with the numbers i entered..

where numbers LIKE 821%

I'd suggest you read up on the LIKE clause...

--
me


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



[PHP] Can I use PHP to draw a chart?

2003-07-06 Thread Sheawh
It's the first time I use PHP as my project server-side language,
and I wanna know if PHP can be used to draw a chart or any other
suggestions. Thx



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



[PHP] Having problems with an IF statement, just doesn't make sense

2003-07-06 Thread BoBB
I am using the following if statement ...

if (isset($theme)) {
  print(Current theme is $theme);
  require content/header_$theme.php;
} else {
  print($theme);
  require content/header.php;
}

now one would think that if it didn't return true that the else
statement wouldn't print anything for $theme ... but it does. Also if I
use !isset it returns true with a null value for $theme ... This doesn't
make sense to me ... maybee I am doing something wrong, if I am someone
please correct me heh.

-- 
/*  BoBB
 *  AIM: Jodokast49 ICQ: 151495596
 *  Jabber: [EMAIL PROTECTED]
 *  http://knightsofchaos.com/~BoBB/new/
 *  I geek, therefor I am.
 */

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



Re: [PHP] Can I use PHP to draw a chart?

2003-07-06 Thread Greg Donald

 It's the first time I use PHP as my project server-side language,
 and I wanna know if PHP can be used to draw a chart or any other
 suggestions. Thx

Yeah, PHP will do that.

I use JPGraph myself: http://www.aditus.nu/jpgraph/


-- 
Greg Donald
http://destiney.com/



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



Re: [PHP] mysql_query

2003-07-06 Thread Kevin Fradkin
Thnx! :)

one last question for the day...
if in one cell i have two names. ex 'mary eleanor'
and i want to search by typing 'ele' with   name LIKE '$name%' will not give
me mary eleanor as a result...
any ideas?



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



Re: [PHP] Having problems with an IF statement, just doesn't make sense

2003-07-06 Thread David Otton
On Mon, 7 Jul 2003 10:18:04 -0700, you wrote:

if (isset($theme)) {
  print(Current theme is $theme);
  require content/header_$theme.php;
} else {
  print($theme);
  require content/header.php;
}

now one would think that if it didn't return true that the else
statement wouldn't print anything for $theme ... but it does. Also if I

I would expect it to error (undefined variable theme). We need to know
what's being printed.

(BTW, to avoid the risk of calling an undefined variable, I tend to do
something like this at the top of the script:

if (!isset($theme)) {
$theme = ;
}

and this later on:

reguire (content/header$theme.php);


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



Re: [PHP] mysql_query

2003-07-06 Thread Chris Knipe
 one last question for the day...
 if in one cell i have two names. ex 'mary eleanor'
 and i want to search by typing 'ele' with   name LIKE '$name%' will not
give
 me mary eleanor as a result...
 any ideas?


*sighs*

LIKE '%$name%'

As I said... Read the MySQL Manual.


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



Re: [PHP] Incrementing counter from an HTML page.

2003-07-06 Thread Mike Migurski
The problem I am facing is that my Index page can be an HTML page only..
not PHP. I cant use framesets, redirects etcetera.  I want to build my
own Counter using PHP  mySQL Database.. with the Users Online and
Total Hits feature.  How can I increment the counter or affect a PHP
code using HTML.. is there someway I can achieve this? To be able to show
the php counter on my HTML page.. ?

If your webserver is Apache, use SSI -
http://httpd.apache.org/docs/howto/ssi.html

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html


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



[PHP] PHP 4.3.1, ini_set, ini_get, memory_limit, and max_input_time

2003-07-06 Thread Raymond C . Rodgers
While documenting I just wrote for a client, I noted that there were several 
server variables (in the form of php.ini configuration settings) that might 
come into play that were generally the responsibility of the web master of 
the server, and thus beyond my control.

These were memory_limit, max_input_time, and max_execution_time.

According to http://www.php.net/function.ini-set , any item with the value 
PHP_INI_ALL in the changeable column should be abe to be set in any of 
the described methods in PHP. (Configuration file, .htaccess file, or through 
ini_set()/ini_alter().) 

One of the user contributed notes seems to contradict this information saying 
that directives with PHP_INI_PERDIR or PHP_INI_ALL may only be set in 
.htaccss files. (And I presume the php.ini file as well.) Both memory_limit 
and max_execution_time are listed as PHP_INI_ALL, but max_input_time isn't 
even listed on the page.

These discrepencies need to be remedied obviously, but it gets stranger still 
for me. Just to verify that these are not changeable in my script, I added a 
few calls to ini_set() to do some testing. Here is the relevant snippet:

$output=ini_set(max_input_time,120);
if ($output!=false) {
$output=ini_get(max_input_time);
echo !-- new input time: $output --\n;
} else
echo !-- problem setting max input time --\n;

$output=ini_set(max_execution_time,120);
if ($output!=false) {
$output=ini_get(max_execution_time);
echo !-- new execution time: $output --\n;
} else
echo !-- problem setting max execution time --\n;

$output=ini_set(memory_limit,12M);
if ($output!=false) {
$output=ini_get(memory_limit);
echo !-- new memory limit: $output --\n;
} else
echo !-- problem setting memory limit --\n;


And here are the results from the page source:

!-- problem setting max input time --
!-- new execution time: 120 --
!-- problem setting memory limit --


So what this tells me is that it is possible to change the execution time 
from with-in the page, but it is not possible to change the input time or the 
memory limit. This wouldn't bother me except that both memory_limit and 
max_execution_time are supposed to be changeable in the same places. 
max_input_time might be as well, but I didn't see any documentation on it. So 
what gives?

On a little further testing, I wasn't even able to get a return value for 
memory_limit with ini_get()... Am I seeing some bizarre behavior that might 
be specific to my OpenBSD/Apache server? (In short, will this work properly 
on the Red Hat Linux/Apache installation that this script will be placed on?) 
Or is this a known bug in PHP 4.3.1? (As I seem to have no problem with a few 
other ini_get() calls.) Or is this behavior just as strange to all of you?

Thanks,
Raymond
-- 
Raymond C. Rodgers
http://bbnk.dhs.org/~rrodgers/
http://www.j-a-n.net/


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



[PHP] how to modify in the db

2003-07-06 Thread Kevin Fradkin
hi...
i have this secuence to insert data to my db

mysql_query
(INSERT INTO my_table(
 number,name,surname
)
 values ('$number','$name','$surname'
));

i want to ask what do i have to do if i want to modify instead of insert
when this data already exists...
 for example.. i have in my_table
number name surname
1jhon smith

and i want to change the name...jhon -- john

and if that not exist create it...
number name surname
0  mary   duke
1  charles emmerson

and add john's one.. ( to check if i can use only modify to add )

thnx!..



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



Re: [PHP] how to modify in the db

2003-07-06 Thread Philip Olson


use UPDATE

Also, be sure to learn basic SQL before use:

http://www.w3schools.com/sql/
http://www.sqlcourse.com/
http://www.onlamp.com/pub/ct/19

Regards,
Philip


On Sun, 6 Jul 2003, Kevin Fradkin wrote:

 hi...
 i have this secuence to insert data to my db
 
 mysql_query
 (INSERT INTO my_table(
  number,name,surname
 )
  values ('$number','$name','$surname'
 ));
 
 i want to ask what do i have to do if i want to modify instead of insert
 when this data already exists...
  for example.. i have in my_table
 number name surname
 1jhon smith
 
 and i want to change the name...jhon -- john
 
 and if that not exist create it...
 number name surname
 0  mary   duke
 1  charles emmerson
 
 and add john's one.. ( to check if i can use only modify to add )
 
 thnx!..
 
 
 
 -- 
 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 to modify in the db

2003-07-06 Thread Miles Thompson
Start with a good tutorial on PHP and MySQL - there are scads of them 
around, and Julie Meloni has some excellent examples at www.thickbook.com.

At 04:41 PM 7/6/2003 -0300, Kevin Fradkin wrote:
hi...
i have this secuence to insert data to my db
mysql_query
(INSERT INTO my_table(
 number,name,surname
)
 values ('$number','$name','$surname'
));
i want to ask what do i have to do if i want to modify instead of insert
when this data already exists...
 for example.. i have in my_table
number name surname
1jhon smith
and i want to change the name...jhon -- john
Use a SELECT query to find if it exists (mysql_numrows() - check sp.)
then issue an UPDATE query to change it, making certain you have a unique 
key to identify the record.
otherwise, use your INSERT query.

This stuff isn't magic - you have to do a bit of work to get the desired 
results.


and if that not exist create it...
number name surname
0  mary   duke
1  charles emmerson
and add john's one.. ( to check if i can use only modify to add )

thnx!..



--
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] fsockopen/curl failure, ipv6 warning??

2003-07-06 Thread alex
Hello.

I'll try wording my question more succinctly in the hopes of getting a response from 
some kind soul.

I'm trying to do a SSL post to a particular secure server, but all methods are failing 
to connect.
curl gives an error 6 = Couldn't resolve host, and fsockopen (using the 
OpenSSL-dependent ssl://
method) fails with the following warnings in the error log:

   PHP Warning:  fsockopen(): unable to connect to [secure.host.name]:443
PHP Warning:  fsockopen(): php_network_getaddresses: getaddrinfo failed: no 
address associated
with name (is your IPV6 configuration correct? If this error happens all the time, try 
reconfiguring
PHP using --disable-ipv6 option to configure)

(I've tried reconfiguring php with --disable-ipv6 and reinstalling, but I continue 
to get the same
message).

What could be causing this?  Any and all insights welcome!

(Platform Info, btw...
OpenBSD 2.9, PHP 4.3.2, Apache 1.3.27, ModSSL 2.8.14, OpenSSL 0.9.6, curl 7.9.8 -- 
I've installed
curl 7.10.5, but PHP configure refuses to see it even when I specify the path,
--with-curl=/usr/local/curl -- it uses the default 7.9.8 install in /usr/local no 
matter what I
do.)

Thanks in advance...
Alex
- - - - - - - - - -
af at ax-im dot com

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



[PHP] Warning: Invalid argument supplied for foreach()

2003-07-06 Thread arnaud gonzales
Hi all,
I am getting crazy, can't understand what i missed!
Does anybody know?

$champs = array (titre_art = h3 ,nom = bleu, prenom = green,
resume = bold);

foreach($champs as $key = $value) {


echo td class='$value'$row($key))/td;
 }

TIA.
zeg


php-general Digest 6 Jul 2003 20:50:39 -0000 Issue 2160

2003-07-06 Thread php-general-digest-help

php-general Digest 6 Jul 2003 20:50:39 - Issue 2160

Topics (messages 154115 through 154145):

Question
154115 by: The.Rock
154118 by: Tom Rogers

Re: does anyone know how to tell if a PHP scrip is being executed from the command 
line not a server HTTP request??
154116 by: Robert Cummings

Reading from remote file
154117 by: Daniele Baroncelli
154119 by: Dan Anderson
154123 by: Philip Olson

mysql_query
154120 by: Kevin Fradkin
154121 by: Sævar Öfjörð
154122 by: Sævar Öfjörð
154127 by: Kevin Fradkin
154128 by: Burhan Khalid
154130 by: Kevin Fradkin
154132 by: Chris Knipe
154136 by: Kevin Fradkin
154138 by: Chris Knipe

echo not working!!!
154124 by: aravandor
154125 by: Tom Rogers
154126 by: David Nicholson

Re: newbie query
154129 by: rob

fsockopen - returning results from port 80, 8080 and 443 requests
154131 by: Dave [Hawk-Systems]

Can I use PHP to draw a chart?
154133 by: Sheawh
154135 by: Greg Donald

Having problems with an IF statement, just doesn't make sense
154134 by: BoBB
154137 by: David Otton

Re: Incrementing counter from an HTML page.
154139 by: Mike Migurski

PHP 4.3.1, ini_set, ini_get, memory_limit, and max_input_time
154140 by: Raymond C. Rodgers

how to modify in the db
154141 by: Kevin Fradkin
154142 by: Philip Olson
154143 by: Miles Thompson

fsockopen/curl failure, ipv6 warning??
154144 by: alex

Warning: Invalid argument supplied for foreach()
154145 by: arnaud gonzales

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]


--
---BeginMessage---
When is the relase date for php 5?


---End Message---
---BeginMessage---
Hi,

Sunday, July 6, 2003, 3:15:56 AM, you wrote:
TR When is the relase date for php 5?




at this point I think the only digits filled in are

200x-xx-xx

-- 
regards,
Tom

---End Message---
---BeginMessage---
I don't know if it is a great way, but it has worked for me for a long
time now. I make the following test:

isset( $HTTP_SERVER_VARS['SERVER_PORT']

Cheers,
Rob.

On Sun, 2003-07-06 at 04:48, Jeffrey D. Means wrote:
 I am trying to write a script but for security I need to verify that it is
 not executed by a web server.  At this point I have just placed it outside
 the htdocs tree but would like to build into the script a test to die if it
 is being executed by a web server.
 
 Thanks
 
 Jeff Means
 CIO for MeansPC
 [EMAIL PROTECTED]
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'
---End Message---
---BeginMessage---
Hi guys,
I am trying to read from a remote file, by using an example reported at the
manual page for the fread function:

?php
$handle = fopen (http://www.php.net/;, rb);
$contents = ;
do {
$data = fread ($handle, filesize ($filename));
if (strlen($data) == 0) {
break;
}
$contents .= $data;
}
fclose ($handle);
?


Unfortunately this example is incorrect, as it gives me a parse error. The
mistake should be in the fact that there is a do keyword without a
while.
Would anyone suggest me the correct version?

Cheers

Daniele



---End Message---
---BeginMessage---
Since you're using a break to determine when to leave why not...
 ?php
 $handle = fopen (http://www.php.net/;, rb);
 $contents = ;
  while (!(feof($handle)))
  {
 $data = fread ($handle, filesize ($filename));
 if (strlen($data) == 0) {
 break;
 }
 $contents .= $data;
 }
 fclose ($handle);
 ?


---End Message---
---BeginMessage---

This is already fixed in CVS.  The entire example is bogus, 
it should not be using filesize($filename) either.

Here's what's in CVS (the manual will be rebuilt sometime
in the next week):

?php
$handle = fopen (http://www.example.com/;, rb);
$contents = ;
do {
$data = fread($handle, 8192);
if (strlen($data) == 0) {
break;
}
$contents .= $data;
} while(true);
fclose ($handle);
?

And the whole point is to demonstrate the following note:

 When reading from network streams or pipes, such as those 
  returned when reading remote files or from popen() and 
  proc_open(), reading will stop after a packet is available. 
  This means that you should collect the data together in 
  chunks as shown in the example below.

Have fun 

RE: [PHP] Warning: Invalid argument supplied for foreach()

2003-07-06 Thread Sævar Öfjörð
Don't you think it should be like this?

foreach($champs as $key=$value) {
echotd class='$value'$key/td;
//--^
}

-Original Message-
From: arnaud gonzales [mailto:[EMAIL PROTECTED] 
Sent: 6. júlí 2003 20:51
To: Php-General
Subject: [PHP] Warning: Invalid argument supplied for foreach() 

Hi all,
I am getting crazy, can't understand what i missed!
Does anybody know?

$champs = array (titre_art = h3 ,nom = bleu, prenom =
green,
resume = bold);

foreach($champs as $key = $value) {


echo td class='$value'$row($key))/td;
 }

TIA.
zeg


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



RE: [PHP] Warning: Invalid argument supplied for foreach()

2003-07-06 Thread Dave [Hawk-Systems]
Hi all,
I am getting crazy, can't understand what i missed!
Does anybody know?

$champs = array (titre_art = h3 ,nom = bleu, prenom = green,
resume = bold);

foreach($champs as $key = $value) {


echo td class='$value'$row($key))/td;
 }

never used foreach()... but I would check the following:

$row($key)) = appears to have an extra ) though it would just be printed in
your example
$row($key) = if it is an array reference, should be $row[$key]

Here is another way to do your problem though

while(list($key,$value)=each($champs)){
echo td class='$value'$key/td;
}

Dave



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



Re: [PHP] Warning: Invalid argument supplied for foreach()

2003-07-06 Thread Philip Olson

On Sun, 6 Jul 2003, arnaud gonzales wrote:

 Hi all,
 I am getting crazy, can't understand what i missed!
 Does anybody know?
 
 $champs = array (titre_art = h3 ,nom = bleu, 
  prenom = green, resume = bold);
 
 foreach($champs as $key = $value) {
 echo td class='$value'$row($key))/td;
 }

It works fine, you are using different code then the above.
In your actual code, make sure you pass in an array that
exists, as currently you are not.

One example reason, the foreach is inside a function and
$champs isn't available in the functions scope (global).

At any rate, before your foreach, var_dump($champs) and
it'll let you know what is up.

Regards,
Philip

p.s. In case $row is an array, you actually mean to write
it as $row[$key], but this is unrelated to the error that
foreach is providing.



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



Re: [PHP] Having problems with an IF statement, just doesn't make sense

2003-07-06 Thread Chris Hayes
At 19:18 7-7-2003, you wrote:
I am using the following if statement ...

if (isset($theme)) {
  print(Current theme is $theme);
  require content/header_$theme.php;
} else {
  print($theme);
  require content/header.php;
}
now one would think that if it didn't return true that the else
statement wouldn't print anything for $theme ... but it does. Also if I
use !isset it returns true with a null value for $theme ... This doesn't
make sense to me ... maybee I am doing something wrong, if I am someone
please correct me heh.
If i use this bit of  code it acts as you and I expect.
So there may be something in the previous code that is acting up here.
Do you see any value in $theme when you do echo [$theme]; ? Spaces should 
show up this way.

Are you working for a CMS? If so, which one? (i ask because i know the 
nukes family uses $theme)



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


[PHP] print vs. heredoc

2003-07-06 Thread Sparky Kopetzky
Hi, again!!

I'm looking for opinions as to which is better, print or heredoc.

print makes the code layout look nice and eazy to debug, where heredoc IS faster but 
makes the code look like a nightmare and I'm pretty picky about what looks good.

Robin E. Kopetzky
Black Mesa Computers/Internet Services
www.blackmesa-isp.net



Re: [PHP] print vs. heredoc

2003-07-06 Thread Greg Donald

 I'm looking for opinions as to which is better, print or heredoc.

I prefer heredoc mostly because I do not enjoy editing html that is full of 
backslashes.  I build up the html and only output anything at the end.  This 
allows for custom compression, whitespace stripping, etc.

 print makes the code layout look nice and eazy to debug, where heredoc IS
 faster but makes the code look like a nightmare and I'm pretty picky about
 what looks good.

Sounds like you already have your mind made up.


-- 
Greg Donald
http://destiney.com/



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



[PHP] Re: PHP crashing with using Oracle

2003-07-06 Thread Lang Sharpe

I had to change ext/oci8/config.m4
Remove the line highlighted in red on this page.

http://cvs.php.net/diff.php/php-src/ext/oci8/config.m4?login=2r1=1.37.2.6r2=1.37.2.7ty=h

The line is
AC_DEFINE(HAVE_OCI8_SHARED_MODE,1,[ ])

Then do configure/make/make install again. That will get the oci8 support to 
work. I haven't tried the oracle functions.

Lang


Reuben D. Budiardja wrote:

 
 Hello,
 I installed PHP-4.3.2 with oci8 and oracle support (using --with-oci8
 --with-oracle).
 I recompile apache-1.3.27 to use the libpthread as mentioned here:
 http://ww.php.net/oci8
 
 Now, I got crashes when using oracle with php. In my apache error logs, I
 get:
 
 [Sat Jul  5 17:24:28 2003] [notice] child pid 17496 exit signal
 [Segmentation
 fault (11)
 [Sat Jul  5 17:24:29 2003] [notice] child pid 17558 exit signal
 [Segmentation
 fault (11)
 
 and the application would just do nothing (I tried reload, submit, etc).
 
 if this happens, the only way I can fix it is by restarting apache. Could
 anyone give me pointer what's going on here  and how to fix it?
 
 In case this matters, the Oracle 9i DB server is also in the same box.
 Somehow it has it's own Apache, but I don't use that.
 
 Thanks for any help.
 RDB
 


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



[PHP] multiple sessions

2003-07-06 Thread David T-G
Hi, all --

I am trying to integrate phpbb into our web site and do so such that we
set the login info before getting into the forum.  We have a user 'x' who
has a numeric user_id 'y' in the phpbb system that we'll need to set.  We
store that user_id in our system for other uses as well.

Our cookie is simply named PHPSESSID and we usually see the session data
by looking in $_SESSION.  The phpbb cookie is named phpbb2mysql_data and
has other good stuff in it.

When I am in the phpbb code I want to be able to look at the PHPSESSID
session data so that I can extract the user_id and pre-set it and then go
on to create the phpbb cookie and so on.  When I get there, though, I
find that $_SESSION is empty.

How do I look at the data stored in another cookie or session -- if I'm
even using the terminology correctly?


TIA  HAND

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



pgp0.pgp
Description: PGP signature


RE: [PHP] Optional form variables (IDEA?)

2003-07-06 Thread Miranda, Joel Louie M
 Yes. Try it first. Let us know if (and how) it doesn't work.
Its working, just having a hard time w/ multiple values


--
Thank you,
Louie


-Original Message-
From: - Edwin - [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 03, 2003 4:44 PM
To: Miranda, Joel Louie M
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Optional form variables (IDEA?)


Hello,

Miranda, Joel Louie M [EMAIL PROTECTED] wrote:

 Hello, im doing a form that when you pass it will generate a preview 
 report. My problem is some fields are optional the optional fields are 
 5. And for those fields I need to make it fit when it generate what 
 idea or codes can you suggest?
 
 Ex, a businesscard preview form. When it generates it will show you a 
 businesscard template. But how about those un-filled fields.
 
 Can this be done thru if and else statement?
 

Yes. Try it first. Let us know if (and how) it doesn't work.

- E -
__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/

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



[PHP] Passing multiple form values in if statement

2003-07-06 Thread Miranda, Joel Louie M

I have a form which passes information and generates a user submitted field.
Its actually a business card template program, on this template program I
have
Some required fields and non required fields which I while use telephone
extension
And webaddress url options.

Now my problem is if they don't enter any fields offcourse the current setup
now
Is just display the template that the user submitted with out verifiying if
some of
The option fields exist, I hope you can see the problem now. Business card
program
Generator will be out of design if the user does not enter some options
fields
Ex: the name Extension #  box option is still there. Im trying to verify
this
Using if and else statement but really I could not figure it out..


$v_name = $_REQUEST['NAME'] ;
$v_jobtitle = $_REQUEST['JOBTITLE'] ;
$v_tel = $_REQUEST['Tel'] ;
$v_telextension = $_REQUEST['TelExtension'] ;
$v_emailadd = $_REQUEST['EmailAdd'] ;
$v_webadd = $_REQUEST['WebAdd'] ;

if ($v_name) {
echo may web;
require temp1.php;
} else {
echo wala web;
require temp1-1.php;
}

if ($v_jobtitle) {
echo may ext;
require temp2.php;
} else {
echo wala ext;
require temp2-1.php;
}

Any help will be most appreciated.


--
Thank you,
Louie

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



[PHP] Looking for a good coder

2003-07-06 Thread Darin
I am interested in getting bids via email for an expert system that I want
to build.  It involves three distinct modules with the following
requirements…

Technical Specifications:

1.  Can be implemented as a web-based ASP model or turn-key box for loading
on internal servers. 
2.  Programmed in open-source code that can be effectively accessed on all
major browsers (IE and Netscape backward compatible to version 4.0) and
all major OS’s (Windows 95-XP, Mac 8+, Unix, Linux).  Use open-source
database that can be similarly leveraged on all major operating systems. 
Use open-source mail client with similar compatibility with OS’s to allow
for messaging between the software and users both inside and outside the
client’s company.  (Once concern that I don’t know how to address is when
the client puts this software on their internal server behind a firewall,
how can external customers provide feedback on person’s in the system? 
Please answer this question as part of your response or bid.)  In your
response please also indicate which programming language, database, and
graphics solutions you believe this software should be built from to
support these requirements. 
3.  Must support HR XML for seamless connectivity to existing HRIS,
Performance Management Systems, and LMS, including SAP and PeopleSoft HR
modules.  (see http://www.hr-xml.org) 
4.  Must be able to run with international data encryption standards on
secure (HTTPS) servers and provide role-based password access for various
user levels. 
5.  Must have a key that requires regular entry or other ongoing algorithms
to prevent usage when my clients do not pay ongoing license fees.  Other
security feature ideas would be appreciated. 
6.  Must be coded for multi-language support (i.e. Unicode) for all user
and Administrator interfaces.  A simple dictionary won’t work; phrases and
short paragraphs must be translated in context to the culture because
interpersonal skills are heavily referenced throughout each module.  Users
will select their preferred language upon login and adding new languages
should be possible via the Administrator side of the modules. 
7.  The three modules must be independent and interdependent of one
another.  Some of my clients only need one module and some need two.  A
few clients need all three.  They will share a common resource
(organizational and user data) table, but some functionality will only
work if more than one module is purchased.  For example, items can be
added to learning plans in the LM module from both of the other modules
only if the LM module was purchased. 
8.  GUI must be engaging, not just boring fields.  The ability to provide
clients with customized skins would be best.  
9.  Users and Administrators will need to query the databases and retrieve
the results in both numerical and graphical reports.  Some data entry
should also be graphical (e.g. organizational charts must be filled in the
same way the client has built the reporting structures within their
company using cascading boxes).  Whatever graphic software is used must be
open-source, neither my clients nor I should be required to buy additional
licenses to use these modules.  The graphics and text reports must be
savable onto individual users’ computers so that users can create
presentations and load the text and graphics into them using cut-and-paste
methods. 
10. Must be tremendously scalable for global Fortune 100 companies. 
11. Need easy remote backups on a daily basis. 
12. Input for key components must be configurable.  My clients may have
existing software that may need to be tapped for some information.  If
they don’t then the strategic data can be collected using this software in
one of two ways: multiple-choice tests of skills or multi-rater feedback
on skill proficiency.  Within the same company some users will be asked to
take tests and others (higher in the organization) will be asked to use
the multi-rater assessment.  Whether gathered via test or multi-rater
feedback the data will be coded the same for everyone.  Most of the base
data will be generated via wizards or by importing .xls spreadsheets or
comma-delimited files. 
13. This is an expert system.  I will provide the help file content in
both Flash and text formats for each page. 
14. Detailed storyboards are already built from the users perspective (not
the Administrators) and the winning bidder will need to comply with a
Non-Disclosure Agreement before those are released to the bidder.  I am
hiring someone to build this software.  I am not interested in licensing
someone else’s content or components.  I will wholly own the resulting
software at the end of the contract.  If the experience is good I will
probably contract for ongoing technical support, development, and
maintenance from the developer.  Ongoing support, development, and
maintenance may be augmented by an online support contract for IRC and
e-mail support for 

RE: [PHP] include/require inside of function

2003-07-06 Thread Ow Mun Heng
Hmm..

Funny I was having this same problem yesterday and wanted to post.

Here's My question, a variable is not actually global is not
actually global until I make it global through global $make_this_global
and then I can assess it using $GLOBAL[$make_this_global]. 

Another method would be to globalise it on demand by writing a
little function. (like Rasmus)

I did it like this -- 


---create_globals.php
function create_global($passed_variable)
if (isset ($GLOBALS[$passed_variable]))
{
return $GLOBALS[$passed_variable];
}
---end-

config.php--
$page_title = Page Title of Web Page
-end

--index.html
require_once ('create_globals.php');

$local_variable = create_global( 'main_title')
echo My Page Title is.$local_variable;
--end-


Hence This way I can make it global-on-demand. 

Maybe a better way to do it would be to 

---config.php---
global $page_title = Alternative Way
end-

then I can -echo This is an .$page_title; and it'll come out as - This
is an alternative way

The only problem here would be the EXTRA typing involved. The other
problem/question is, will there be a speed tradeoff? If I were to global'ise
everything at the 1st place, would it be faster than jumping in and out of
create_global() and going through $page_title  whatever other variables? (I
want to make all global configurations in this file so it'll be easy to
change)

Any help is appreciated.


Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia 
DID : 03-7870 5168


-Original Message-
From: Greg Beaver [mailto:[EMAIL PROTECTED]
Sent: Saturday, July 05, 2003 12:39 AM
To: Rasmus Lerdorf
Cc: Aric Caley; [EMAIL PROTECTED]
Subject: Re: [PHP] include/require inside of function


Hi,

If the file you are including is of your own authorage (I know that 
isn't a word, but whatever :), just refer to global variables always as 
an index of the $GLOBALS array.  This is good practice anyways for any 
file that might be included by another user, for exactly this issue.

I have a file that could be a global include or not in my project, and 
making sure every global variable is referenced as $GLOBALS['varname'] 
fixed it for me without any fancy code (although Rasmus's code is very nice)

Regards,
Greg
--
phpDocumentor
http://www.phpdoc.org

Rasmus Lerdorf wrote:
 On Fri, 4 Jul 2003, Aric Caley wrote:
 
Is there anyway to include a file inside of a function and have the
included
stuff be global?  For instance if I defined a class or a function in that
include file, I want to be able to use that class outside of the function.

On the documentation for include() a poster commented that it did indeed
work like this, but my testing indicates it does not.  Everything stays
local to the function and goes away when the function ends.

Is there a way?
 
 
 Functions defined in included files are always global.  So I guess it is
 just the variable you want to put out into the global symbol table.  It's
 a little bit tricky, but you can do it like this:
 
 function foo($filename) {
 extract($GLOBALS, EXTR_REFS);
 include $filename;
 $arr = array_diff(get_defined_vars(),$GLOBALS);
 foreach($arr as $var=$val) $GLOBALS[$var] = $val;
 }
 
 -Rasmus



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