[PHP] gdf fonts

2005-12-21 Thread Adrian Bruce

Hi

Does anyone know where i can get some decent gdf fonts for using in the 
imageloadfont() function, i have found some on the net but they are all 
a bit naf so far.  I'm really just looking for something like Arial or 
verdana.  Im creating pie charts on the fly but at the moment they look 
like something that would be produced by a spectrum or commodore 64!


Thanks
Adrian

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



Re: [PHP] select statement with variables ???

2005-12-21 Thread Robin Vickery
On 12/21/05, Anasta [EMAIL PROTECTED] wrote:
 Can someone tell me why this select is wrong please---ive tried everything.
 the $cat is the tablename .

You've tried *everything*  ?

Why do you think it's wrong? Did you get an error message of some kind?

What do you see if you echo $query? Are the values of $cat and $id
what you expected?

  -robin


Re: [PHP] gdf fonts

2005-12-21 Thread Silvio Porcellana [tradeOver]
Adrian Bruce wrote:
 Hi
 
 Does anyone know where i can get some decent gdf fonts for using in the
 imageloadfont() function, i have found some on the net but they are all
 a bit naf so far.  I'm really just looking for something like Arial or
 verdana.  Im creating pie charts on the fly but at the moment they look
 like something that would be produced by a spectrum or commodore 64!
 
 Thanks
 Adrian
 

Try here:
http://www.widgnet.com/gdf_fonts/

HTH, cheers

Silvio
-- 
tradeOver | http://www.tradeover.net
...ready to become the King of the World?

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



[PHP] mutiple file upload

2005-12-21 Thread Ross
Hi,

I am trying create a multiple file upload to a mysql server.

I have done the the single upload 
http://www.php-mysql-tutorial.com/php-mysql-upload.php but what if I want to 
upload many files (BLOB)at once.

Thanks,


Ross

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



Re: [PHP] mutiple file upload

2005-12-21 Thread Silvio Porcellana [tradeOver]
Ross wrote:
 Hi,
 
 I am trying create a multiple file upload to a mysql server.
 

Google is your friend...
http://www.google.com/search?hl=enq=multiple+upload+phpbtnG=Google+Search

And, by the way, if you are uploading and storing images in your MySQL
DB, you might want to consider that there is a much better database for
storing files. It's called 'filesystem'.

HTH, cheers

Silvio
-- 
tradeOver | http://www.tradeover.net
...ready to become the King of the World?

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



RE: [PHP] select statement with variables ???

2005-12-21 Thread Jim Moseby
 
 Can someone tell me why this select is wrong please---ive 
 tried everything.
 the $cat is the tablename .
 
 
 $query= SELECT title FROM $cat WHERE id='$id';
 
 

Apparently, either $cat or $id is not the value you think it is.  First, I
would try changing

$result=mysql_query($query);

to read:

$result=mysql_query($query) or die(mysql_error());

This will, no doubt, lend some insight into where your error is.

JM

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



RE: [PHP] select statement with variables ???

2005-12-21 Thread Jay Blanchard
[snip]
 $query= SELECT title FROM $cat WHERE id='$id';
[/snip]

echo $query; // does it look right to you?
Alway throw an error when in question

if(!($result = mysql_query($query, $connection))){
   echo mysql_error() . br\n;
   exit();
}

My bet is that you need to concatenate

$query = SELECT title FROM  . $cat .  WHERE id = '. $id .' ;

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



Re: [PHP] select statement with variables ???

2005-12-21 Thread Jochem Maas

side-question
Jay how come you though concating would give
a different result to interpolation?
/side-question

Jay Blanchard wrote:

[snip]


$query= SELECT title FROM $cat WHERE id='$id';


[/snip]

echo $query; // does it look right to you?
Alway throw an error when in question

if(!($result = mysql_query($query, $connection))){
   echo mysql_error() . br\n;
   exit();
}



up to here I agree with Jay 100%, especially the 'echo' part (also get
familiar with var_dump() and print_r() functions to help debug your problems...


My bet is that you need to concatenate

$query = SELECT title FROM  . $cat .  WHERE id = '. $id .' ;


now unless either $cat or $id is actually an object with a 'magic'
__toString() method defined and the engine has been changed to fully/properly
support 'magic' object2string casting I don't agree that concat'ing will help
(even all of what I sAid was true I don't think it would help either),
the reaosn being that AFAICT the following 2 statements leave you with the same
string:


$cat = mytable;
$id  = 1234;
$one = SELECT title FROM $cat WHERE id='$id';
$two = SELECT title FROM .$cat. WHERE id = '.$id.';

var_dump( ($one === $two) ); // -- will show you that this equates to TRUE.

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



RE: [PHP] select statement with variables ???

2005-12-21 Thread Jay Blanchard
[snip]
side-question
Jay how come you though concating would give
a different result to interpolation?
/side-question
[/snip]

It is not really a different result, it is just something that I am in the
habit of doing. The concat or not to concat question has fueled many a
holy war. I concat, others do not. I am used to seeing it and looking for it
in code. Others think that it adds too much junk.

[snip]
 My bet is that you need to concatenate

...I don't agree that concat'ing will help...
[/snip]

I probably shouldn't have used bet...I just should have suggested it.

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



Re: [PHP] select statement with variables ???

2005-12-21 Thread Jochem Maas

Jay Blanchard wrote:

[snip]
side-question
Jay how come you though concating would give
a different result to interpolation?
/side-question
[/snip]

It is not really a different result, it is just something that I am in the
habit of doing. The concat or not to concat question has fueled many a
holy war. I concat, others do not. I am used to seeing it and looking for it
in code. Others think that it adds too much junk.


I see - personally I don't give a  about this holy war; I use both
pretty interchangably - depends on the context what I think looks neater.

tangent
it is my believe the technically this:

echo $a, $b, $c;

is (should be) faster than:

echo $a . $b . $c;

can anyone confirm this to be true?
/tangent



[snip]


My bet is that you need to concatenate



...I don't agree that concat'ing will help...
[/snip]

I probably shouldn't have used bet...I just should have suggested it.


I still stand by the fact that whether you bet or suggest the OP would end up
with the same broken query string.

now the hint about using ECHO .. that you could have written in 40 foot high 
letters :-)





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



Re: [PHP] pspell dictionary issue

2005-12-21 Thread Adi
I found my problem...I was using:

pspell_new(en, british);
pspell_new(en, american);
pspell_new(en, canadian);

and I should've been using:

pspell_new(en_GB, british);
pspell_new(en_US, american);
pspell_new(en_CA, canadian);

if I want to use specific dictionaries in the english language. There is no
sign of this in the documentation; I stumbled upon this by chance...trying
everything to resolve my problem.

Take care...
Adam.


Re: [PHP] Help Desk software

2005-12-21 Thread Daniel Lahey
I found one set of links that might prove helpful:  http:// 
www.helpdesk.com/software-helpdesk.htm  A lot of the software doubles  
as asset management software or comes bundled with such a module.   
There are a yitload of links on that page.  I'm only on the Bs.  Good  
luck.


On Dec 21, 2005, at 12:05 AM, [EMAIL PROTECTED] wrote:


Daniel Lahey said the following on 12/20/2005 10:28 PM:

Can anyone recommend some good Open-Source Help Desk software for
PHP?



Glenn Sieb said:
IMHO the best is RT, which is Perl and Mason.
(http://www.bestpractical.com/rt)

There are some nice PHP ones out there, but I don't have any
experience
with them:

ruQueue: http://freshmeat.net/projects/ruqueue/
Hesk: http://www.phpjunkyard.com/free-helpdesk-software.php
Help Desk Software: http://www.helpdeskreloaded.com/

I'm sure there are more..


At the risk of hijacking this thread, I was hoping to see, in the
answers to Daniel's question, software that handled software/hardware
itinerary and problem history .. so support, but for a closed group of
users, rather like a medical history for each machine and user. Anyone
know of anything like that?

J


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



[PHP] HTML rendering extension?

2005-12-21 Thread Marcus Bointon
Has anyone seen such a thing? I'm looking to be able to generate web  
page previews dynamically and automatically, so I need to render the  
page on the server. The most efficient way would be if there was a  
PHP HTML rendering extension - gecko or KHTML perhaps. HTML2PDF  
doesn't go nearly far enough. Alternatively something like a CLI  
option to firefox to run without X (i.e. no visible windows) and  
output to a file instead of a display device. The options here don't  
indicate that it can do that:


http://kb.mozillazine.org/Command_line_arguments

Any other ideas?

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

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



Re: [PHP] HTML rendering extension?

2005-12-21 Thread Richard Lynch
On Wed, December 21, 2005 12:13 pm, Marcus Bointon wrote:
 Has anyone seen such a thing? I'm looking to be able to generate web
 page previews dynamically and automatically, so I need to render the
 page on the server. The most efficient way would be if there was a
 PHP HTML rendering extension - gecko or KHTML perhaps. HTML2PDF
 doesn't go nearly far enough. Alternatively something like a CLI
 option to firefox to run without X (i.e. no visible windows) and
 output to a file instead of a display device. The options here don't
 indicate that it can do that:

I've been told that there is a webthumb command line tool to do just
what you ask as a JPEG.

At least I *think* it was called webthumb...

Maybe from the GD folks???

It's out there somewhere, and I was going to look into it, but...

You'd feed it a URL and it gives you an image.  You need X installed,
so it can run X in the background and render it.

-- 
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] unlink, symlink and caching

2005-12-21 Thread jgmtfia Mr
I have a directory with the files:
/config/A
/config/B
and
/config/C is a symlink to /config/A.

Via php I unlink /config/C:

$FILE = '/config/C';
while(file_exists($FILE)){
unlink($FILE);
clearstatcache();
}

When run, the first time through the loop $FILE is removed from disk
as it should.

The loop then continues forever with file_exists() returning true, but
unlink() returns false with the error message Warning:
unlink(/config1/C) [function.unlink]: No such file or directory in
/www/script.php on line 10

If I do this:
$FILE = '/config/C';
unlink($FILE);
cleanstatcache();
symlink('/config/B', '/config/C');

I get the error message:
Warning: symlink() [function.symlink]: File exists in /www/script.php
on line 11

However the link had been deleted.

The symlink /config/C is read via file_get_contents() before the
unlink and relink is performed.

I have also done the following:
$FILE = '/config/C';
unlink($FILE);
`ln -s /config/B /config/C`

Which works as expected, the old link is replaced with the new link,
however any attempt to open and read from the new link returns the
contents of the old file.

How would I be able to get the expected behavior from PHP.  I expect
that the problem has something to do with the symlinks being used.

Any assistance is appreciated.


PHP Version: 5.1.0
Server API: Apache 2.0 Handler
PHP API: 20041225
PHP Extension: 20050922
Zend Extension: 220051025
Apache Version: Apache/2.0.52 (Unix) PHP/5.1.0
Apache API Version: 20020903

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



[PHP] sorting dates with php

2005-12-21 Thread Ross
Hi,

Have a load of dates in the format DD/MM/YY. Thet are stored as a VARCHAR on 
a mysql DB.

I need a way to sort them into order(most recent first)


Using the QUERY   $query = SELECT doc_date FROM papers ORDER BY doc_date 
DESC;

this just arranges them by day. e.g


30/12/2005
30/11/2005
22/12/2005
19/12/2005
17/12/2005
12/12/2005
10/12/2005
06/12/2007
06/09/2002
05/12/2005
05/09/2005



Now I have tried to use strtotime() but I find this needs a timezone (GMT) 
to work and I don't know if the server supports it. Also I find strototime() 
and mktime() very confusing and a things go wrong of you work in GMT because 
we also have Brittish Summer Time where the clocks get put back/forward at 
certain time of the year.

Is there a simple function like sort() that could do it??

R. 

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



Re: [PHP] unlink, symlink and caching

2005-12-21 Thread Curt Zirzow
On Wed, Dec 21, 2005 at 11:27:23AM -0700, jgmtfia Mr wrote:
 I have a directory with the files:
   /config/A
   /config/B
 and
   /config/C is a symlink to /config/A.
 
 Via php I unlink /config/C:
 
   $FILE = '/config/C';
   while(file_exists($FILE)){
   unlink($FILE);
   clearstatcache();
   }
 
 When run, the first time through the loop $FILE is removed from disk
 as it should.
 
 The loop then continues forever with file_exists() returning true, but
 unlink() returns false with the error message Warning:
 unlink(/config1/C) [function.unlink]: No such file or directory in
 /www/script.php on line 10
 
This might be an issue with the OS or Filessystem.  The code
works just fine for me, i dont even need the clearstatcache().


Curt.
-- 
cat .signature: No such file or directory

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



Re: [PHP] sorting dates with php

2005-12-21 Thread André Medeiros
You COULD sort them if the date was stored backwards, ie. Year/Month/Day

On 12/21/05, Jim Moseby [EMAIL PROTECTED] wrote:
  Have a load of dates in the format DD/MM/YY. Thet are stored
  as a VARCHAR on
  a mysql DB.
 
  I need a way to sort them into order(most recent first)
 
 
  Using the QUERY   $query = SELECT doc_date FROM papers ORDER
  BY doc_date
  DESC;
 
  this just arranges them by day. e.g
 
 
  30/12/2005
  30/11/2005
  22/12/2005
  19/12/2005
  17/12/2005
  12/12/2005
  10/12/2005
  06/12/2007
  06/09/2002
  05/12/2005
  05/09/2005
 
 
 
  Now I have tried to use strtotime() but I find this needs a
  timezone (GMT)
  to work and I don't know if the server supports it. Also I
  find strototime()
  and mktime() very confusing and a things go wrong of you work
  in GMT because
  we also have Brittish Summer Time where the clocks get put
  back/forward at
  certain time of the year.
 
  Is there a simple function like sort() that could do it??
 

 Hi!

 Its a real shame your dates aren't stored in a DATE type field instead of
 VARCHAR, because you can just sort them in your query with order by DATE.
 If its possible, you would really benefit by converting them and storing
 them in the proper DATE type field.

 That being said, I suppose you could explode() them into an array then
 figure out how to sort them from there.

 JM

 --
 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] unlink, symlink and caching

2005-12-21 Thread jgmtfia Mr
  The loop then continues forever with file_exists() returning true, but
  unlink() returns false with the error message Warning:
  unlink(/config1/C) [function.unlink]: No such file or directory in
  /www/script.php on line 10

 This might be an issue with the OS or Filessystem.  The code
 works just fine for me, i dont even need the clearstatcache().

Thank you for checking on this.

I am using debain stable with a 2.6.14.3 kernel.  The filesystem in
question is ext2 on a 48 MB ramdisk.

I also did the following on another machine using ext2 on a harddisk
with command line php.

?php
/*
-rw-r--r--  1 user user  0 Dec 21 12:41 A
-rw-r--r--  1 user user  0 Dec 21 12:41 B
lrwxr-xr-x  1 user user  1 Dec 21 12:43 C - A
-rw-r--r--  1 user user 91 Dec 21 12:41 test.php
*/

$FILE = 'C';

while(file_exists($FILE)){
echo $FILE exists\n;
echo `ls -l C`;
if(!unlink($FILE)){
echo Unable to delete $FILE\n;
echo `ls -l C`;
}else{
echo Deleted $FILE\n;
}
echo \n;
}

/*
Output:
php5 ./test.php

C exists
lrwxr-xr-x  1 user user 1 Dec 21 12:59 C - A
Deleted C


C exists
ls: C: No such file or directory
Warning: unlink(C): No such file or directory in
/home/user/x/test.php on line 14
Unable to delete C
ls: C: No such file or directory


C exists
ls: C: No such file or directory
Warning: unlink(C): No such file or directory in
/home/user/x/test.php on line 14
Unable to delete C
ls: C: No such file or directory

 */

?

This shows that apache is not responsible for the problem.

Note also that if I delete A and C within the loop the code works as
expected and the loop only executes once.  So file_exists() is seeing
A when I tell it to delete C and unlink is seeing C as it
should.

Any ideas where to start to look for the cause of the problem?

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



[PHP] GD/Freetype text problems with bold or size 8

2005-12-21 Thread Jason Young
Currently, I'm running PHP 5.0.4 (only because it's the only one I can 
get to work on my FC4 x64 install!), but for some reason, using pixel 
sizes under 8, or using bold fonts, makes the text look horrible.
My old host (11 in case anyone else has them..) had this working well, 
but I have no idea what their settings were.


I've heard that editing the gd.h file to change the resolution from 96 
to 72 helps, but I'm assuming I'd have to recompile something for that 
to take effect, and I can't find a PHP-GD Source RPM for my arch.


What must I do to get everything smooth again?

Fedora Core 4, x64
PHP 5.0.4
PHP-GD module (separate RPM install)
Freetype 2.1
gd-2.0.33

Thank you.

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



Re: [PHP] HTML rendering extension?

2005-12-21 Thread M

Marcus Bointon wrote:
Has anyone seen such a thing? I'm looking to be able to generate web  
page previews dynamically and automatically, so I need to render the  
page on the server. The most efficient way would be if there was a  PHP 
HTML rendering extension - gecko or KHTML perhaps. HTML2PDF  doesn't go 
nearly far enough. Alternatively something like a CLI  option to firefox 
to run without X (i.e. no visible windows) and  output to a file instead 
of a display device. The options here don't  indicate that it can do that:


http://kb.mozillazine.org/Command_line_arguments

Any other ideas?

Marcus


http://marginalhacks.com/Hacks/html2jpg/

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



Re: [PHP] sorting dates with php

2005-12-21 Thread Chris Lott
On 12/21/05, Ross [EMAIL PROTECTED] wrote:
 Hi,

 Have a load of dates in the format DD/MM/YY. Thet are stored as a VARCHAR on
 a mysql DB.

Couldn't you use cast() to cast the values first? Something like (untested):

SELECT CAST(doc_date AS DATE) FROM papers ORDER BY doc_date DESC

c

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



Re: [PHP] HTML rendering extension?

2005-12-21 Thread Marcus Bointon

On 21 Dec 2005, at 21:18, M wrote:


http://marginalhacks.com/Hacks/html2jpg/


That's the kind of marginal hack I was hoping to avoid ;^) However,  
it did lead me to http://khtml2png.sourceforge.net/ which seems far  
more like it. Now I just have to persuade it to compile.


Thanks.

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

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



Re: [PHP] Help Desk software

2005-12-21 Thread Tim Boring
On Wed, 2005-12-21 at 09:17 -0800, Daniel Lahey wrote:
 I found one set of links that might prove helpful:  http:// 
 www.helpdesk.com/software-helpdesk.htm  A lot of the software doubles  
 as asset management software or comes bundled with such a module.   
 There are a yitload of links on that page.  I'm only on the Bs.  Good  
 luck.

We use EnterTrack (http://www.entertrack.org) in my company.  We've been
using it for about 2 years and are pretty happy with it.  I've also done
some customization to our EnterTrack installation in order to integrate
it with our company intranet.  It's focus is on tracking/archiving
issues, so it doesn't have any functionality for asset management.  But
it does have a pretty flexible group/permissions system that allows you
to set up multiple groups and provides various levels of access to
users.

At one time, I evaluated phpMyInventory for asset management.  There is
the free version (http://phpmyinventory.sourceforge.net/index.php) and
there is also a commercial version.  We ended up going with Network
Inventory Analyzer from Alloy
(http://www.alloy-software.com/nin/pro.html).  It's a commercial
package, but it was inexpensive (~$1000 for 150 nodes) and met our
needs.

Hope that helps!

Tim

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



Re: [PHP] HTML rendering extension?

2005-12-21 Thread Marcus Bointon

On 21 Dec 2005, at 18:17, Richard Lynch wrote:


At least I *think* it was called webthumb...

Maybe from the GD folks???

It's out there somewhere, and I was going to look into it, but...

You'd feed it a URL and it gives you an image.  You need X installed,
so it can run X in the background and render it.


It is indeed called webthumb: http://www.boutell.com/webthumb/

After installing firefox on my server, tweaking webthumb to use  
firefox instead of Mozilla, a bit of messing with xauth settings, and  
I've got it working! It seems like a more polished alternative to  
html2jpg. It uses Xvfb for a local display so you don't need a real  
one, and it doesn't interfere with remote X sessions, though firefox  
complains if you try to run it on both X displays at once. Now I just  
need to go find a borderless chrome package for ff...


khtml2jpg is definitely a more advanced solution as it contains its  
own browser and is thus not limited by screen size - you could grab a  
page 10,000 pixels tall if you wanted to - and it can monitor browser  
state e.g. so it can know when all images are loaded instead of just  
waiting for a bit. Flipside - it's not working for me...


Thanks very much for the tip, very glad to have finally found a  
solution.


Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

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



[PHP] Connection: close Always?

2005-12-21 Thread Michael B Allen
Why does PHP always close the connection with Connection: close? I'm
using PHP 4.3.11 w/ Firefox 1.0.4. Requests are HTTP/1.1 and Connection:
keep-alive is requested.

Mike

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