Re: [PHP] Reducing size of htm output

2005-05-09 Thread Prathaban Mookiah
Oops. Sorry, you are correct. I did not look at the ob_gzhandler. I just 
thought of the ob_start function.

But I remember gz encoding works fine with IE 5. Shouldn't be a problem with 
5.5.

Cheers,

Prathap


-- Original Message ---
From: Rasmus Lerdorf [EMAIL PROTECTED]
To: Prathaban Mookiah [EMAIL PROTECTED]
Cc: Kirsten [EMAIL PROTECTED], php-general@lists.php.net
Sent: Fri, 06 May 2005 14:31:04 -0700
Subject: Re: [PHP] Reducing size of htm output

 Prathaban Mookiah wrote:
  Is it true that ob_start(ob_gzhandler) can cause problems on IE 5.5+?
  
  Since IE any-version is on the client side, it shouldn't cause any 
problems 
  to ob_start(), in that case any other PHP function.
 
 That's not true.  ob_gzhandler is extremely browser-dependant since 
 it needs to check to see if the browser sent an appropriate accept-encoding
 header.  Some of the early IE versions sent accept-encoding: gzip but
 didn't correctly implement it, so you can run into problems if you 
 use ob_gzhandler with certain older browsers.  It is fine for all 
 the recent releases though.
 
 -Rasmus
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
--- End of Original Message ---

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



RE: [PHP] Any alternative to POST method FTP uploads from client computer?

2005-05-09 Thread Richard Lynch
On Sun, May 8, 2005 9:22 pm, Murray @ PlanetThoughtful said:
 As others have suggested, using an ftp client application is one way to
 handle it, however, users being users, the feedback has been Why do we
 need
 to upload the files via an ftp client, *then* go to the web application
 and
 attach the filename to a job entry? Why can't we do it all at once?

Some alternatives to consider:

If you can get them to name their files in some consistent manner, perhaps
you could determine the job entry from their filenames.

So they upload a file names 'job4732.zip' and they are done.  Your PHP
script checks their FTP space for the file, examines the filename, and
knows what job entry to tie it to.

Another possibility is that the content within the file may somehow
indicate what job the file belongs with.

You may even be able to check *both* their filename and the contents, and
have the program cross-check for consistency, and only auto-process the
ones that pass both tests.

If the filenames would be too long perhaps you could have them use some
kind of pre-built directory structure on their desktop where they drop
their files into the right job entry

Then you have a .bat file that runs through the directories and compares
date/time stamps and uploads new files.

There are a lot of possible solutionns, really, but it depends on the work
flow and actual data what's best

Certainly if you can make life easier for them *AND* maintain, or even
improve, accuracy of the data upload and data entry, it's worth some
development time.

Hey, maybe you even install php.exe on their desktops, and write the
synchronization script in PHP :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] setting up browscap.ini with .htaccess

2005-05-09 Thread Ross
I would like to use browscap.ini, I believe you can override the php.ini 
file values with a php_value line in a .htaccess file.

Is this possible? Is so how?

R. 

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



Re: [PHP] payment gateways slightly OT

2005-05-09 Thread Angelo Zanetti
thanks greg, will check them out.

Greg Donald wrote:

On 5/6/05, Angelo Zanetti [EMAIL PROTECTED] wrote:
  

I just want to find out from you which payment gateways you use and what
experiences good and bad have you had with them. I'm looking for a
reliable payment gateway to handle credit card processing



I've coded against Authorize.net (AIM and SIM), Verisign Payflow,
Yourpay, and Linkpoint.

I like Authorize.net the best.  It's very solid, excellent docs and
all.  I use Curl for the AIM method, it's very easy.

I found Yourpay to be the worst.  The api was buggy, the control panel
options were limited, and their 'test' mode leaves much to be desired.


  



Re: [PHP] Between Query (0T)

2005-05-09 Thread Burhan Khalid
Ryan A wrote:
clip
Your looking at something like. For ages between 21 and 23
$Upper = date(m-d-Y, mktime(0,0,0,date(m),date(d),date(y)-22));
$Lower = date(m-d-Y, mktime(0,0,0,date(m),date(d),date(y)-23));
$sql = SELECT field1,field2,field3 FROM `table_name` WHERE `age`
BETWEEN  . $Lower .  AND  . $Upper;
$result = myqsl_query($sql);
etc
Cheers
Richard
/clip
Hey Rich,
Thanks! That is EXACTLY what I was looking for and instead I got around 10
people sending me
a link to the mySql manual's BETWEEN syntax :-)
If you are lucky enough to use MySQL 5 *grin* you can simply do :
SELECT field1,field2 FROM `sometable` WHERE 
TIMESTAMPDIFF(YEAR,NOW(),`age`) = 22

to find all 22 year olds.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Any alternative to POST method FTP uploads from client computer?

2005-05-09 Thread Burhan Khalid
Murray @ PlanetThoughtful wrote:
[ snipped ]
when u upload it name it dynamiccaly by appending date and time before
the file name
like this
2005050501010-filename.jpg

Hi, yes, I'm already doing this. Conflict of filename isn't my issue -- it's
whether or not the file should be uploaded at all, in the first place.
The difficulty being that you can't examine the file until *after* it has
been uploaded.
As others have suggested, using an ftp client application is one way to
handle it, however, users being users, the feedback has been Why do we need
to upload the files via an ftp client, *then* go to the web application and
attach the filename to a job entry? Why can't we do it all at once?
The answer being, Well, you can, but I bet you're going to be even more
annoyed when you've uploaded a huge file via the web application using the
POST upload method, only to find that the file is already there. Serves you
right for having too many stakeholders in uploading the files, dunnit?
Here is one thing you can try.  Create a button that (using javascript) 
passes the name of the file to another script -- which then scans your 
files directory to see if the file exists already. If it does, it 
submits an alert or some other indication.

You will have to standardize on the file time. I would suggest that you 
only use the file's meta-data on the server so that users can check when 
the file was last updated on the server, not on their boxes.  Some other 
information (like last uploaded by) would also be helpful from a user's 
standpoint.

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


Re: [PHP] sort by date

2005-05-09 Thread William Stokes
Thanks Richard.

That did the trick. Now to the DB fixing business...

-Will

Richard Lynch [EMAIL PROTECTED] kirjoitti 
viestissä:[EMAIL PROTECTED]
 On Thu, May 5, 2005 10:42 pm, William Stokes said:
 I made a mistake and stored date information to DB as varchar values
 (dd.mm.yyy). When I read the DB is it still possible to sort the data by
 date with SQL query (ORDER BY date ASC)? Or is it nessessary to have the
 date information to be stored as a date in the DB? Will it work or is the
 output going to be sorted randomly?

 As noted, your best solution is to fix the database.

 A short-term hack would be to:
 order by substring(your_field, 6, 4), substring(your_Field, 3, 2),
 substring(your_field, 1, 2)

 Read the MySQL manual to check the actual numbers for substring in MySQL

 -- 
 Like Music?
 http://l-i-e.com/artists.htm 

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



RE: [PHP] I'm having a blond moment with a while loop???

2005-05-09 Thread Mark Rees


-Original Message-
From: George Pitcher [mailto:[EMAIL PROTECTED] 
Sent: 08 May 2005 11:56
To: php-general@lists.php.net
Subject: [PHP] I'm having a blond moment with a while loop???


Hi guys,

I'm doing something dumb but I can't see it.

The basic premise is:

sql search of orders sorted by customer
set g_customer_id to ''
loop through resultset
  if customer_id not same as last record's customer_id (g_customer_id)
get customer email details
set up message header if this is the first record for a customer
set item details
  else
set item details
-
Try moving the next line to below send email, It would be easier to
help if you posted your code.

set g_customer_id to customer_id

-
  endif
  send email
end loop

The problem is that as a sample I have two records from one demo
customer
(me) and I can only get my email to handle one record - either sending
separate records for each record or one email covering the last record
only

Its as if I should have another inner loop

Any tips

MTIA

George

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

Gamma Global : Suppliers of HPCompaq, IBM, Acer, EPI, APC, Cyclades, D-Link, 
Cisco, Sun Microsystems, 3Com

GAMMA GLOBAL (UK) LTD IS A RECOGNISED 'INVESTOR IN PEOPLE' AND AN 'ISO 9001 
2000' REGISTERED COMPANY

**

CONFIDENTIALITY NOTICE:

This Email is confidential and may also be privileged. If you are not the
intended recipient, please notify the sender IMMEDIATELY; you should not
copy the email or use it for any purpose or disclose its contents to any
other person.

GENERAL STATEMENT:

Any statements made, or intentions expressed in this communication may not
necessarily reflect the view of Gamma Global (UK) Ltd. Be advised that no 
content
herein may be held binding upon Gamma Global (UK) Ltd or any associated company
unless confirmed by the issuance of a formal contractual document or
Purchase Order,  subject to our Terms and Conditions available from 
http://www.gammaglobal.com

EOE

**
**


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



[PHP] need manual reload on Mac client

2005-05-09 Thread Francesco Casalena

Hi,



I've a strange problem on this scenario:



-SERVER MacOs X server w/

Apache's httpd2, MySql Max, PHP5



-CLIENT1 MacOs X w/ Netscape (JS enabled)

-CLIENT2 Linux 2.6 w/ Netscape (JS enabled also)



In a web application, I need to open a JS window

within data came from MySql and processed by PHP.

On CLIENT1 the JS window opens ok, but doesn't

contain the right data, I need a manual reload 

to view them.

On CLIENT2 all works well.

I've seen MySql's log, in both cases queries

are right and done in appropriate time. 

PHP code includes coockie.



Any idea? Should be a browser (or JS) error 

or a PHP for Mac mistake?



Regards, thanks in advance!

Ciao,

Francesco

---
Scegli il tuo dominio preferito e attiva la tua email! Da oggi
l'eMail di superEva e' ancora piu' veloce e ricca di funzioni!
http://webmail.supereva.it/new/
---

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



[PHP] PHP 5, mySQL and Win XP. I NEED HELP

2005-05-09 Thread Rory Browne
Sorry - forgot to CC to list.

Personally I have a feeling that if you take out the :3306, your
script might just work.

I read somewhere that on unix, mysql used a unix socket whenever the
hostname was localhost. On unix localhost:something means that
something is a unix socket, when it would otherwise be a port, so I
think your system may be looking for a file named 3306(which would
just happen to be a socket.

Failing that replace localhost with 127.0.0.1

This is as well of course just a guess, and probably not a very educated one.


On 5/9/05, Richard Lynch [EMAIL PROTECTED] wrote:
 On Sat, May 7, 2005 4:56 am, Deep said:
  Hi,
 
   If you are using localhost, i dont think u need to
  specify the port number. Localhost would be enough.
  Also pls check the user privileges and all in the
  database.
 
  ..Deep..
 
  --- Oscar Andersson [EMAIL PROTECTED]
  wrote:
 
  I have made a instal of the latest mySQL and PHP 5
  on my computer.
  I have made the following changes to my php.ini file
 
  extension=php_mysql.dll
  extension_dir = c:\php\
 
  and i have put the php_mysql. and libmysql.dll in
  c:\php\ and in c:\windows
  to
 
  Now i try this in my php-file
  $con = mysql_connect(localhost:3306, buddy,
  bestbuddy);
 
  I cant connect to mySQL. I dont know what is wrong.
  mySQL listen to port
  3306. I have tried with my IP to. I get this warning
  Warning: mysql_connect() [function.mysql-connect]:
  Too many open links (0)
  in myfilename.php.

 Too many open links sounds to me like you've set up MySQL to only allow X
 connections, and you are trying to open up X+1 connection.

 The 0 would make me guess that X is 0.

 So I'd *GUESS* you have a setting in my.cnf that says to limit number of
 connections to 0, and that means you can't have any connections at all...

 Just a GUESS.

 --
 Like Music?
 http://l-i-e.com/artists.htm

 --
 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] Reducing size of htm output

2005-05-09 Thread Rory Browne
 But I remember gz encoding works fine with IE 5. Shouldn't be a problem with
 5.5.

Did you try downloading the same compressed page twice, and checking
the server logs, to see if it loaded from cache the second time
around?


 
 Cheers,
 
 Prathap
 
 
 -- Original Message ---
 From: Rasmus Lerdorf [EMAIL PROTECTED]
 To: Prathaban Mookiah [EMAIL PROTECTED]
 Cc: Kirsten [EMAIL PROTECTED], php-general@lists.php.net
 Sent: Fri, 06 May 2005 14:31:04 -0700
 Subject: Re: [PHP] Reducing size of htm output
 
  Prathaban Mookiah wrote:
   Is it true that ob_start(ob_gzhandler) can cause problems on IE 5.5+?
   
   Since IE any-version is on the client side, it shouldn't cause any
 problems
   to ob_start(), in that case any other PHP function.
 
  That's not true.  ob_gzhandler is extremely browser-dependant since
  it needs to check to see if the browser sent an appropriate accept-encoding
  header.  Some of the early IE versions sent accept-encoding: gzip but
  didn't correctly implement it, so you can run into problems if you
  use ob_gzhandler with certain older browsers.  It is fine for all
  the recent releases though.
 
  -Rasmus
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 --- End of Original Message ---
 
 --
 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] Reducing size of htm output

2005-05-09 Thread Prathaban Mookiah
I just finished testing what you said. It comes from the cache during the 
second time. But this happens with all the other pages too (the non-
compressed) not only the ones that were returned using ob_gzhandler.

It is the same phenomena with Opera 8 too.

Prathap


-- Original Message ---
From: Rory Browne [EMAIL PROTECTED]
To: Prathaban Mookiah [EMAIL PROTECTED]
Cc: Rasmus Lerdorf [EMAIL PROTECTED], php-general@lists.php.net, 
[EMAIL PROTECTED]
Sent: Mon, 9 May 2005 10:42:52 +0100
Subject: Re: [PHP] Reducing size of htm output

  But I remember gz encoding works fine with IE 5. Shouldn't be a problem 
with
  5.5.
 
 Did you try downloading the same compressed page twice, and checking
 the server logs, to see if it loaded from cache the second time
 around?
 
  
  Cheers,
  
  Prathap
  
  
  -- Original Message ---
  From: Rasmus Lerdorf [EMAIL PROTECTED]
  To: Prathaban Mookiah [EMAIL PROTECTED]
  Cc: Kirsten [EMAIL PROTECTED], php-general@lists.php.net
  Sent: Fri, 06 May 2005 14:31:04 -0700
  Subject: Re: [PHP] Reducing size of htm output
  
   Prathaban Mookiah wrote:
Is it true that ob_start(ob_gzhandler) can cause problems on IE 5.
5+?

Since IE any-version is on the client side, it shouldn't cause any
  problems
to ob_start(), in that case any other PHP function.
  
   That's not true.  ob_gzhandler is extremely browser-dependant since
   it needs to check to see if the browser sent an appropriate accept-
encoding
   header.  Some of the early IE versions sent accept-encoding: gzip but
   didn't correctly implement it, so you can run into problems if you
   use ob_gzhandler with certain older browsers.  It is fine for all
   the recent releases though.
  
   -Rasmus
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  --- End of Original Message ---
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
 
--- End of Original Message ---

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



[PHP] flashPHP Issue

2005-05-09 Thread Khorosh Irani
Hello
Can I get the background color a swf file with php?
Thanks

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



RE: [PHP] need manual reload on Mac client

2005-05-09 Thread Mark Rees


-Original Message-
From: Francesco Casalena [mailto:[EMAIL PROTECTED] 
Sent: 09 May 2005 10:18
To: php-general@lists.php.net
Subject: [PHP] need manual reload on Mac client



Hi,



I've a strange problem on this scenario:



-SERVER MacOs X server w/

Apache's httpd2, MySql Max, PHP5



-CLIENT1 MacOs X w/ Netscape (JS enabled)

-CLIENT2 Linux 2.6 w/ Netscape (JS enabled also)



In a web application, I need to open a JS window

within data came from MySql and processed by PHP.

On CLIENT1 the JS window opens ok, but doesn't

contain the right data, I need a manual reload 

to view them.

On CLIENT2 all works well.

I've seen MySql's log, in both cases queries

are right and done in appropriate time. 

PHP code includes coockie.



Any idea? Should be a browser (or JS) error 

or a PHP for Mac mistake?
--
It's hard to say without any code to look at.

It might be a caching problem - do you see the old data on the Mac? If
so, adjust your browser settings, or if you need this to work reliably,
try giving the window a unique name (use a timestamp or similar).
--


Regards, thanks in advance!

Ciao,

Francesco

---
Scegli il tuo dominio preferito e attiva la tua email! Da oggi l'eMail
di superEva e' ancora piu' veloce e ricca di funzioni!
http://webmail.supereva.it/new/
---

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

Gamma Global : Suppliers of HPCompaq, IBM, Acer, EPI, APC, Cyclades, D-Link, 
Cisco, Sun Microsystems, 3Com

GAMMA GLOBAL (UK) LTD IS A RECOGNISED 'INVESTOR IN PEOPLE' AND AN 'ISO 9001 
2000' REGISTERED COMPANY

**

CONFIDENTIALITY NOTICE:

This Email is confidential and may also be privileged. If you are not the
intended recipient, please notify the sender IMMEDIATELY; you should not
copy the email or use it for any purpose or disclose its contents to any
other person.

GENERAL STATEMENT:

Any statements made, or intentions expressed in this communication may not
necessarily reflect the view of Gamma Global (UK) Ltd. Be advised that no 
content
herein may be held binding upon Gamma Global (UK) Ltd or any associated company
unless confirmed by the issuance of a formal contractual document or
Purchase Order,  subject to our Terms and Conditions available from 
http://www.gammaglobal.com

EOE

**
**


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



Re: [PHP] Between Query (0T)

2005-05-09 Thread Ryan A

On 5/9/2005 9:47:50 AM, Burhan Khalid ([EMAIL PROTECTED]) wrote:
 Ryan A wrote:

  clip

  Your looking at something like. For ages between 21 and 23

 

  $Upper = date(m-d-Y, mktime(0,0,0,date(m),date(d),date(y)-22));

  $Lower = date(m-d-Y, mktime(0,0,0,date(m),date(d),date(y)-23));

 

  $sql =
 SELECT field1,field2,field3 FROM `table_name` WHERE `age`
  BETWEEN  .
 $Lower .  AND  . $Upper;

 

  $result = myqsl_query($sql);

 

  etc

 

  Cheers

  Richard

  /clip


 If you are lucky enough to use MySQL 5 *grin* you can simply do :

 SELECT field1,field2 FROM `sometable` WHERE
 TIMESTAMPDIFF(YEAR,NOW(),`age`) = 22

 to find all 22 year olds.

Hey,
Luck and me? You dont know who you are talking to my friendI am still on
mysql 3.23 not even
4.1  !!!

:-D

Cheers,
Ryan



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.6 - Release Date: 5/6/2005

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



Re: [PHP] Between Query (0T)

2005-05-09 Thread andreja
I am not sure
but maybe something like this is posible

$current_year = date(Y);
$qry = SELECT * FROM
 `table`
 WHERE ($current_year-YEAR(birthday))  BETWEEN 25 AND 26



Matthew Weier O'Phinney [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
* Ryan A [EMAIL PROTECTED] :
 Thanks for replying.

  SELECT * FROM
  `table`
  WHERE `age` BETWEEN 25 AND 26;

 I knew the above, but how do i use it with my date field when i have
 birthdates like this:
 01-01-1969
 and 03-05-1955

 Just like you would in the example above -- only with dates that are
 compliant with your RDBMS, and using the earliest date first. The
 formats you give -- 'MM-DD-' won't work in most RDBMS'; typically
 you go from most general to most specific, e.g. '-MM-DD'. So, using
 the dates you gave:

SELECT * FROM `table` WHERE `age` BETWEEN '1955-03-05' AND 
 '1969-01-01';

 The date fields may be subject to the UNIX epoch; if so, neither of the
 dates above will be valid (epoch started 1970-01-01). Check the manual
 for your RDBMS to see if this is the case.

 Now, based on the OP's original question, about finding all users
 between an age range, one would need to determine the start date and end
 date prior to passing in the SQL. This can easily be done with
 strtotime():

$ages = explode(',', $_GET['ages'], 2); // get the start/end ages
$startDate = date(Y-m-d, strtotime(-$ages[0] years));
$endDate   = date(Y-m-d, strtotime(-$ages[1] years));
$sql = SELECT * FROM `table` WHERE `age` BETWEEN $startDate AND 
 $endDate;

 Hope that helps.

 On 5/8/2005 4:28:44 PM, Andy Pieters ([EMAIL PROTECTED]) wrote:
  On Sunday 08 May 2005 15:20, Ryan A wrote:
   Sorry I know this is OT but I'm hoping someone will still
   help...it should be quite simple :-)
   I have a field in the database called age which is a DATE field.
  
   I also have a webform where the user can select between which ages
   he wants the records shown...
   eg: if he types 23,25 then I should get all results where
   age  =23 and age =25
  
  SELECT * FROM
  `table`
  WHERE `age` BETWEEN 25 AND 26;
 
  You might want to sanitize your input first.
 
  Like using intval() on your input or mysql_escape_string


 -- 
 Matthew Weier O'Phinney   | WEBSITES:
 Webmaster and IT Specialist   | http://www.garden.org
 National Gardening Association| http://www.kidsgardening.com
 802-863-5251 x156 | http://nationalgardenmonth.org
 mailto:[EMAIL PROTECTED] | http://vermontbotanical.org 

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



RE: [PHP] Between Query (0T)

2005-05-09 Thread Kim Madsen
 -Original Message-
 From: Ryan A [mailto:[EMAIL PROTECTED]
 Sent: Monday, May 09, 2005 1:02 PM


 Luck and me? You dont know who you are talking to my friendI am
still
 on
 mysql 3.23 not even
 4.1  !!!

TO_DAYS() works on 3.23 too ;-)

--
Med venlig hilsen / best regards
ComX Networks A/S
Kim Madsen
Systemudvikler/Systemdeveloper

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



[PHP] text with $

2005-05-09 Thread Martín Marqués
I have a text variable that contains $ symbols, that when I pass it out PHP 
thinks that the $ mean that a variable name comes right after.

I tried escaping the $ put with no luck. 

Is there something I can do?

-- 
 09:21:28 up 37 days, 17:45,  1 user,  load average: 2.54, 2.04, 1.50
-
Martín Marqués| select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica  |  DBA, Programador, Administrador
 Universidad Nacional
  del Litoral
-

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



Re: [PHP] payment gateways slightly OT

2005-05-09 Thread Deep
Hi,

 CCavenue is good.
Also try 2checkout.com, but i wont reccomenrd that
because their interface is not that good as
ccavenue's.

..Deeps..

--- Angelo Zanetti [EMAIL PROTECTED] wrote:
 Hi guys,
 
 I just want to find out from you which payment
 gateways you use and what
 experiences good and bad have you had with them. I'm
 looking for a
 reliable payment gateway to handle credit card
 processing
 
 Apologies for the OT post
 
 thanks in advance
 
 -- 
 
 Angelo Zanetti
 Z Logic
 www.zlogic.co.za
 [c] +27 72 441 3355
 [t] +27 21 469 1052
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony

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



Re: [PHP] Between Query (0T)

2005-05-09 Thread Matthew Weier O'Phinney
* [EMAIL PROTECTED] [EMAIL PROTECTED] :
 I am not sure
 but maybe something like this is posible

 $current_year = date(Y);
 $qry = SELECT * FROM
  `table`
  WHERE ($current_year-YEAR(birthday))  BETWEEN 25 AND 26


No -- because this incorrectly identifies somebody born on June 14 as 26
even though today is May 9, and they're still 25.


 Matthew Weier O'Phinney [EMAIL PROTECTED] wrote in message 
 news:[EMAIL PROTECTED]
  * Ryan A [EMAIL PROTECTED] :
   Thanks for replying.
  
SELECT * FROM
`table`
WHERE `age` BETWEEN 25 AND 26;
  
   I knew the above, but how do i use it with my date field when i have
   birthdates like this:
   01-01-1969
   and 03-05-1955

-- 
Matthew Weier O'Phinney   | WEBSITES:
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
mailto:[EMAIL PROTECTED] | http://vermontbotanical.org

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



Re: [PHP] if then else statement not working

2005-05-09 Thread Deep
Hi,

Where are the dollar signs before seatnum, seat1 etc
in the if condition.

..Deeps..

--- Anasta [EMAIL PROTECTED] wrote:
 What am i doing wrong here, the output is always
 'empty'
 
 
 
 
 ?php
  $result = mysql_query(SELECT username FROM users
 WHERE seatnum='seat1') or die(mysql_error());
 
   if (seatnum == seat1) {
 echo username;
 } else {
 echo 'empty';
 }
 ?
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony

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



Re: [PHP] Sending htm as it's being generated

2005-05-09 Thread Brent Baisley
Bottom line is that you can't do it reliably with PHP or anything on 
the server. Different browsers will display content at different times. 
I think Internet Explorer will only display something after it gets a 
certain amount of information (i.e. 18k) or the entire page. I don't 
think any browser displays content if it is between tags. Like an 
open table or something.

As others have mentioned, look into using the AJAX technology and 
javascript to reliably update your page.

On May 8, 2005, at 4:17 PM, Kirsten wrote:
How do I make the browser to display data as it being generated? I've
noticed some websites do this with cgi.
For example:
html
head
titleXXX/title
/head
body
%
$i = 0;
while (true){
  echo p . $i++ . /p;
  sleep(1);
}
%
/body
/html
This scripts does not work: It only shows 0,1,2,3[29] when the 
timeout
limit is reached.
Any ideas?

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

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search  Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] need manual reload on Mac client

2005-05-09 Thread Brent Baisley
I would first look to the browser configuration and your html code. Are 
you using meta tags in your web page like pragma nocache and page 
expiration? If not, then it's really kind of up to the browser if it's 
going to reload the entire page from the server. I know there have been 
issues with Internet Explorer ignoring even the meta tags and http 
directives (maybe only on the Mac).

If it is a server issue, it is most likely the Web Performance Cache 
piece of OS X server. I would turn that off if you are not dealing with 
mainly static content.

But, I would first make sure you have all  the proper html and http 
directives and code. There is a lot of leeway in how browsers act when 
left to there own decisions.

On May 9, 2005, at 5:17 AM, Francesco Casalena wrote:
Hi,
I've a strange problem on this scenario:
-SERVER MacOs X server w/
Apache's httpd2, MySql Max, PHP5
-CLIENT1 MacOs X w/ Netscape (JS enabled)
-CLIENT2 Linux 2.6 w/ Netscape (JS enabled also)
In a web application, I need to open a JS window
within data came from MySql and processed by PHP.
On CLIENT1 the JS window opens ok, but doesn't
contain the right data, I need a manual reload
to view them.
On CLIENT2 all works well.
I've seen MySql's log, in both cases queries
are right and done in appropriate time.
PHP code includes coockie.
Any idea? Should be a browser (or JS) error
or a PHP for Mac mistake?
Regards, thanks in advance!
Ciao,
Francesco
---
Scegli il tuo dominio preferito e attiva la tua email! Da oggi
l'eMail di superEva e' ancora piu' veloce e ricca di funzioni!
http://webmail.supereva.it/new/
---
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search  Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] text with $

2005-05-09 Thread Richard Davey
Hello Martín,

Monday, May 9, 2005, 1:23:45 PM, you wrote:

MM I have a text variable that contains $ symbols, that when I pass it out 
PHP
MM thinks that the $ mean that a variable name comes right after.

MM I tried escaping the $ put with no luck. 

$string = hello\$world;

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 I do not fear computers. I fear the lack of them. - Isaac Asimov

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



Re: [PHP] Question about acessing databases and formatting output

2005-05-09 Thread The Doctor
On Mon, May 09, 2005 at 08:29:34AM +0530, bala chandar wrote:
 On 5/9/05, bala chandar [EMAIL PROTECTED] wrote:
  Hi
  
  On 5/9/05, The Doctor [EMAIL PROTECTED] wrote:
   On Sun, May 08, 2005 at 01:49:08PM -0600, The Doctor wrote:
On Sun, May 08, 2005 at 08:56:25PM +0530, bala chandar wrote:
 On 5/8/05, The Doctor [EMAIL PROTECTED] wrote:
  On Thu, May 05, 2005 at 05:49:38AM -0600, The Doctor wrote:
   On Thu, May 05, 2005 at 10:11:14AM +0530, bala chandar wrote:
hi,
   
On 5/5/05, The Doctor [EMAIL PROTECTED] wrote:
 This is probably easy, but how does
 one access a database, mysql or oracle or postgresql,
 and
 present the data in a tabular format?

 --

   
check out http://in2.php.net/mysql
   
  
   Looks good to me.
  
 
  So far so good except my blobs are appearing as is instead of
  as an interpret item.  What next?
--

 what are you storing in BLOB?

   
First a .tgf and then a jpg.
  
  hey, check out this. this might help you
  
  http://www.zend.com/zend/trick/tricks-sept-2001.php
 
 http://forum.100megswebhosting.com/archive/index.php/t-2971.html
  
   
  
   Is their a way to embed the third column?
  
   And what changes do I need to make to the php code?
  
  
  

Seems to be correct.  Here is what I think:

All the non-blobs are working fine; it is the blobs that are turning up
as text instead of data.  Can you not tell the PHP scripts the following:

if a blob then present the data as binary
else
present the text
endif
?

-- 
Member - Liberal International  
This is [EMAIL PROTECTED]   Ici [EMAIL PROTECTED]
God Queen and country! Beware Anti-Christ rising!
BC, Vote Liberal!!

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



Re: [PHP] text with $

2005-05-09 Thread Andy Pieters
On Monday 09 May 2005 14:23, Martín Marqués wrote:
 I have a text variable that contains $ symbols, that when I pass it out
 PHP thinks that the $ mean that a variable name comes right after.

To include the string symbol in a variable, use the single quotes.

$myvar='this is $$$ test';

Andy
-- 
Registered Linux User Number 379093
-- --BEGIN GEEK CODE BLOCK-
Version: 3.1
GAT/O/E$ d-(---)+ s:(+): a--(-)? C$(+++) UL$ P-(+)++
L+++$ E---(-)@ W++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++)
PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+)
e$@ h++(*) r--++ y--()
-- ---END GEEK CODE BLOCK--
--
Check out these few php utilities that I released
 under the GPL2 and that are meant for use with a 
 php cli binary:
 
 http://www.vlaamse-kern.com/sas/
--

--

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



Re: [PHP] text with $

2005-05-09 Thread =?ISO-8859-1?Q?Victor_Salda=F1a_D=2E?=
On 5/9/05, Martín Marqués martin@bugs.unl.edu.ar wrote:
 I have a text variable that contains $ symbols, that when I pass it out PHP
 thinks that the $ mean that a variable name comes right after.
 
 I tried escaping the $ put with no luck.
 
 Is there something I can do?

$var = 'hi $there';

-- 
Victor Saldaña D.
User #330054 counter.li.org

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



Re: [PHP] text with $

2005-05-09 Thread Petar Nedyalkov
On Monday 09 May 2005 15:23, Martín Marqués wrote:
 I have a text variable that contains $ symbols, that when I pass it out
 PHP thinks that the $ mean that a variable name comes right after.

 I tried escaping the $ put with no luck.

Use single quote.


 Is there something I can do?

 --
  09:21:28 up 37 days, 17:45,  1 user,  load average: 2.54, 2.04, 1.50
 -
 Martín Marqués| select 'mmarques' || '@' || 'unl.edu.ar'
 Centro de Telematica  |  DBA, Programador, Administrador
  Universidad Nacional
   del Litoral
 -

-- 

Cyberly yours,
Petar Nedyalkov
Devoted Orbitel Fan :-)

PGP ID: 7AE45436
PGP Public Key: http://bu.orbitel.bg/pgp/bu.asc
PGP Fingerprint: 7923 8D52 B145 02E8 6F63 8BDA 2D3F 7C0B 7AE4 5436


pgpjAfU9TNVpW.pgp
Description: PGP signature


[PHP] Re: text with $

2005-05-09 Thread Jason Barnett
Martín Marqués wrote:
I have a text variable that contains $ symbols, that when I pass it out PHP 
thinks that the $ mean that a variable name comes right after.

I tried escaping the $ put with no luck. 

Is there something I can do?
?php
echo '$';
echo \$;
?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] text with $

2005-05-09 Thread disguised.jedi
On 5/9/05, Martín Marqués martin@bugs.unl.edu.ar wrote:
 I have a text variable that contains $ symbols, that when I pass it out PHP
 thinks that the $ mean that a variable name comes right after.
/*
This is standard behavior, as far as I know.  Are you using an IDE, or
just a standard text editor?  Many IDEs will notify you of this, or
just escape it automatically.
*/ 
 I tried escaping the $ put with no luck.
/*
Escaping didn't work?  That's strange.  Could you post the code?  This
would help, as I think you might not be escaping it correctly.  See
below...
*/ 
 Is there something I can do?
/*
'Single Quotes?'  Be sure that when you escape it you are using \, not
/!  Again, try posting code.  You're always more likely to get
responses if you post the code, and/or any error messages you get.
*/

-- 
[EMAIL PROTECTED]

PHP rocks!
Knowledge is Power.  Power Corrupts.  Go to school, become evil

Disclaimer: Any disclaimer attached to this message may be ignored. 
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.

This message is Certified Virus Free

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



[PHP] Accessible HTML - OT

2005-05-09 Thread Mikey
Hiya!
 
I have just come back from the client visit and one of the issues that arose
was over the use of accessible markup, more specifically the use of tables
versus the use of layers.
 
Now, my long held belief was that div/layers were added to the spec so that
designers could separate presentation markup from content - that is, use
positioned layers for laying out content, use tables for tables of data as
they were originally intended.  However, my client seemed adamant that it
was the other way around and that the use of tables was preferred owing to
browser compatibility issues.
 
Now, I have just had a look around w3 and have found some inferences that
support my view but nothing that states clearly in either direction.  Does
anyone on this list have a definitive answer for this one?
 
TIA,

Mikey
--
The revolution will not be sent as an e-mail attachment.

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



Re: [PHP] text with $

2005-05-09 Thread Marek Kilimajer
Martín Marqués wrote:
I have a text variable that contains $ symbols, that when I pass it out PHP 
thinks that the $ mean that a variable name comes right after.

I tried escaping the $ put with no luck. 

Is there something I can do?
How did you escape the symbol? You should use backslash: \
Or use single quotes.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] project looking for a web designer/developer

2005-05-09 Thread bruce
Hi..

Is this a correct mailing list to submit a posting looking for a web
developer/web designer? The project will initially be a Sweat Equity
project? Are there members here interested in being part of a Start-Up.

Even though this is a PHP/Development list, we thought we'd ask!

We have a layout of a hybrid hotornot/'yahoo groups'/'distributed streaming
video' and we're looking to create a mockup/prototype, and to then get the
functionality up/running. Your skills would be used to convert what we have,
into a css/jscript/etc.. mockup... Once we get the look/feel/links/etc..
nailed down, we'll layer it on top of the underlying functionality..

Thanks

Bruce
[EMAIL PROTECTED]


(PS. Just where does one go on the Web To find entrepreneurs who want to
start a company/be part of a startup?? Sounds like a biz concept!!)

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



Re: [PHP] Question about acessing databases and formatting output

2005-05-09 Thread bala chandar
Hi,

On 5/9/05, The Doctor [EMAIL PROTECTED] wrote:
 On Mon, May 09, 2005 at 08:29:34AM +0530, bala chandar wrote:
  On 5/9/05, bala chandar [EMAIL PROTECTED] wrote:
   Hi
  
   On 5/9/05, The Doctor [EMAIL PROTECTED] wrote:
On Sun, May 08, 2005 at 01:49:08PM -0600, The Doctor wrote:
 On Sun, May 08, 2005 at 08:56:25PM +0530, bala chandar wrote:
  On 5/8/05, The Doctor [EMAIL PROTECTED] wrote:
   On Thu, May 05, 2005 at 05:49:38AM -0600, The Doctor wrote:
On Thu, May 05, 2005 at 10:11:14AM +0530, bala chandar wrote:
 hi,

 On 5/5/05, The Doctor [EMAIL PROTECTED] wrote:
  This is probably easy, but how does
  one access a database, mysql or oracle or postgresql,
  and
  present the data in a tabular format?
 
  --
 

 check out http://in2.php.net/mysql

   
Looks good to me.
   
  
   So far so good except my blobs are appearing as is instead of
   as an interpret item.  What next?
 --
 
  what are you storing in BLOB?
 

 First a .tgf and then a jpg.
  
   hey, check out this. this might help you
 
   http://www.zend.com/zend/trick/tricks-sept-2001.php
 
  http://forum.100megswebhosting.com/archive/index.php/t-2971.html
  

   
Is their a way to embed the third column?
   
And what changes do I need to make to the php code?
   
  
 
 
 Seems to be correct.  Here is what I think:
 
 All the non-blobs are working fine; it is the blobs that are turning up
 as text instead of data.  Can you not tell the PHP scripts the following:
 
 if a blob then present the data as binary
 else
 present the text
 endif
 ?

I think you cannot judge the content of the blob.  for text use the
data type text instead of blob

 
 --
 Member - Liberal International
 This is [EMAIL PROTECTED]   Ici [EMAIL PROTECTED]
 God Queen and country! Beware Anti-Christ rising!
 BC, Vote Liberal!!
 


-- 
bala balachandar muruganantham
blog lynx http://chandar.blogspot.com
web http://www.chennaishopping.com

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



Re: [PHP] text with $

2005-05-09 Thread bala chandar
hi 

On 5/9/05, Martín Marqués martin@bugs.unl.edu.ar wrote:
 I have a text variable that contains $ symbols, that when I pass it out PHP
 thinks that the $ mean that a variable name comes right after.

use this

$$text = $text;


 
 I tried escaping the $ put with no luck.
 
 Is there something I can do?
 
 --
  09:21:28 up 37 days, 17:45,  1 user,  load average: 2.54, 2.04, 1.50
 -
 Martín Marqués| select 'mmarques' || '@' || 'unl.edu.ar'
 Centro de Telematica  |  DBA, Programador, Administrador
  Universidad Nacional
   del Litoral
 -
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
bala balachandar muruganantham
blog lynx http://chandar.blogspot.com
web http://www.chennaishopping.com

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



Re: [PHP] text with $

2005-05-09 Thread =?iso-8859-1?q?Mart=EDn_Marqu=E9s?=
El Lun 09 May 2005 11:44, Marek Kilimajer escribió:
 Martín Marqués wrote:
  I have a text variable that contains $ symbols, that when I pass it out 
PHP 
  thinks that the $ mean that a variable name comes right after.
  
  I tried escaping the $ put with no luck. 
  
  Is there something I can do?
  
 
 How did you escape the symbol? You should use backslash: \

Sorry, my misstake. :-(

I was doing: 

srt_replace($,\$,$string);

instead of: 

srt_replace($,\\$,$string);

Forgot to escape the escape caracter! :-D

-- 
 11:45:49 up 37 days, 20:09,  2 users,  load average: 1.37, 1.07, 1.06
-
Martín Marqués| select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica  |  DBA, Programador, Administrador
 Universidad Nacional
  del Litoral
-

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



Re: [PHP] text with $

2005-05-09 Thread Brent Baisley
Do you mean you named a variable like $varia$le? I wouldn't do that.
If you mean you have something like:
A text $tring with $ome dollar$
Just put it in single quotes instead of double quotes. PHP doesn't 
evaluate what's inside single quotes.
'A text $tring with '.$variable.'  dollar'

On May 9, 2005, at 8:23 AM, Martín Marqués wrote:
I have a text variable that contains $ symbols, that when I pass it 
out PHP
thinks that the $ mean that a variable name comes right after.

I tried escaping the $ put with no luck.
Is there something I can do?
--
 09:21:28 up 37 days, 17:45,  1 user,  load average: 2.54, 2.04, 1.50
-
Martín Marqués| select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica  |  DBA, Programador, Administrador
 Universidad Nacional
  del Litoral
-
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search  Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Question about acessing databases and formatting output

2005-05-09 Thread The Doctor
On Mon, May 09, 2005 at 08:19:47PM +0530, bala chandar wrote:
 Hi,
 
 On 5/9/05, The Doctor [EMAIL PROTECTED] wrote:
  On Mon, May 09, 2005 at 08:29:34AM +0530, bala chandar wrote:
   On 5/9/05, bala chandar [EMAIL PROTECTED] wrote:
Hi
   
On 5/9/05, The Doctor [EMAIL PROTECTED] wrote:
 On Sun, May 08, 2005 at 01:49:08PM -0600, The Doctor wrote:
  On Sun, May 08, 2005 at 08:56:25PM +0530, bala chandar wrote:
   On 5/8/05, The Doctor [EMAIL PROTECTED] wrote:
On Thu, May 05, 2005 at 05:49:38AM -0600, The Doctor wrote:
 On Thu, May 05, 2005 at 10:11:14AM +0530, bala chandar wrote:
  hi,
 
  On 5/5/05, The Doctor [EMAIL PROTECTED] wrote:
   This is probably easy, but how does
   one access a database, mysql or oracle or postgresql,
   and
   present the data in a tabular format?
  
   --
  
 
  check out http://in2.php.net/mysql
 

 Looks good to me.

   
So far so good except my blobs are appearing as is instead of
as an interpret item.  What next?
  --
  
   what are you storing in BLOB?
  
 
  First a .tgf and then a jpg.
   
hey, check out this. this might help you
  
http://www.zend.com/zend/trick/tricks-sept-2001.php
  
   http://forum.100megswebhosting.com/archive/index.php/t-2971.html
   
 

 Is their a way to embed the third column?

 And what changes do I need to make to the php code?

   
  
  
  Seems to be correct.  Here is what I think:
  
  All the non-blobs are working fine; it is the blobs that are turning up
  as text instead of data.  Can you not tell the PHP scripts the following:
  
  if a blob then present the data as binary
  else
  present the text
  endif
  ?
 
 I think you cannot judge the content of the blob.  for text use the
 data type text instead of blob
 

Can you please clarify?
-- 
Member - Liberal International  
This is [EMAIL PROTECTED]   Ici [EMAIL PROTECTED]
God Queen and country! Beware Anti-Christ rising!
BC, Vote Liberal!!

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



RE: [PHP] text with $

2005-05-09 Thread Mikey
  I have a text variable that contains $ symbols, that when 
 I pass it 
  out PHP thinks that the $ mean that a variable name comes 
 right after.
 
 To include the string symbol in a variable, use the single quotes.
 
 $myvar='this is $$$ test';

Or, if you still want to use interpolation, use the backslash to escape the
$:

$str = \$foo = $bar;

HTH,

Mikey

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



RE: [PHP] Accessible HTML - OT

2005-05-09 Thread Mark Rees


-Original Message-
From: Mikey [mailto:[EMAIL PROTECTED] 
Sent: 09 May 2005 15:40
To: php-general@lists.php.net
Subject: [PHP] Accessible HTML - OT


Hiya!
 
I have just come back from the client visit and one of the issues that
arose was over the use of accessible markup, more specifically the use
of tables versus the use of layers.
 
Now, my long held belief was that div/layers were added to the spec so
that designers could separate presentation markup from content - that
is, use positioned layers for laying out content, use tables for tables
of data as they were originally intended.  However, my client seemed
adamant that it was the other way around and that the use of tables was
preferred owing to browser compatibility issues.
--
It depends how far back you want to go with this in terms of
compatibility. It is simple to code for IE5+ and NN6+ /Mozilla which
covers well over 90% of the market without using tables for layout
purposes. I wouldn't say there was anything inherently wrong with
using tables to control layout but the presentation vs layout argument
you advance is fairly convincing.

Accessibility (for e.g. the blind or partially sighted) is another
matter. Look at Bobby for more information bobby.watchfire.com/

--
 
Now, I have just had a look around w3 and have found some inferences
that support my view but nothing that states clearly in either
direction.  Does anyone on this list have a definitive answer for this
one?
 
TIA,

Mikey
--
The revolution will not be sent as an e-mail attachment.

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

Gamma Global : Suppliers of HPCompaq, IBM, Acer, EPI, APC, Cyclades, D-Link, 
Cisco, Sun Microsystems, 3Com

GAMMA GLOBAL (UK) LTD IS A RECOGNISED 'INVESTOR IN PEOPLE' AND AN 'ISO 9001 
2000' REGISTERED COMPANY

**

CONFIDENTIALITY NOTICE:

This Email is confidential and may also be privileged. If you are not the
intended recipient, please notify the sender IMMEDIATELY; you should not
copy the email or use it for any purpose or disclose its contents to any
other person.

GENERAL STATEMENT:

Any statements made, or intentions expressed in this communication may not
necessarily reflect the view of Gamma Global (UK) Ltd. Be advised that no 
content
herein may be held binding upon Gamma Global (UK) Ltd or any associated company
unless confirmed by the issuance of a formal contractual document or
Purchase Order,  subject to our Terms and Conditions available from 
http://www.gammaglobal.com

EOE

**
**


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



[PHP] Re: Accessible HTML - OT

2005-05-09 Thread Matthew Weier O'Phinney
* Mikey [EMAIL PROTECTED]:
 I have just come back from the client visit and one of the issues that
 arose was over the use of accessible markup, more specifically the use
 of tables versus the use of layers.
  
 Now, my long held belief was that div/layers were added to the spec so
 that designers could separate presentation markup from content - that
 is, use positioned layers for laying out content, use tables for
 tables of data as they were originally intended.  However, my client
 seemed adamant that it was the other way around and that the use of
 tables was preferred owing to browser compatibility issues.
  
 Now, I have just had a look around w3 and have found some inferences
 that support my view but nothing that states clearly in either
 direction.  Does anyone on this list have a definitive answer for this
 one?

You have it correct, theoretically, regarding accessibility. Tables
should be used for tabular data, divs for presentation and layout. 

However, many people confuse accessibility with consistency; they want a
look-and-feel that works the same no matter what the browser. (Why they
feel this is accessibility is anybody's guess, but I've seen it a number
of times). In this latter arena, on a practical level, tables are
typically your best bet.

I've done a lot of tableless and table-based layouts, and the
unfortunate fact of the matter is it's a lot easier to create a layout
that is consistent cross-browser and cross-platform using tables. Until
IE supports the CSS2 'display: table-*' elements (which is the easiest
way of creating columns of the same height), this will continue to be
the case.

Now, this does not mean you should create a bunch of nested tables for
the layout. I find that a simple skeleton made of a table with a few
columns can create the basic page layout, and then I use as much CSS as
I can within (unordered lists for navigation menus, floats to position
image/caption pairs, etc.).  This combines some of the best of both
worlds, and creates a fairly accessible page at the same time.

As in all things, it's a matter of balance.

-- 
Matthew Weier O'Phinney   | WEBSITES:
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
mailto:[EMAIL PROTECTED] | http://vermontbotanical.org

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



[PHP] Wash with SOAP

2005-05-09 Thread Jay Blanchard
It has come to a point where a vendor is requiring that we use SOAP to
access a service that they provide, so I need some recommendations...

a. Do I build my own request/receipt functions.
2. Do I use something like nusoap or Pears' SOAP classes?

Would those of you who are experienced with PHP and SOAP give me your
opinions? TVMIA!

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



Re[2]: [PHP] text with $

2005-05-09 Thread Richard Davey
Hello bala,

Monday, May 9, 2005, 3:51:21 PM, you wrote:

 I have a text variable that contains $ symbols, that when I pass it out PHP
 thinks that the $ mean that a variable name comes right after.

bc use this
bc $$text = $text;

While I'm sure creating a variable variable is useful in lots of
circumstances, this isn't really one of them and doesn't solve the
original posters problem.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 I do not fear computers. I fear the lack of them. - Isaac Asimov

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



Re: [PHP] Accessible HTML - OT

2005-05-09 Thread eoghan
hi
perhaps have a look here:
http://www.webstandards.org/about/
Mikey wrote:
Hiya!
 
I have just come back from the client visit and one of the issues that arose
was over the use of accessible markup, more specifically the use of tables
versus the use of layers.
 
Now, my long held belief was that div/layers were added to the spec so that
designers could separate presentation markup from content - that is, use
positioned layers for laying out content, use tables for tables of data as
they were originally intended.  However, my client seemed adamant that it
was the other way around and that the use of tables was preferred owing to
browser compatibility issues.
 
Now, I have just had a look around w3 and have found some inferences that
support my view but nothing that states clearly in either direction.  Does
anyone on this list have a definitive answer for this one?
 
TIA,

Mikey
--
The revolution will not be sent as an e-mail attachment.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Any alternative to POST method FTP uploads from client computer?

2005-05-09 Thread Jared Williams

 Hi All,
 
  
 
 I need to implement the ability to ftp upload files from 
 client machines via a form in a web application I'm developing.
 
  
 
 From reading the PHP help, all I can find to perform this is 
 the POST method for handling file uploads 
 (http://au2.php.net/manual/en/features.file-upload.php).
 
  
 
 From my perspective, while this seems to work, there are a 
 couple of drawbacks, most important of which is that it seems 
 you can only do comparisons of the uploaded file, against the 
 potential that the file has already been uploaded, once the 
 file has already been uploaded and is sitting in the server 
 temp directory.
 
  
 
 This is a drawback to our application because the files can 
 typically vary on a daily basis in size from 20mb thru to 
 400mb, and 400mb seems like a lot of bandwidth to consume to 
 discover that the file already exists on our server.
 

Hmm, sounds like you just want to send something like a hash first 
Like the SHA1 of the file. 
So would need ActiveX/Java obect to perform the SHA1 of the file client side 
first.
Send that, if it hasn't been seen then send the whole file.

As for other methods... 

You could try WebDAV and the PUT method. There is a PHP implementation of a 
WebDAV server in PEAR. Its not form based, but would
make it somewhat more easier to upload than using FTP atleast. I believe WinXP 
can attach directly to them, or use Novells' NetDrive
to map a drive letter to the WebDAV server.

Jared



 

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



Re: [PHP] Question about acessing databases and formatting output

2005-05-09 Thread bala chandar
On 5/9/05, The Doctor [EMAIL PROTECTED] wrote:
 On Mon, May 09, 2005 at 08:19:47PM +0530, bala chandar wrote:
  Hi,
 
  On 5/9/05, The Doctor [EMAIL PROTECTED] wrote:
   On Mon, May 09, 2005 at 08:29:34AM +0530, bala chandar wrote:
On 5/9/05, bala chandar [EMAIL PROTECTED] wrote:
 Hi

 On 5/9/05, The Doctor [EMAIL PROTECTED] wrote:
  On Sun, May 08, 2005 at 01:49:08PM -0600, The Doctor wrote:
   On Sun, May 08, 2005 at 08:56:25PM +0530, bala chandar wrote:
On 5/8/05, The Doctor [EMAIL PROTECTED] wrote:
 On Thu, May 05, 2005 at 05:49:38AM -0600, The Doctor wrote:
  On Thu, May 05, 2005 at 10:11:14AM +0530, bala chandar 
  wrote:
   hi,
  
   On 5/5/05, The Doctor [EMAIL PROTECTED] wrote:
This is probably easy, but how does
one access a database, mysql or oracle or postgresql,
and
present the data in a tabular format?
   
--
   
  
   check out http://in2.php.net/mysql
  
 
  Looks good to me.
 

 So far so good except my blobs are appearing as is instead of
 as an interpret item.  What next?
   --
   
what are you storing in BLOB?
   
  
   First a .tgf and then a jpg.

 hey, check out this. this might help you
   
 http://www.zend.com/zend/trick/tricks-sept-2001.php
   
http://forum.100megswebhosting.com/archive/index.php/t-2971.html

  
 
  Is their a way to embed the third column?
 
  And what changes do I need to make to the php code?
 

   
  
   Seems to be correct.  Here is what I think:
  
   All the non-blobs are working fine; it is the blobs that are turning up
   as text instead of data.  Can you not tell the PHP scripts the following:
  
   if a blob then present the data as binary
   else
   present the text
   endif
   ?
 
  I think you cannot judge the content of the blob.  for text use the
  data type text instead of blob
 
 
 Can you please clarify?

kindly check this link
http://forums.devshed.com/archive/t-63144/UserContributed-PHP-Mysql-and-Images


-- 
bala balachandar muruganantham
blog lynx http://chandar.blogspot.com
web http://www.chennaishopping.com

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



[PHP] Re: [PHP-DEV] make new return a reference to existent object

2005-05-09 Thread Jochem Maas
Leonardo Pedretti wrote:
I would like (for code cleanliness purposes) to make 'new' return a reference 
to an already created object under certain circumstances without using a 
factory, is it possible?
not unless you hack the php engine (in which case
your code will only work on your custom php build),
I'll bet money that none of the php/zend devs feel anything for introducing
this kind of 'magic' into engine.
IMHO a factory would be a clean method of handling this behaviour and
has the benefit that no programmer looking at your code will
misinterpret occurances of the 'new' keyword. e.g.:
class Test
{
/* ... */
function __construct() {}
function get() {}
}
// and do:
$var = Test::get( /* pass ctor args */ );
// instead of:
$var = new Test( /* pass ctor args */ );
... in this example its only 1 extra char to type when
using the factory method and you could turn that around by
doing something evil(tm) like:
$var = Test::_( /* pass ctor args */ ); // '_' is a function name!!! (ala 
wordpress-CS)
maybe reply to generals describing what you are (trying to) do[ing],
I for one am always interested in other people's realworld php5/oo
problems/ideas/etc :-)
rgds,
Jochem

ps - I redirected this reply to generals because I didn't really think
that it was an internals question (and those guys are busy enough :-)
Thanx
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] numbers as strings

2005-05-09 Thread Jon Aston
how do I set a number as a string
example

let us say
$a = 1;
$b = 2;
$c = 0;

I would like to be able to
$str = $c.$a.$b;

to result with
$str = 012;

is there something that I have missed or I guess the question should be what
did I miss

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



[PHP] A couple questions about templating

2005-05-09 Thread James Williams
Hey fellas, sorry to infest the list with another question about a
templating engine, but I am looking for some professional opinions
here...

I am trying to make a small, fast, and simple templating class...  Now
I have mastered the art of variable replacement, and have made two
versions.  The first one I made simply used file() to load up the file
into an array, str_replace() to replace variables, then it printed it
back.  I made a second one, which reads the file into an array,
changes the variables the same way, but instead compiles the finished
product into a compile directory and then reads the compiled file back
to the page.  the benefit to this being that I can easily create a
simple cache system now.

1st question)  I need a professionaly opinion on to which solution is
better, considering speed, security, and expandability.

2nd question)  Like I said before, I've mastered the art of variable
replacement, but how would one go about adding support for if {}
statements as well as loops.  I'm a little bit lost when it comes to
this.

Thank-you guys very very much.
-- 
jamwil.com

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



[PHP] mail() Problem

2005-05-09 Thread Mary-Anne Nayler
Hi.
I am very new to this group and this is my first request for help so please be 
patient.
when I try to use the mail() function in a PHP based webpage I get the 
following error:

Fatal error: Call to undefined function: mail() in the path to my 
script on line line number

I have tried changing some mail config details in php.ini. For instance, 
the path to sendmail used to be: /usr/lib and I have changed it to: 
/usr/lib/sendmail -t -i.  The permissions on sendmail are 555, owner 
is root and group is other.

I guess you could say I am well and truly clutching at straws now!!
Has anyone else ever had this problem? If so how was it resolved?
Mary-Anne
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] numbers as strings

2005-05-09 Thread Rory Browne
For the most part you can simply treat them as strings. What is
happening that shouldn't be happening, or what should be happening,
but isn't?

 let us say
 $a = 1;
 $b = 2;
 $c = 0;

$str_a = (string)$a;
$str_b = $b

 
 I would like to be able to
 $str = $c.$a.$b;
Does that not work? What happens when you do that? Personally I'd use
$str = $c$a$b;


 to result with
 $str = 012;
 
I tried:
[EMAIL PROTECTED] ~]$ cat  test.php
?php

$a = 1; $b = 2; $c = 0;

$str = $c . $a . $b;

echo $str;

?
[EMAIL PROTECTED] ~]$ php -q test.php
012



 is there something that I have missed or I guess the question should be what
 did I miss
 
 --
 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] Re: Accessible HTML - OT

2005-05-09 Thread Mary-Anne Nayler
Nested tables are the absolute worst thing you can do! A screen reader 
is able to tab to a table and tab within a table but once you begin to 
have tables within tables, UGH! To quote accessibility guru Joe Clark; 
With nested tables, a screen reader user ends up working from within a 
maze formed by one table within another.  All you coders out there know 
how hard it is to code nested tables and how confusing it gets right? 
Imagine trying to reverse engineer this jumbled mess with nothing but 
audio to go on!

Matthew Weier O'Phinney wrote, On 10/05/05 01:59 AM:
* Mikey [EMAIL PROTECTED]:
 

I have just come back from the client visit and one of the issues that
arose was over the use of accessible markup, more specifically the use
of tables versus the use of layers.
Now, my long held belief was that div/layers were added to the spec so
that designers could separate presentation markup from content - that
is, use positioned layers for laying out content, use tables for
tables of data as they were originally intended.  However, my client
seemed adamant that it was the other way around and that the use of
tables was preferred owing to browser compatibility issues.
Now, I have just had a look around w3 and have found some inferences
that support my view but nothing that states clearly in either
direction.  Does anyone on this list have a definitive answer for this
one?
   

You have it correct, theoretically, regarding accessibility. Tables
should be used for tabular data, divs for presentation and layout. 

However, many people confuse accessibility with consistency; they want a
look-and-feel that works the same no matter what the browser. (Why they
feel this is accessibility is anybody's guess, but I've seen it a number
of times). In this latter arena, on a practical level, tables are
typically your best bet.
I've done a lot of tableless and table-based layouts, and the
unfortunate fact of the matter is it's a lot easier to create a layout
that is consistent cross-browser and cross-platform using tables. Until
IE supports the CSS2 'display: table-*' elements (which is the easiest
way of creating columns of the same height), this will continue to be
the case.
Now, this does not mean you should create a bunch of nested tables for
the layout. I find that a simple skeleton made of a table with a few
columns can create the basic page layout, and then I use as much CSS as
I can within (unordered lists for navigation menus, floats to position
image/caption pairs, etc.).  This combines some of the best of both
worlds, and creates a fairly accessible page at the same time.
As in all things, it's a matter of balance.
 

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


Re: [PHP] Re: [PHP-DEV] make new return a reference to existent object

2005-05-09 Thread Rory Browne
I think Leonardo might have a point here. Built-in support for
Singletons could be a nice feature, without the use of static
functions, would be nice. I wouldn't use the 'new' keyword however. I
think something along the lines of existing, or ref

$ref = existing TEST; // which would return an existing instance of
TEST, if one exists, and a new one if it doesn't. ( pretty much like
the singleton code, except no need for singleton code)

I don't think it's anything important, and there are more pressing
matters, to be worked on, I'm sure, but if someone created the code,
and it was secure / bug-free / compliant-with-coding-standards / etc,
I can't see why it couldn't(or shouldn't) be included. When all's said
and done though, it's still just syntactic sugar. It all depends on
how sweet the devs consider it.

On 5/9/05, Jochem Maas [EMAIL PROTECTED] wrote:
 Leonardo Pedretti wrote:
  I would like (for code cleanliness purposes) to make 'new' return a 
  reference
  to an already created object under certain circumstances without using a
  factory, is it possible?
 
 not unless you hack the php engine (in which case
 your code will only work on your custom php build),
 I'll bet money that none of the php/zend devs feel anything for introducing
 this kind of 'magic' into engine.
 
 IMHO a factory would be a clean method of handling this behaviour and
 has the benefit that no programmer looking at your code will
 misinterpret occurances of the 'new' keyword. e.g.:
 
 class Test
 {
 /* ... */
 function __construct() {}
 function get() {}
 }
 
 // and do:
 
 $var = Test::get( /* pass ctor args */ );
 
 // instead of:
 
 $var = new Test( /* pass ctor args */ );
 
 ... in this example its only 1 extra char to type when
 using the factory method and you could turn that around by
 doing something evil(tm) like:
 
 $var = Test::_( /* pass ctor args */ ); // '_' is a function name!!! (ala 
 wordpress-CS)
 
 maybe reply to generals describing what you are (trying to) do[ing],
 I for one am always interested in other people's realworld php5/oo
 problems/ideas/etc :-)
 
 rgds,
 Jochem
 
 ps - I redirected this reply to generals because I didn't really think
 that it was an internals question (and those guys are busy enough :-)
 
 
  Thanx
 
 --
 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] Accessible HTML - OT

2005-05-09 Thread Mary-Anne Nayler
I was under the belief that tables are very bad for accessibility.  I 
once attended a conference on accessibility and standards and witnessed 
a blind person  attempting to read a website that had it's information 
laid out in a table with a screen reader. It was awful and shamed me 
into never using tables in my web design again (where possible of course).

Check out Joe Clarkes website: http://joeclark.org. Joe is an expert in 
web accessibility issues.

Mikey wrote, On 10/05/05 12:40 AM:
Hiya!
I have just come back from the client visit and one of the issues that arose
was over the use of accessible markup, more specifically the use of tables
versus the use of layers.
Now, my long held belief was that div/layers were added to the spec so that
designers could separate presentation markup from content - that is, use
positioned layers for laying out content, use tables for tables of data as
they were originally intended.  However, my client seemed adamant that it
was the other way around and that the use of tables was preferred owing to
browser compatibility issues.
Now, I have just had a look around w3 and have found some inferences that
support my view but nothing that states clearly in either direction.  Does
anyone on this list have a definitive answer for this one?
TIA,
Mikey
--
The revolution will not be sent as an e-mail attachment.
 

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


Re: [PHP] A couple questions about templating

2005-05-09 Thread Rory Browne
 I am trying to make a small, fast, and simple templating class...  Now
 I have mastered the art of variable replacement, and have made two
 versions.  The first one I made simply used file() to load up the file
 into an array,
Personally I think you should use file_get_contents() instead.

 str_replace() to replace variables, then it printed it
 back.
Unless you're doing only very basic substitution, you may need to
consider regex, and preg_replace().

 I made a second one, which reads the file into an array,
 changes the variables the same way, but instead compiles the finished
 product into a compile directory and then reads the compiled file back
 to the page.  the benefit to this being that I can easily create a
 simple cache system now.

All I'd change here, is that instead of reading the file into an
array, I'd load it into a string.

 1st question)  I need a professionaly opinion on to which solution is
 better, considering speed, security, and expandability.
Depends on how it's implemented. When you 'compile' the script into
native php, you are having a highly optimised parser do the variabe
insertion. Your main problem here would be register_globals, so you
need to ensure that you initialise any variables used.

 2nd question)  Like I said before, I've mastered the art of variable
 replacement, but how would one go about adding support for if {}
 statements as well as loops.  I'm a little bit lost when it comes to
 this.
You could use a full featured tokeniser/parser(and you'd probably IIRC
find one in Pear), but it may perhaps be simpler, to simply use preg
to replace something like {foreach:var:list}, or whatever your
perfered syntax.

 Thank-you guys very very much.
 --
 jamwil.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] A couple questions about templating

2005-05-09 Thread Greg Donald
On 5/9/05, James Williams [EMAIL PROTECTED] wrote:
 1st question)  I need a professionaly opinion on to which solution is
 better, considering speed, security, and expandability.

Bench them both with Apache's ab.

 2nd question)  Like I said before, I've mastered the art of variable
 replacement, but how would one go about adding support for if {}
 statements as well as loops.  I'm a little bit lost when it comes to
 this.

eval() will parse your PHP code.  I use that with filemtime() for my
own simple templating/caching system.


-- 
Greg Donald
Zend Certified Engineer
http://destiney.com/

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



Re: [PHP] A couple questions about templating

2005-05-09 Thread James Williams
On 5/9/05, Rory Browne [EMAIL PROTECTED] wrote:
  I made a second one, which reads the file into an array,
  changes the variables the same way, but instead compiles the finished
  product into a compile directory and then reads the compiled file back
  to the page.  the benefit to this being that I can easily create a
  simple cache system now.
 
 All I'd change here, is that instead of reading the file into an
 array, I'd load it into a string.
 

That was a mistake on my part, it is loaded into a string.

  2nd question)  Like I said before, I've mastered the art of variable
  replacement, but how would one go about adding support for if {}
  statements as well as loops.  I'm a little bit lost when it comes to
  this.

 You could use a full featured tokeniser/parser(and you'd probably IIRC
 find one in Pear), but it may perhaps be simpler, to simply use preg
 to replace something like {foreach:var:list}, or whatever your
 perfered syntax.
 

The problem is that, I have no problem replacing the keyword with the
proper php syntax for a loop or whatever, the problem is that it just
shows up as a string when all is said and done.

If you want to see the code I have right now, here it is (below).  I'm
thinking I'm going to have to combine the load() and run() methods,
and then make assign() create an array of stuff that must be assigned,
then do pretty much all the work in the combined method or load() and
run().  That probably sounded pretty confusing, I hope you understand
what I'm sayin.


?php
class tpl {
//
// PRIVATE CLASS VARIABLES
//
var $file;
var $template;
var $compiled;

//
// LOAD A TEMPLATE FILE
//
function load($template) {
$this-template = 'tpl/' . $template . '.tpl';
$this-compiled = 'compiled/' . $template . '.tplc';
if (file_exists($this-template)  
filemtime($this-template) 
filemtime($this-compiled)) {
$file = fopen($this-template,'r');
$this-file = 
fread($file,filesize($this-template));
fclose($file);
} elseif (file_exists($this-compiled) 
filemtime($this-template)  filemtime($this-compiled)) {
readfile($this-compiled);
} else {
print('/p' . $this-template . ' Does not 
exist/p');
}
}

//
// ASSIGN THE VARIABLES
//
function assign($var,$value) {
if (isset($var)  isset($value)) {
$this-file = str_replace('{' . $var . 
'}',$value,$this-file);
}
}

//
// DISPLAY THE TEMPLATE
//
function run() {
if (filemtime($this-template)  
filemtime($this-compiled)) {
$file = fopen($this-compild,'w');
fwrite($file,$this-file);
fclose($file);
readfile($this-compiled);
}
}
}
?


-- 
jamwil.com

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



Re: [PHP] mail() Problem

2005-05-09 Thread dan
Mary-Anne Nayler wrote:
Hi.
I am very new to this group and this is my first request for help so 
please be patient.

when I try to use the mail() function in a PHP based webpage I get the 
following error:

Fatal error: Call to undefined function: mail() in the path to my 
script on line line number

I have tried changing some mail config details in php.ini. For instance, 
the path to sendmail used to be: /usr/lib and I have changed it to: 
/usr/lib/sendmail -t -i.  The permissions on sendmail are 555, owner 
is root and group is other.

I guess you could say I am well and truly clutching at straws now!!
Has anyone else ever had this problem? If so how was it resolved?
Mary-Anne
Mary -
This error occours when PHP can't find sendmail at compile-time.  Your 
best bet would be to install sendmail or a sendmail-compatible MTA, and 
then rebuild PHP.

Postfix is my second love, so naturally I'd recommend it - www.postfix.org.
Thanks
-dant
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] mail() Problem

2005-05-09 Thread Richard Lynch
On Mon, May 9, 2005 4:02 pm, Mary-Anne Nayler said:
 Fatal error: Call to undefined function: mail() in the path to my
 script on line line number

That means PHP has no mail() function to even call, which is MUCH earlier
in the process than sendmail location.

Most likely, your webhost has decided that to stop spammers and runaway
mail abuse, he'd just rip out the mail() function from PHP.

You may be able to bypass this by using one of the mail classes at
http://phpclasses.org to talk directly to an SMTP server not under that
webhost control.

So, this time, it's actually NOT about paths/permissions on sendmail. :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] Re: A couple questions about templating

2005-05-09 Thread Matthew Weier O'Phinney
* James Williams [EMAIL PROTECTED]:
 Hey fellas, sorry to infest the list with another question about a
 templating engine, but I am looking for some professional opinions
 here...

 I am trying to make a small, fast, and simple templating class...  Now
 I have mastered the art of variable replacement, and have made two
 versions.  The first one I made simply used file() to load up the file
 into an array, str_replace() to replace variables, then it printed it
 back.  I made a second one, which reads the file into an array,
 changes the variables the same way, but instead compiles the finished
 product into a compile directory and then reads the compiled file back
 to the page.  the benefit to this being that I can easily create a
 simple cache system now.

 1st question)  I need a professionaly opinion on to which solution is
 better, considering speed, security, and expandability.

 2nd question)  Like I said before, I've mastered the art of variable
 replacement, but how would one go about adding support for if {}
 statements as well as loops.  I'm a little bit lost when it comes to
 this.

This has all been done before, and in a number of ways. If you really
*must* build your own templating class, go and thoroughly review the
code of those that already exist: Smarty, Savant, paTemplate,
FastTemplate, etc. Figure out how each solved the problems. Then
determine if you can improve upon their solutions.

-- 
Matthew Weier O'Phinney   | WEBSITES:
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
mailto:[EMAIL PROTECTED] | http://vermontbotanical.org

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



Re: [PHP] Re: Accessible HTML - OT

2005-05-09 Thread Matthew Weier O'Phinney
* Mary-Anne Nayler [EMAIL PROTECTED] :
 Nested tables are the absolute worst thing you can do! 

I agree -- which, if you read my post, you'll see I didn't advocate
nested tables -- just a single table for columnar layout of the page.
Within each column, items are floated or positioned using CSS.

 A screen reader is able to tab to a table and tab within a table but
 once you begin to have tables within tables, UGH! 

I use text-based browsers regularly, and, while tables can be rendered
fine in many of them, nested tables get very ugly, very fast --
especially if the terminal you use is limited to 80 characters.

 To quote accessibility guru Joe Clark; With nested tables, a screen
 reader user ends up working from within a maze formed by one table
 within another.  All you coders out there know how hard it is to code
 nested tables and how confusing it gets right?  Imagine trying to
 reverse engineer this jumbled mess with nothing but audio to go on!

Absolutely. This is the argument I use when trying to convince others to
use a standards-compliant design. But often the customer (or your boss)
will ditch this kind of accessibility for some simple cross-platform
cross-browser consistency (not realizing that the cosmetic tweaks used
to do this mean that even though the site looks good on a Mac, a Windows
machine, and some linux browsers, it reads like a complete foreign
language in audio browsers or text-based browsers). 

In the end, on a practical level, I often am not *allowed* to make a
tableless design due to the wishes of my boss or client. And,
unfortunately, I have to pay the bills so my family and I have a place
to live and food to eat, so I can't simply refuse a job based on
principle. That's pretty much all I was getting at in my first post.

 Matthew Weier O'Phinney wrote, On 10/05/05 01:59 AM:
  * Mikey [EMAIL PROTECTED] :
   I have just come back from the client visit and one of the issues
   that arose was over the use of accessible markup, more
   specifically the use of tables versus the use of layers.
   
   Now, my long held belief was that div/layers were added to the
   spec so that designers could separate presentation markup from
   content - that is, use positioned layers for laying out content,
   use tables for tables of data as they were originally intended.
   However, my client seemed adamant that it was the other way around
   and that the use of tables was preferred owing to browser
   compatibility issues.
   
   Now, I have just had a look around w3 and have found some
   inferences that support my view but nothing that states clearly in
   either direction.  Does anyone on this list have a definitive
   answer for this one?
 
  You have it correct, theoretically, regarding accessibility. Tables
  should be used for tabular data, divs for presentation and layout. 
 
  However, many people confuse accessibility with consistency; they
  want a look-and-feel that works the same no matter what the browser.
  (Why they feel this is accessibility is anybody's guess, but I've
  seen it a number of times). In this latter arena, on a practical
  level, tables are typically your best bet.
 
  I've done a lot of tableless and table-based layouts, and the
  unfortunate fact of the matter is it's a lot easier to create a
  layout that is consistent cross-browser and cross-platform using
  tables. Until IE supports the CSS2 'display: table-*' elements
  (which is the easiest way of creating columns of the same height),
  this will continue to be the case.
 
  Now, this does not mean you should create a bunch of nested tables
  for the layout. I find that a simple skeleton made of a table with a
  few columns can create the basic page layout, and then I use as much
  CSS as I can within (unordered lists for navigation menus, floats to
  position image/caption pairs, etc.).  This combines some of the best
  of both worlds, and creates a fairly accessible page at the same
  time.
 
  As in all things, it's a matter of balance.

-- 
Matthew Weier O'Phinney   | WEBSITES:
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
mailto:[EMAIL PROTECTED] | http://vermontbotanical.org

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



Re: [PHP] Re: Accessible HTML - OT

2005-05-09 Thread Manuel Lemos
Hello,
on 05/09/2005 08:24 PM Mary-Anne Nayler said the following:
Nested tables are the absolute worst thing you can do! A screen reader 
is able to tab to a table and tab within a table but once you begin to 
have tables within tables, UGH! To quote accessibility guru Joe Clark; 
With nested tables, a screen reader user ends up working from within a 
maze formed by one table within another.  All you coders out there know 
how hard it is to code nested tables and how confusing it gets right? 
Imagine trying to reverse engineer this jumbled mess with nothing but 
audio to go on!
I know that very few sites use it, but I think that is why the attribute 
tabindex exists:

http://www.w3.org/TR/html401/interact/forms.html#adef-tabindex
The way I see it there are more non-obvious reasons that preachers of 
usability without tables miss, like the fact that the alternatives that 
they suggest based on CSS/DIV/SPAN give other headaches to site 
developers that want to implement sites that look the same in different 
browsers but sometimes is almost impossible as such browsers do not 
interpret the standards the same way.

Probably because tables were introduced long before the DIV/SPAN layout 
based mania, it seems tables work more reliably and allow developers to 
assure a more consistent visual across browsers.

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


[PHP] While and echoing HTML

2005-05-09 Thread Mark Sargent
Hi All,
this page,
http://www.freewebmasterhelp.com/tutorials/phpmysql/5
has the below code,
?
$i=0;
while ($i  $num) {
$first=mysql_result($result,$i,first);
$last=mysql_result($result,$i,last);
$phone=mysql_result($result,$i,phone);
$mobile=mysql_result($result,$i,mobile);
$fax=mysql_result($result,$i,fax);
$email=mysql_result($result,$i,email);
$web=mysql_result($result,$i,web);
?
tr
tdfont face=Arial, Helvetica, sans-serif? echo $first. .$last; 
?/font/td
tdfont face=Arial, Helvetica, sans-serif? echo $phone; ?/font/td
tdfont face=Arial, Helvetica, sans-serif? echo $mobile; 
?/font/td
tdfont face=Arial, Helvetica, sans-serif? echo $fax; ?/font/td
tdfont face=Arial, Helvetica, sans-serifa href=mailto:? echo 
$email; ?E-mail/a/font/td
tdfont face=Arial, Helvetica, sans-serifa href=? echo $web; 
?Website/a/font/td
/tr

?
$i++;
}
echo /table;
which I basically understand, except the html generation. I am trying to 
create something similiar, although, I think there are some errors in 
even perhaps my logic..?

html
body
h1centerJumbo Status/center/h1br
?php
$db = mysql_connect(localhost, root, grunger);
mysql_select_db(status,$db);
$result = mysql_query(SELECT ProductTypes.product_type_detail FROM 
ProductTypes,$db);
$myrow = mysql_fetch_array($result);
$num = mysql_num_rows($result);
?
table aligh=center border=2
tr
tdProduct Type/td
/tr
?
$i=0;
while ($i  $num){
$product_type=mysql_result($result,$i,product_type_detail);
echo trtd? echo $product_type ?/td/tr
}
$i++
?
/table
/body
/html

I get the folowing error,
*Parse error*: parse error, unexpected '}', expecting ',' or ';' in 
*/var/www/html/products.php* on line *20
*
which is the $i++ section.

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


[PHP] Test: Please Ignore

2005-05-09 Thread Mark Sargent
Testing receipt of post..cheers.
Mark Sargent.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php