php-general Digest 24 Nov 2001 15:53:00 -0000 Issue 1013
Topics (messages 75604 through 75612):
Hour Calculation
75604 by: neeraj
Is Freetype needed for Gd? Or just truetype fonts?
75605 by: Joelmon2001.aol.com
75609 by: Michael A. Peters
Variable matching...
75606 by: Ashley M. Kirchner
PHP SECURITY
75607 by: outbound.centrum.cz
75612 by: Kurt Lieber
UDP Sockets (networking)
75608 by: Blaster
cooperation
75610 by: Boris_Lipner
Help needed developing Logic!
75611 by: Thomas Edison Jr.
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Hi List,
!! Please help !!
My problem,
1) My Start time for a xyz file is 11.15 am 14-11-2001
2) My End Time for xyz file is 01.20 pm 14-11-2001
3) Total number of hours on the file is 02.05 Hours.
1) Question is how do i calculate the difference in Hours as the result is in point
number 3 ?
Please help me Urgent
!!! Thanks in advance !!!
Warm Regards
Neeraj Rattu
--- End Message ---
--- Begin Message ---
Hello. What I mean is, I want to manipulate images
that exist, and those that I create
To use truetype fonts so the default font text
is not all that's required, but more importantly
I want to do all the stuff gd/php can do
so, I wonder if *just* having true type font support
is enough, or is freetype so special, I must get that
with libpng/gd and the rest?
IN order to make/modify images, text on those images
specifically. I am just confused that's all
Thanks for your time
Joel
--- End Message ---
--- Begin Message ---
Hi.
If you are going to be doing text stuff with gd- you definately want
FreeType.
You want t1lib as well.
I'm not positive, but I think your gd library needs to be compiled against
FreeType.
Here is the part of my configure script for gd-
--with-gd=/usr/local \
--with-jpeg-dir=/usr/local \
--with-png-dir=/usr/local \
--with-freetype-dir=/usr/local \
--with-t1lib=/usr/local \
my gd library is compiled against libpng, libjpeg, and freetype.
It is not compiled against t1lib but adding t1lib in the configure script
gives me t1lib in my php gd.
On Sat, 24 Nov 2001 03:43:36 EST
[EMAIL PROTECTED] mentioned:
> Hello. What I mean is, I want to manipulate images
> that exist, and those that I create
>
> To use truetype fonts so the default font text
> is not all that's required, but more importantly
> I want to do all the stuff gd/php can do
>
> so, I wonder if *just* having true type font support
> is enough, or is freetype so special, I must get that
> with libpng/gd and the rest?
>
> IN order to make/modify images, text on those images
> specifically. I am just confused that's all
>
> Thanks for your time
>
> Joel
>
>
--
-=-=-=-=-=-=-=-=-=-=-=-=-
Michael A. Peters
http://24.5.29.77:10080/
--- End Message ---
--- Begin Message ---
Can anyone help me with translating the following (which was
written in something else):
[NOTE: I've simplified the code for this purpose]
pairs = {{"First Name", "first_name"},{"Address", "address"}};
while (data) {
line = split($data, " ");
for pair in (pairs) {
if (match(line[1], pair[1])) {
pair[2] = line[2];
}
}
}
The idea here is that 'pairs' contains a list of items that the
program uses, by matching the first item with 'data', and if it matches,
it sets the second item with whatever 'data' is passing. With the above
code, if 'data' was something like "First Name: John" (yes, with
the spaces before the name), the result will basically set first_name to
"John". And that variable 'first_name' can be used elsewhere in the
code. When the 'data' contains 'Address' in it, it'll set the variable
'address' to whatever the second value is in data.
The code itself contains a rather large set in 'pairs' that it goes
through while there's 'data' for it to parse. However, as you can see,
the code is also rather poorly written in that it cycles through the
entire list in 'pairs' for every single line of 'data' there is. (this
is why I'm trying to rewrite this whole beast into PHP and hopefully get
something better).
The data that comes flowing in looks like this:
First Name: John
Last Name: Doe
Address: 12345 Fairy Lane
Address:
City: White Clouds
State/Province: Cloud 9
Country: Heaven
etc.
etc. (there is more information that I need to capture after this)
--
H | "Life is the art of drawing without an eraser." - John Gardner
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
Director of Internet Operations / SysAdmin . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave, #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
--- End Message ---
--- Begin Message ---
Hello,
we have strange problem.
We host more domains and each user can use PHP of course.
But when any of our user use readdir and other commands for manipulating
with directories - this user can read scripts of others.
I have found open_basedir variable in php.ini and there is written that I
should use open_basedir="." - but it doesn't work :(
Do you know what to do ?
Thank you,
Roman
--- End Message ---
--- Begin Message ---
On Saturday 24 November 2001 04:24 am, [EMAIL PROTECTED] wrote:
> But when any of our user use readdir and other commands for manipulating
> with directories - this user can read scripts of others.
>
> Do you know what to do ?
1) Read the PHP manual chapter on security:
http://www.php.net/manual/en/security.php
2) Check the archives of this mailing list. This topic has been discussed
many times before:
http://marc.theaimsgroup.com/?l=php-general
--- End Message ---
--- Begin Message ---
Hi,
I have a problem with UDP sockets in PHP. What I want to do is the
following, i send a UDP message
to a server, and a reply should come instantly back. Now, the length of the
message returned to me
is unknown. It can be anywhere from 1 to 8192 (or more) bytes. However,
some strange problems
arise when i try to do this.
I first open a udp socket to my server. The socket handle is valid, and I
send off my message.
(my socket is now in blockingmode, opened by fsockopen).
A message is returned to me and I receive one byte at the time in a loop.
The receive procedure I
use is "fgetc". It states in the manual that this function retrieves 1
byte, if the file pointer is at the
end of the stream, it should return false.
This is my code so far:
$query_handle = fsockopen("udp://$host", $port, &$errno, &$errstr, $timeout);
$request = "mymsg";
$databuffer = "";
if ($query_handle) {
fwrite($query_handle, $request);
$do = true;
while ($do) {
$tempdata = fgetc($query_handle);
if (!$tempdata) {
$do = false;
} else {
$databuffer .= $tempdata;
}
}
echo("Received " . strlen($databuffer) . " bytes of data.");
fclose($query_handle);
} else {
echo "Invalid socket handle - $errstr.\n";
}
Now, the fgetc doesn't seem to return false. Ever? Instead it sits there
and waits for another byte, but since
there is no more data, my script sits here until the script times out (30 sec).
In short,
How can I get the number of bytes waiting for me in the socket buffer (so I
can use fread to get all in one)
OR
How can I set a timeout for fgetc? For example, it should wait for a char
for x seconds.
Please help. I'm getting extremly frustrated about this now!
I've tried fread($mysockhandle, 8192) to receive all data but it doesn't
work either. It seems like
fread also waits until 8192 bytes is in the buffer, THEN returns. But since
i cannot assume the
message is a constant size, this is no good for me.
--- End Message ---
--- Begin Message ---
Dear Sirs,
For some technical reasons we have partially lost our Data Bank of art galleries.
Please, write the address of your website, so that we could continue our cooperation.
Our site is http://www.gallery-a.ru/
--
Best regards,
Boris_Lipner mailto:[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Hi,
I've made a PHP Chatroom and i need help developing
the logic behind the "Private Chat" feature.
I'll first explain briefly how my chat works.
It's a very very simple Chat using just DB and nothing
else.
User enters.. his name,date goes into Chat.
QueryString passes his name to main area from where he
can post messages with the name as the main link
between his messages & database.
You can view it at
http://www.mjimm.com/index.php3?page=chat/mjchat.html
Please choose "PHP Chat" from above link.
Anyway, now i need to develop a system where one can
private chat with a user. So that by selecting the
User's name, when the person sends a message.. it is
displayed only on the Selected User's chat.. and not
anyone else.. or perhaps some other way.
Can anyone help?
Ask me any question if you wish to clarify further how
my chat works!!
Cheers & Glory,
T. Edison jr.
=====
Rahul S. Johari (Director)
******************************************
Abraxas Technologies Inc.
Homepage : http://www.abraxastech.com
Email : [EMAIL PROTECTED]
Tel : 91-4546512/4522124
*******************************************
__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1
--- End Message ---