Re: [PHP] BreadCrumb Class

2003-01-03 Thread Jason Wong
On Friday 03 January 2003 11:50, Michael J. Pawlowsky wrote:
 I was wondering if anyone had a good BreadCrumb class.
 If not I will write my own, but thought surely there must be many out
 there. But quick searches only brought up Poof which is more than I want.

You have started a new thread by taking an existing posting and replying to
it while you changed the subject.

That is bad, because it breaks threading. Whenever you reply to a message,
your mail client generates a References: header that tells all recipients
which posting(s) your posting refers to. A mail client uses this information
to build a threaded view (tree view) of the postings.

With your posting style you successfully torpedoed this useful feature; your
posting shows up within an existing thread it has nothing to do with.

Always do a fresh post when you want to start a new thread. To achieve this,
click on New message instead of Reply within your mail client, and enter
the list address as the recipient. You can save the list address in your
address book for convenience.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
You will gain money by an illegal action.
*/


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




Re: [PHP] 2 servers for mail implementation

2003-01-03 Thread Rick Widmer
At 07:11 PM 1/2/03 -0800, Roger Thomas wrote:

dear all,
i have 2 servers that were *given* to me to setup and implement webmail
solution for our client. i have done some groundwork in terms of the backend
applications that are needed to do this.



This doesn't have much to do with PHP.  In fact it can probably be done 
without PHP.

The ideal setup depends on your situation.  How many domans?  How many 
users?  How much email?


If you have multiple domains, I suggest you look at

  http://inter7.com/freesoftware/


They have a complete package to manage multiple virtual domains on a Qmail 
server using only one system user.  I've been using it for a couple years, 
with good luck.  There is an active development effort


If I was going to setup two machines as mail servers, I would put half the 
users on each, with all the programs running on both.  Then I would setup 
MX records so that each server backed up the other, collecting email for 
later delivery if the other server is down.This way if one of the 
machines goes down, half your users still get mail, and the messages for 
the other half are queued on the remaining server.

Be sure to keep a backup copy of one machine's configuration on the 
other.  You should have everything you need to re-build a dead server on 
the other machine.  If you put the user mailboxes and mail queue on 
separate hard drives you can pop that drive from one machine to another 
very quickly.


You can run Apache on the mail server to manage email accounts, and for 
webmail, but keep all non-mail related web services off of it.  You don't 
want all the web developers logging on to the mail server.


Rick


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



Re: [PHP] returning data from a function in a class

2003-01-03 Thread Jason Wong
On Friday 03 January 2003 14:40, Ken Nagorski wrote:
 Hi there,

 I am totally new at classes and oop... I have never done any object
 oriented stuff before so I don't know if my question is a php one, a
 browser issue or an oop one but here goes.  I am writing a class that deals
 with members for a site (I know there are examples on the web, I have used
 pieces parts from them...) and things seem to be going ok (actually better
 than OK, I have totally amazed myself so far). but I have one issue. I have
 a function in the class that returns the session ID if there is a valid
 session. otherwise it returns 0. This function works fine in IE6 however
 fails in mozilla or lynx. I have NO idea why and can't seem to figure out
 where to even start.

As always, the best thing to do when code doesn't behave as expected is to 
start printing out variables to see whether they contain what you expect them 
to contain ...


 I would really appreciate any advice. I have included the code snippits
 below.

 -- from class.session_logger.php --
 function is_logged_in()
 {
 session_start();
 $this-current_session_id=session_id();

... eg what does $this-current_session_id contain now? Most likely it is 
empty, ...

 $session_logger = new session_logger;
 $session_id=$session_logger-is_logged_in();
 //echos the session id in IE6, echos 0 in Mozilla ???
 echo(B la la la $session_id/Bbr);

... probably because Mozilla is not accepting cookies?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
If you sit down at a poker game and don't see a sucker, get up.  You're
the sucker.
*/


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




[PHP] Limit to size of autoindex in MySQL/PHPMyAdmin?

2003-01-03 Thread Jim MacCormaic
Hi all. I'm new here, currently implementing my first PHP/MySQL website 
on an iMac running Mac OS X v.10.2.3.

All has been going really well until just now while I was adding 
records to the MySQL database. I have a table which includes an 
auto-incremented field which is set as the Primary key. I was happily 
entering information and then suddenly got a warning of an error in my 
MySQL query, telling me that I had a 'duplicate entry 255 for key 1'.

I've checked the relevant table in PHPMyAdmin and, sure enough, under 
Row Statistic in the Structure option it gives a value of 255 for the 
Next Autoindex even though that value was already assigned in the 
previous record. I feel as if I've hit a brick wall on this one. I ran 
Check Table, Analyze Table and Optimize Table in PHPMyAdmin Operations 
and all reported 'OK'. I'm using a PHP form to insert the records and 
have code included to print out the MySQL query and to report errors 
(hence the warning which I received). The field in question is of type 
tinyint(4), unsigned, not NULL and, as stated, is the Primary key and 
set to auto-increment.

Have I hit some sort of limit by reaching an id of 255? If so, can I 
fix this? Any help would be appreciated, as my database has to all 
intents and purposes lost its functionality once I cannot add further 
records.

Jim MacCormaic
Dublin, Ireland
iChat/AIM	 : [EMAIL PROTECTED]


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



Re: [PHP] Re: PHP memory usage

2003-01-03 Thread Rick Widmer
At 01:25 AM 1/3/03 -0200, Fernando Serboncini wrote:



function a(myclass c)
{
return c;
}

would create another copy of c in memory. Things get a bit larger when you
go with linked-list like structures in classes, where you have to take
really good care to don't duplicate data. If you're not taking care, then
maybe 5MB is normal.



Not really.  PHP has its own method of handling variables which does not 
make a copy of data unless it has to.  See:

   http://www.zend.com/zend/art/ref-count.php


This may be the most important paragraph in the article:

   Note that PHP 4 is not like C: passing variables by reference is not
   necessarily faster than passing them by value. Indeed, in PHP 4 it is
   usually better to pass a variable by value, except if the function
   changes the passed value or if a reference is being passed.


Rick


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



Re: [PHP] Limit to size of autoindex in MySQL/PHPMyAdmin?

2003-01-03 Thread Jasper Bryant-Greene
Jim MacCormaic wrote:


Hi all. I'm new here, currently implementing my first PHP/MySQL 
website on an iMac running Mac OS X v.10.2.3.

All has been going really well until just now while I was adding 
records to the MySQL database. I have a table which includes an 
auto-incremented field which is set as the Primary key. I was happily 
entering information and then suddenly got a warning of an error in my 
MySQL query, telling me that I had a 'duplicate entry 255 for key 1'.

I've checked the relevant table in PHPMyAdmin and, sure enough, under 
Row Statistic in the Structure option it gives a value of 255 for the 
Next Autoindex even though that value was already assigned in the 
previous record. I feel as if I've hit a brick wall on this one. I ran 
Check Table, Analyze Table and Optimize Table in PHPMyAdmin Operations 
and all reported 'OK'. I'm using a PHP form to insert the records and 
have code included to print out the MySQL query and to report errors 
(hence the warning which I received). The field in question is of type 
tinyint(4), unsigned, not NULL and, as stated, is the Primary key and 
set to auto-increment.

Have I hit some sort of limit by reaching an id of 255? If so, can I 
fix this? Any help would be appreciated, as my database has to all 
intents and purposes lost its functionality once I cannot add further 
records.

Jim MacCormaic
Dublin, Ireland
iChat/AIM : [EMAIL PROTECTED]


Change the field type from TINYINT to SMALLINT or MEDIUMINT. UNSIGNED 
TINYINT only has a range of 0 thru 255.

Regards.

Jasper Bryant-Greene
http://fatal.kiwisparks.co.nz/


smime.p7s
Description: S/MIME Cryptographic Signature


[PHP] Split that keeps delimiter

2003-01-03 Thread Simon Dedeyne

Is there a way to split a string without using something like this:
$keywords=preg_split(/[?!.]/, this ! Is a possible
test,PREG_SPLIT_DELIM_CAPTURE);
My php version doesn't seem to support the flags, and I want to know
which delimiter the string was splitted by.

Kind regards,

Simon De Deyne


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




[PHP] Re: Code contents of a function

2003-01-03 Thread liljim
Output buffering functions sound like something you could use:

?php

 function OtherStuff()
 {
  echo MONKEY!!!br\n;
 }

 function DoStuff()
 {
  echo Somethingbr\n;
  echo Something elsebr\n;
  OtherStuff();
 }

 // Start output buffering.
 ob_start();

 // Grab the content.
 DoStuff();
 $content = ob_get_contents();

 // Finish up.
 ob_end_clean();

 // What to do with $content?
 echo Content is: b . $content . /b\n;

?

However, this could get messy and might not be what you're really after. If
you're just wanting to return values from your functions, use return:

function OtherStuff()
{
return Monkey!br\n;
}

function DoStuff()
{
$output = Somethingbr\n;
$output .= Something elsebr\n;
$output .= OtherStuff();

return $output;
}

$content = DoStuff();

echo Content =  . $content;

would have a similar effect to the output method above.

Anyway, further reference for you on output buffering can be found here:
http://www.php.net/manual/en/ref.outcontrol.php

-James


Shawn McKenzie [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have a script with some functions and within the script I want to read
the
 code from one of the functions into a string.

 Example:

 function myfunction() {
 echo something;
 echo something else;
 someotherfunction();
 }

 I want to read:

 echo something;
 echo something else;
 someotherfunction();

 into a string.

 Any ideas??? TIA
 -Shawn





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




[PHP] ImageCreateFromPNG

2003-01-03 Thread Roy van Arem
ImageCreateFromPNG does not work ...

I use php4.3 on win2000 and ImageCreateFromPNG give an error...
undefined function... how is that possible... can someone help me


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




Re: [PHP] Mass-mailing method

2003-01-03 Thread Paul Roberts
some times more than 100 bcc's are treated spam and dropped by the server, try it with 
a limit in the query.

Best Wishes  Happy New Year

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: Cesar Aracena [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 03, 2003 6:19 AM
Subject: RE: [PHP] Mass-mailing method


I'm going to try changing that. I don't have access to my client's
server as I work remotely, so I can't view any logs... or can I? If
anyone else have something for me to try, start shooting...

Thanks,

Cesar L. Aracena
[EMAIL PROTECTED]
[EMAIL PROTECTED]
(0299) 156-356688
Neuquén (8300) Capital
Argentina


-Mensaje original-
De: Michael J. Pawlowsky [mailto:[EMAIL PROTECTED]] 
Enviado el: viernes, 03 de enero de 2003 3:15
Para: Cesar Aracena; [EMAIL PROTECTED]
Asunto: Re: [PHP] Mass-mailing method

Take a look at the sendmail.log for some clues...

But I had something weird were it worked fine for me at home Linux 8 PHP
4.2.2
and when I sent it up to the prod server I had to change the .\r\n;
to .\n;
Which technically is wrong.

Go figure!

But take a look at the sendmail log to begin with.

Mike

 

*** REPLY SEPARATOR  ***

On 03/01/2003 at 3:08 AM Cesar Aracena wrote:

Hi all,

I did a registration page for a customer, and now I'm trying to develop
a way for him to send an e-mail once in a while to the people
registered
with him. I did something (shown below) and everything seems to be ok,
but the e-mail never reaches... Can someone find the problem or maybe
point me to something already done to send multiple e-mails as BCC???

Thanks in advance,

$query = SELECT * FROM mararegistro2 ORDER BY lname;
$result = mysql_query($query) or die (mysql_errno());
$num_rows = mysql_num_rows($result);

for ($x=0; $x  $num_rows; $x++)
{
$row = mysql_fetch_array($result);
$bcc .= $row[email].; ;
}

$myname = .$name.; 
$myemail = .$email.; 

$contactemail = $bcc; 

$message = .$mes.; 
$subject = .$subject.; 

$headers .= MIME-Version: 1.0\r\n; 
$headers .= Content-type: text/html; charset=iso-8859-1\r\n; 
$headers .= From: .$myname. .$myemail.\r\n; 
$headers .= Bcc: .$contactemail.\r\n; 
$headers .= Reply-To: .$myname. .$myemail.\r\n; 
$headers .= X-Priority: 1\r\n; 
$headers .= X-MSMail-Priority: High\r\n; 
$headers .= X-Mailer: Joyeria Mara; 

$mail = mail(, $subject, $message, $headers); 



Cesar L. Aracena
[EMAIL PROTECTED]
[EMAIL PROTECTED]
(0299) 156-356688
Neuquén (8300) Capital
Argentina




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





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


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





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




RE: [PHP] mktime() and the format of the day number entry

2003-01-03 Thread Ford, Mike [LSS]
 -Original Message-
 From: Johnson, Kirk [mailto:[EMAIL PROTECTED]]
 Sent: 02 January 2003 23:29
 
 The month behaves the same: both '08' and '09' are treated as zero by
 mktime().

A leading 0 on a number denotes it as octal.  08 and 09 are not valid octal
numbers.  PHP is interpreting as much of the number as it can (i.e. the
leading 0) and ignoring the invalid part.  This gives you your zero results.

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




[PHP] Re: ImageCreateFromPNG

2003-01-03 Thread Leon Mergen
You haven't compiled PHP with png support.

Roy Van Arem [EMAIL PROTECTED] schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 ImageCreateFromPNG does not work ...
 I use php4.3 on win2000 and ImageCreateFromPNG give an error...
 undefined function... how is that possible... can someone help me



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




Re: [PHP] Code contents of a function

2003-01-03 Thread Khalid El-Kary
although i never needed to do such a thing, but you can open the PHP file 
with the file system functions fopen,fread,fgets ... and work with it using 
string functions strpos(),substr() ...

File system functions: http://www.php.net/manual/en/ref.filesystem.php
String functions: http://www.php.net/manual/en/ref.strings.php

good luck!

Regrads,
Khalid Al-Kary

What???  I want to read the code from the function into a string!

Peter Houchin [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 so put it in a if or switch statement

 eg

 if ($var){
  myfunction();
 }
 else {
  sumotherfunction();
 }

 etc


  -Original Message-
  From: Shawn McKenzie [mailto:[EMAIL PROTECTED]]
  Sent: Friday, 3 January 2003 12:18 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] Code contents of a function
 
 
  I have a script with some functions and within the script I want
  to read the
  code from one of the functions into a string.
 
  Example:
 
  function myfunction() {
  echo something;
  echo something else;
  someotherfunction();
  }
 
  I want to read:
 
  echo something;
  echo something else;
  someotherfunction();
 
  into a string.
 
  Any ideas??? TIA
  -Shawn
 
 
 
  --
  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



_
The new MSN 8 is here: Try it free* for 2 months 
http://join.msn.com/?page=dept/dialup


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



Re: [PHP] Limit to size of autoindex in MySQL/PHPMyAdmin?

2003-01-03 Thread Leif K-Brooks
The limit to tinyint is 255... use int.

Jim MacCormaic wrote:


Hi all. I'm new here, currently implementing my first PHP/MySQL 
website on an iMac running Mac OS X v.10.2.3.

All has been going really well until just now while I was adding 
records to the MySQL database. I have a table which includes an 
auto-incremented field which is set as the Primary key. I was happily 
entering information and then suddenly got a warning of an error in my 
MySQL query, telling me that I had a 'duplicate entry 255 for key 1'.

I've checked the relevant table in PHPMyAdmin and, sure enough, under 
Row Statistic in the Structure option it gives a value of 255 for the 
Next Autoindex even though that value was already assigned in the 
previous record. I feel as if I've hit a brick wall on this one. I ran 
Check Table, Analyze Table and Optimize Table in PHPMyAdmin Operations 
and all reported 'OK'. I'm using a PHP form to insert the records and 
have code included to print out the MySQL query and to report errors 
(hence the warning which I received). The field in question is of type 
tinyint(4), unsigned, not NULL and, as stated, is the Primary key and 
set to auto-increment.

Have I hit some sort of limit by reaching an id of 255? If so, can I 
fix this? Any help would be appreciated, as my database has to all 
intents and purposes lost its functionality once I cannot add further 
records.

Jim MacCormaic
Dublin, Ireland
iChat/AIM : [EMAIL PROTECTED]



--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.




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




[PHP] Re: email/time question

2003-01-03 Thread Tularis
Since PHP is a languaged that work with user-activation, it would only 
be possible with an infinitive loop, and a constant time check.

PHP needs some user interaction before it can start processing. That's 
the entire basis. As such, it IS techinally possible to do what you 
said, but is also something that is really NOT recommended to do with php.

The other possiblity is to set a cron job to fire up a script which will 
send the email.

- Tularis

Randy Johnson wrote:
Here is what i need to do.



I have a form where a user will submit, email address, email text and a time
 like 11:15pm  and at 11:15pm the email is supposed to be sent out.   any
ideas on how i can make this happen automatically???





Randy




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




[PHP] include/require vs performance

2003-01-03 Thread Radek Zajkowski
i am designing a small app that obviuosly works best when I have a lot of 
global files with functions, which cut down on editing.

I will likely have a main page that will contain modules and also load 
all of the required includes like config etc. in total some 10 files will 
be reqested.

Is there, was there ever issue around including a lot files via 
include(). I am running things on a local server so it's hard to gauge.

Thansk in advance.

R 

___
Radoslaw Zajkowski
http://www.finalbanana.com


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




Re: [PHP] include/require vs performance

2003-01-03 Thread Rasmus Lerdorf
 Is there, was there ever issue around including a lot files via
 include(). I am running things on a local server so it's hard to gauge.

I don't understand that comment.  includes/requires are always (well
nearly anyway) local to the server regardless of where the request is
coming from.  So if you have a test box and it is fast enough for you,
then go with it.

-Rasmus

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




Re: [PHP] 2 servers for mail implementation

2003-01-03 Thread Joe Mck

 Hi,

  At 07:11 PM 1/2/03 -0800, Roger Thomas wrote:
  dear all,
  i have 2 servers that were *given* to me to setup and implement webmail
  solution for our client. i have done some groundwork in terms of the
backend
  applications that are needed to do this.
 
 
  This doesn't have much to do with PHP.  In fact it can probably be done
  without PHP.
 
  The ideal setup depends on your situation.  How many domans?  How many
  users?  How much email?
 
 
  If you have multiple domains, I suggest you look at
 
 http://inter7.com/freesoftware/
 
 
  They have a complete package to manage multiple virtual domains on a
Qmail
  server using only one system user.  I've been using it for a couple
years,
  with good luck.  There is an active development effort
 
 
  If I was going to setup two machines as mail servers, I would put half
the
  users on each, with all the programs running on both.  Then I would setup
  MX records so that each server backed up the other, collecting email for
  later delivery if the other server is down.This way if one of the
  machines goes down, half your users still get mail, and the messages for
  the other half are queued on the remaining server.

 I think it would be more efficient putting all the users on one box, with
it
 hd doing raid, and the other box doing the processing.
 so, if something happens on my storage server (the one who has the mails) i
 would just need to replace the server (or one of the hd's) reducing time
 response. And if i need more processing (lets say, i get 100% more visits
 than when i builded this), i would just need to add another proc server and
 do load balancing trough DNS.
 To share the mail data you may use NFS.

 
  Be sure to keep a backup copy of one machine's configuration on the
  other.  You should have everything you need to re-build a dead server on
  the other machine.  If you put the user mailboxes and mail queue on
  separate hard drives you can pop that drive from one machine to another
  very quickly.
 
 
  You can run Apache on the mail server to manage email accounts, and for
  webmail, but keep all non-mail related web services off of it.  You don't
  want all the web developers logging on to the mail server.

 Maybe running all the services in one server wont be a problem if you
 configure all the system properly, your developers may need to read mails
 from console for development reasons anyways.
 I think that maybe you could put the POP3 server on the storage and
 SMTP/HTTP on the proc server. It deppends on the hardware of the two boxes
 and the amount of users that will use the system.

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

 Excuse my english.
 Jou.


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




[PHP] Re: include/require vs performance

2003-01-03 Thread Leon Mergen

Radek Zajkowski [EMAIL PROTECTED] schreef in bericht
news:[EMAIL PROTECTED]...
 Is there, was there ever issue around including a lot files via
 include(). I am running things on a local server so it's hard to gauge.

I think that the only source that could cause any problems with too many
files included will be your operating system (since that thing has certain
limitations on a max number of locked files for example) . Other than that,
I don't think so. I myself include about 15 files on certain pages. But it
is easy to make a test or anything...

Just make a PHP script that generates like 1000 php scripts called
include.test.x.php , where x is is a number, then the contents of those
scripts should by ? include(include.test. . (x+1) . .php);? or
something like that...

Then you are for sure, and you immediately also know how much performance is
lost for including 1000 files :)



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




[PHP] newbie q: how to count words in a file

2003-01-03 Thread Tauntz
Hi !

I'm new to php and I have not found a solution for my problem (dumb me)
ok.. here we go...

I have a file.. it's content is: hello, ello, llo and so on and so on
ok.. and now I want to know how many hello words are in that file..

how can I arrange it ?:)


Thanks
Tauntz


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




Re: [PHP] include/require vs performance

2003-01-03 Thread Michael J. Pawlowsky

These files are parsed by the interpreter...
They are not sent to the client, so I you are thinking bandwidth I dont see how it 
would affect it.
Unless they all output a bunch of data.

Of course there will be some overhead for PHP to interpret all that code.

Mike



*** REPLY SEPARATOR  ***

On 03/01/2003 at 8:25 AM Radek Zajkowski wrote:

i am designing a small app that obviuosly works best when I have a lot of
global files with functions, which cut down on editing.

I will likely have a main page that will contain modules and also load
all of the required includes like config etc. in total some 10 files will
be reqested.

Is there, was there ever issue around including a lot files via
include(). I am running things on a local server so it's hard to gauge.

Thansk in advance.

R

___
Radoslaw Zajkowski
http://www.finalbanana.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] help with form adding to database!!

2003-01-03 Thread Marek Kilimajer
|$sql = INSERT into $table_name (f_name, l_name, username, password)
Values ('$f_name', '$l_name', '$username', '$password');|

notice the single quotes

Karl James wrote:


Hey guys,

I cant figure out what’s wrong with this code.
Im sure its syntax can some one take a look at it and 
Help me out

What im trying to do is create a form for sign up. 
So that the values will be added to the table in the databse..

For log in purposes.

Thanks 
Karl 
Here is the code.

HYPERLINK
http://host.makethewebsecure.com/~admin12/do_adduser.phpshttp://host.m
akethewebsecure.com/~admin12/do_adduser.phps



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.434 / Virus Database: 243 - Release Date: 12/25/2002


 



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




Re: [PHP] Re: include/require vs performance

2003-01-03 Thread Stephan Seidt
I guess that PHP will close file 1 before it opens
file 2 and so on.. For example :

include 'foo';
include 'bar';

When bar is being opened foo is already closed.

Leon Mergen wrote:

Radek Zajkowski [EMAIL PROTECTED] schreef in bericht
news:[EMAIL PROTECTED]...


Is there, was there ever issue around including a lot files via
include(). I am running things on a local server so it's hard to gauge.



I think that the only source that could cause any problems with too many
files included will be your operating system (since that thing has certain
limitations on a max number of locked files for example) . Other than that,
I don't think so. I myself include about 15 files on certain pages. But it
is easy to make a test or anything...

Just make a PHP script that generates like 1000 php scripts called
include.test.x.php , where x is is a number, then the contents of those
scripts should by ? include(include.test. . (x+1) . .php);? or
something like that...

Then you are for sure, and you immediately also know how much performance is
lost for including 1000 files :)






--
I won't pay Bills'


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




[PHP] How to attach a file to mail()

2003-01-03 Thread Davíð Örn Jóhannsson
mail($to, $subject, $body, From: $email);
 
how do I insert an attachment into this mail function, It would be
submitted with file field and would be called attachment.
 
Regards, David



Re: [PHP] Re: include/require vs performance

2003-01-03 Thread Leon Mergen

Stephan Seidt [EMAIL PROTECTED] schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I guess that PHP will close file 1 before it opens
 file 2 and so on.. For example :

 include 'foo';
 include 'bar';

 When bar is being opened foo is already closed.

Hmmm, i think the parser is built recursive, so at the moment it sees an
include 'foo'; , it will look in foo, parse that one, and after it has
finished foo, it will continue with the main script...



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




Re: [PHP] include/require vs performance

2003-01-03 Thread Marek Kilimajer
He likely ment that his local server is simply fast enough that any 
speed defference is unnoticeable,
but on a shared host this might make some difference.
Use include/require as you are more comfortable with it.

Rasmus Lerdorf wrote:

Is there, was there ever issue around including a lot files via
include(). I am running things on a local server so it's hard to gauge.
   


I don't understand that comment.  includes/requires are always (well
nearly anyway) local to the server regardless of where the request is
coming from.  So if you have a test box and it is fast enough for you,
then go with it.

-Rasmus

 



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




Re: [PHP] way to insert timer / pause?

2003-01-03 Thread Gerald Timothy Quimpo
On Friday 03 January 2003 10:56 am, Jeff Bluemel wrote:
 if there a command, or a way I can put say a 5 second, or a 10 second pause
 which will make it so it will output x amount of html, and then continue?
 or if I can pause it will it not display any of the html until the entire
 script has ran?

that depends on a few things.  output buffering (manual or automatic)
may block immediate output of text or HTML.

tables get displayed when the whole table has been received by the
browser. so you can't show parts of a table.  tables within tables
will get displayed only when the outermost table is complete.

there may also be quirks in browsers, proxies or servers that affect
this, but i don't know any details.

tiger

-- 
Gerald Timothy Quimpo  tiger*quimpo*org gquimpo*sni-inc.com tiger*sni*ph
Public Key: gpg --keyserver pgp.mit.edu --recv-keys 672F4C78
   Veritas liberabit vos.
   Doveryai no proveryai.

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




[PHP] Possible bug with PHP v4.1.1 and bits?

2003-01-03 Thread Daevid Vincent
I'm not even sure how to classify this...

Given:

INPUT NAME=action TYPE=SUBMIT VALUE='?=$Enabled?');

Where $Enabled is either a 0 or 1 as read from a database ( TINYINT(1)
);

And

echo action = .$_POST[action].BR;
if ($_POST[action] == 1 || $_POST[action] == 0)
  echo = UPDATE Company SET Enabled = .!(intval($_POST[action])).
WHERE CompanyID = $id;

(skipping all the obvious bits -- no pun intended)

I cannot figure out how to simply make the 0 and 1 invert or negate or
toggle as it were.

When I submit the form, my output is:

action = 0
UPDATE Company SET Enabled = 1 WHERE CompanyID = 89

action = 1
UPDATE Company SET Enabled = WHERE CompanyID = 17

I've tried all kinds of combinations, but whenever the action is 1 to
begin with, the 'inverted' version is always blank or -2 when I would
expect it to be 0.

If I use 
  echo = UPDATE Company SET Enabled = .~(intval($_POST[action])).
WHERE CompanyID = $id;

action = 1
UPDATE Company SET Enabled = -2 WHERE CompanyID = 17


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




[PHP] PHP-Performance

2003-01-03 Thread Fatih stnda
Do you know any resource about php performance?

I wonder that can I use php+apache+oracle for a web site
serving to many clients ( such as 10.000 ) at the same time?


Fatih Üstündað
Yöre Elektronik Yayýmcýlýk A.Þ.
0 212 234 00 90


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




Re: [PHP] Re: include/require vs performance

2003-01-03 Thread Stephan Seidt
well ok, if it's :

main.php :
include 'foo';

foo :
include 'bar';

bar :
include 'whatever';

...

there will be lots of used file descriptors at once

Leon Mergen wrote:

Stephan Seidt [EMAIL PROTECTED] schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...


I guess that PHP will close file 1 before it opens
file 2 and so on.. For example :

include 'foo';
include 'bar';

When bar is being opened foo is already closed.



Hmmm, i think the parser is built recursive, so at the moment it sees an
include 'foo'; , it will look in foo, parse that one, and after it has
finished foo, it will continue with the main script...






--
I won't pay Bills'


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




Re: [PHP] newbie q: how to count words in a file

2003-01-03 Thread Khalid El-Kary
Use file system functions to get the contents of the file in a string, then 
us substr_count() on that string.

Filesystem: http://www.php.net/manual/en/ref.filesystem.php
substr_count: http://www.php.net/manual/en/function.substr-count.php

Regrads
Khalid Al-kary

Hi !

I'm new to php and I have not found a solution for my problem (dumb me)
ok.. here we go...

I have a file.. it's content is: hello, ello, llo and so on and so on
ok.. and now I want to know how many hello words are in that file..

how can I arrange it ?:)


Thanks
Tauntz


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



_
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus


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



Re: [PHP] PHP-Performance

2003-01-03 Thread Khalid El-Kary
Performance related issues depend on too many factors infact, however, PHP 
is known to be fast in itself (as an apache module), oracle is also known to 
be fast just like MySQL, but still it depends on what your app will do with 
the database, and how would you manage both your database and application in 
order to get good performance, one of the most important sides, is your 
hardware, single server, multiple servers, dual processors or more? , and so 
on ... your connection?

However PHP, Oracle, Apache, Linux (prefered) is a good group.

Regrads,
Khalid Al-kary

Do you know any resource about php performance?

I wonder that can I use php+apache+oracle for a web site
serving to many clients ( such as 10.000 ) at the same time?


Fatih Üstündað
Yöre Elektronik Yayýmcýlýk A.Þ.
0 212 234 00 90


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



_
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
http://join.msn.com/?page=features/junkmail


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



Re: [PHP] PHP-Performance

2003-01-03 Thread Michael J. Pawlowsky

Get in touch with Zend. I bet they have benchmarks with their optimizer engine.
http://www.zend.com/

Cheers,
Mike



*** REPLY SEPARATOR  ***

On 03/01/2003 at 3:56 PM Fatih Üstündað wrote:

Do you know any resource about php performance?

I wonder that can I use php+apache+oracle for a web site
serving to many clients ( such as 10.000 ) at the same time?




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




Re: [PHP] newbie q: how to count words in a file

2003-01-03 Thread Tauntz
Thank you.. figured it out now.


Tauntz


Khalid El-Kary wrote:


Use file system functions to get the contents of the file in a string, 
then us substr_count() on that string.

Filesystem: http://www.php.net/manual/en/ref.filesystem.php
substr_count: http://www.php.net/manual/en/function.substr-count.php

Regrads
Khalid Al-kary

Hi !

I'm new to php and I have not found a solution for my problem (dumb me)
ok.. here we go...

I have a file.. it's content is: hello, ello, llo and so on and so 
on
ok.. and now I want to know how many hello words are in that file..

how can I arrange it ?:)


Thanks
Tauntz


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



_
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus





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




[PHP] ImageCreateFromPNG

2003-01-03 Thread Roy van Arem
ImageCreateFromPNG just won't work in php4.3 on windows 2000 . . . .I
cannot find any information on that ... can someone help me?? please

Roy van Arem
[EMAIL PROTECTED]


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




Re: [PHP] Possible bug with PHP v4.1.1 and bits?

2003-01-03 Thread Marek Kilimajer
inverting value:
$action = ($value==='1' ? '0' : '1' );

Daevid Vincent wrote:


I'm not even sure how to classify this...

Given:

INPUT NAME=action TYPE=SUBMIT VALUE='?=$Enabled?');

Where $Enabled is either a 0 or 1 as read from a database ( TINYINT(1)
);

And

echo action = .$_POST[action].BR;
if ($_POST[action] == 1 || $_POST[action] == 0)
 echo = UPDATE Company SET Enabled = .!(intval($_POST[action])).
WHERE CompanyID = $id;

(skipping all the obvious bits -- no pun intended)

I cannot figure out how to simply make the 0 and 1 invert or negate or
toggle as it were.

When I submit the form, my output is:

action = 0
UPDATE Company SET Enabled = 1 WHERE CompanyID = 89

action = 1
UPDATE Company SET Enabled = WHERE CompanyID = 17

I've tried all kinds of combinations, but whenever the action is 1 to
begin with, the 'inverted' version is always blank or -2 when I would
expect it to be 0.

If I use 
 echo = UPDATE Company SET Enabled = .~(intval($_POST[action])).
WHERE CompanyID = $id;

action = 1
UPDATE Company SET Enabled = -2 WHERE CompanyID = 17


 



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




Re: [PHP] Limit to size of autoindex in MySQL/PHPMyAdmin?

2003-01-03 Thread Jim MacCormaic
On Friday, January 3, 2003, at 08:59  am, Leif K-Brooks wrote:


The limit to tinyint is 255... use int.


On Friday, January 3, 2003, at 09:02  am, Jasper Bryant-Greene wrote:


Change the field type from TINYINT to SMALLINT or MEDIUMINT. UNSIGNED 
TINYINT only has a range of 0 thru 255.

Thanks so much guys. I've made the change, tried again, and all is 
well. I opted for SMALLINT because its range is more than adequate for 
my needs. Whew! Relief!

Sorry for not thinking of going first to the source. Having read your 
posts I went back to the MYSQL manual and checked out Column Types. In 
my defence all I can say is that I'll remember it better this way ;-)


Jim MacCormaic
Dublin, Ireland
iChat/AIM	 : [EMAIL PROTECTED]


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



Re: [PHP] ImageCreateFromPNG

2003-01-03 Thread Chris Hewitt
Roy van Arem wrote:


ImageCreateFromPNG just won't work in php4.3 on windows 2000 . . . .I
cannot find any information on that ... can someone help me?? please


Does phpinfo() show that you have png support enabled (in gd section)?  
I'm working with php 4.1.2 (on linux) so things may differ with the 
built-in gd in 4.3.

What error message, if any, do you get?

HTH
Chris





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




[PHP] Parsing a string

2003-01-03 Thread Greg
Hi-
I'd like to parse the string returned by popen(uptime, r);.  The string
that is returned is:

9:47am up 37 days, 16:24, 1 user, load average: 0.09, 0.02, 0.00

What I'd like is 5 strings...the first contains 37 days, 16:24, the second
1 user, the third 0.09, the fourth 0.02, and the fifth 0.00.

Any easy way to do this?  Thanks very much in advance!
-Greg



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




Re: [PHP] Parsing a string

2003-01-03 Thread Michael J. Pawlowsky
Just use explode() and then dont use what you dont want.

Mike


*** REPLY SEPARATOR  ***

On 03/01/2003 at 9:49 AM Greg wrote:

Hi-
I'd like to parse the string returned by popen(uptime, r);.  The string
that is returned is:

9:47am up 37 days, 16:24, 1 user, load average: 0.09, 0.02, 0.00

What I'd like is 5 strings...the first contains 37 days, 16:24, the
second
1 user, the third 0.09, the fourth 0.02, and the fifth 0.00.

Any easy way to do this?  Thanks very much in advance!
-Greg



--
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] signal handler to ignore kill of parent

2003-01-03 Thread Thomas Weber
I am using the pcntl_ fork() from PHP. The problem with exec() is that i
need the variables and socket-descriptors from the parent.

Thomas 'Neo' Weber
---
[EMAIL PROTECTED]
[EMAIL PROTECTED]

- Original Message -
From: Michael J. Pawlowsky [EMAIL PROTECTED]
To: PHP-List [EMAIL PROTECTED]
Sent: Thursday, January 02, 2003 7:42 PM
Subject: Re: [PHP] signal handler to ignore kill of parent



 Actually let me try to be a bit more helpful... nut not much though :-)

 Did you write the code for the fork();

 Can you modify it?  Read the fork, exec and clone man pages.
 This might help you a bit understand the behaviour.

 If so just call exec from the forked process... this will create a new
process instead of a child one.
 Then call exit() in your forked process.

 Mike






 *** REPLY SEPARATOR  ***

 On 02/01/2003 at 7:05 PM Thomas Weber wrote:

 Hi,
 
 i need some way for child-processes to ignore the kill of their parent.
Any
 idea?
 
 Thanks,
 Thomas 'Neo' Weber
 ---
 [EMAIL PROTECTED]
 [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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Parsing a string

2003-01-03 Thread Khalid El-Kary
check explode() ;)

http://www.php.net/manual/en/function.explode.php

Regrads,
Khalid Al-kary



Hi-
I'd like to parse the string returned by popen(uptime, r);.  The string
that is returned is:

9:47am up 37 days, 16:24, 1 user, load average: 0.09, 0.02, 0.00

What I'd like is 5 strings...the first contains 37 days, 16:24, the 
second
1 user, the third 0.09, the fourth 0.02, and the fifth 0.00.

Any easy way to do this?  Thanks very much in advance!
-Greg



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



_
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus


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



[PHP] Loading Module not in php.ini

2003-01-03 Thread Michael J. Pawlowsky


I doubt that I can do this...  but as someone once told me, There's no such thing as 
a stupid question.
I guess they were never on any mailing lists!  :-)

So here it goes

Is there anyway to load a module without having access to php.ini
kind of like a ini_set(extension=mymodule.co); that would load a new process with 
this module and pass the request on to it?


Cheers,
Mike





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




Re: [PHP] Loading Module not in php.ini

2003-01-03 Thread Rasmus Lerdorf
php.net/dl

On Fri, 3 Jan 2003, Michael J. Pawlowsky wrote:



 I doubt that I can do this...  but as someone once told me, There's no such thing 
as a stupid question.
 I guess they were never on any mailing lists!  :-)

 So here it goes

 Is there anyway to load a module without having access to php.ini
 kind of like a ini_set(extension=mymodule.co); that would load a new process with 
this module and pass the request on to it?


 Cheers,
 Mike





 --
 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] File Modification Date/Time

2003-01-03 Thread Christopher J. Crane
I am trying to parse through a directory and get the modification dates of
the file.

?PHP
$DirToCheck = tempdata/;
if ($handle = opendir($DirToCheck)) {
while (false !== ($file = readdir($handle))) {
echo nbsp;nbsp;$file - Last Modified:  . date(F d Y H:i:s.,
filemtime($file)) . br\n;
 }
closedir($handle);
 }
?

All the files are coming back with a date of December 31 1969 19:00:00. What
am I doing wrong? The next step is I want to check if the file is older than
30 minutes and if so, I want to delete it. How would I go about that?




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




[PHP] Recommend payment processors?

2003-01-03 Thread Chad Day
Just wondering what people are using/recommend out there.. I'm going to be
getting a merchant account and let people purchase services through my
website on a secure server, all in PHP.  What concerns me is this archived
post I came across:

http://marc.theaimsgroup.com/?l=php-generalm=102165623600464w=2

Reading that, it sounds like it's not possible to use Payment Pro, or
possibly other systems, with PHP .. is this correct?  Some of the other
posts in the archive sounded like people were using it, so I'm not really
sure what is possible at this point.

Thanks,
Chad


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




[PHP] [PDF Creation] Insertion of image on a PDF using EzPDF library

2003-01-03 Thread Natacha Salmon
Hi all,

Here is my problem. I got a web application, who must build a PDF using
datas from a MySQL table and a logo (JPEG format), and send the PDF
generated by mail.

I manage to build the PDF.

Instead of sending it via mail, I tried to open it directly on my browser,
IE 6.0. All is ok, I see my datas, and the logo.

But when I send it via mail, all I got when I open it on Acrobat Reader is
datas, but the logo isn't displayed. Instead , I got a grey bow, and an
alert message telling me : Image too big.

Of course I tried to put an image 15px*15px, so, not that big ;) but it's
the same.

I really don't understand, and as the library I use is specifical, it's not
really easy to find help or documentation. And to be honnest, my application
is soon finished, and if I had to change of library, it would take me lot of
time :(

I would really appreciate any help :)

Thanks a lot.

Natacha





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




Re: [PHP] ImageCreateFromPNG

2003-01-03 Thread Chris Hewitt
Roy van Arem wrote:


In gd section. hm... I always used to use PHP 3. something and that
didn't have half the variables I can set in php4.3.. anyway this is
phpinfo:

http://62.142.245.64/g/gheos.com/test.php


No gd section or png mentioned on that page.


br /
bFatal error/b:  Call to undefined function:  imagecreatefrompng() in


This error message is telling you that gd was not entered in the 
./configure stage of compiling php.

If I put exactly the same script on my ISP's server, then it works without
any problem!
But on my pc it just does not!


If you look at a phpinfo() on your isp's server then gd must be present.

You need to recompile php, or get a distribution of it with gd present. 
As I only use php under linux I'm not the best person to advise where to 
get a suitable set of windows binaries. I suggest a search of the 
archives of this list as this question comes up occasionally, or try a 
google search. (Of course you could just load linux, but I guess that is 
not the answer you are looking for :-)

Hope this helps

Chris


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



Re: [PHP] File Modification Date/Time

2003-01-03 Thread Marek Kilimajer
you must prepend $DirToCheck to $file:

filemtime($DirToCheck . $file)



Christopher J. Crane wrote:


I am trying to parse through a directory and get the modification dates of
the file.

?PHP
$DirToCheck = tempdata/;
if ($handle = opendir($DirToCheck)) {
   while (false !== ($file = readdir($handle))) {
   echo nbsp;nbsp;$file - Last Modified:  . date(F d Y H:i:s.,
filemtime($file)) . br\n;
}
   closedir($handle);
}
?

All the files are coming back with a date of December 31 1969 19:00:00. What
am I doing wrong? The next step is I want to check if the file is older than
30 minutes and if so, I want to delete it. How would I go about that?




 



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




Re: [PHP] File Modification Date/Time

2003-01-03 Thread Christopher J. Crane
Oh that would make sense. I was think ahead. I thought the file was loaded
into an array and I was like foreach in the array. So simple, I didn't see
it.

Thank you!

Marek Kilimajer [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 you must prepend $DirToCheck to $file:

 filemtime($DirToCheck . $file)



 Christopher J. Crane wrote:

 I am trying to parse through a directory and get the modification dates
of
 the file.
 
 ?PHP
 $DirToCheck = tempdata/;
 if ($handle = opendir($DirToCheck)) {
 while (false !== ($file = readdir($handle))) {
 echo nbsp;nbsp;$file - Last Modified:  . date(F d Y H:i:s.,
 filemtime($file)) . br\n;
  }
 closedir($handle);
  }
 ?
 
 All the files are coming back with a date of December 31 1969 19:00:00.
What
 am I doing wrong? The next step is I want to check if the file is older
than
 30 minutes and if so, I want to delete it. How would I go about that?
 
 
 
 
 
 




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




Re: [PHP] Recommend payment processors?

2003-01-03 Thread Rick Emery
I use PayPal.  Does not require a merchant account.  PHP payment interface and 
interaction is easy
to implement.  Via HTML in your webpage, you pass to PayPal the URL of the PHP script 
to be executed
when a payment is received.

- Original Message -
From: Chad Day [EMAIL PROTECTED]
To: php general [EMAIL PROTECTED]
Sent: Friday, January 03, 2003 10:14 AM
Subject: [PHP] Recommend payment processors?


Just wondering what people are using/recommend out there.. I'm going to be
getting a merchant account and let people purchase services through my
website on a secure server, all in PHP.  What concerns me is this archived
post I came across:

http://marc.theaimsgroup.com/?l=php-generalm=102165623600464w=2

Reading that, it sounds like it's not possible to use Payment Pro, or
possibly other systems, with PHP .. is this correct?  Some of the other
posts in the archive sounded like people were using it, so I'm not really
sure what is possible at this point.

Thanks,
Chad


--
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: threads (was Re: [PHP] BreadCrumb Class)

2003-01-03 Thread David T-G
Jason, et al --

...and then Jason Wong said...
% 
% On Friday 03 January 2003 11:50, Michael J. Pawlowsky wrote:
%  I was wondering if anyone had a good BreadCrumb class.
...
% 
% You have started a new thread by taking an existing posting and replying to
% it while you changed the subject.

I try not to harp on this, though I vehemently agree that it just
shouldn't be done.  The probblem is that those who typically do this
(usually it's LookOut! users; this is the first time I've noticed Calypso
as the X-Mailer: and I'm sure there are some others) can't even see the
threading information and can't use it in their MUA, threading only by
a Subject: line, and will probably never learn.  Since I use mutt and
have the thread-breaking and thread-joining patch installed, I just break
the thread and move on.

Absolutely classic, though, was Jim MacCormaic's identical attempt at a
new thread in response to your message!


HAND

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




msg91459/pgp0.pgp
Description: PGP signature


[PHP] Javascript broken!

2003-01-03 Thread Adam Wilson
I am beginning a tidy-up of a very messy site i am now managing. I have
started splitting repeated sections into single header and footer files, for
inclusion via php. Unfortunately the javascript no longer works, i.e.
rollovers etc.

Can someone please help me on this? Is this a known problem?


--
Adam Wilson
__
Webmaster
123Doc Ltd
www.123doc.com



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




[PHP] Bit manipulation

2003-01-03 Thread Michael J. Pawlowsky

I can't remember who wanted the bit manipulation stuff...
But I was looking for something in my bookmarks when I saw this simple little class.

I use bits to test for user permissions for specific function.
as in   if ((int)$user.permissions  (int)$permbit) {}

I dont use that class but thought it could be helpful to you.
It has a FlipBit.

Mike

  Start Class 
-

?php

/* Constants */
define( BIT_0, 0 );
define( BIT_1, 1 );
define( BIT_2, 2 );
define( BIT_3, 4 );
define( BIT_4, 8 );
define( BIT_5, 16 );
define( BIT_6, 32 );
define( BIT_7, 64 );
define( BIT_8, 128 );
define( BIT_9, 256 );
define( BIT_10, 512 );
define( BIT_11, 1024 );
define( BIT_12, 2048 );
define( BIT_13, 4096 );
define( BIT_14, 8192 );
define( BIT_15, 16384 );
define( BIT_16, 32768 );
define( BIT_17, 65536 );
define( BIT_18, 131072 );
define( BIT_19, 262144 );
define( BIT_20, 524288 );
define( BIT_21, 1048576 );
define( BIT_22, 2097152 );
define( BIT_23, 4194304 );
define( BIT_24, 8388608 );
define( BIT_25, 16777216 );
define( BIT_26, 33554432 );
define( BIT_27, 67108864 );
define( BIT_28, 134217728 );
define( BIT_29, 268435456 );
define( BIT_30, 536870912 );
define( BIT_31, 1073741824 );

class CBitField {
  var $bitfield = 0;
  function CBitField () {
  $this - bitfield = ($this - bitfield | 0);
  }
  function QueryBit ($bit) {
if (($this - bitfield  $bit)  0 )
  return 1;
else
  return 0;
  }
  function SetBit ($bit, $boolean) {
if ($boolean == 1)
  $this - bitfield |= $bit;
else
  $this - bitfield = ~$bit;
  }
  function FlipBit ($bit) {
$this - bitfield ^= $bit;
  }
}

?

--  End Class -

Example


$bits = new CBitField;
$bits - SetBit (BIT_1, 1);
$bits - SetBit (BIT_2, 0);
$bits - SetBit (BIT_3, 0);
$bits - FlipBit (BIT_3);
echo $bits - QueryBit(BIT_1).,;
echo $bits - QueryBit(BIT_2).,;
echo $bits - QueryBit(BIT_3);





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




Re: [PHP] Javascript broken!

2003-01-03 Thread John Nichel
You may want to try a JavaScript mailing list.

Adam Wilson wrote:

I am beginning a tidy-up of a very messy site i am now managing. I have
started splitting repeated sections into single header and footer files, for
inclusion via php. Unfortunately the javascript no longer works, i.e.
rollovers etc.

Can someone please help me on this? Is this a known problem?


--
Adam Wilson
__
Webmaster
123Doc Ltd
www.123doc.com






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

2003-01-03 Thread Michael Weiner
Does someone have a script of php function or page that has this code
working that i can review? I am wanting to create a webpage that will
let a user enter in an image name (i.e. a png or whatever) and have php
create an image from that...

Thanks in advance
Michael Weiner


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




Re: [PHP] Re: threads (was Re: [PHP] BreadCrumb Class)

2003-01-03 Thread Michael J. Pawlowsky
Unfortunately Calypso threads the messages by date etc. Not Mail IDs.
It has a Show references command that creates threads but I don't keep these mails 
on my system for more than a day unless there's some really good info in it.
So it had no effect for me.

It's a great mailer if you have many e-mail accounts and many roles.
I have 15 different accounts (for different clients, businesses etc.) and it manages 
multiple personalities very well.

Decent filtering (besides threads)
Templates
Auto-Responder
Bulk Mail
Grouped Mail
Sigs attached to accounts
PGP support
LDAP Support
Multiple Window Layouts
etc.
And uses very little ressources to do so.

It was freeware for a while because support was dropped for it... but it is now it the 
hands of Rose City Software
http://www.rosecitysoftware.com/Calypso/

Ok enough of a plug for Calypso.

I just wanted to say I added php as a quick nick in my address book so it won't 
happend again!

:-)

Cheers,
Mike


I try not to harp on this, though I vehemently agree that it just
shouldn't be done.  The probblem is that those who typically do this
(usually it's LookOut! users; this is the first time I've noticed Calypso
as the X-Mailer: and I'm sure there are some others) can't even see the
threading information and can't use it in their MUA, threading only by
a Subject: line, and will probably never learn.  Since I use mutt and
have the thread-breaking and thread-joining patch installed, I just break
the thread and move on.

Absolutely classic, though, was Jim MacCormaic's identical attempt at a
new thread in response to your message!




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




[PHP] installation problems (php 4.2.3/mcrypt/curl)

2003-01-03 Thread Michael Geier
I searched MARC first, but none of the answers there seemed to work.

Installing:
  RH 8
  Apache 1.3.27 (--enable-module=so)
  PHP 4.2.3 (--with-apxs --enable-ftp --with-esoob --with-mcrypt
 --with-curl --with-openssl, etc.)
  Openssl 0.9.7
  Mcrypt 2.5.3  (--disable-posix-threads)
  Curl 7.10.2   (--enable-ftp --enable-http --with-ssl)

No errors during installation.  Apache/PHP loads without error.

phpinfo shows mcrypt and curl support, yet both error out on basic functions 
(mcrypt_module_open, curl_init)(PHP Fatal Error: call to undefined function...)

mcrypt   support enabled 
version  = 2.4.x 
Supportedciphers twofish rijndael-128 rijndael-192 rijndael-256 
 saferplus rc2 xtea serpent safer-sk64 safer-sk128 cast-256 
 loki97 gost threeway cast-128 blowfish des blowfish-compat 
 tripledes enigma arcfour panama wake  
Supported modes  ofb cfb nofb cbc ecb stream ncfb ctr  

mcrypt.algorithms_dir /usr/local/lib/libmcrypt 
mcrypt.modes_dir  /usr/local/lib/libmcrypt

CURL support enabled 
CURL Information libcurl/7.10.2 OpenSSL/0.9.6b zlib/1.1.4 
 
Any help appreciated.

mike

---
 This email sent using CDM Sports Webmail v3.1
  [ http://webmail.cdmsports.com ]

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




Re: [PHP] ImageCreateFromPNG

2003-01-03 Thread Michael J. Pawlowsky

I have something that does it but only with gif since I have the old version of GDLib.
But everthing is the same except for the output and the opening from a specific file..
It's not exactly what you are looking for but it will get you started
I use a db clas for my db calls so dont try and use does. You will have to change them.


I also build some images on the fly from data

Take a look at http://www.rconline.ca/wind/index.php?id=1club_id=0

It is built on the fly using GDLib





?php


require(/lib/util.php);
$sql = new MySQL_class;
$sql-Create(mydb);

if (isset($_POST['action'])) {


/* Update the database records */

$sql-Insert(INSERT INTO photo_item (unum, cat, cutline, create_date, 
hsize, vsize)
  VALUES ( 
$HTTP_COOKIE_VARS[unum], $_POST[cat], '$_POST[cutline]', now(), 0,0));

$affected_rows = $sql-a_rows;
$lastid = mysql_insert_id();

/* If we have an photo let's move it */
if (is_uploaded_file($_FILES['userfile']['tmp_name']))
{
move_uploaded_file($_FILES['userfile']['tmp_name'], 
pics/$lastid.gif);
} else {
/* No photo then send error and delete db entry  */
$sql-Delete(DELETE from photo_item where id = $lastid);
echo (Error no photo uploaded);
Die();
}

$imagehw = GetImageSize(pics/$lastid.gif);

$imagewidth  = $imagehw[0];
$imageheight = $imagehw[1];
$imagetype   = $imagehw[2];


if ($imagetype != 1)
{
$sql-Delete(DELETE from photo_item where id = $lastid);
$err = unlink (pics/$lastid.gif);
echo (Photos must be of type .GIF);
Die();
}

// Make sure the pic is at least 250X175
if (($imageheight  250) AND ($imagewidth  175))
{
$sql-Delete(DELETE from photo_item where id = $lastid);
$err = unlink (pics/$lastid.gif);
echo (Photos should be a minimum of 250x175 pixels);
Die();
}

if (($imageheight  175) AND ($imagewidth  250))
{
$sql-Delete(DELETE from photo_item where id = $lastid);
$err = unlink (pics/$lastid.gif);
echo (Photos should be a minimum of 250x175 pixels);
Die();
}


// Create or source image for scaling and thumbnail
$src_img=ImageCreateFromGif(pics/$lastid.gif);


if (($imageheight  600) or ($imagewidth  600))
{
// We need to scale it
if ($imageheight  $imagewidth)
{
// We have a vertical
$hscale = ($imageheight / 600);
$new_w  = round($imageheight / $hscale);
$new_h  = round($imageheight / $hscale);
} else {
// We have a horizontal or square
$hscale = ($imagewidth / 600);
$new_w  = round($imagewidth / $hscale);
$new_h  = round($imageheight / $hscale);
}

$dst_img=ImageCreate($new_w,$new_h);

ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,$imagewidth,$imageheight);
ImageGif($dst_img, pics/$lastid.gif);
ImageDestroy($dst_img);

} else {
// Keep original dimensions
$new_w  = $imagewidth;
$new_h  = $imageheight;
}



// Let's see if it's vertical or horizontal and create thumbnail scale
if ($imageheight  $imagewidth)
{
// We have a vertical
$tscale = ($imageheight / 250);
$new_tw  = round($imagewidth / $tscale);
$new_th  = round($imageheight / $tscale);
} else {
// We have a horizontal or square
$tscale = ($imagewidth / 250);
$new_tw  = round($imagewidth / $tscale);
$new_th  = round($imageheight / $tscale);
}


// Make the thumbnail
$t_img=ImageCreate($new_tw,$new_th);


[PHP] PHP intereferes with my Javascript

2003-01-03 Thread Adam Wilson
I posted just before, i think i'll try again and re-word...

I have split a page up into three sections, header, content and footer.
Header and footer are included in content via PHP. Header contains
Javascript functions. Content and header both call the javascript functions.
When i look at the source generated it looks exactly like before it was
split.

BUT the javascript generates errors. Does anyone have any idea why this
might happen?

ANY help is much appreciated.

--
Adam Wilson
__
Webmaster
123Doc Ltd
www.123doc.com



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




RE: [PHP] Possible bug with PHP v4.1.1 and bits?

2003-01-03 Thread Ford, Mike [LSS]
-Original Message-
From: Daevid Vincent
To: [EMAIL PROTECTED]

echo action = .$_POST[action].BR;
if ($_POST[action] == 1 || $_POST[action] == 0)
  echo = UPDATE Company SET Enabled = .!(intval($_POST[action])).
WHERE CompanyID = $id;

I cannot figure out how to simply make the 0 and 1 invert or negate or
toggle as it were.
--

echo = UPDATE Company SET Enabled = .(1-$_POST[action]) ...

Cheers!

Mike

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




Re: [PHP] ImageCreateFromPNG

2003-01-03 Thread Michael J. Pawlowsky
Oops...  thought you wanted them to upload a file...


So here something else...  just modify it to your needs
It' the code to the URL I sent you...



?php

header(Content-type: image/gif);

// Define some constants here (I know they are vars)
$imagewidth = 400;
$imageheight = 400;

$img = imagecreate($imagewidth, $imageheight);

// Let's define some colours
$white = ImageColorAllocate($img, 255, 255, 255);
$blue = ImageColorAllocate($img, 0, 0, 255);
$black = ImageColorAllocate($img, 0, 0, 0);
$grey = imagecolorallocate($img, 128,128,128);
$navy = imagecolorallocate($img, 0,0,128);

// Define patterns (Styles)
$dash=array($white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$white,$grey,$grey,$grey,$grey,$grey,$grey,$grey,$grey,$grey,$grey,$grey,$grey,$grey,$grey,$grey);

// Define bit map font
$run0 = imageloadfont(/var/sites/rconline.ca/web/wind/run0.gdf);
$run180 =   imageloadfont(/var/sites/rconline.ca/web/wind/run180.gdf);

//---
// Ready to go -- Lets create an image
//---


// Draw the runway
imagefilledrectangle ($img, 150, 0, 250, 400, $black);
imagefilledrectangle ($img, 154, 4, 246, 396, $grey);


//Add the wind speeds
ImageString($img, 5, 178, 185, Hello, $blue);

Imagegif($img);
//  Imagejpeg($img);
ImageDestroy($img);

?












*** REPLY SEPARATOR  ***

On 03/01/2003 at 11:58 AM Michael Weiner wrote:

Does someone have a script of php function or page that has this code
working that i can review? I am wanting to create a webpage that will
let a user enter in an image name (i.e. a png or whatever) and have php
create an image from that...

Thanks in advance
Michael Weiner


--
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] PHP intereferes with my Javascript

2003-01-03 Thread Michael J. Pawlowsky
It's not because of the splitting up...

Because the browser does not even know about that.


Save both files to disk and do a diff on them.  I bet there will be a few lines...


Mike




*** REPLY SEPARATOR  ***

On 03/01/2003 at 5:21 PM Adam Wilson wrote:

I posted just before, i think i'll try again and re-word...

I have split a page up into three sections, header, content and footer.
Header and footer are included in content via PHP. Header contains
Javascript functions. Content and header both call the javascript
functions.
When i look at the source generated it looks exactly like before it was
split.

BUT the javascript generates errors. Does anyone have any idea why this
might happen?

ANY help is much appreciated.

--
Adam Wilson
__
Webmaster
123Doc Ltd
www.123doc.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] PHP intereferes with my Javascript

2003-01-03 Thread Ford, Mike [LSS]
-Original Message-
From: Adam Wilson
To: [EMAIL PROTECTED]

I have split a page up into three sections, header, content and footer.
Header and footer are included in content via PHP. Header contains
Javascript functions. Content and header both call the javascript
functions.
When i look at the source generated it looks exactly like before it was
split.

BUT the javascript generates errors. Does anyone have any idea why this
might happen?
--

If you're absolutely sure the generated source is completely identical, then no I have 
no idea -- what you are doing is exactly how I generate the majority of my pages, and 
it works fine.

You really need to relate the JavaScript errors back to the source as displayed by 
your browser, work out why that page as displayed generates that error (not always 
easy in itself!), and then work out why your script generates the erroneous output.  
I've been through this process a couple of times, and it can sometimes be quite 
painful...!

If you've got a decent file comparator handy, it might be worth flinging your original 
static page and a Save As of the generated page at it, to see if it detects anything 
your human eye failed to!!

Cheers!

Mike

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




Re: [PHP] ImageCreateFromPNG

2003-01-03 Thread R'twick Niceorgaw
I have something that I use to create simple buttons. I use the command line
interface version of php to create the buttons offline. However, the
function can also be used on an web application easily.
I am creating the image with fixed height and width, you can change it by
using $i_width and $i_height variables in call to ImageCreate /
ImageRectangle/ImageFtText function.

Change it as you like.  One thing, is the fontfile has to be an absolute
file path.

HTH
-R'twick

Code ---
#!/usr/local/bin/php-cli
?php
function create_image($string,$name) {
$pointsize = 15;
$fontfile = /usr/local/fonts/arial.ttf;
$imagefile=$name..png;

$string_size = ImageFtBbox($pointsize, 0, $fontfile, $string,
array(linespacing = 1));
$s_width = $string_size[4];
$s_height = $string_size[5];
$i_width = $s_width+2;
$i_height = -1 * $s_height+2;

$im = imagecreate(115, 22);
$white = imagecolorallocate ($im, 255, 255, 255);
$black = imagecolorallocate ($im,   0,0  ,0);
ImageRectangle ( $im, 0,0, 114, 21,$black);

ImageFtText($im, $pointsize, 0, (122 - $s_width)/2 - 1, 22-(22+$s_height)/2,
$black, $fontfile, $string, array(linespacing = 1));

ImagePNG ($im,$imagefile);
ImageDestroy ($im);
}
if ($argc 3) {

echo usage: . $argv[0]. text filename\n;
exit (-1);
}
create_image ($argv[1],$argv[2]);
?
 End
Code ---
- Original Message -
From: Michael Weiner [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, January 03, 2003 11:58 AM
Subject: [PHP] ImageCreateFromPNG


 Does someone have a script of php function or page that has this code
 working that i can review? I am wanting to create a webpage that will
 let a user enter in an image name (i.e. a png or whatever) and have php
 create an image from that...

 Thanks in advance
 Michael Weiner


 --
 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] PHP intereferes with my Javascript

2003-01-03 Thread Khalid El-Kary
two problemes here, off-topic, and i didn't see the code to figure out the 
error

but maybe you forgot to remove the htmlhead... parts from each include 
except the header?

regards,
Khalid Al-Kary


I posted just before, i think i'll try again and re-word...

I have split a page up into three sections, header, content and footer.
Header and footer are included in content via PHP. Header contains
Javascript functions. Content and header both call the javascript 
functions.
When i look at the source generated it looks exactly like before it was
split.

BUT the javascript generates errors. Does anyone have any idea why this
might happen?

ANY help is much appreciated.

--
Adam Wilson
__
Webmaster
123Doc Ltd
www.123doc.com



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

_
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail


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



Re: [PHP] PHP intereferes with my Javascript

2003-01-03 Thread Steve Keller
At 1/3/2003 05:21 PM, you wrote:


I have split a page up into three sections, header, content and footer.
Header and footer are included in content via PHP. Header contains
Javascript functions. Content and header both call the javascript functions.
When i look at the source generated it looks exactly like before it was
split.

BUT the javascript generates errors. Does anyone have any idea why this
might happen?


When you include these headers, are all the files that are accessing them 
in the same directory? Are your references in your javascripts absolute or 
relative? If they're relative, and you change directories, the code breaks.

But again, I haven't seen the code so I can't say.
--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org


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



Re: [PHP] Baffling output

2003-01-03 Thread Steve Keller
At 1/3/2003 12:25 AM, Lightfirst wrote:

Can someone explain to me why the loop that counts to 99 appears before the
5 by 5 grid in the following php code?

Yes.

## else {
## 	echo td align=\center\ valign=\middle\ width=\15%\ 
height=\77\ border=\1\ bordercolor=\#00\;
## 	echo div align=\center\font size=\1\/font/div;
## 	echo Hello ; $i++;
## } //for else

You start the TD tags, but whenever your conditional echoes Hello, 
you're not echoing the /TD. And when you come out of your loop, you never 
close your TABLE tag. I hope you also realize that you're opening and 
closing that DIV and FONT without putting the Hello inside of it.

Here's a good tip someone gave me when I first started learning PHP: when 
you're dealing with HTML, it's a good idea to use \n at the end of your 
echoed lines and \t's at the beginnings to create staggered indentations, 
this makes it a little easier to read when you're testing the output.

For example, try running this version of your code:

?php
echo table border=\1\ align=\center\ width=\100%\ 
bgcolor=\#FF\ bordercolor=\#FF\\n\ttr\n;
for ($r=0; $r5; $r++){
	for ($c=0; $c7; $c++){
		if ($c==0 || $c%7==0)
			echo \t\ttd align=\center\ valign=\middle\ width=\15%\ 
height=\77\ bordercolor=\#00\/td\n;
			else if ($c%6==0)
			echo \t\ttd align=\center\ valign=\middle\ width=\14%\ 
height=\77\ bordercolor=\#00\/td\n\t/tr\n\ttr\n;
   else {
			echo \t\ttd align=\center\ valign=\middle\ width=\15%\ 
height=\77\ border=\1\ bordercolor=\#00\\n;
			echo \t\t\tdiv align=\center\font size=\1\;
			echo Hello ; $i++;
			echo /font/div\n\t\t/td\n;
  } //for else
   }// for loop c
} //for loop r
echo \t/tr\n/table\n\n;
for ($i=1; $i100; $i++)
	echo $ibr\n;
?

Hope this answers some of your questions.
--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org


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



RE: [PHP] Recommend payment processors?

2003-01-03 Thread Chad Day
Paypal is not an option for reasons I won't begin to get into.  I'm sure
someone is using something solid out there ..

-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 11:36 AM
To: php general
Subject: Re: [PHP] Recommend payment processors?


I use PayPal.  Does not require a merchant account.  PHP payment interface
and interaction is easy
to implement.  Via HTML in your webpage, you pass to PayPal the URL of the
PHP script to be executed
when a payment is received.

- Original Message -
From: Chad Day [EMAIL PROTECTED]
To: php general [EMAIL PROTECTED]
Sent: Friday, January 03, 2003 10:14 AM
Subject: [PHP] Recommend payment processors?


Just wondering what people are using/recommend out there.. I'm going to be
getting a merchant account and let people purchase services through my
website on a secure server, all in PHP.  What concerns me is this archived
post I came across:

http://marc.theaimsgroup.com/?l=php-generalm=102165623600464w=2

Reading that, it sounds like it's not possible to use Payment Pro, or
possibly other systems, with PHP .. is this correct?  Some of the other
posts in the archive sounded like people were using it, so I'm not really
sure what is possible at this point.

Thanks,
Chad


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




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



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




[PHP] PEAR extension (mailparse) not working

2003-01-03 Thread Jeff Schwartz

I've just upgraded to PHP 4.3.0 and am unable to get the PEAR extension mailparse to 
work. I've installed mailparse via PEAR but PHP doesn't seem to see it. It doesn't 
show up in phpinfo().

What do I need to do to activate it?

Thanks,

Jeff

 



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


[PHP] Session Question

2003-01-03 Thread ed

 Does php use cookies for sessions even if you don't explicitly use cookie
functions to save session data server side?

TIA,

Ed



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




Re: [PHP] File Modification Date/Time

2003-01-03 Thread Christopher J. Crane
Doyou know how to compare time. I would like to get the difference in time
from now to when the file was last accessed.

I was thinking something like this:
?PHP
$DirToCheck = tempdata/;
echo $Nowbrbr\n;
$TimeNow = time();
if ($handle = opendir($DirToCheck)) {
while (false !== ($file = readdir($handle))) {
  $FileTimeUnix = fileatime($DirToCheck . $file);
  $TimeDiff = $TimeNow - $FileTimeUnix;
echo nbsp;nbsp;$file - Last accessed:  . date(F d Y H:i:s.,
fileatime($DirToCheck . $file)) .  - $TimeDiffbr\n;
   if($TimeDiff  1) { unlink($DirToCheck . $file); }
  $TimeDiff = 0;
 }
closedir($handle);
 }
?

Marek Kilimajer [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 you must prepend $DirToCheck to $file:

 filemtime($DirToCheck . $file)



 Christopher J. Crane wrote:

 I am trying to parse through a directory and get the modification dates
of
 the file.
 
 ?PHP
 $DirToCheck = tempdata/;
 if ($handle = opendir($DirToCheck)) {
 while (false !== ($file = readdir($handle))) {
 echo nbsp;nbsp;$file - Last Modified:  . date(F d Y H:i:s.,
 filemtime($file)) . br\n;
  }
 closedir($handle);
  }
 ?
 
 All the files are coming back with a date of December 31 1969 19:00:00.
What
 am I doing wrong? The next step is I want to check if the file is older
than
 30 minutes and if so, I want to delete it. How would I go about that?
 
 
 
 
 
 




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




Re[2]: [PHP] Possible bug with PHP v4.1.1 and bits?

2003-01-03 Thread Tom Rogers
Hi,

Saturday, January 4, 2003, 3:23:37 AM, you wrote:
FML -Original Message-
FML From: Daevid Vincent
FML To: [EMAIL PROTECTED]

FML echo action = .$_POST[action].BR;
FML if ($_POST[action] == 1 || $_POST[action] == 0)
FML   echo = UPDATE Company SET Enabled = .!(intval($_POST[action])).
FML WHERE CompanyID = $id;

FML I cannot figure out how to simply make the 0 and 1 invert or negate or
FML toggle as it were.
FML --

FML echo = UPDATE Company SET Enabled = .(1-$_POST[action]) ...

FML Cheers!

FML Mike

In mysql you can use the invert (tilde)operator like this:

select 5  ~1 returns 4 so you could do

UPDATE Company SET Enabled = (Enabled  ~1)   which will toggle bit 1 of
Enabled.

(Untested :)



-- 
regards,
Tom


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




RE: [PHP] Baffling output

2003-01-03 Thread Ford, Mike [LSS]
-Original Message-
From: Steve Keller
To: [EMAIL PROTECTED]

At 1/3/2003 12:25 AM, Lightfirst wrote:

Can someone explain to me why the loop that counts to 99 appears before
the
5 by 5 grid in the following php code?

Yes.

## else {
##  echo td align=\center\ valign=\middle\ width=\15%\ 
height=\77\ border=\1\ bordercolor=\#00\;
##  echo div align=\center\font size=\1\/font/div;
##  echo Hello ; $i++;
## } //for else

You start the TD tags, but whenever your conditional echoes Hello, 
you're not echoing the /TD. And when you come out of your loop, you
never 
close your TABLE tag. I hope you also realize that you're opening and 
closing that DIV and FONT without putting the Hello inside of it.

Here's a good tip someone gave me when I first started learning PHP:
when 
you're dealing with HTML, it's a good idea to use \n at the end of your 
echoed lines and \t's at the beginnings to create staggered
indentations, 
this makes it a little easier to read when you're testing the output.
--

When you have large blocks of (almost) pure HTML like this, I usually reckon
it's a better bet still to jump out of PHP mode completely, and just write
your HTML inline -- then it's *much* easier to see if it's malformed!

A couple of other observations:

* In if ($c==0 || $c%7==0), the first test is completely redundant, since
0 % anything == 0

* Most of your td tag is the same in all three branches, so I'd strip that
out and echo it before the first if.

* Speaking purely personally here, but whenever I see PHP code full of
comments explaining what all its closing }s are for, I wonder why on earth
the author doesn't just get into using the :-style syntax for block
structures.

So my take on this would go something like:

table border=1 align=center width=100% bgcolor=#FF
bordercolor=#FF
  tr
  ?php
  for ($r=0; $r5; $r++):
for ($c=0; $c7; $c++):
?
td align=center valign=middle height=77 bordercolor=#00
width=?php
  if ($c%7==0):
?15%/td
  ?php
  elseif ($c%6==0):
?14%/td
  /tr
  tr
  ?php
  else:
?15% border=1
  div align=centerfont size=1
Hello ?php echo $i++ ?/font/div
/td
  ?php
  endif; // ($c)
endfor; // ($c)
  endfor; // ($r)
  ?
  /tr
/table

?php
for ($i=1; $i100; $i++):
  echo $ibr\n;
endfor;
?

Yes, it is a slightly different way of thinking to code like this, and it
may not suit you -- but I find it more convenient for pages that have a
largish percentage of actual HTML on them.  (And if you have an editor that
can do syntax highlighting in different ranges of colours for HTML and PHP,
it makes it really easy to pick one out from the other, and especially to
follow their separate logic structures.)

Cheers!

Mike

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




Re: [PHP] Session Question

2003-01-03 Thread Kevin Stone
In most cases, Yes.   Calling session_start() for the first time sets a
cookie on the client's computer containing the session id.  At the same time
the function creates a matching session file on the server.  You register
whatever variables you want to this file so that when you call
session_start() on another page it looks for the cookie, retrieves the
session id, and makes the associated variables in the file available to your
script.

I suggest you read the manual.  It's all there...
http://www.php.net/manual/en/ref.session.php

-Kevin

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 03, 2003 11:10 AM
Subject: [PHP] Session Question



  Does php use cookies for sessions even if you don't explicitly use cookie
 functions to save session data server side?

 TIA,

 Ed



 --
 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] Session Question

2003-01-03 Thread Ford, Mike [LSS]
-Original Message-
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]

 Does php use cookies for sessions even if you don't explicitly use
cookie
functions to save session data server side?
--

That question doesn't even make sense to me -- cookie functions can't save
data server side, for one thing!  Can you try to explain exactly what it is
you're trying to find out?

Cheers!

Mike

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




Re: [PHP] Baffling output

2003-01-03 Thread Chris Shiflett
--- Steve Keller [EMAIL PROTECTED] wrote:
 Here's a good tip someone gave me when I first started
 learning PHP: when you're dealing with HTML, it's a good
 idea to use \n at the end of your echoed lines and \t's
 at the beginnings to create staggered indentations,
 this makes it a little easier to read when you're
 testing the output.

Proper HTML formatting is a great suggestion. Many novices
write broken tables, simply because their markup is too
sloppy for them to notice their errors.

Aside from using \n and \t in your echo statements,
consider that you can also switch in/out of PHP mode as
appropriate. In many cases, there is very little (or no)
dymanic data in your output, so it may be better just to
write it in HTML. For example, consider this in lieu of
your code snippet:

else
{
?
  td align=center width=15%Hello/td
?
   $i++;
}

instead of:

else {
echo td align=\center\ valign=\middle\ width=\15%\

height=\77\ border=\1\ bordercolor=\#00\;
echo div align=\center\font
size=\1\/font/div;
echo Hello ; $i++;
} //for else

Not only is this much easier to read, it also would have
helped you notice the missing /td tag that Steve pointed
out for you.

Chris

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




RE: [PHP] Session Question

2003-01-03 Thread ed

 Sorry I didn't make myself more clear. I only want to use server side
sessions. I don't want to have to rely on a client having cookies enabled
in their browser. So far having trans_sid is just doing the trick. I can
save values into sessions server side and not explicitly create a client
side cookie with any values to retrieve the information.

Thanks again,

Ed


On Fri, 3 Jan 2003, Ford, Mike   [LSS] wrote:

 -Original Message-
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 
  Does php use cookies for sessions even if you don't explicitly use
 cookie
 functions to save session data server side?
 --
 
 That question doesn't even make sense to me -- cookie functions can't save
 data server side, for one thing!  Can you try to explain exactly what it is
 you're trying to find out?
 
 Cheers!
 
 Mike
 


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




RE: [PHP] Session Question

2003-01-03 Thread Michael J. Pawlowsky


I use both...  and the way I see PHP handling it is like this...

First call in it will add the SESSID to the hrefs.
Next call (page load) if it finds the cookie it will not append SESSID to URL.
However if it doesn't it will.

There are a few instance were I need to get the SESSION ID and append them myself.

Redirects are a good example you need to add it yourself.

header(Location: http://mysite.org/index.php?PHPSESSID=$sid;);


Cheers,
Mike

P.S. This is just from my obeservation






*** REPLY SEPARATOR  ***

On 03/01/2003 at 1:52 PM [EMAIL PROTECTED] wrote:

Sorry I didn't make myself more clear. I only want to use server side
sessions. I don't want to have to rely on a client having cookies enabled
in their browser. So far having trans_sid is just doing the trick. I can
save values into sessions server side and not explicitly create a client
side cookie with any values to retrieve the information.

Thanks again,

Ed


On Fri, 3 Jan 2003, Ford, Mike   [LSS] wrote:

 -Original Message-
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]

  Does php use cookies for sessions even if you don't explicitly use
 cookie
 functions to save session data server side?
 --

 That question doesn't even make sense to me -- cookie functions can't
save
 data server side, for one thing!  Can you try to explain exactly what it
is
 you're trying to find out?

 Cheers!

 Mike



--
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] Variables that persist through reload?

2003-01-03 Thread David Chamberlin
Hey,

I'm somewhat new to PHP and I'm doing a lot of forms stuff.  Looking at 
some of the examples at:

http://www.linuxguruz.org/z.php?id=33

The variables seem to persist through a reload.  For example, the first 
demo has:


?
if (!isset($pick)) {
echo Fill out and submit the form below.; }
else {
$j = count($pick);
for($i=0; $i$j; $i++) {
echo Pick b$pick[$i]/b is Checkedbr /; }
}
?

form action=? echo $PHP_SELF; ?
ol
liPaintinginput name=pick[] type=checkbox value=Painting //li
liPlumbinginput name=pick[] type=checkbox value=Plumbing //li
liElectricinput name=pick[] type=checkbox value=Electric //li
/ol

input type=submit value=Submit! /
input type=reset value=Reset /
/form


So the $pick variable is maitained through the submit.  When I demo the 
script on that site, it works as advertised.  When I use the same code 
on my web server, it doesn't work ($pick is never set after submitting). 
  Is there some configuration option that dictates whether variables 
persist in this manner?

Thanks,
Dave


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



Re: [PHP] Variables that persist through reload?

2003-01-03 Thread Joseph W. Goff
Your local version does not have register_globals turned on in php.ini.
You can either set the value = on or access posted values by using $_POST or
$HTTP_POST_VARS depending on your version of php.
- Original Message -
From: David Chamberlin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 03, 2003 1:58 PM
Subject: [PHP] Variables that persist through reload?


 Hey,

 I'm somewhat new to PHP and I'm doing a lot of forms stuff.  Looking at
 some of the examples at:

 http://www.linuxguruz.org/z.php?id=33

 The variables seem to persist through a reload.  For example, the first
 demo has:

 
 ?
 if (!isset($pick)) {
 echo Fill out and submit the form below.; }
 else {
 $j = count($pick);
 for($i=0; $i$j; $i++) {
 echo Pick b$pick[$i]/b is Checkedbr /; }
 }
 ?

 form action=? echo $PHP_SELF; ?
 ol
 liPaintinginput name=pick[] type=checkbox value=Painting //li
 liPlumbinginput name=pick[] type=checkbox value=Plumbing //li
 liElectricinput name=pick[] type=checkbox value=Electric //li
 /ol

 input type=submit value=Submit! /
 input type=reset value=Reset /
 /form
 

 So the $pick variable is maitained through the submit.  When I demo the
 script on that site, it works as advertised.  When I use the same code
 on my web server, it doesn't work ($pick is never set after submitting).
Is there some configuration option that dictates whether variables
 persist in this manner?

 Thanks,
 Dave


 --
 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] Variables that persist through reload?

2003-01-03 Thread Kevin Stone
That's just the browser's cache, nothing to do with PHP.  Not all browsers
will cache succesfully.  If you want to guarentee that variables will be
stored for later retrieval (or for repopulating a form)  then you need to
use sessions or store the content of the variables in a database.

-Kevin

- Original Message -
From: David Chamberlin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 03, 2003 12:58 PM
Subject: [PHP] Variables that persist through reload?


 Hey,

 I'm somewhat new to PHP and I'm doing a lot of forms stuff.  Looking at
 some of the examples at:

 http://www.linuxguruz.org/z.php?id=33

 The variables seem to persist through a reload.  For example, the first
 demo has:

 
 ?
 if (!isset($pick)) {
 echo Fill out and submit the form below.; }
 else {
 $j = count($pick);
 for($i=0; $i$j; $i++) {
 echo Pick b$pick[$i]/b is Checkedbr /; }
 }
 ?

 form action=? echo $PHP_SELF; ?
 ol
 liPaintinginput name=pick[] type=checkbox value=Painting //li
 liPlumbinginput name=pick[] type=checkbox value=Plumbing //li
 liElectricinput name=pick[] type=checkbox value=Electric //li
 /ol

 input type=submit value=Submit! /
 input type=reset value=Reset /
 /form
 

 So the $pick variable is maitained through the submit.  When I demo the
 script on that site, it works as advertised.  When I use the same code
 on my web server, it doesn't work ($pick is never set after submitting).
Is there some configuration option that dictates whether variables
 persist in this manner?

 Thanks,
 Dave


 --
 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] Variables that persist through reload?

2003-01-03 Thread Kevin Stone
Woops.. sorry I missed the crux of your post.  I didn't read all the way
down.  :)
-Kevin

- Original Message -
From: Kevin Stone [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; David Chamberlin [EMAIL PROTECTED]
Sent: Friday, January 03, 2003 1:18 PM
Subject: Re: [PHP] Variables that persist through reload?


 That's just the browser's cache, nothing to do with PHP.  Not all browsers
 will cache succesfully.  If you want to guarentee that variables will be
 stored for later retrieval (or for repopulating a form)  then you need to
 use sessions or store the content of the variables in a database.

 -Kevin

 - Original Message -
 From: David Chamberlin [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, January 03, 2003 12:58 PM
 Subject: [PHP] Variables that persist through reload?


  Hey,
 
  I'm somewhat new to PHP and I'm doing a lot of forms stuff.  Looking at
  some of the examples at:
 
  http://www.linuxguruz.org/z.php?id=33
 
  The variables seem to persist through a reload.  For example, the first
  demo has:
 
  
  ?
  if (!isset($pick)) {
  echo Fill out and submit the form below.; }
  else {
  $j = count($pick);
  for($i=0; $i$j; $i++) {
  echo Pick b$pick[$i]/b is Checkedbr /; }
  }
  ?
 
  form action=? echo $PHP_SELF; ?
  ol
  liPaintinginput name=pick[] type=checkbox value=Painting //li
  liPlumbinginput name=pick[] type=checkbox value=Plumbing //li
  liElectricinput name=pick[] type=checkbox value=Electric //li
  /ol
 
  input type=submit value=Submit! /
  input type=reset value=Reset /
  /form
  
 
  So the $pick variable is maitained through the submit.  When I demo the
  script on that site, it works as advertised.  When I use the same code
  on my web server, it doesn't work ($pick is never set after submitting).
 Is there some configuration option that dictates whether variables
  persist in this manner?
 
  Thanks,
  Dave
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 



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





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




Re: [PHP] Variables that persist through reload?

2003-01-03 Thread David Chamberlin
Ahhh.that explains it.  Just read up on register_globals.  I 
understand now.

To make the script work with register_globals off I can just do:

$pick = $_GET['pick'];

And then the rest works.  Thanks!

-Dave

Joseph W. Goff wrote:
Your local version does not have register_globals turned on in php.ini.
You can either set the value = on or access posted values by using $_POST or
$HTTP_POST_VARS depending on your version of php.
- Original Message -
From: David Chamberlin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 03, 2003 1:58 PM
Subject: [PHP] Variables that persist through reload?




Hey,

I'm somewhat new to PHP and I'm doing a lot of forms stuff.  Looking at
some of the examples at:

http://www.linuxguruz.org/z.php?id=33

The variables seem to persist through a reload.  For example, the first
demo has:


?
if (!isset($pick)) {
echo Fill out and submit the form below.; }
else {
$j = count($pick);
for($i=0; $i$j; $i++) {
echo Pick b$pick[$i]/b is Checkedbr /; }
}
?

form action=? echo $PHP_SELF; ?
ol
liPaintinginput name=pick[] type=checkbox value=Painting //li
liPlumbinginput name=pick[] type=checkbox value=Plumbing //li
liElectricinput name=pick[] type=checkbox value=Electric //li
/ol

input type=submit value=Submit! /
input type=reset value=Reset /
/form


So the $pick variable is maitained through the submit.  When I demo the
script on that site, it works as advertised.  When I use the same code
on my web server, it doesn't work ($pick is never set after submitting).
  Is there some configuration option that dictates whether variables
persist in this manner?

Thanks,
Dave


--
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] One more form question

2003-01-03 Thread David Chamberlin
OK, last one was answered quickly and successfully (thank you!), so 
here's another one.

Is there an easy way to set something in a select list to be selected? 
Right now I'm doing a real brute-force method.  e.g.,

	echo tdselect name=\disp_address\;
	$choices = array( 'pub' = 'On Public Page',
	   'members' = 'Only on Members Page',
	   'nodisp' = 'Do not Display' );
	foreach ( $choices as $key = $choice ) {
	  $selected = '';
	  if ( strcmp( $key, $member_info-display_address ) == 0 ) {
	$selected = 'selected';
	  }
	  echo option value=\$key\ $selected$choice;
	}
	echo '/select/td';

I've got to imagine there's a better way 

Thanks,
Dave


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



Re: [PHP] One more form question

2003-01-03 Thread Kevin Stone
- Original Message -
From: David Chamberlin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 03, 2003 1:27 PM
Subject: [PHP] One more form question


 OK, last one was answered quickly and successfully (thank you!), so
 here's another one.

 Is there an easy way to set something in a select list to be selected?
 Right now I'm doing a real brute-force method.  e.g.,

 echo tdselect name=\disp_address\;
 $choices = array( 'pub' = 'On Public Page',
'members' = 'Only on Members Page',
'nodisp' = 'Do not Display' );
 foreach ( $choices as $key = $choice ) {
   $selected = '';
   if ( strcmp( $key, $member_info-display_address ) == 0 ) {
 $selected = 'selected';
   }
   echo option value=\$key\ $selected$choice;
 }
 echo '/select/td';

 I've got to imagine there's a better way 

 Thanks,
 Dave

Okay let me take another hack at one of your questions and maybe I won't
screw up this time.  ;-)

PHP has no functional control over the HTML content.  You could make it
easier on yourself by writing a function that outputs 'selected' or null
instead of coding a separate conditional for each form element, but other
than that this is the only way to do it.

-Kevin



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




[PHP] Excel to MySQL

2003-01-03 Thread Joe LoMoglio
Does anyone know of a FREE utility that will export data from an MS 
Excel file and import it to MySQL. I have found a bunch of nice 
utilities, but none of them are FREE. I'm in a bind and have to get 
over 2000 rows imported to my database by morning and don't have to 
order one of the other solutions.

Joe LoMoglio


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



[PHP] Hello and help

2003-01-03 Thread Todd Barr
I am a PHP newbie, and I am having difficulty in getting my records to display

here is my code

?php
$Host=localhost;
$User=us34992a;
$Password=*;
$DBname=db34992a;
$Tablename=calendar;
$Link=mysql_pconnect($Host, $User, $Password)
or die (YOu suck1);
$db=mysql_select_db($DBname, $Link) 
or die (ISUCKEGGS);
$result=mysql_query(SELECT * from calendar, $Link)
or die (YOu suck3);
print(table width=53% border=0 cellpadding=0 cellspacing=0\n);
print (tr\n); 
print (td background=topbig.gif\n);
print (div align=centerfont face=Arial, Helvetica, sans-serifbfont 
color=#FFCalender/font/b/font/div
  /td
/tr\n);
print (tr bgcolor=#009ACE\n);
print(td$result[meeting_name]/td\n)or die (you suck);
mysql_close ($Link);
?

any help?



Re: [PHP] Excel to MySQL

2003-01-03 Thread Richard Baskett
You could export, or save as a tab delimited text file, then go ahead and
use phpMyAdmin or a custom script to pull all that data into the database.
It really shouldn¹t be much of a problem coming from Excel.

Cheers!

Rick

Finish each day and be done with it. You have done what you could; some
blunders and absurdities have crept in; forget them as soon as you can.
Tomorrow is a new day; you shall begin it serenely and with too high a
spirit to be encumbered with your old nonsense. - Ralph Waldo Emerson

 From: Joe LoMoglio [EMAIL PROTECTED]
 Date: Fri, 3 Jan 2003 14:20:02 -0700
 To: [EMAIL PROTECTED]
 Subject: [PHP] Excel to MySQL
 
 Does anyone know of a FREE utility that will export data from an MS
 Excel file and import it to MySQL. I have found a bunch of nice
 utilities, but none of them are FREE. I'm in a bind and have to get
 over 2000 rows imported to my database by morning and don't have to
 order one of the other solutions.
 
 Joe LoMoglio
 
 
 -- 
 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] Excel to MySQL

2003-01-03 Thread Michael J. Pawlowsky
I think BiffWriter might do it...

By why not simply output a comma delimited files from excel and import it in with a 
small php script.

Mike



*** REPLY SEPARATOR  ***

On 03/01/2003 at 2:20 PM Joe LoMoglio wrote:

Does anyone know of a FREE utility that will export data from an MS
Excel file and import it to MySQL. I have found a bunch of nice
utilities, but none of them are FREE. I'm in a bind and have to get
over 2000 rows imported to my database by morning and don't have to
order one of the other solutions.

Joe LoMoglio


--
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] Hello and help

2003-01-03 Thread Richard Baskett
Use this instead:

?php
$Host=localhost;
$User=us34992a;
$Password=*;
$DBname=db34992a;
$Tablename=calendar;
$Link=mysql_pconnect($Host, $User, $Password)
or die (YOu suck1);
$db=mysql_select_db($DBname, $Link)
or die (ISUCKEGGS);
$result=mysql_query(SELECT * from calendar, $Link)
or die (YOu suck3);
print(table width=\53%\ border=\0\ cellpadding=\0\
cellspacing=\0\\n);
print (tr\n); 
print (td background=\topbig.gif\\n);
print (div align=\center\font face=\Arial, Helvetica,
sans-serif\bfont color=\#FF\Calender/font/b/font/div
  /td
/tr\n);
print (tr bgcolor=\#009ACE\\n);
print(td{$result['meeting_name']}/td\n) or die (you suck);
mysql_close ($Link);
?

So basically make sure you escape your double quotes within your print
statements, plus you should use single quotes in your associative array.

Cheers!

Rick

Sir my concern is not whether God is on our side. My great concern is to be
on God's side. - Abraham Lincoln

 From: Todd Barr [EMAIL PROTECTED]
 Date: Fri, 3 Jan 2003 16:32:08 -0800
 To: [EMAIL PROTECTED]
 Subject: [PHP] Hello and help
 
 I am a PHP newbie, and I am having difficulty in getting my records to display
 
 here is my code
 
 ?php
 $Host=localhost;
 $User=us34992a;
 $Password=*;
 $DBname=db34992a;
 $Tablename=calendar;
 $Link=mysql_pconnect($Host, $User, $Password)
 or die (YOu suck1);
 $db=mysql_select_db($DBname, $Link)
 or die (ISUCKEGGS);
 $result=mysql_query(SELECT * from calendar, $Link)
 or die (YOu suck3);
 print(table width=53% border=0 cellpadding=0 cellspacing=0\n);
 print (tr\n);
 print (td background=topbig.gif\n);
 print (div align=centerfont face=Arial, Helvetica, sans-serifbfont
 color=#FFCalender/font/b/font/div
 /td
   /tr\n);
 print (tr bgcolor=#009ACE\n);
 print(td$result[meeting_name]/td\n)or die (you suck);
 mysql_close ($Link);
 ?
 
 any help?
 


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




Re: [PHP] Hello and help

2003-01-03 Thread Joseph W. Goff
You are on the right track, but missed one major thing.
Anytime you want to retrieve information from a database result set you have
to follow 3 basic steps.
1) Connect to the database *you got that one
2) Execute a query *you got that one
3) Retrieve the resultset ***missed this one

See http://www.php.net/mysql_fetch_assoc for the appropriate syntax.


- Original Message -
From: Todd Barr [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 03, 2003 6:32 PM
Subject: [PHP] Hello and help


I am a PHP newbie, and I am having difficulty in getting my records to
display

here is my code

?php
$Host=localhost;
$User=us34992a;
$Password=*;
$DBname=db34992a;
$Tablename=calendar;
$Link=mysql_pconnect($Host, $User, $Password)
or die (YOu suck1);
$db=mysql_select_db($DBname, $Link)
or die (ISUCKEGGS);
$result=mysql_query(SELECT * from calendar, $Link)
or die (YOu suck3);
print(table width=53% border=0 cellpadding=0 cellspacing=0\n);
print (tr\n);
print (td background=topbig.gif\n);
print (div align=centerfont face=Arial, Helvetica,
sans-serifbfont color=#FFCalender/font/b/font/div
  /td
/tr\n);
print (tr bgcolor=#009ACE\n);
print(td$result[meeting_name]/td\n)or die (you suck);
mysql_close ($Link);
?

any help?



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




[PHP] Newbie Help

2003-01-03 Thread Erich Kolb
Does anyone have an example of how to download newsgroup headers from a NNTP
server and insert them into a MySQL DB?



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




[PHP] PHP post size question

2003-01-03 Thread David Jeffress
Hi,

I'm using PHP to implement a contract database for a midrange hospital.  I'm
having trouble configuring (I assume) the post_max_size and
upload_max_filesize to allow for pdf's to be uploaded.

Presently, these are set to 1008M and 1006M respectively, and a file of size
620K still gives me a 413 Error - Request Entity Too Large.

Are there any other settings that I need to look at in order to make this
work?  All of the other basic settings are in place (IE, file_uploads = on
etc)

Any help would be greatly appreciated.

Thanks,
David M. Jeffress
[EMAIL PROTECTED]



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




Re: [PHP] include/require vs performance

2003-01-03 Thread R . Z .
Sorry if this was not 100% clear. In a nutshell the app I'm making will 
be available for poeple to use. My feeling is that there will be users 
using shared servers, which under a stress tend to suck. The only thing 
in this one I'm doing that;s new to me is having some 20 includes loaded 
as I need them, sometimes up to 10 at a time, hence the concern.

Thanks for all your responses, I got enough info to go on. ANother words, 
this should not be a problem.

R

http://sourceforge.net/projects/athena-research

 Is there, was there ever issue around including a lot files via
 include(). I am running things on a local server so it's hard to gauge.

I don't understand that comment.  includes/requires are always (well
nearly anyway) local to the server regardless of where the request is
coming from.  So if you have a test box and it is fast enough for you,
then go with it.

-Rasmus

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


___
Radoslaw Zajkowski
http://www.finalbanana.com


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




Re: [PHP] PHP post size question

2003-01-03 Thread Michael J. Pawlowsky
Did you also set the file size in the HTML input tag?


Also take a look at http://www.phpbuilder.com/columns/florian19991014.php3?page=4



Mike


*** REPLY SEPARATOR  ***

On 03/01/2003 at 4:15 PM David Jeffress wrote:

Hi,

I'm using PHP to implement a contract database for a midrange hospital.
I'm
having trouble configuring (I assume) the post_max_size and
upload_max_filesize to allow for pdf's to be uploaded.

Presently, these are set to 1008M and 1006M respectively, and a file of
size
620K still gives me a 413 Error - Request Entity Too Large.

Are there any other settings that I need to look at in order to make this
work?  All of the other basic settings are in place (IE, file_uploads = on
etc)

Any help would be greatly appreciated.

Thanks,
David M. Jeffress
[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] Create Online Test Program

2003-01-03 Thread Devin Atencio

Dear PHP Users,

I am in the process of trying to create an Online Program that will
give questions and possible answers then score the test. I was wondering
if anyone has done this type of thing already and might be able to give
me some pointers on what the best method of doing this might be?

Devin


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




[PHP] error

2003-01-03 Thread Ysrael Guzmán
 
wFONT size=5FONT size=3FONT face=Courier NewhSPAN
class=887075722-03012003at this error???/SPAN/FONT/FONT/FONT
FONT face=Courier NewSPAN
class=887075722-03012003/SPAN/FONTFONT color=#ffPHP has
encountered an Access Violation at 012B7DE7/FONT/FONT

Ysrael Guzmán Meza

 

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




Re: [PHP] Create Online Test Program

2003-01-03 Thread Michael J. Pawlowsky


I've done a few...  It all depends on how many question and how many answers.
How often will they change.
How many will you have.


Mike



*** REPLY SEPARATOR  ***

On 03/01/2003 at 2:47 PM Devin Atencio wrote:

Dear PHP Users,

I am in the process of trying to create an Online Program that will
give questions and possible answers then score the test. I was wondering
if anyone has done this type of thing already and might be able to give
me some pointers on what the best method of doing this might be?

Devin


--
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] please help me, y have a error

2003-01-03 Thread Ysrael Guzmán
this is the message of the ERROR:
 
 
PHP has encountered an Access Violation at 012B7DE7
 
what this
 

Ysrael Guzmán Meza

 

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




  1   2   >