[PHP] Re: PHp Books

2004-02-11 Thread rush
"Rajani Anand Iyer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Can someone recommend some good books on PHP Advanced topics.

here is my (amazon) list

http://www.templatetamer.org/index.php?RecommendedBooks

rush
--
http://www.templatetamer.com/

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



Re: [PHP] weird header() (bug may be)

2004-02-11 Thread Chris Shiflett
--- adwinwijaya <[EMAIL PROTECTED]> wrote:
>   if($foo == 'something'){
>   header('Location:to_another_page.php') ;
>   }else
>   {
>do another thing in here
>   }
> 
>   header('Location:to_previous_page.php');
> 
> 
>   I got a problem ... when $foo == 'something' .. it wont redirect me
>   to to_another_page.php  but if I put die(); after calling
>   header(); .. it will work ...
> 
>   is this the bug ?

Nope. As others have pointed out, your Location header is improperly
formed.

However, your immediate problem is that, regardless of whether $foo ==
'something', you *always* set the Location header to to_previous_page.php.

So, even if you set it to to_another_page.php previously, you're
overwriting it.

Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming mid-2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



Re: [PHP] weird header() (bug may be)

2004-02-11 Thread joel boonstra
On Thu, Feb 12, 2004 at 05:20:29PM +1100, adwinwijaya wrote:
> Hello php-generaler's ,
> 
>   I have a script like this :
> 
>   if($foo == 'something'){
>   header('Location:to_another_page.php') ;
>   }else
>   {
>do another thing in here
>   }
> 
>   header('Location:to_previous_page.php');
> 
> 
>   I got a problem ... when $foo == 'something' .. it wont redirect me
>   to to_another_page.php  but if I put die(); after calling
>   header(); .. it will work ...

The reason it works after you put die() after calling your first
header() is because once you send the location header, you can't send
other stuff.  Using die() causes script execution to end, which lets the
header work.  So put something in there that causes script execution to
end (e.g., exit()).

The proper code (including the properly-formed URL mentioned by others)
is something like:

   if($foo == 'something'){
   header('Location: http://www.example.com/to_another_page.php') ;
   exit();
   }else
   {
do another thing in here
   }
 
   header('Location: http://www.example.com/to_previous_page.php');
   exit(); // for good measure

joel

-- 
[ joel boonstra | gospelcom.net ]

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



Re: [PHP] Re: weird header() (bug may be)

2004-02-11 Thread Jason Wong
On Thursday 12 February 2004 14:40, Eric Bolikowski wrote:
> Headers have to be pretty accurate, or it will cause trouble.
> And your redirect header is not quite correct.
> It should be this:
> header("Location: another_page.php");
> and NOT header("Location:another_page.php");
>
> What you need here is a space between "Location:" and the URL.

Also it should be an absolute URL otherwise it might break on some (standards 
compliant only) browsers:

  header("Location: http://www.example.tld/another_page.php";);

-- 
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
--
/*
Honesty is the best policy, but insanity is a better defense.
*/

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



[PHP] Re: weird header() (bug may be)

2004-02-11 Thread Eric Bolikowski
Headers have to be pretty accurate, or it will cause trouble.
And your redirect header is not quite correct.
It should be this:
header("Location: another_page.php");
and NOT header("Location:another_page.php");

What you need here is a space between "Location:" and the URL.

"Adwinwijaya" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello php-generaler's ,
>
>   I have a script like this :
>
>   if($foo == 'something'){
>   header('Location:to_another_page.php') ;
>   }else
>   {
>do another thing in here
>   }
>
>   header('Location:to_previous_page.php');
>
>
>   I got a problem ... when $foo == 'something' .. it wont redirect me
>   to to_another_page.php  but if I put die(); after calling
>   header(); .. it will work ...
>
>   is this the bug ?
>
>   I use php 4.3.4 ... and Apache 2.x
>
>   thanks
>
>
> -- 
> Best regards,
>  adwinwijaya  mailto:[EMAIL PROTECTED]

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



php-general Digest 12 Feb 2004 06:20:40 -0000 Issue 2585

2004-02-11 Thread php-general-digest-help

php-general Digest 12 Feb 2004 06:20:40 - Issue 2585

Topics (messages 177436 through 177477):

Re: [Q]PHP not taking input values from forms
177436 by: Richard Davey
177437 by: John Nichel
177440 by: Dan Aloma
177441 by: Richard Davey
177442 by: Dan Aloma
177443 by: Richard Davey
177444 by: John Nichel
177470 by: André Cerqueira

Re: question
177438 by: John Nichel

Re: question {way OT}
177439 by: Jay Blanchard

Re: Undefined function
177445 by: Dominique ANOKRE

Help with ldap_add
177446 by: Chakravarthy Cuddapah

date() funtion  language
177447 by: Thiago Pavesi
177448 by: Richard Davey
177469 by: André Cerqueira

A dumb question
177449 by: Jeremy Schroeder
177450 by: Chris W. Parker
177452 by: Chris W. Parker
177471 by: Paul Furman

Re: parse error, unexpected $
177451 by: Hugh Danaher

Re: Sessions on Win2k
177453 by: memoimyself.yahoo.com.br

Re: array data
177454 by: memoimyself.yahoo.com.br

Please help me understand gmmktime()
177455 by: Richard Day

Re: Zlib - Insert files?
177456 by: Markus Fischer

mutliple select form not passing multiple values
177457 by: Ben Ramsey
177459 by: Richard Davey
177460 by: Ben Ramsey
177463 by: Richard Davey

Re: [Q] Problems invoking a PHP script - Have no hair left to pull - Please help  [:-)
177458 by: Richard Davey

Re: replace ' with "
177461 by: Kim Steinhaug

Re: uploaded files are corrupted
177462 by: Pablo Gosse

form array
177464 by: Matthew Oatham
177465 by: Martin Towell

I think this is a mysql question
177466 by: Ronald Ramos
177467 by: Justin Patrin
177475 by: Ronald Ramos

PHP FILE SIZE LIMIT
177468 by: Matthew Oatham
177473 by: André Cerqueira

Re: Newbie questions
177472 by: Jason Wong
177474 by: John Nichel

my improved code:: array data
177476 by: Imran Asghar

weird header() (bug may be)
177477 by: adwinwijaya

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 ---
Hello Dan,

Wednesday, February 11, 2004, 6:01:21 PM, you wrote:

DA> Sorry about not including code the first time. Here is a snippet of code I
DA> am fairly certain should be doing something. Thank you SOOO much for the

Your code is (mostly) fine. The only part that didn't work is the final
"the form has been submitted" section because it comes after the HTML
page end. Move it to the start. Also, you don't have a closing form
tag.

The following is your code, changed slightly.. try it and see but it
works perfectly here (PHP 4.3.2, Apache, Windows). I added the echo
time() line so you can see if the page reloads or not:




";
echo time();
}
?>




Your name:



Your email:



Your message:









-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Dan Aloma wrote:

Sorry about not including code the first time. Here is a snippet of code 
I am fairly certain should be doing something. Thank you SOOO much for 
the help. I've been working on setting up php for four days now and 
EVERYTHING else works (phpinfo() calls, etc), but for some reason forms, 
even ones that I know should be working don't take values. They just 
return you to the same screen.

CODE:








Your name:



Your email:



Your message:







What's the output to the browser when you submit this?

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--- End Message ---
--- Begin Message ---
I tried adding that code you gave me, but all it does go back to the same 
page, and doesn't echo out the time(); results. I can't seem to figure it 
out for the life of me. like i said, everything else in php is working fine, 
except for this.


From: Richard Davey <[EMAIL PROTECTED]>
Reply-To: Richard Davey <[EMAIL PROTECTED]>
To: "Dan Aloma" <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Subject: Re[2]: [PHP] [Q]PHP not taking input values from forms
Date: Wed, 11 Feb 2004 18:20:11 +
Hello Dan,

Wednesday, February 11, 2004, 6:01:21 PM, you wrote:

DA> Sorry about not including code the first time. Here is a snippet of 
code I
DA> am fairly certain should be doing something. Thank you SOOO much for 
the

Your code is (mostly) fine. The only part that didn't work is the final
"the form has been submitted" section because it comes after the HTML
page end. Move it to the start. Also, you don't have a closing form
tag.
The following is your code, changed slightly.. try it and see but it
works perfectly here (PHP 4.3.2, Apache, Windows). I added the echo
time() line so y

[PHP] weird header() (bug may be)

2004-02-11 Thread adwinwijaya
Hello php-generaler's ,

  I have a script like this :

  if($foo == 'something'){
  header('Location:to_another_page.php') ;
  }else
  {
   do another thing in here
  }

  header('Location:to_previous_page.php');


  I got a problem ... when $foo == 'something' .. it wont redirect me
  to to_another_page.php  but if I put die(); after calling
  header(); .. it will work ...

  is this the bug ?

  I use php 4.3.4 ... and Apache 2.x

  thanks
  

-- 
Best regards,
 adwinwijaya  mailto:[EMAIL PROTECTED]

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



RE: [PHP] Re: I think this is a mysql question

2004-02-11 Thread Ronald Ramos
create table oras(
NameVARCHAR(30),
TimeIn DATETIME,
TimeOut DATETIME,
Total   DATETIME
);

insert into oras values('Nhadie','2004-10-10 10:10:00','2004-11-11
12:12:00','TIMEDIFF(TimeIn,TImeOut)');

Hi,

Are those correct? Because the value on the Total field is 000-00-00
00:00:00.
I think there's something wrong. I'm using 4.0.


mysql> select * from oras;
++-+-+--
---+
| Name   | TimeIn  | TimeOut | Total
|
++-+-+--
---+
| Nhadie | 2004-10-10 10:10:00 | 2004-11-11 12:12:00 | -00-00
00:00:00 |
++-+-+--
---+
1 row in set (0.01 sec)

TIA












-Original Message-
From: Justin Patrin [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 12, 2004 9:08 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: I think this is a mysql question


Ronald Ramos wrote:

> How can I use PHP to compute the difference between two dates(with 
> time)? Let's say in mysql, I have field 1, login, and on field 2, I 
> have logout.
> 
> How can I compute the diffrence between login and logut and output it 
> on field 3 let's say totaltime.
> 
> Is this a mysql question? Or can PHP actually do this?
> 
> TIA

Both can do it, but it depends heavily on what type of date format it 
is. If it's a normal mysql date or datetime (not a timestamp) then you 
can grab it, then do:

$seconds = strtotime($field1) - strtotime($field2);

strtotime() does a good job of converting just about every type of 
formatted date.

If you're using a timestamp, there aren't any deliminators. I'm not sure

if strtotime() will parse those as you want. In this case (and the 
other, actually) you can easily use SQL.

SELECT UNIX_TIMESTAMP(field1) - UNIX_TIMESTAMP(field2) AS secondsBetween

FROM table

--
paperCrane 

-- 
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] Newbie questions

2004-02-11 Thread John Nichel
Jason Wong wrote:

Anything else anyone could tell me would be great!


Depends on what you want to know. Almost every problem that you will come 
across will be covered in:

 - the php manual
 - the list archives
 - google
Don't forget about Mr. Holmes.  I betcha he's got php scribbled all over 
the walls of his house...so the OP could check there.  ;)

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PHP FILE SIZE LIMIT

2004-02-11 Thread André Cerqueira
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
everything has a limit, but im sure in this case you are under it big time
ive seen ppl running 1-2megs scripts hehe


Matthew Oatham wrote:

hi is there a limit to the filesize of a php ? 

I know tomcat had limits on the file size of jsps.

My problem is I have a 13kb php file when I add some more lines of code to it the html output becomes currupt - it could well be bad html but I cant find it so thought I would ask this question?

Cheers.

Matt
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFAKwM1axdA/5C8vH8RAoz/AJ9KludBI0UZp5XPq7mqOlYAdaDsZwCfTJKn
aYSg7klSbEigX4QEYq/md6M=
=DZ+C
-END PGP SIGNATURE-
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Newbie questions

2004-02-11 Thread Jason Wong
On Thursday 12 February 2004 01:03, James Marcinek wrote:

> I have a couple of questions I'd like to ask:
>
> 1.) Are there built in libraries to connect to DB2?
> Nothings clear from the documentation I've read. I see
> that there's libraries for Oracle, Informix, MySQL.

Apparently so, ask google.

> 2.) If there is a DB2 library(support or whatever its
> called, someone enlighten me please with the correct
> term!) does anyone know if the Red Hat rpm comes with
> the option to support this turned on?

Ask RedHat?

> 3.) I'm just coming across some information about
> PEAR. My question to this: Is it better to use PEAR
> than the regular libraries included?

What exactly do you mean by "the regular libraries included"? Basically using 
the PEAR libraries will save you from re-inventing many wheels, the downside 
being the extra overhead required. www.phpclasses.org is also a great source 
of classes/libraries.

> Anything else anyone could tell me would be great!

Depends on what you want to know. Almost every problem that you will come 
across will be covered in:

 - the php manual
 - the list archives
 - google

-- 
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
--
/*
All diplomacy is a continuation of war by other means.
-- Chou En Lai
*/

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



Re: [PHP] A dumb question

2004-02-11 Thread Paul Furman
Chris W. Parker wrote:
Chris W. Parker <>
on Wednesday, February 11, 2004 11:45 AM said:

I think in this is what's called a reference. 


Sounds like that's simply a way of making an alias for a variable:
http://us2.php.net/manual/en/language.references.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] [Q]PHP not taking input values from forms

2004-02-11 Thread André Cerqueira
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
time() is only echo'ed if $_POST['submit'] is something on this case
maybe he has a really old version of php...
$HTP_POST_VARS...?
do what Richard Davey is saying,  on the top

Richard Davey wrote:

Hello Dan,

Wednesday, February 11, 2004, 6:39:35 PM, you wrote:

DA> they're being tested on a testing machine we use. I know PHP is (rather
DA> appears to be) working fine. Why would it be parsing files fine and calling
DA> phpinfo() fine, but not being able to take input values. that's strange
echo time() isn't an input value.

If it can't even do that then it's not surprising it can't handle
$_POST values either, there is something else at play here and it's
not your code.
Stick "echo phpinfo()" at the top of your form code - does it work?

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFAKutoaxdA/5C8vH8RAo1WAJ9MZMtBAvXcJDizOVXblxp1DlCqSgCeNDdm
rmE+jBIlMe4Hb6qaIUObCiQ=
=NvxC
-END PGP SIGNATURE-
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: date() funtion language

2004-02-11 Thread André Cerqueira
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
i had problems with locale
i think its safer to make a dayname and monthname array, and use
getdate(), than build the string yourself
like:


function date_wrapper($format, $timestamp=NULL)
{
global $wdayname_array, $monthname_array;
if ($timestamp == NULL)
$timestamp = time();
$date = getdate($timestamp);
$wdayname = $wdayname_array[$date['wday']];
$monthname = $monthname_array[$date['mon']-1];
$format = str_replace(array('l', 'F'), array('\l', '\F'), $format);
$date = date($format, $timestamp);
$date = str_replace(array('\\l', '\\F'), array($wdayname, $monthname),
$date);
return $date;
}
echo date_wrapper('l, d \de F \de Y');

//the follow should, but doesnt seem to work
//setlocale(LC_ALL, 'pt_BR');
//echo date('l, j de F de Y');
?>
this example may not work well with slashes... just wrote it hehe

tb sou brasileiro hehe (im brazillian too)

Thiago Pavesi wrote:

| Hello,
|
| Does any one knows how do I set my date() function to return the days
|  of the week and moth in my own language (brazilian portuguese)?
|
| Thanks,
|
| Thiago Pavesi
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFAKuWmaxdA/5C8vH8RAv7gAJ0WHvXC4beywQDTjQzz7KI0jLGfPACgjqgv
y/UzSg9ijyRx/UvWGi8dFXU=
=Wh2S
-END PGP SIGNATURE-
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] PHP FILE SIZE LIMIT

2004-02-11 Thread Matthew Oatham
hi is there a limit to the filesize of a php ? 

I know tomcat had limits on the file size of jsps.

My problem is I have a 13kb php file when I add some more lines of code to it the html 
output becomes currupt - it could well be bad html but I cant find it so thought I 
would ask this question?

Cheers.

Matt

[PHP] Re: I think this is a mysql question

2004-02-11 Thread Justin Patrin
Ronald Ramos wrote:

How can I use PHP to compute the difference between two dates(with
time)?
Let's say in mysql, I have field 1, login, and on field 2, I have
logout.
How can I compute the diffrence between login and logut and output it on
field 3 let's say totaltime.
Is this a mysql question? Or can PHP actually do this?

TIA
Both can do it, but it depends heavily on what type of date format it 
is. If it's a normal mysql date or datetime (not a timestamp) then you 
can grab it, then do:

$seconds = strtotime($field1) - strtotime($field2);

strtotime() does a good job of converting just about every type of 
formatted date.

If you're using a timestamp, there aren't any deliminators. I'm not sure 
if strtotime() will parse those as you want. In this case (and the 
other, actually) you can easily use SQL.

SELECT UNIX_TIMESTAMP(field1) - UNIX_TIMESTAMP(field2) AS secondsBetween 
FROM table

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


[PHP] I think this is a mysql question

2004-02-11 Thread Ronald Ramos
How can I use PHP to compute the difference between two dates(with
time)?
Let's say in mysql, I have field 1, login, and on field 2, I have
logout.

How can I compute the diffrence between login and logut and output it on
field 3 let's say totaltime.

Is this a mysql question? Or can PHP actually do this?

TIA

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



RE: [PHP] form array

2004-02-11 Thread Martin Towell
Matthew,

use $_POST/$_GET/$_REQUEST (depending on your form method)  and  foreach()

eg:
  foreach($_POST['image'] as $key=>$value)
  {
echo "$key -> $value\n";
  }

Martin


> -Original Message-
> From: Matthew Oatham [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 12 February 2004 11:29 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] form array
> 
> 
> Hi,
> 
> I have a form on page1 that i want to submit to another php 
> page - page2
> 
> the form has the fields
> 
> 
> 
> 
> 
> Basically I want to have these form field values as an array 
> of values I can
> loop through on page 2 but what do I put on page 2 too get 
> the array and
> loop through ?
> 
> Thanks.

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



[PHP] form array

2004-02-11 Thread Matthew Oatham
Hi,

I have a form on page1 that i want to submit to another php page - page2

the form has the fields





Basically I want to have these form field values as an array of values I can
loop through on page 2 but what do I put on page 2 too get the array and
loop through ?

Thanks.

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



Re[2]: [PHP] mutliple select form not passing multiple values

2004-02-11 Thread Richard Davey
Hello Ben,

Wednesday, February 11, 2004, 9:38:38 PM, you wrote:

BR> Ah-ha!  I missed that, and I always do.  Let's hope I don't anymore.
BR> While we're on the subject, why is PHP set up this way?  Why can't it
BR> just add the elements to the array automatically, since adding the
BR> square brackets to one's HTML form name is not a standard practice?

I guess because the times when a value will be an array vs. a straight
variable are probably so small that it's un-necessary overhead on
PHP's behalf to have to treat every single element as a potential
array. Far easier to just stick [] on the end and tell PHP it is.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



RE: [PHP] uploaded files are corrupted

2004-02-11 Thread Pablo Gosse

> I have a script that allows the user to browse his/her local hard
drive
for
> a file and email it as an attachment.  Text files come through OK but
any
> binary type file, e.g., JPEG or PDF arrive broken.  JPEG will show as
a
red
> X in my browser and Adobe will complain about the PDF.  I don't know
why???


I recently encountered this issue and as far as I can tell it has
nothing to do with PHP.  In my case it was caused by some arcane problem
which occurred when installing the os and software (Apache, PHP,
PostgreSQL, etc.) straight from a RedHat cd instead of downloading and
compiling the source files.

Everything worked fine except POST method uploads.  Whenever I attempted
to upload a file it would not upload properly, and if I was using a
textarea to post a large chunk of code to a page for processing the code
would also get mangled somewhere after clicking the submit button and
before it was accessible via the $_POST array in the receiving script.

The only thing I was able to surmise was that the problem had something
to do with the "vanilla install" (as my sysadmin described it) of
Apache, PHP and PostgreSQL.  When I moved the project I was working on
to its permanent home (an actual Dell server with everything compiled
properly from the source) the problem disappeared altogether.

I also tested it on a number of other production machines here and it
worked fine on all of them.

If possible I would suggest you take your code to another machine and
test it out there as I would wager that the problem is within your
system, not your code or PHP settings.

I know this isn't an answer per se but I hope that is of some use and
will save wasted time in trying to figure out the problem.

Cheers,
Pablo.

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



[PHP] Re: replace ' with "

2004-02-11 Thread Kim Steinhaug
Depending on the use you might also want to look at this one :
htmlentities()

If working with mySQL inserts consider this aswell :
mysql_escape_string()

And finally, javascripts in HTML doesnt like either the ' " or the
equivilant htmlentities. I just wash them away direkt if i need to
output something into a javascript statement, eg.
   

The above example caused me alot of headaches when the text inside '
contained either ' or ", and even the entities also messed up.

-- 
Kim Steinhaug
--
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
--
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
--

"Diana Castillo" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> How do I replace all single quotes with double quotes in a string for
> echoing it with the double quotes?
>
> --
> Diana Castillo
> Global Reservas, S.L.
> C/Granvia 22 dcdo 4-dcha
> 28013 Madrid-Spain
> Tel : 00-34-913604039 ext 214
> Fax : 00-34-915228673
> email: [EMAIL PROTECTED]
> Web : http://www.hotelkey.com
>   http://www.destinia.com

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



Re: [PHP] mutliple select form not passing multiple values

2004-02-11 Thread Ben Ramsey
Ah-ha!  I missed that, and I always do.  Let's hope I don't anymore. 
While we're on the subject, why is PHP set up this way?  Why can't it 
just add the elements to the array automatically, since adding the 
square brackets to one's HTML form name is not a standard practice?

Richard Davey wrote:
Hello Ben,

Wednesday, February 11, 2004, 9:22:33 PM, you wrote:

BR> Am I doing something wrong?

Yup :)

It needs to be:



Note the change in name from modules to modules[]

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


Re: [PHP] mutliple select form not passing multiple values

2004-02-11 Thread Richard Davey
Hello Ben,

Wednesday, February 11, 2004, 9:22:33 PM, you wrote:

BR> Am I doing something wrong?

Yup :)

It needs to be:

mailto:[EMAIL PROTECTED]

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



Re[4]: [PHP] [Q] Problems invoking a PHP script - Have no hair left to pull - Please help [:-)

2004-02-11 Thread Richard Davey
Hello Tony,

Wednesday, February 11, 2004, 9:16:18 PM, you wrote:

TDS> That was the problem.  The PHP book I have doesn't mention $_GET or $_POST.
TDS> The exercises right from the beginning use register_globals. I didn't
TDS> realise they were turned off by default.

Whoever wrote that book ought to be shot :)
(metaphorically speaking)

Unless it's a quite old book?

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



[PHP] mutliple select form not passing multiple values

2004-02-11 Thread Ben Ramsey
I'm running PHP 5.0b3, so I'm not sure whether this is an issue with the 
version of PHP I'm running.

I've got a select field in a form that is allowing multiple selects:


Banner Manager
Calendar of Events
Contacts
Elections
Emergency Notices
Employment Opportunites
FAQs
Files & Downloads
Image Gallery
Links
Meetings & Agendas
News & Articles
Notices of Public 
Hearing
Procurement 
Opportunities
Publications
Weather Information


I'm posting the data to another script, in which I have the following:

print_r($_POST);

The only thing that is being saved to $_POST['modules'] is the last 
value (15).  When I count($_POST['modules']), I only get 1, so I know 
that it's not passing back an array of numbers like it should.

Am I doing something wrong?

-Ben

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


[PHP] Re: Zlib - Insert files?

2004-02-11 Thread Markus Fischer
Hi,

basically, gzip is only about compression of data. If you want compress 
more than one file at once, you need to put it into an archive before, 
e.g. a tar archive. Then you can compress this tar-Archive (single file) 
width gzip.

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


[PHP] Please help me understand gmmktime()

2004-02-11 Thread Richard Day
Hello:


Environment:
Linux server
PHP 4.3.4

This code:

echo ''.strftime('%T %Z',mktime()).', Timestamp='.mktime();
echo ''.strftime('%T GMT',gmmktime()).', Timestamp='.gmmktime();

yields this result:

23:52:08 EST, Timestamp=1076475128
18:52:08 GMT, Timestamp=1076457128

Why? GMT should be 5 hours ahead of EST, not 5 behind. Right? What am I
missing here??


Richard

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



[PHP] Re: array data

2004-02-11 Thread memoimyself
Hello Imran,

On 12 Feb 2004 at 1:17, Imran Asghar wrote:

> Hi,
>  
> Is not working, is it correct way
> 
> File1.php
>
>
>   
>
> 
> File2.php
>  
>   echo $colors[0];
>  echo $colors[1];
>  echo $colors[2];
>  echo $colors[4];
> ?>
> 
> 
> 
> imee
> 

I'm afraid you'll have to start learning PHP from scratch. The freely-available PHP 
manual has a fairly good introductory section and you'll also find tons of tutorials 
for 
beginners on the web.

Good luck,

Erik

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



[PHP] Re: Sessions on Win2k

2004-02-11 Thread memoimyself
Hello Don,

On 11 Feb 2004 at 11:19, Donpro wrote:

> I've searched the archives and note that many have probelms using session on
> a Win2K server.  I am getting a
>  
> Undefined index: sessions in
> D:\inetpub\mydomain\www\forms\formmail\formmail.php on line 768
>  
> error.  Line 768 is: session_start();
>  
> It works Ok on Linux; is there any "special" Windows configuration?

Are you perchance running your script on a machine with an active firewall? I had all 
sorts of session-related problems and spent ages trying to figure out what was wrong 
with my code until eventually I read somewhere that ZoneAlarm might interfere with 
sessions. I shut down ZA and — guess what? — there wasn't anything wrong with my 
code after all. Now whenever I need to test scripts involving sessions I disconnect 
from 
the Internet and shut down ZoneAlarm.

Hope this helps,

Erik

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



RE: [PHP] A dumb question

2004-02-11 Thread Chris W. Parker
Chris W. Parker <>
on Wednesday, February 11, 2004 11:45 AM said:

> I think in this it's what's called a reference. Don't know much else.
> :) 

Ok that should be "I think this is what's called"... had to correct
that.

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



Re: [PHP] parse error, unexpected $

2004-02-11 Thread Hugh Danaher
Bruno,
This often occurs when there is no closing bracket " } " for a conditional
statement or a loop.
hth
Hugh
- Original Message -
From: "Bruno Mattarollo" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 11, 2004 2:51 AM
Subject: Re: [PHP] parse error, unexpected $

> Parse error: parse error, unexpected $ in
> /var/www/html/donation/installations/gpi/form.inc on line 528

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



RE: [PHP] A dumb question

2004-02-11 Thread Chris W. Parker
Jeremy Schroeder 
on Wednesday, February 11, 2004 11:39 AM said:

> What does the ampersand do in the bottom example code, they both work.
> 
> $n1 = $num1 -> function();
> $n1 = & $num1 -> function();

I think in this it's what's called a reference. Don't know much else. :)



Chris.

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



[PHP] A dumb question

2004-02-11 Thread Jeremy Schroeder
Hey Group

I am starting to write class and objects and came across some syntax 
that I dont understand.

What does the ampersand do in the bottom example code, they both work.

$n1 = $num1 -> function();
$n1 = & $num1 -> function();
-Blake

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


Re: [PHP] date() funtion language

2004-02-11 Thread Richard Davey
Hello Thiago,

Wednesday, February 11, 2004, 8:03:47 PM, you wrote:

TP>   Does any one knows how do I set my date() function to return the days
TP> of the week and moth in my own language (brazilian portuguese)?

setlocale()

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



[PHP] date() funtion language

2004-02-11 Thread Thiago Pavesi
Hello,

 Does any one knows how do I set my date() function to return the days 
of the week and moth in my own language (brazilian portuguese)?

Thanks,

Thiago Pavesi

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


[PHP] Help with ldap_add

2004-02-11 Thread Chakravarthy Cuddapah
I am using RedHat Enterprise Linux (ES). Installed openldap, php, apache 
latest versions. All except ldap_add functions are working. When I use 
ldapadd at the terminal it works adding entries to ldap. But when I use php 
ldap_add , error code shows it is Success. But does not add any entires to 
ldap. I am using the form uid-xxx, cn=xxx,ou=xxx,o=x. It works for 
cn=xxx,ou=xxx,o=xxx. When I try to add uid=xxx, cn=xxx,ou=xxx,o=x it 
fails. slapd log shows err=0. Appreciate any help.

_
Keep up with high-tech trends here at "Hook'd on Technology." 
http://special.msn.com/msnbc/hookedontech.armx

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


Re: [PHP] Undefined function

2004-02-11 Thread Dominique ANOKRE
Ok, everything run now !
the problem was the path to the database.
You must indicate like this :

$host = localhost:c:\path\to\databasename

Thanks you !!
- Original Message -
From: "John Nichel" <[EMAIL PROTECTED]>
To: "Dominique ANOKRE" <[EMAIL PROTECTED]>
Cc: "Php List" <[EMAIL PROTECTED]>
Sent: Wednesday, February 11, 2004 3:16 PM
Subject: Re: [PHP] Undefined function


> Dominique ANOKRE wrote:
>
> > ok ,
> >
> > i install the good php windows installer (with interbase) and now i
think my
> > function is recognized.
> > But the message displayed is :
> >
> > Warning: ibase_connect(): unavailable database in
> > c:\inetpub\wwwroot\index.php on line 12
> >
> > But i can connect to the database whitout any problems via interbase
console
> > .
> >
> > So what'is wrong ??
>
> Without seeing the code, I can only guess that the problem is either a)
> your code, b) database configuration, c) network connectivity, d) etc,
> or e) between the monitor and chair. ;)
>
> --
> By-Tor.com
> It's all about the Rush
> http://www.by-tor.com
>
> --
> 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] [Q]PHP not taking input values from forms

2004-02-11 Thread John Nichel
Dan Aloma wrote:

I tried adding that code you gave me, but all it does go back to the 
same page, and doesn't echo out the time(); results. I can't seem to 
figure it out for the life of me. like i said, everything else in php is 
working fine, except for this.
Fill in some values for your form fields, submit it, and post the source 
(HTML) of the page it returns.

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re[6]: [PHP] [Q]PHP not taking input values from forms

2004-02-11 Thread Richard Davey
Hello Dan,

Wednesday, February 11, 2004, 6:39:35 PM, you wrote:

DA> they're being tested on a testing machine we use. I know PHP is (rather
DA> appears to be) working fine. Why would it be parsing files fine and calling
DA> phpinfo() fine, but not being able to take input values. that's strange

echo time() isn't an input value.

If it can't even do that then it's not surprising it can't handle
$_POST values either, there is something else at play here and it's
not your code.

Stick "echo phpinfo()" at the top of your form code - does it work?

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



RE: Re[4]: [PHP] [Q]PHP not taking input values from forms

2004-02-11 Thread Dan Aloma
they're being tested on a testing machine we use. I know PHP is (rather 
appears to be) working fine. Why would it be parsing files fine and calling 
phpinfo() fine, but not being able to take input values. that's strange


From: Richard Davey <[EMAIL PROTECTED]>
Reply-To: Richard Davey <[EMAIL PROTECTED]>
To: "Dan Aloma" <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Subject: Re[4]: [PHP] [Q]PHP not taking input values from forms
Date: Wed, 11 Feb 2004 18:35:31 +
Hello Dan,

Wednesday, February 11, 2004, 6:32:16 PM, you wrote:

DA> I tried adding that code you gave me, but all it does go back to the 
same
DA> page, and doesn't echo out the time(); results. I can't seem to figure 
it
DA> out for the life of me. like i said, everything else in php is working 
fine,
DA> except for this.

If it doesn't even echo out time() then you have something very wrong
in either the installation of PHP (unlikely) or the configuration of
using PHP on your web server. Where are these files being
hosted/tested?
--
Best regards,
 Richardmailto:[EMAIL PROTECTED]

_
Choose now from 4 levels of MSN Hotmail Extra Storage - no more account 
overload! http://click.atdmt.com/AVE/go/onm00200362ave/direct/01/

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


Re[4]: [PHP] [Q]PHP not taking input values from forms

2004-02-11 Thread Richard Davey
Hello Dan,

Wednesday, February 11, 2004, 6:32:16 PM, you wrote:

DA> I tried adding that code you gave me, but all it does go back to the same
DA> page, and doesn't echo out the time(); results. I can't seem to figure it
DA> out for the life of me. like i said, everything else in php is working fine,
DA> except for this.

If it doesn't even echo out time() then you have something very wrong
in either the installation of PHP (unlikely) or the configuration of
using PHP on your web server. Where are these files being
hosted/tested?

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



RE: Re[2]: [PHP] [Q]PHP not taking input values from forms

2004-02-11 Thread Dan Aloma
I tried adding that code you gave me, but all it does go back to the same 
page, and doesn't echo out the time(); results. I can't seem to figure it 
out for the life of me. like i said, everything else in php is working fine, 
except for this.


From: Richard Davey <[EMAIL PROTECTED]>
Reply-To: Richard Davey <[EMAIL PROTECTED]>
To: "Dan Aloma" <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Subject: Re[2]: [PHP] [Q]PHP not taking input values from forms
Date: Wed, 11 Feb 2004 18:20:11 +
Hello Dan,

Wednesday, February 11, 2004, 6:01:21 PM, you wrote:

DA> Sorry about not including code the first time. Here is a snippet of 
code I
DA> am fairly certain should be doing something. Thank you SOOO much for 
the

Your code is (mostly) fine. The only part that didn't work is the final
"the form has been submitted" section because it comes after the HTML
page end. Move it to the start. Also, you don't have a closing form
tag.
The following is your code, changed slightly.. try it and see but it
works perfectly here (PHP 4.3.2, Apache, Windows). I added the echo
time() line so you can see if the page reloads or not:


";
echo time();
}
?>



Your name:



Your email:



Your message:







--
Best regards,
 Richardmailto:[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_
Click here for a FREE online computer virus scan from McAfee. 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

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


RE: [PHP] question {way OT}

2004-02-11 Thread Jay Blanchard
[snip]
Did you forget your mind-reading helmet at home today?
[/snip]

I have both kinds of ESP.ESPn & ESPn2 :)

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



Re: [PHP] question

2004-02-11 Thread John Nichel
Chris W. Parker wrote:

Meramec Challenge Paintball, LLC 
on Wednesday, February 11, 2004 7:40 AM said:
I'm glad you put "question" in your subject line because for a minute
there I thought you were sending me a note of praise. I realized you
weren't once I read your informative subject line.

I have tried for a long time now on various forums to get help. Every
one says to come to you for support. I looked for a forum on your
site but did not see one.


On my site??

;)


I had to turn the Enable account activation by admin feature. In
doing so when someone tries to create an account when they hit submit
they get this error:


You assume anyone here knows what you're talking about. What program is
this that you're using?

Line : 234

File : /home/mcpain36/public_html/forum/includes/emailer.php[/code]


What exactly is the error?


It does not send them an email about how the admin has to turn on the
account. How can I fix this?


By answering the above two questions and showing us what is on line 234
of /home/mcpain36/public_html/forum/includes/emailer.php. That will at
least give us a starting point.
Chris.

Did you forget your mind-reading helmet at home today?

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] [Q]PHP not taking input values from forms

2004-02-11 Thread John Nichel
Dan Aloma wrote:

Sorry about not including code the first time. Here is a snippet of code 
I am fairly certain should be doing something. Thank you SOOO much for 
the help. I've been working on setting up php for four days now and 
EVERYTHING else works (phpinfo() calls, etc), but for some reason forms, 
even ones that I know should be working don't take values. They just 
return you to the same screen.

CODE:








Your name:



Your email:



Your message:







What's the output to the browser when you submit this?

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re[2]: [PHP] [Q]PHP not taking input values from forms

2004-02-11 Thread Richard Davey
Hello Dan,

Wednesday, February 11, 2004, 6:01:21 PM, you wrote:

DA> Sorry about not including code the first time. Here is a snippet of code I
DA> am fairly certain should be doing something. Thank you SOOO much for the

Your code is (mostly) fine. The only part that didn't work is the final
"the form has been submitted" section because it comes after the HTML
page end. Move it to the start. Also, you don't have a closing form
tag.

The following is your code, changed slightly.. try it and see but it
works perfectly here (PHP 4.3.2, Apache, Windows). I added the echo
time() line so you can see if the page reloads or not:




";
echo time();
}
?>




Your name:



Your email:



Your message:









-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



Re: [PHP] Using a perl regex

2004-02-11 Thread Michal Migurski
>I am trying to use a perl regular expression to validate a form field
>where I am allowing someone to edit a sql date-time stamp in the format
>of '2004-02-05 21:43:34'.

Just FYI, strtotime() provides date/time validation for free - check the
input using strtotime() and date('Y-m-d H:i:s') to get it in the form you
want.

An alternate, simpler PCRE would be:
'/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/'

Though note that unlike strtotime(), it won't tell you whether the date is
illegal.

-
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



RE: [PHP] question

2004-02-11 Thread Chris W. Parker
Meramec Challenge Paintball, LLC 
on Wednesday, February 11, 2004 7:40 AM said:

I'm glad you put "question" in your subject line because for a minute
there I thought you were sending me a note of praise. I realized you
weren't once I read your informative subject line.

> I have tried for a long time now on various forums to get help. Every
> one says to come to you for support. I looked for a forum on your
> site but did not see one.

On my site??

;)

> I had to turn the Enable account activation by admin feature. In
> doing so when someone tries to create an account when they hit submit
> they get this error:

You assume anyone here knows what you're talking about. What program is
this that you're using?

> Line : 234
> 
> File : /home/mcpain36/public_html/forum/includes/emailer.php[/code]

What exactly is the error?

> It does not send them an email about how the admin has to turn on the
> account. How can I fix this?

By answering the above two questions and showing us what is on line 234
of /home/mcpain36/public_html/forum/includes/emailer.php. That will at
least give us a starting point.


Chris.

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



Re: [PHP] [Q]PHP not taking input values from forms

2004-02-11 Thread Dan Aloma
Sorry about not including code the first time. Here is a snippet of code I 
am fairly certain should be doing something. Thank you SOOO much for the 
help. I've been working on setting up php for four days now and EVERYTHING 
else works (phpinfo() calls, etc), but for some reason forms, even ones that 
I know should be working don't take values. They just return you to the same 
screen.

CODE:








Your name:



Your email:



Your message:









From: Richard Davey <[EMAIL PROTECTED]>
Reply-To: Richard Davey <[EMAIL PROTECTED]>
To: "Dan Aloma" <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Subject: Re: [PHP] [Q]PHP not taking input values from forms
Date: Wed, 11 Feb 2004 17:49:56 +
Hello Dan,

Wednesday, February 11, 2004, 5:47:21 PM, you wrote:

DA> Can anyone tell me why PHP is not taking any values I give it? In other
DA> words, if I post something it doesn't accept any of those values. I 
have set
DA> register_globals to on, which is the only thing I could think of that 
would
DA> be doing this. I'm a newbie to php, and I've scoured the net for an 
answer
DA> to no avail. Thanks in advance.

Post your code and more importantly, turn register globals off again
and learn to code without them on - they're a security nightmare.
--
Best regards,
 Richardmailto:[EMAIL PROTECTED]

_
Check out the great features of the new MSN 9 Dial-up, with the MSN Dial-up 
Accelerator. http://click.atdmt.com/AVE/go/onm00200361ave/direct/01/

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


RE: [PHP] [Q]PHP not taking input values from forms

2004-02-11 Thread Shaunak Kashyap
Please post your code. It makes it easier to understand the problem.

Shaunak

> -Original Message-
> From: Dan Aloma [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 11, 2004 12:47 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] [Q]PHP not taking input values from forms
> 
> 
> Can anyone tell me why PHP is not taking any values I give it? In other 
> words, if I post something it doesn't accept any of those values. 
> I have set 
> register_globals to on, which is the only thing I could think of 
> that would 
> be doing this. I'm a newbie to php, and I've scoured the net for 
> an answer 
> to no avail. Thanks in advance.
> 
> _
> Click here for a FREE online computer virus scan from McAfee. 
> http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
> 
> -- 
> 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] [Q]PHP not taking input values from forms

2004-02-11 Thread Richard Davey
Hello Dan,

Wednesday, February 11, 2004, 5:47:21 PM, you wrote:

DA> Can anyone tell me why PHP is not taking any values I give it? In other
DA> words, if I post something it doesn't accept any of those values. I have set
DA> register_globals to on, which is the only thing I could think of that would
DA> be doing this. I'm a newbie to php, and I've scoured the net for an answer
DA> to no avail. Thanks in advance.

Post your code and more importantly, turn register globals off again
and learn to code without them on - they're a security nightmare.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



Re: [PHP] [Q]PHP not taking input values from forms

2004-02-11 Thread John Nichel
Dan Aloma wrote:

Can anyone tell me why PHP is not taking any values I give it? In other 
words, if I post something it doesn't accept any of those values. I have 
set register_globals to on, which is the only thing I could think of 
that would be doing this. I'm a newbie to php, and I've scoured the net 
for an answer to no avail. Thanks in advance.
Posting some code would go a long way in helping solve your issue.

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] [Q]PHP not taking input values from forms

2004-02-11 Thread Dan Aloma
Can anyone tell me why PHP is not taking any values I give it? In other 
words, if I post something it doesn't accept any of those values. I have set 
register_globals to on, which is the only thing I could think of that would 
be doing this. I'm a newbie to php, and I've scoured the net for an answer 
to no avail. Thanks in advance.

_
Click here for a FREE online computer virus scan from McAfee. 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

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


[PHP] Getting image size for a compressed flash movie

2004-02-11 Thread Shaunak Kashyap
Is there any way in PHP to get the height and width attributes of a
compressed flash movie? I have tried getimagesize() which seems to work for
uncompressed flash movies but will not work for compressed movies.

TIA

Shaunak

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



RE: [PHP] Sessions on Win2k

2004-02-11 Thread Alex Hogan
Sorry..., my bad

I was just relating what I thought had been related to me for the same
question.

I think I'll stick to the asking and not the answering for a while longer...

Gotta go goose is waiting..

> -Original Message-
> From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 11, 2004 11:00 AM
> To: 'Alex Hogan'; php list
> Subject: RE: [PHP] Sessions on Win2k
> 
> On 11 February 2004 16:39, Alex Hogan contributed these pearls of wisdom:
> 
> > Session_start() has to be the first thing at the top of the
> > page before
> > anything else. Even header info.
> 
> Er, no.  session_start() itself generates headers, so it doesn't matter
> whether it goes before or after other headers.  It also doesn't matter how
> much code is before your session_start(), so long as none of it generates
> any actual page content of any kind (and that includes whitespace).
> 
> So it could be perfectly valid to have a session_start() on line 768, if
> everything preceding it is PHP initializations and logic -- and the error
> message isn't about headers being output at the wrong place, so I'm
> guessing that isn't it.
> 
> Unfortunately, I don't have any real idea what *could* be the problem
> here, but I wanted to stop the OP haring off on a wild goose chase...!
> 
> Cheers!
> 
> Mike
> 
> --
> Mike Ford,  Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
> Email: [EMAIL PROTECTED]
> Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




Re: [PHP] Using a perl regex

2004-02-11 Thread Verdon Vaillancourt
Thanks Kelly (and Richard),

That did the job :)

Salut,
Verdon


On 2/11/04 12:22 PM, "Kelly Hallman" <[EMAIL PROTECTED]> wrote:

> On Wed, 11 Feb 2004, Verdon Vaillancourt wrote:
>> I thought I might have tried that and just did again.
>> 
>> I receive the error; Warning :  Delimiter must not be alphanumeric or
>> backslash in /server/path/to/functions.php on line 
>> 
>> I'm not sure if this means I have to escape something in the pattern,
>> but will look further.
> 
> I think it means you need to put a delimiter around your regex...
> Typically you would use slashes (preg_match("/regex/")) but the character
> can be other than slash.. i.e. "not alphanumeric or backslash" :)

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



Re: [PHP] Using a perl regex

2004-02-11 Thread Kelly Hallman
On Wed, 11 Feb 2004, Verdon Vaillancourt wrote:
> I thought I might have tried that and just did again.
> 
> I receive the error; Warning :  Delimiter must not be alphanumeric or
> backslash in /server/path/to/functions.php on line 
> 
> I'm not sure if this means I have to escape something in the pattern,
> but will look further.

I think it means you need to put a delimiter around your regex...
Typically you would use slashes (preg_match("/regex/")) but the character
can be other than slash.. i.e. "not alphanumeric or backslash" :)

-- 
Kelly Hallman
// Ultrafancy

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



Re: [PHP] Using a perl regex

2004-02-11 Thread Verdon Vaillancourt
I thought I might have tried that and just did again.

I receive the error;
Warning :  Delimiter must not be alphanumeric or backslash in
/server/path/to/functions.php on line 

I'm not sure if this means I have to escape something in the pattern, but
will look further.

Cheers,
Verdon


On 2/11/04 12:12 PM, "Richard Davey" <[EMAIL PROTECTED]> wrote:

> Hello Verdon,
> 
> Wednesday, February 11, 2004, 5:09:22 PM, you wrote:
> 
> VV> I am trying to use a perl regular expression to validate a form field
> where
> 
> VV> 
> (!ereg("20\d{2}(-|\/)((0[1-9])|(1[0-2]))(-|\/)((0[1-9])|([1-2][0-9])|(3[0-1]
> 
> Surely you should be using preg_match() (i.e. a perl syntax reg exp) ?

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



Re: [PHP] Using a perl regex

2004-02-11 Thread Verdon Vaillancourt
I should have prefaced my subject with NEWBIE :)

Thanks, I'll give it a try.

Best regards, verdon


On 2/11/04 12:12 PM, "Richard Davey" <[EMAIL PROTECTED]> wrote:

> Hello Verdon,
> 
> Wednesday, February 11, 2004, 5:09:22 PM, you wrote:
> 
> VV> I am trying to use a perl regular expression to validate a form field
> where
> 
> VV> 
> (!ereg("20\d{2}(-|\/)((0[1-9])|(1[0-2]))(-|\/)((0[1-9])|([1-2][0-9])|(3[0-1]
> 
> Surely you should be using preg_match() (i.e. a perl syntax reg exp) ?

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



Re: [PHP] Using a perl regex

2004-02-11 Thread Richard Davey
Hello Verdon,

Wednesday, February 11, 2004, 5:09:22 PM, you wrote:

VV> I am trying to use a perl regular expression to validate a form field where

VV> (!ereg("20\d{2}(-|\/)((0[1-9])|(1[0-2]))(-|\/)((0[1-9])|([1-2][0-9])|(3[0-1]

Surely you should be using preg_match() (i.e. a perl syntax reg exp) ?

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



[PHP] Using a perl regex

2004-02-11 Thread Verdon Vaillancourt
Hi,

I am trying to use a perl regular expression to validate a form field where
I am allowing someone to edit a sql date-time stamp in the format of
'2004-02-05 21:43:34'.

I have found a pattern that works (at
http://www.regexplib.com/RETester.aspx?regexp_id=93) which is;

20\d{2}(-|\/)((0[1-9])|(1[0-2]))(-|\/)((0[1-9])|([1-2][0-9])|(3[0-1]))(T|\s)
(([0-1][0-9])|(2[0-3])):([0-5][0-9]):([0-5][0-9])

However, when I try to use it in a php if statement like this;

if 
(!ereg("20\d{2}(-|\/)((0[1-9])|(1[0-2]))(-|\/)((0[1-9])|([1-2][0-9])|(3[0-1]
))(T|\s)(([0-1][0-9])|(2[0-3])):([0-5][0-9]):([0-5][0-9])",$date_time)) {
echo "You must provide a date and time in the format -MM-DD
HH:MM:SS";
echo "";
}


It doesn't match and allow valid strings through.

Any suggestions?

TIA, 
Verdon

Ps. Please cc me in any replies to list as I am in digest mode.

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



[PHP] Zlib - Insert files?

2004-02-11 Thread Till Krüss

Hi there!

I'm trying to make a GZip compressed file with some files in it.
But i'm only getting a foo.gz with a file foo in it an foo contains
the data of
all files in $this->_Files. I need foo.gz with a file and its
content for each $this->_Files.

$fp = gzopen('foo.gz', 'wb9');
for($i = 0; $i < count($this->_Files); $i++) {
gzwrite($fp, file_get_contents($this->_Files[$i]));
}
gzclose($ZP);


rgds Till

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



[PHP] Newbie questions

2004-02-11 Thread James Marcinek
Hey Everyone,

I have a couple of questions I'd like to ask:

1.) Are there built in libraries to connect to DB2?
Nothings clear from the documentation I've read. I see
that there's libraries for Oracle, Informix, MySQL. 

2.) If there is a DB2 library(support or whatever its
called, someone enlighten me please with the correct
term!) does anyone know if the Red Hat rpm comes with
the option to support this turned on?

3.) I'm just coming across some information about
PEAR. My question to this: Is it better to use PEAR
than the regular libraries included?

Anything else anyone could tell me would be great!

Thanks,

James
RHCE

__
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

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



RE: [PHP] Sessions on Win2k

2004-02-11 Thread Ford, Mike [LSS]
On 11 February 2004 16:39, Alex Hogan contributed these pearls of wisdom:

> Session_start() has to be the first thing at the top of the
> page before
> anything else. Even header info.

Er, no.  session_start() itself generates headers, so it doesn't matter whether it 
goes before or after other headers.  It also doesn't matter how much code is before 
your session_start(), so long as none of it generates any actual page content of any 
kind (and that includes whitespace).

So it could be perfectly valid to have a session_start() on line 768, if everything 
preceding it is PHP initializations and logic -- and the error message isn't about 
headers being output at the wrong place, so I'm guessing that isn't it.

Unfortunately, I don't have any real idea what *could* be the problem here, but I 
wanted to stop the OP haring off on a wild goose chase...!

Cheers!

Mike

-- 
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211

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



RE: [PHP] Sessions on Win2k

2004-02-11 Thread Alex Hogan
Session_start() has to be the first thing at the top of the page before
anything else. Even header info.

I just got this answered for me about two weeks ago  

> -Original Message-
> From: Donpro [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 11, 2004 10:20 AM
> To: php list
> Subject: [PHP] Sessions on Win2k
> 
> Hi,
> 
> I've searched the archives and note that many have probelms using session
> on
> a Win2K server.  I am getting a
> 
> Undefined index: sessions in
> D:\inetpub\mydomain\www\forms\formmail\formmail.php on line 768
> 
> error.  Line 768 is: session_start();
> 
> It works Ok on Linux; is there any "special" Windows configuration?
> 
> Thanks,
> Don
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




Re: [PHP] HELP: Nested include(...)'s take relative paths not intuitively

2004-02-11 Thread Samuel Ventura

Hi there again people,

I looks like this thread turned into a 'include' usage
discussion. Well, nothing wrong with that.

The conclusion seems to be that ALL level of nested
included inherit current directory reference for
relative paths from the very first script ( that in
$_SERVER[SCRIPT_NAME] ) that calls them. 

I just wanted to clarify my need, even I know some one
may think it is not a good idea to depend in nested
includes in higher level subdirs for default/inherited
script behaviour.

I came to this question when trying to design a
framework for my personal site with the following
requirements.

1. Full frame integration (for frame I mean same menu,
links, etc.. around the content of a specific seccion,
no the html frame tag)
2. Full modularity of subseccions, it means to me, put
a subseccion in a subdirectory an it should be ready
to go. Of course I need to make some includes standar
for this to work.

All this is cleanly implemented with includes for
inherited defaults up to 1 level of subseccion depth.

Since I want second-level-depth (or subsubseccions)
not to know about what is above them, I came to need
this NESTED includes and that is where all started to
fall apart with the problem I already described.

I will start looking for a diferent aproach.

Thanxs to u all.





















__
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

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



RE: [PHP] array data

2004-02-11 Thread Shaunak Kashyap
It is not the correct way because $colors being an array, the HTML code for
the hidden input element will look like this (once the HTML has been
generated by PHP):

[code]

[/code]

What you probably want to do instead is something like this:

[code]


 // close loop
[/code]

This will create the following HTML (for the given example)...

[code]




[/code]

... and File2.php will do its job as desired.

Shaunak

> -Original Message-
> From: Imran Asghar [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 11, 2004 3:17 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] array data
>
>
> Hi,
>
> Is not working, is it correct way
>
> File1.php
>
>
>   
>   
>
> File2.php
>
>   echo $colors[0];
>  echo $colors[1];
>  echo $colors[2];
>  echo $colors[4];
> ?>
>
>
>
> imee
>

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



[PHP] Sessions on Win2k

2004-02-11 Thread Donpro
Hi,
 
I've searched the archives and note that many have probelms using session on
a Win2K server.  I am getting a
 
Undefined index: sessions in
D:\inetpub\mydomain\www\forms\formmail\formmail.php on line 768
 
error.  Line 768 is: session_start();
 
It works Ok on Linux; is there any "special" Windows configuration?
 
Thanks,
Don
 

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



Re[8]: [PHP] HELP: Nested include(...)'s take relative paths not int uitively

2004-02-11 Thread Richard Davey
Hello Alex,

Wednesday, February 11, 2004, 3:47:09 PM, you wrote:

AH> How large can that file be?

How long is a piece of string? :)
It's as long as you need it to be.

AH> I have a func.php file that I'm putting all my reusable functions in but I
AH> can see that getting pretty large if this project starts getting eaten up
AH> with feature creep, er.., I mean additional functionality. (I know that'll
never happen...;->>)

Are you using classes? If so that should naturally break your project
down into more meaningful chunks.. i.e. you could have a user class,
an order class, etc etc.

If not then you'll end up with hundreds of functions in a single file
which will become a nightmare, so split them into more sensible groups.

AH> So how large is too large?  I have about 50 constants and globals right now
AH> and it's probably going to get a little larger.  At what point do you break
AH> up the files for performance versus convenience and maintainability?

Bear in mind that it is PHP that has to load and use the file, not the
web browser. So to be honest I would say you can easily fit all of
those constants in a single file - my common include at the moment is
35k.

AH> I read the article that someone posted the other day about "good php coding
AH> practices" and found that it contradicted a lot of what I have seen not only
AH> on php.net but in this forum.  Some of what was written though made a
AH> tremendous amount of sense.  Other was just common sense, like not putting
AH> function calls in loops.

There is no "standard" so you have to find your own middle ground. I
don't know which article you are referring to though. Some things make
sense, some make you think "now that's a good idea" and others are
just downright stupid. Trust me, you will NEVER find two PHP
developers who do things the *exact* same way. That doesn't mean write
bad, poorly formatted code - it just means no-one can turn around and
tell you "it's wrong".

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



RE: Re[6]: [PHP] HELP: Nested include(...)'s take relative paths not int uitively

2004-02-11 Thread Alex Hogan
How large can that file be?

I have a func.php file that I'm putting all my reusable functions in but I
can see that getting pretty large if this project starts getting eaten up
with feature creep, er.., I mean additional functionality. (I know that'll
never happen...;->)

So how large is too large?  I have about 50 constants and globals right now
and it's probably going to get a little larger.  At what point do you break
up the files for performance versus convenience and maintainability?

I read the article that someone posted the other day about "good php coding
practices" and found that it contradicted a lot of what I have seen not only
on php.net but in this forum.  Some of what was written though made a
tremendous amount of sense.  Other was just common sense, like not putting
function calls in loops.

I think I need more coffee...

> -Original Message-
> From: Richard Davey [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 11, 2004 9:28 AM
> To: [EMAIL PROTECTED]
> Subject: Re[6]: [PHP] HELP: Nested include(...)'s take relative paths not
> int uitively
> 
> Hello John,
> 
> Wednesday, February 11, 2004, 3:25:23 PM, you wrote:
> 
> JWH> I hope you are also denying access to .inc files otherwise we could
> view
> JWH> your file as plain text.
> 
> Please.. try ;)
> 
> I used to call the file common.php until we had a rather large debate
> about the correct naming convention for PHP include files on the PHP
> Community list where various people convinced me that .inc is the
> correct standard for include files.
> 
> --
> Best regards,
>  Richardmailto:[EMAIL PROTECTED]
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




Re[8]: [PHP] HELP: Nested include(...)'s take relative paths not int uitively

2004-02-11 Thread Richard Davey
Hello John,

Wednesday, February 11, 2004, 3:42:39 PM, you wrote:

JWH> Heh.. I was just giving a heads up, not threatening.

:)

JWH> I personally don't care for .inc files that are in the web root. The ways to
JWH> deny access to them vary across web servers and platforms, so it makes
JWH> distributing your code a hassle. I know the issues with giving it a .php

True.. except I don't distribute my code. It sits on the servers owned
by the company I work for. I know it's different for others though.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



Re: [PHP] uploaded files are corrupted

2004-02-11 Thread John W. Holmes
From: "Donpro" <[EMAIL PROTECTED]>

> I have a script that allows the user to browse his/her local hard drive
for
> a file and email it as an attachment.  Text files come through OK but any
> binary type file, e.g., JPEG or PDF arrive broken.  JPEG will show as a
red
> X in my browser and Adobe will complain about the PDF.  I don't know
why???

How are you viewing the attachments? It's hard to tell where the issue is
with that description.

Look at the source code of a regular email with attachments and then compare
it to the source code of the email and attachments you create with PHP.

---John Holmes...

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



Re: Re[6]: [PHP] HELP: Nested include(...)'s take relative paths not int uitively

2004-02-11 Thread John W. Holmes
From: "Richard Davey" <[EMAIL PROTECTED]>

> JWH> I hope you are also denying access to .inc files otherwise we could
view
> JWH> your file as plain text.
>
> Please.. try ;)
>
> I used to call the file common.php until we had a rather large debate
> about the correct naming convention for PHP include files on the PHP
> Community list where various people convinced me that .inc is the
> correct standard for include files.

Heh.. I was just giving a heads up, not threatening.

I personally don't care for .inc files that are in the web root. The ways to
deny access to them vary across web servers and platforms, so it makes
distributing your code a hassle. I know the issues with giving it a .php
extension, also, but at least those issues I can control and fix and are not
related to the OS or webserver.

---John Holmes...

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



[PHP] question

2004-02-11 Thread Meramec Challenge Paintball, LLC
I have tried for a long time now on various forums to get help. Every one
says to come to you for support. I looked for a forum on your site but did
not see one.

 

I had to turn the Enable account activation by admin feature. In doing so
when someone tries to create an account when they hit submit they get this
error:

 

[code]Failed sending email :: PHP :: 

 

DEBUG MODE

 

Line : 234

File : /home/mcpain36/public_html/forum/includes/emailer.php[/code]

 

It does not send them an email about how the admin has to turn on the
account. How can I fix this?

 

Thanks,

 

Russ

 

P.S. Sorry if this is a nuisance.



Re[6]: [PHP] HELP: Nested include(...)'s take relative paths not int uitively

2004-02-11 Thread Richard Davey
Hello John,

Wednesday, February 11, 2004, 3:25:23 PM, you wrote:

JWH> I hope you are also denying access to .inc files otherwise we could view
JWH> your file as plain text.

Please.. try ;)

I used to call the file common.php until we had a rather large debate
about the correct naming convention for PHP include files on the PHP
Community list where various people convinced me that .inc is the
correct standard for include files.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



Re: Re[4]: [PHP] HELP: Nested include(...)'s take relative paths not int uitively

2004-02-11 Thread John W. Holmes
From: "Richard Davey" <[EMAIL PROTECTED]>

> Personally I use a file called common.inc which is basically
> my global include file - it has nothing but variables I need set (no
> functions, etc - they are held elsewhere) and files I need to include.
> It sits at the root of my project and is included on every page. It's
> the only file that needs to be included.

I hope you are also denying access to .inc files otherwise we could view
your file as plain text. Same goes for INI files used with parse_ini_file()
that are stored in the webroot.

---John Holmes...

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



Re: [PHP] uploaded files are corrupted

2004-02-11 Thread Richard Davey
Hello Donpro,

Wednesday, February 11, 2004, 2:58:20 PM, you wrote:

D> I have a script that allows the user to browse his/her local hard drive for
D> a file and email it as an attachment.  Text files come through OK but any
D> binary type file, e.g., JPEG or PDF arrive broken.  JPEG will show as a red
D> X in my browser and Adobe will complain about the PDF.  I don't know why???
 
D> A code sample of my form is:

There's nothing wrong with the small bit of html you posted so the
error lies elsewhere. Use the example code in the PHP manual and see
what happens - check your PHP upload settings.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



Re: Re[2]: [PHP] HELP: Nested include(...)'s take relative paths not intuitively

2004-02-11 Thread John W. Holmes
From: "Ford, Mike [LSS]" <[EMAIL PROTECTED]>

> Mind you, there are exceptions: exit(), for example, is a language
construct
> but requires the parens (at least, that's what the fine manual appears to
> say, and I've not tested it without!).

Only if you want to pass an exit value, i.e. exit(101); otherwise just plain
'ole exit; works fine.

---John Holmes...

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



Re[4]: [PHP] HELP: Nested include(...)'s take relative paths not int uitively

2004-02-11 Thread Richard Davey
Hello Alex,

Wednesday, February 11, 2004, 3:08:02 PM, you wrote:

AH> Is it also recommended that an application local config file be used to set
AH> all the globals that will be used throughout?  Right now I'm using the db to
AH> hold all the vars that I want to make available for all apps. Is this
AH> something that shouldn't be done this way?  Is there a performance factor

When using SQL there will always be overhead that could otherwise be
avoided. Personally I use a file called common.inc which is basically
my global include file - it has nothing but variables I need set (no
functions, etc - they are held elsewhere) and files I need to include.
It sits at the root of my project and is included on every page. It's
the only file that needs to be included.

This is a matter of personal preference though - others will do it
like this, infact that is how .NET works to a degree via the
web.config file, but you may find a way which works best for you.
No-one can say if its wrong or right, but it would definitely be
quicker than a SQL query :)

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



Re: [PHP] Undefined function

2004-02-11 Thread John Nichel
Dominique ANOKRE wrote:

ok ,

i install the good php windows installer (with interbase) and now i think my
function is recognized.
But the message displayed is :
Warning: ibase_connect(): unavailable database in
c:\inetpub\wwwroot\index.php on line 12
But i can connect to the database whitout any problems via interbase console
.
So what'is wrong ??
Without seeing the code, I can only guess that the problem is either a) 
your code, b) database configuration, c) network connectivity, d) etc, 
or e) between the monitor and chair. ;)

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] uploaded files are corrupted

2004-02-11 Thread Jason Wong
On Wednesday 11 February 2004 22:58, Donpro wrote:

> A code sample of my form is:
>
> 
> Send this file: 
> 
> 

Try the example(s) in manual > Handling file uploads. If they work, then 
figure out what you're doing differently in your code that makes it not work.

If the examples don't work, and you have read the above chapter thoroughly and 
still can't get them to work then post back here.

-- 
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
--
/*
If I promised you the moon and the stars, would you believe it?
-- Alan Parsons Project
*/

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



[PHP] Re: str_replace not replacing

2004-02-11 Thread Michael Nolan
Aaron Merrick wrote:
I'm reading in to a variable $section1 an entire php file that creates a
mysql table. I can output the variable in a new file just fine (figured out
what all had to be escaped in the original file).
My problem is, I want to replace the table name in the original file with a
new table name before I output it to the new file. But the str_replace has
no effect. Neither does an ereg_replace. Is there something in the content
of the file that is foiling the replace?
Here is what I have right now. It produces the same file content as is read
in.


$search = "item";
$replace = "poem";
mkdir($replace, 0777);
$section1 = file_get_contents("table_create.php");
str_replace($search, $replace, $section1);
chdir($replace);
$table_create = fopen($replace."_table_create.php","w+");
fwrite($table_create,$section1);
?>

str_replace() doesn't affect $section1; it returns the subject with the 
replacements, so you'd need:

$section1 = str_replace($search, $replace, $section1);

Of course, you'd know this if you had RTFM ;-)

http://www.php.net/str_replace

Mike

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


Re: [PHP] str_replace not replacing

2004-02-11 Thread Aaron Merrick
Richard,

Thank you so much. That works perfectly. I knew it had to be something
simple.

Aaron

> From: Richard Davey <[EMAIL PROTECTED]>
> Reply-To: Richard Davey <[EMAIL PROTECTED]>
> Date: Wed, 11 Feb 2004 15:04:44 +
> To: Aaron Merrick <[EMAIL PROTECTED]>
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] str_replace not replacing
> 
> Hello Aaron,
> 
> Wednesday, February 11, 2004, 3:00:47 PM, you wrote:
> 
> AM> $section1 = file_get_contents("table_create.php");
> AM> str_replace($search, $replace, $section1);
> 
> You need to assign the output of str_replace to something:
> 
> $new_section = str_replace($search, $replace, $section1)
> 
> -- 
> Best regards,
> Richardmailto:[EMAIL PROTECTED]
> 
> -- 
> 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] Undefined function

2004-02-11 Thread Dominique ANOKRE
ok ,

i install the good php windows installer (with interbase) and now i think my
function is recognized.
But the message displayed is :

Warning: ibase_connect(): unavailable database in
c:\inetpub\wwwroot\index.php on line 12

But i can connect to the database whitout any problems via interbase console
.

So what'is wrong ??

- Original Message -
From: "Richard Davey" <[EMAIL PROTECTED]>
To: "Dominique ANOKRE" <[EMAIL PROTECTED]>
Cc: "Php List" <[EMAIL PROTECTED]>
Sent: Wednesday, February 11, 2004 2:04 PM
Subject: Re: [PHP] Undefined function


> Hello Dominique,
>
> Wednesday, February 11, 2004, 1:58:17 PM, you wrote:
>
> DA> Fatal error: Call to undefined function: ibase_connect() in
> DA> c:\inetpub\wwwroot\index.php on line 12
>
> DA> I want to know what is wrong with the code or if i have to do
> DA> with php in order to run with  Interbase ?
>
> You don't have Interbase support enabled in the version of PHP you
> are using.
>
> See the InterBase functions manual page for details on how to enable
> it on Win32 machines. Here's the most important part of it:
>
> Note to Win32 Users: In order to enable this module on a Windows
> environment, you must copy gds32.dll from the DLL folder of the
> PHP/Win32 binary package to the SYSTEM32 folder of your windows
> machine. (Ex: C:\WINNT\SYSTEM32 or C:\WINDOWS\SYSTEM32). In case you
> installed the InterBase database server on the same machine PHP is
> running on, you will have this DLL already. Therefore you don't need
> to copy gds32.dll from the DLL folder.
>
> --
> Best regards,
>  Richardmailto:[EMAIL PROTECTED]
>
>

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



RE: Re[2]: [PHP] HELP: Nested include(...)'s take relative paths not int uitively

2004-02-11 Thread Alex Hogan
Hi Richard,

> Why not just set a $basedir value somewhere and always use that in an
> include/require function: include "$basedir/sub/whatever" - then no
> matter where it's called from it'll never be wrong.

That makes sense...

Is it also recommended that an application local config file be used to set
all the globals that will be used throughout?  Right now I'm using the db to
hold all the vars that I want to make available for all apps.  Is this
something that shouldn't be done this way?  Is there a performance factor
that I should be aware of?  The tests I have done so far show an improvement
in the performance from what I am upgrading from, but (that's another
story):-]

alex



** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




Re: [PHP] str_replace not replacing

2004-02-11 Thread Jason Wong
On Wednesday 11 February 2004 23:00, Aaron Merrick wrote:

> My problem is, I want to replace the table name in the original file with a
> new table name before I output it to the new file. But the str_replace has
> no effect. 

[snip]

> str_replace($search, $replace, $section1);

str_replace() returns a value, use it.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
A bit of talcum
Is always walcum
-- Ogden Nash
*/

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



Re: [PHP] str_replace not replacing

2004-02-11 Thread Richard Davey
Hello Aaron,

Wednesday, February 11, 2004, 3:00:47 PM, you wrote:

AM> $section1 = file_get_contents("table_create.php");
AM> str_replace($search, $replace, $section1);

You need to assign the output of str_replace to something:

$new_section = str_replace($search, $replace, $section1)

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



Re: [PHP] replace ' with "

2004-02-11 Thread John Nichel
Diana Castillo wrote:

How do I replace all single quotes with double quotes in a string for
echoing it with the double quotes?
By looking here...

http://us4.php.net/str_replace

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Math Question

2004-02-11 Thread John Nichel
Jeremy Schroeder wrote:

Hey group

Is there a function that when you divide 2 numbers you drop the 
remainder and are left with the whole number.

A whole section of the manual dedicated to mathematical functions!

http://us4.php.net/manual/en/ref.math.php

floor()
ceil()
round()
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] str_replace not replacing

2004-02-11 Thread Aaron Merrick
I'm reading in to a variable $section1 an entire php file that creates a
mysql table. I can output the variable in a new file just fine (figured out
what all had to be escaped in the original file).

My problem is, I want to replace the table name in the original file with a
new table name before I output it to the new file. But the str_replace has
no effect. Neither does an ereg_replace. Is there something in the content
of the file that is foiling the replace?

Here is what I have right now. It produces the same file content as is read
in.



The file I'm reading in is as follows:









The table has been created.";
}
else
{
$msg = "echo mysql_error()";
}

// reveal what happened

echo "$msg"; ?>



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



[PHP] uploaded files are corrupted

2004-02-11 Thread Donpro
Hi,
 
I have a script that allows the user to browse his/her local hard drive for
a file and email it as an attachment.  Text files come through OK but any
binary type file, e.g., JPEG or PDF arrive broken.  JPEG will show as a red
X in my browser and Adobe will complain about the PDF.  I don't know why???
 
A code sample of my form is:
 
 
Send this file:  


 
 
Thanks,
Don

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



Re: [PHP] Math Question

2004-02-11 Thread Jeremy Schroeder
Thanks for all the help, floor() was the correct choice for this problem .

-Blake

Vincent Jansen wrote:

Hi Richard

I agree
But you always want to round down ;)
Blake> Is there a function that when you divide 2 numbers you drop the 
Blake> remainder and are left with the whole number.

Still seems floor() to me

Vincent



-Original Message-
From: Richard Davey [mailto:[EMAIL PROTECTED] 
Sent: woensdag 11 februari 2004 15:23
To: Vincent Jansen
Cc: [EMAIL PROTECTED]
Subject: Re[2]: [PHP] Math Question

Hello Vincent,

Wednesday, February 11, 2004, 2:15:15 PM, you wrote:

VJ> Seems to me you need
VJ> floor($number1 / $number2)
Only if you always want to round *down* the equation. For example
flooring a result of 4.99 will give you an integer of 4 whereas
round() (or ceil()) will give you 5. It depends on the situation as to
which is most useful.
 

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


RE: [PHP] replace ' with "

2004-02-11 Thread Angelo Zanetti

str_replace(''',"'", $StringToReplace);

should work

-Original Message-
From: Diana Castillo [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 11, 2004 4:33 PM
To: [EMAIL PROTECTED]
Subject: [PHP] replace ' with "


How do I replace all single quotes with double quotes in a string for
echoing it with the double quotes?

--
Diana Castillo
Global Reservas, S.L.
C/Granvia 22 dcdo 4-dcha
28013 Madrid-Spain
Tel : 00-34-913604039 ext 214
Fax : 00-34-915228673
email: [EMAIL PROTECTED]
Web : http://www.hotelkey.com
  http://www.destinia.com

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


Disclaimer 
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is 
intended for the attention and use only of the addressee. 
Should you have received this e-mail in error, please delete 
and destroy it and any attachments thereto immediately. 
Under no circumstances will the Cape Technikon or the sender 
of this e-mail be liable to any party for any direct, indirect, 
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to 
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

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



Re: [PHP] replace ' with "

2004-02-11 Thread Stuart
Diana Castillo wrote:
How do I replace all single quotes with double quotes in a string for
echoing it with the double quotes?
$text = str_replace("'", '"', $text);

http://php.net/str_replace and please at least RTFM before posting here 
in future.

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


[PHP] replace ' with "

2004-02-11 Thread Diana Castillo
How do I replace all single quotes with double quotes in a string for
echoing it with the double quotes?

--
Diana Castillo
Global Reservas, S.L.
C/Granvia 22 dcdo 4-dcha
28013 Madrid-Spain
Tel : 00-34-913604039 ext 214
Fax : 00-34-915228673
email: [EMAIL PROTECTED]
Web : http://www.hotelkey.com
  http://www.destinia.com

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



RE: Re[2]: [PHP] Math Question

2004-02-11 Thread Vincent Jansen
Hi Richard

I agree
But you always want to round down ;)

Blake> Is there a function that when you divide 2 numbers you drop the 
Blake> remainder and are left with the whole number.

Still seems floor() to me

Vincent



-Original Message-
From: Richard Davey [mailto:[EMAIL PROTECTED] 
Sent: woensdag 11 februari 2004 15:23
To: Vincent Jansen
Cc: [EMAIL PROTECTED]
Subject: Re[2]: [PHP] Math Question


Hello Vincent,

Wednesday, February 11, 2004, 2:15:15 PM, you wrote:

VJ> Seems to me you need
VJ> floor($number1 / $number2)

Only if you always want to round *down* the equation. For example
flooring a result of 4.99 will give you an integer of 4 whereas
round() (or ceil()) will give you 5. It depends on the situation as to
which is most useful.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

-- 
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: array data

2004-02-11 Thread pete M
Think this is what u want

Imran Asghar wrote:
Hi,
 
Is not working, is it correct way

File1.php
   
   
  
  


 $v
{
?>



File2.php
 

 echo $colors[1];
 echo $colors[2];
 echo $colors[4];
?>



imee

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


RE: Re[2]: [PHP] Math Question

2004-02-11 Thread Jay Blanchard
[snip]
VJ> Seems to me you need 
VJ> floor($number1 / $number2)

Only if you always want to round *down* the equation. For example
flooring a result of 4.99 will give you an integer of 4 whereas
round() (or ceil()) will give you 5. It depends on the situation as to
which is most useful.
[/snip]

you can also try number_format($a / $b, 0, '', '');

and test for the result as some rounding does occur. (I prbably have the
syntax wrong this AM)

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



Re[2]: [PHP] Math Question

2004-02-11 Thread Richard Davey
Hello Vincent,

Wednesday, February 11, 2004, 2:15:15 PM, you wrote:

VJ> Seems to me you need 
VJ> floor($number1 / $number2)

Only if you always want to round *down* the equation. For example
flooring a result of 4.99 will give you an integer of 4 whereas
round() (or ceil()) will give you 5. It depends on the situation as to
which is most useful.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



  1   2   >