Re: [PHP] Binary data confusion

2003-01-11 Thread Clay Loveless
Well, I'm always trying to make it harder than it needs to be. A few more
hours of research yielded this solution:

$out = preg_replace(/\%([0-9][0-9])/e, chr(hexdec(\0x$1\)), $buf);
Header(Content-type: image/png);
echo $out;

... Worked like a charm.

If anyone can see any problems with this solution, I would be interested to
hear them!

Thanks,
Clay


 From: Clay Loveless [EMAIL PROTECTED]
 Date: Fri, 10 Jan 2003 22:09:03 -0800
 To: PHP-General [EMAIL PROTECTED]
 Subject: [PHP] Binary data confusion
 
 Hi,
 
 I've got a problem to solve regarding binary data strings, which is an area
 I don't have a lot of experience in. If anyone can help, I would be
 grateful.
 
 Here's the problem in a nutshell:
 
 I am getting a binary string from a third-party server that I need to encode
 into a PNG image. The string arrives double-quoted, so double quotes which
 may occur in the binary string have been escaped. I need to parse through
 the string and extract only the PNG data, and convert whatever has been
 escaped into usable data.
 
 I cannot control the output from the third-party -- I've got to deal with
 what they're sending. (I would much rather have them send a base64 encoded
 PNG, but unfortunately I'm not able to influence their methods.)
 
 
 Here's the problem as described by the API I'm working with:
 
 
 The rule for encoding the PNG image in the returned buffer was designed to
 eliminate certain illegal characters (byte values) by replacing them with an
 escape sequence. Those values that are not allowed include:
 
   * NULL (0x00 hex)
   * Double Quote (0x22 hex)
 
 The percent character '%' (0x25 hex) is used as the escape character, and
 therefore it must be replaced where it occurs naturally. Whenever a
 disallowed character or the escape character '%' is encountered, it is
 replaced by the escape character '%' (0x25 hex) followed by two characters
 comprising the hexadecimal numeral representing the value of the character.
 For example, the NULL character (0x00 hex) is replaced by three characters:
 
   * '%' (0x25)
   * '0' (0x30)
   * '0' (0x30)
 
 The percent character 0x25 is replaced by three characters:
 
   * '%' (0x25)
   * '2' (0x32)
   * '5' (0x35)
 
 The algorithm for decoding the PNG image in the returned buffer is as
 follows. Read bytes from the buffer one at a time. When a byte read is not
 equal to the '%' character (0x25 hex), pass it through unchanged. When a
 byte is read that is equal to the '%' character (0x25 hex), read an
 additional two bytes, which will each take a value from zero (0x30 hex)
 through nine (0x39 hex) or 'A' (0x41 hex) through 'F' (0x46 hex). These two
 bytes are interpreted as a character representation of a two-digit
 hexadecimal numeral ranging from 0x00 through 0xFF. The single byte having
 the integral value represented by that numeral is appended to your output.
 
 For example, when the 3-byte string '%22' is encountered, '' (0x22) - the
 double quote character - is passed out. When the 3 bytes '%00' are read, the
 null character is written.
 
 In essence, the developer will need to take the data received and store it
 in a buffer, which has sufficient memory to hold the entire data stream.
 Once the data has been received, the program must call a function similar to
 the one described below in order to parse the data in the buffer and extract
 only the PNG image data.
 
 
 The API then presents an example in C, which I've tried to translate into
 PHP as best as I can. It's pretty close, I think -- but I'm still not
 getting a PNG out when I'm done.
 
 Here's what I've written, based on the C example:
 
 $buf = [binary data received];
 $len = strlen($buf);
 $out = '';
 
 for ($c = 1; $c  $len; $c++) {
   $data = $buf{$c};
 
   if ($data != '%')
   $out .= $data;
 
   if ($data == '%') {
   for ($e = 0; $e  2; $e++) {
   $c++;
   $data = $buf{$c};
 
   if ((($data = 0x30)  ($data = 0x39))
   || (($data = 0x41)  ($data = 0x46))) {
   if ($e == 1) {
   $d = $data;
   $d = $d  0x0f;
   if (($data = 0x41)  ($data = 0x46)) {
   $d += 9;
   }
   $store = $store | $d;
   } else {
   $d = $data;
   $d = $d  0x0f;
   if (($data = 0x41)  ($data = 0x46)) {
   $d += 9;
   }
   $store = $d  4;
   }
   }
   
   }
 
   $out .= $store;
   }
 }
 
 Header(Content-type: image/png);
 echo $out;
 
 
 
 I'm just getting a blank screen at the end here -- not a PNG image.
 
 

[PHP] Session vars vs. POST/GET vars?

2003-01-11 Thread Noel Wade
Hi all,

So I have a session variable; but with register_globals active on the server
I'm hosted at (no way to turn it off), just checkng for $varX in my script
could retrieve the session variable, a GET variable with the same name, or a
POST variable with the same name - and as a security concern, someone could
use a GET request (http://somehost/mypage.php?varX=0) to spoof the script
into thinking that varX is the wrong value.

So, is there any way in a script to specify that I want to retrieve the
value stored in the registered session_variable(varX)??

Thanks,

--Noel




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




[PHP] Re: Session vars vs. POST/GET vars?

2003-01-11 Thread Noel Wade
Nevermind, just found the $HTTP_SESSION_VARS array...

Thanks anyways!  Take care,

--Noel

Noel Wade [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi all,

 So I have a session variable; but with register_globals active on the
server
 I'm hosted at (no way to turn it off), just checkng for $varX in my
script
 could retrieve the session variable, a GET variable with the same name, or
a
 POST variable with the same name - and as a security concern, someone
could
 use a GET request (http://somehost/mypage.php?varX=0) to spoof the script
 into thinking that varX is the wrong value.

 So, is there any way in a script to specify that I want to retrieve the
 value stored in the registered session_variable(varX)??

 Thanks,

 --Noel






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




Re: [PHP] Session vars vs. POST/GET vars?

2003-01-11 Thread Jason k Larson
FYI:
Don't like auto register globals ... try the following at the beginning 
of your script.

ini_set ('register_globals','Off');

Works for me places I'm hosted at.

HTH,
Jason k Larson


Noel Wade wrote:
Hi all,

So I have a session variable; but with register_globals active on the server
I'm hosted at (no way to turn it off), just checkng for $varX in my script
could retrieve the session variable, a GET variable with the same name, or a
POST variable with the same name - and as a security concern, someone could
use a GET request (http://somehost/mypage.php?varX=0) to spoof the script
into thinking that varX is the wrong value.

So, is there any way in a script to specify that I want to retrieve the
value stored in the registered session_variable(varX)??

Thanks,

--Noel







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




[PHP] version confusion - please help

2003-01-11 Thread Christian Stalberg
what does debug_phpinfo.php read to get its information?

When I run debug_phpinfo.php in my browser it says version 4.2.3

But when I execute php -v at the command line I get 4.0.4pl1


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




Re: [PHP] session_destroy problem

2003-01-11 Thread Tamás Árpád
 You da man.  Unload is perfect.  If the problem he mentioned before
prevents
 the browser from finishing its communication with the server you can
always
 send a wait command with sufficient time for things to finish up.  I'll
 start testing in a live environment with it now.  Thank you for the help.
You don't have to use the wait function, I just made it to show that the
browser will always wait till the script finishes it's job.
Arpi





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




php-general Digest 11 Jan 2003 12:20:39 -0000 Issue 1816

2003-01-11 Thread php-general-digest-help

php-general Digest 11 Jan 2003 12:20:39 - Issue 1816

Topics (messages 131210 through 131239):

Re: Make fil downloadable
131210 by: Timothy Hitchens \(HiTCHO\)
131211 by: Stephen
131213 by: Timothy Hitchens \(HiTCHO\)
131214 by: Stephen
131217 by: Timothy Hitchens \(HiTCHO\)
131218 by: Stephen
131219 by: Stephen

php with mime magic?
131212 by: Rob Brandt

Re: session_destroy problem
131215 by: Tamás Árpád
131232 by: Larry Brown
131239 by: Tamás Árpád

Re: Source Guardian
131216 by: UberGoober
131224 by: michael kimsal
131226 by: Sean Malloy
131227 by: michael kimsal

Suggestions on FAQ application?
131220 by: Jeff Lewis
131221 by: Timothy Hitchens \(HiTCHO\)
131222 by: Jeff Lewis
131223 by: Sean Malloy
131225 by: michael kimsal

Re: Medium to Large PHP Application Design
131228 by: Manuel Lemos

Re: how to passing two dimension array
131229 by: Rizki Salamun

Re: Encrypt in Javascript and Decrypt in PHP
131230 by: Gerald Timothy Quimpo

Binary data confusion
131231 by: Clay Loveless
131233 by: Clay Loveless

Session vars vs. POST/GET vars?
131234 by: Noel Wade
131235 by: Noel Wade
131236 by: Jason k Larson

Using $vars from include()d functions in the main programm and other functions
131237 by: ben9000

version confusion - please help
131238 by: Christian Stalberg

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]


--

---BeginMessage---
You need to send headers to tell the browser how to handle it see:
header(); or.. if it is a php file and you want the visitor to
see/download the source you would be better off giving it another
extension eg .phps or .txt etc or have a handler file that did a
readfile after sending headers.


Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: [EMAIL PROTECTED] 


-Original Message-
From: Stephen [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, 11 January 2003 10:17 AM
To: PHP List
Subject: [PHP] Make fil downloadable


I need to somehow make it so when a user clicks a link, then get
displayed the download dialogue for the file. The file is a .php file so
I'm not sure how this is done but I've seen it been done before. How can
you do this?

Thanks,
Stephen Craton
http://www.melchior.us

What's the point in appearance if your true love, doesn't care about
it? -- http://www.melchior.us


---End Message---
---BeginMessage---
It's a dynamically created file the user downloads and uses later as a PHP
script. If I put header() in it, that would make it downloadable again when
the user uses it on his/her server, wouldn't it?


- Original Message -
From: Timothy Hitchens (HiTCHO) [EMAIL PROTECTED]
To: 'Stephen' [EMAIL PROTECTED]; 'PHP List'
[EMAIL PROTECTED]
Sent: Friday, January 10, 2003 7:24 PM
Subject: RE: [PHP] Make fil downloadable


: You need to send headers to tell the browser how to handle it see:
: header(); or.. if it is a php file and you want the visitor to
: see/download the source you would be better off giving it another
: extension eg .phps or .txt etc or have a handler file that did a
: readfile after sending headers.
:
:
: Timothy Hitchens (HiTCHO)
: Open Platform Consulting
: e-mail: [EMAIL PROTECTED]
:
:
: -Original Message-
: From: Stephen [mailto:[EMAIL PROTECTED]]
: Sent: Saturday, 11 January 2003 10:17 AM
: To: PHP List
: Subject: [PHP] Make fil downloadable
:
:
: I need to somehow make it so when a user clicks a link, then get
: displayed the download dialogue for the file. The file is a .php file so
: I'm not sure how this is done but I've seen it been done before. How can
: you do this?
:
: Thanks,
: Stephen Craton
: http://www.melchior.us
:
: What's the point in appearance if your true love, doesn't care about
: it? -- http://www.melchior.us
:
:
: --
: PHP General Mailing List (http://www.php.net/)
: To unsubscribe, visit: http://www.php.net/unsub.php
:
:
:



---End Message---
---BeginMessage---
eg:

a href=file.phpDownload File Click Here/a

Now in the file.php you have:

?php

header(Content-type: text/plain);
header(Content-Disposition: attachment; filename=xxx.php);;
// now we read the real file
readfile('xxx.php');

exit();

?

This won't put the headers into the downloaded file and remember to
change the xxx.php into the file
to be delivered and the xxx.php in the header to the name you would like
them to save as.

* the file.php in the top is not the real file but a script that reads
into the buffer the real file!!



Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: [EMAIL PROTECTED]

 -Original Message-
 From: Stephen [mailto:[EMAIL 

[PHP] Change Date

2003-01-11 Thread Naqashzade, Sadeq
Hi,
How can I find time stamp for example 125 next days. or 03:30 hours next?

Regards,
S. Naqashzade
PS: Sorry for my bad english :-(



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




[PHP] Re: Using $vars from include()d functions in the main programm andother functions

2003-01-11 Thread Thomas Seifert
They should show up but still think of the order
in which they are loaded.
You can access vars which are not yet loaded.
Also you can't access variables which are initialized in a function (if they are not 
global).

Including adds the contents of the files as if it was directly in main.php4, they are 
not 
new namespaces


Thomas




On Sat, 11 Jan 2003 12:49:15 +0100 [EMAIL PROTECTED] (Ben9000) wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Hello List,
 
 a simple problem turned out to be not so simple as I thought.
 
 Here the situation:
 main.php4
 |
 +-include() mainhtml.php4
 |
 +-include() functions.php4
   |
   +a function does include() languagevars.php4
 
 I can see the included $vars from languagevars.php4 in functions.php4 
 but not in main.php4. 
 
 Using global $var just seems to work top-down but I'm not able to 
 bring the $vars up to the main.php4 or to the mainhtml.php4.
 
 This time, I just wanted to write not one scary large PHP4-Page with 
 around ~100kb in size. But I'm really stuck - all the books, pdfs and 
 web information just want to bring the $vars down. 
 
 Or is there just a failure in thinking?!
 
 Any hint is highly appreciated.
 Ben :)
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.2.1 (GNU/Linux)
 
 iD8DBQE+IATAROwluvOuI4ARApiOAJ9EyDo2ER3YROGZ120CgllOkjM8tgCfUIeD
 pxtKmzi71xC3n8Tpb0FSQ7w=
 =BZcc
 -END PGP SIGNATURE-

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




[PHP] Re: Change Date

2003-01-11 Thread Thomas Seifert
http://de.php.net/manual/en/function.mktime.php

The most important part is 
mktime() is useful for doing date arithmetic and validation, as it will automatically 
calculate the correct value for out-of-range input.



Thomas

On Sun, 11 Jan 2004 16:12:01 +0330 [EMAIL PROTECTED] (Sadeq Naqashzade) wrote:

 Hi,
 How can I find time stamp for example 125 next days. or 03:30 hours next?
 
 Regards,
 S. Naqashzade
 PS: Sorry for my bad english :-(
 
 

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




[PHP] Re: Change Date

2003-01-11 Thread Naqashzade, Sadeq

So Thanks, but can you get me some example code?

Regards,
Sadeq

Thomas Seifert [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 http://de.php.net/manual/en/function.mktime.php

 The most important part is
 mktime() is useful for doing date arithmetic and validation, as it will
automatically calculate the correct value for out-of-range input.



 Thomas

 On Sun, 11 Jan 2004 16:12:01 +0330 [EMAIL PROTECTED] (Sadeq Naqashzade) wrote:

  Hi,
  How can I find time stamp for example 125 next days. or 03:30 hours
next?
 
  Regards,
  S. Naqashzade
  PS: Sorry for my bad english :-(
 
 



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




[PHP] count characters without space

2003-01-11 Thread harald.mohring
who knowes how to count the charcaters in a string without the space
character?

thanks harry



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




[PHP] Make thumbnail online

2003-01-11 Thread Naqashzade, Sadeq
Hi every one,
I want to create thumbnail of a photo stored in MySQL table online.

Best Wishes,
S. Naqashzade




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




Re: [PHP] count characters without space

2003-01-11 Thread Gerald Timothy Quimpo
On Saturday 11 January 2003 08:51 pm, [EMAIL PROTECTED] wrote:
 who knowes how to count the charcaters in a string without the space
 character?

you need to be more clear.

number of characters in the string except space?
number of distinct characters in the string except space?
include other non-space whitespace (\t \n \r etc)?

case sensitive?

this is really not hard at all and would be educational for you to 
write yourself, as an exercise in learning php.

one approach:

1.  create an empty string, charsfound.  
 for each character in your input string, see if the character already 
exists in charsfound (use strchr or strpos).  
if it's a space, continue the loop (don't exec the code below).
if  it's already there, skip to the next character.
if it's not yet there, increment a counter, add the character to
charsfound and continue the loop.

 at the end of the input string exit the loop.  the counter is the
 number of distinct non-space characters in the input string.

 putting the increment a counter elsewhere (but in the appropriate
 places) in the  loop will give you the number of non-space (not distinct)
 characters in the input string.

tiger

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

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




[PHP] Date Comparison

2003-01-11 Thread Dhaval Desai
Hello ppl,


Well, I want to compate date is php, could anybody tell me which is the best 
way to do so? I have tried various ways but nothing seems consistent.
I tried for example:
if(2003-1-15  2003-1-11)
{
echo true;

}
which doesn't work in some cases...

Thank you!


Best Regards,
Dhaval




_
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail


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



Re: [PHP] Date Comparison

2003-01-11 Thread Matt
- Original Message -
From: Dhaval Desai [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, January 11, 2003 8:38 AM
Subject: [PHP] Date Comparison
 Well, I want to compate date is php, could anybody tell me which is the
best  way to do so?

Look at PHPs date functions http://www.php.net/manual/en/ref.datetime.php
in particular, strtotime() and then compare the timestamps.



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




[PHP] Re: Change Date

2003-01-11 Thread Thomas Seifert

i.e.
// getting the current time in an array
$timeval=localtime();

// we want the time 3 hours in the future
$timeval[2] = $timeval[2]+3;

// calc the new timestamp
$timestamp=mktime ($timeval[2], $timeval[1], $timeval[0], $timeval[4], $timeval[3], 
i$timeval[5]);



An even better solution, you are talking about a unix-timestamp, right?

just add or subtract the the seconds from the current timestamp,
i.e.

// get the current timestamp
$timestamp=time();

// 1 minute = 60 seconds, 1 hour = 60 minutes, therefore 1 hour = 60*60 = 3600 seconds
// so we add 3600*3 to have the time in 3 hours
$timestamp = $timestamp + (3600*3);

// you can convert this time back to a readable format using strftime



Regards,

Thomas

On Sun, 11 Jan 2004 16:22:08 +0330 [EMAIL PROTECTED] (Sadeq Naqashzade) wrote:

 
 So Thanks, but can you get me some example code?
 
 Regards,
 Sadeq
 
 Thomas Seifert [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  http://de.php.net/manual/en/function.mktime.php
 
  The most important part is
  mktime() is useful for doing date arithmetic and validation, as it will
 automatically calculate the correct value for out-of-range input.
 
 
 
  Thomas
 
  On Sun, 11 Jan 2004 16:12:01 +0330 [EMAIL PROTECTED] (Sadeq Naqashzade) wrote:
 
   Hi,
   How can I find time stamp for example 125 next days. or 03:30 hours
 next?
  
   Regards,
   S. Naqashzade
   PS: Sorry for my bad english :-(
  
  
 
 

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




[PHP] Re: Make thumbnail online

2003-01-11 Thread Thomas Seifert
how about just reading the docs which are available online?
http://de.php.net/manual/en/ref.image.php

and especially 
http://de.php.net/manual/en/function.imagecopyresized.php

will help.


Thomas

On Sun, 11 Jan 2004 16:32:36 +0330 [EMAIL PROTECTED] (Sadeq Naqashzade) wrote:

 Hi every one,
 I want to create thumbnail of a photo stored in MySQL table online.
 
 Best Wishes,
 S. Naqashzade
 
 
 

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




[PHP] COM object

2003-01-11 Thread [EMAIL PROTECTED]
How I can create a Word document through PHP?
Must I modify php.ini?


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




Re: [PHP] Suggestions on FAQ application?

2003-01-11 Thread Jeffrey B. Ferland
 Why re-invent what is already written? I'm well aware that it's easy to
 write but there may be something out there already that suits my needs and
 has some features that I hadn't thought of. If you don't have a suggestion
 on a package please spare me the rude replies which seem to run rampant on
 here lately...

Though I agree the reply given was rather crude, and I think also
unnecessary, so was you question. It is rather a waste of the time of the
list's membership to spend their time doing searches for you to find code
packages. It is my impression, at least, that this list exists to provide
assistance on a somewhat higher level of issues. Your question was worded in
such a way that it wasn't very different from this:

 Hi every one,
 I want to create thumbnail of a photo stored in MySQL table online.

 Best Wishes,
 S. Naqashzade

And that is not something I care to bother with. I spent the effort of
typing php thumbnail mysql photo into Google. And as a surprise to some, I
had to refine the search once to get that, and what you're looking for
you'll sometimes have to scroll down for or *gasp* even head to the next 10
results.

I suggest going to Google's directory:
http://directory.google.com/Top/Computers/Programming/Languages/PHP/Scripts/
try doing a search for FAQ. Since I really don't know what it is you want, I
can't help much more than that. The basic idea is spend some time searching,
look inside of well-known script sites, dig through the search enginges...
You might also be able to strip the FAQ section out of PHP Nuke, but that's
a confusing mess in its own right. Forgive my bitterness, but Sometimes you
end up looking at a question and going Why am I wasting my time on this?
This person expects me to do everything but make their site.

Don't straight-up ask for info on questions that are covered EVERY WEEK, and
do look at more than just one site.

-Jeff
SIG: HUP


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




Re: [PHP] count characters without space

2003-01-11 Thread Jeffrey B. Ferland
 who knowes how to count the charcaters in a string without the space
 character?

Using a regular expression to strip out all the spaces before passing to the
word counting function seems easiest. You'll be left to adapt it to PHP, but
the regexp is: 's/ //g' That removes all spaces. If it gives an error, try
s/\ //g to escape the space. Pass the result to whatever you use to count
the number of characters.

-Jeff
SIG: HUP


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




[PHP] Problem with Search Engine Friendly URLs under PHP Windows XP

2003-01-11 Thread Jonathan Chum
I'm following various tutorials online that uses the PATH_INFO to do this,
however Apache isn't playing nicely. I read a few documents that Apache has
a built in look back feature, but a query on google on lead me back to a few
articles that I just read so I'm assuming this feature is made up in the
article?

I've gotten the .htaccess to run a file as a .php, however I can't attach
arguments to the right hand side of the URL. An example would be, I have a
file called index.php. I turn this into index and run it as a .php file. It
works fine, though I should be able to add /name/1 which shows up under the
PATH_INFO variable.

However, I get a blank page and this error logged in Apache:

[Sat Jan 11 10:33:40 2003] [error] [client 127.0.0.1] PHP Fatal error:
Unable to open c:\apache\www\www.mxportal.com\public_html\dir\resources\d in
Unknown on line 0

So it looks like Apache is not reading back to resources, but thinks there
is  folder called resources and a file called d in which it's trying to open
and pass it to PHP.

This however works under *NIX systems. I'm not sure if there's a different
of doing it under Windows or if this is a bug in Apache. Any ideas?



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




Re: [PHP] Suggestions on FAQ application?

2003-01-11 Thread John Nichel
Maybe y'all should take your flame war off list?  Just a friendly little 
suggestion.

Jeffrey B. Ferland wrote:
Why re-invent what is already written? I'm well aware that it's easy to
write but there may be something out there already that suits my needs and
has some features that I hadn't thought of. If you don't have a suggestion
on a package please spare me the rude replies which seem to run rampant on
here lately...



Though I agree the reply given was rather crude, and I think also
unnecessary, so was you question. It is rather a waste of the time of the
list's membership to spend their time doing searches for you to find code
packages. It is my impression, at least, that this list exists to provide
assistance on a somewhat higher level of issues. Your question was worded in
such a way that it wasn't very different from this:



Hi every one,
I want to create thumbnail of a photo stored in MySQL table online.

Best Wishes,
S. Naqashzade



And that is not something I care to bother with. I spent the effort of
typing php thumbnail mysql photo into Google. And as a surprise to some, I
had to refine the search once to get that, and what you're looking for
you'll sometimes have to scroll down for or *gasp* even head to the next 10
results.

I suggest going to Google's directory:
http://directory.google.com/Top/Computers/Programming/Languages/PHP/Scripts/
try doing a search for FAQ. Since I really don't know what it is you want, I
can't help much more than that. The basic idea is spend some time searching,
look inside of well-known script sites, dig through the search enginges...
You might also be able to strip the FAQ section out of PHP Nuke, but that's
a confusing mess in its own right. Forgive my bitterness, but Sometimes you
end up looking at a question and going Why am I wasting my time on this?
This person expects me to do everything but make their site.

Don't straight-up ask for info on questions that are covered EVERY WEEK, and
do look at more than just one site.

-Jeff
SIG: HUP





--
By-Tor.com
It's all about the Rush
http://www.by-tor.com


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




[PHP] Re: Template tutorials?

2003-01-11 Thread David Eisenhart
Check out the Smarty tutorial links page from it's site resources section  -
http://smarty.php.net/resources.php?category=0

Also the Smarty manual is excellent - very comprehensive and well written. I
just about taught myself Smarty using this alone.

I think Smarty is the absolute biz when it comes to php template engines;
well worth giving a really good test run.

D.




Chad Day [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'm googling around for template tutorials and such after seeing a link to
 the Smarty template engine .. can anyone point me to any particularly good
 ones?  I've always been going with the 'one-file' approach .. which I
think
 it's time I changed.

 Thanks,
 Chad










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




RE: [PHP] Is this possible with php?

2003-01-11 Thread Rasmus Lerdorf
You should probably mention that this is called WebFolders in M$-speak and 
it actually works quite well when combined with the mod_dav and mod_digest 
Apache modules.

-Rasmus

On Fri, 10 Jan 2003, Timothy Hitchens (HiTCHO) wrote:

 So you want to be able to have a directory that when saved to it is
 really the server well
 besides ftp or samba integration into explorer the only other option you
 have is to use
 webdav with apache and that way it would be a post of sorts to the mod
 webdav module in apache.
 
 
 
 Timothy Hitchens (HiTCHO)
 Open Platform Consulting
 e-mail: [EMAIL PROTECTED]
 
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
  Sent: Friday, 10 January 2003 4:06 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] Is this possible with php?
  
  
  I would like to know if the follwing function can be 
  implemneted in php with help of other tools:
  
  using MS Word in windows, when a file is saved, can it be 
  AUTOMATICALLY uploaded (via http POST or other mechanism) to a server?
  
  Currently I need to first save it on my desktop, then upload 
  that copy to a php-supported server.
  
  Thanks in advance.
  
  Tim
  
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 
 


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




[PHP] Sorting arrays

2003-01-11 Thread Chris Kay

I have a array as below I wish to sort if by the key fff

name = blah
fff = 4
join = pppop

name = ttoo
fff = 3
join = wewe

name = blff
fff = 9
join = ppeep

Any1 know of a quick way to do this, I have been looking at the sorting
of arrays in the
Manual but cant see anything..

Thanks in advance

Regards
Chris Kay



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




Re: [PHP] Problem with Search Engine Friendly URLs under PHP Windows XP

2003-01-11 Thread Jonathan Chum
Toying with Apache further, I actually was able to get this to work a few
minutes I posted the thread. What I was doing wrong was running PHP as a CGI
rather than using it as SAPI module.

Hopefully this helps other folks as I was going nuts going through
google.com trying to find a solution.

Add this line to your httpd.conf with the path to php4apache.dll included in
the Windows distribution:

LoadModule php4_module C:\apache\php\sapi\php4apache.dll

Then add this line:

AddModule mod_php4.c

Then add the MIME types for PHP:

AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml

Also, you'll need to copy php4ts.dll into your c:\Windows\System32 folder.

After all that, this feature works under Windows whoohoo :)

Gerard Samuel [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 As far as I know, this technique doesn't work under windows...

 Jonathan Chum wrote:

 I'm following various tutorials online that uses the PATH_INFO to do
this,
 however Apache isn't playing nicely. I read a few documents that Apache
has
 a built in look back feature, but a query on google on lead me back to a
few
 articles that I just read so I'm assuming this feature is made up in the
 article?
 
 I've gotten the .htaccess to run a file as a .php, however I can't attach
 arguments to the right hand side of the URL. An example would be, I have
a
 file called index.php. I turn this into index and run it as a .php file.
It
 works fine, though I should be able to add /name/1 which shows up under
the
 PATH_INFO variable.
 
 However, I get a blank page and this error logged in Apache:
 
 [Sat Jan 11 10:33:40 2003] [error] [client 127.0.0.1] PHP Fatal error:
 Unable to open c:\apache\www\www.mxportal.com\public_html\dir\resources\d
in
 Unknown on line 0
 
 So it looks like Apache is not reading back to resources, but thinks
there
 is  folder called resources and a file called d in which it's trying to
open
 and pass it to PHP.
 
 This however works under *NIX systems. I'm not sure if there's a
different
 of doing it under Windows or if this is a bug in Apache. Any ideas?
 
 
 
 
 

 --
 Gerard Samuel
 http://www.trini0.org:81/
 http://dev.trini0.org:81/





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




Re: [PHP] Is this possible with php?

2003-01-11 Thread Chris Hewitt
[EMAIL PROTECTED] wrote:


using MS Word in windows, when a file is saved, can it be AUTOMATICALLY
uploaded (via http POST or other mechanism) to a server?


Yes, in a webDAV enabled directory on your webserver 
(http://www.webdav.org). Its a module that you can compile for use with 
Apache (I'm using it under linux). M$ are one of the authors of the 
standard (RFC2518).

Currently I need to first save it on my desktop, then upload that copy
to a php-supported server.


Yes, that is the problem statement. In a webDAV enabled directory, its 
like an ordinary directory from your webserver but read/write, with file 
locking. Any authorisation your webserver supports may be used.

Nothing to do with PHP though.

Regards

Chris


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



[PHP] Free web-hosting

2003-01-11 Thread Anton Gladky
Hello everybody!
Can anybody advice me the best free web-hosting with PHP?
Thank you.


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




[PHP] php5 cvs

2003-01-11 Thread electroteque
hi guys just noticed php5 cvs in the snaps page , does this have the zend
2.0 engine ? more specific question has it got the proper OO built in yet ?



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




Re: [PHP] Re: Change Date

2003-01-11 Thread Jason Wong
On Sunday 11 January 2004 20:52, Naqashzade, Sadeq wrote:
 So Thanks, but can you get me some example code?

There are plenty of examples in the manual!

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

/*
Digital Manipulator exceeding velocity parameters
*/


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




Re: [PHP] Session vars vs. POST/GET vars?

2003-01-11 Thread Jason Wong
On Saturday 11 January 2003 19:47, Jason k Larson wrote:
 FYI:
 Don't like auto register globals ... try the following at the beginning
 of your script.

 ini_set ('register_globals','Off');

 Works for me places I'm hosted at.

register_globals cannot be set at runtime (to be precise, it can be set but it 
has no effect). If it works for you, you should report it as a bug!

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

/*
Do not worry about which side your bread is buttered on: you eat BOTH sides.
*/


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




Re: [PHP] Date Comparison

2003-01-11 Thread Jason Wong
On Saturday 11 January 2003 21:38, Dhaval Desai wrote:
 Hello ppl,


 Well, I want to compate date is php, could anybody tell me which is the
 best way to do so? I have tried various ways but nothing seems consistent.
 I tried for example:
 if(2003-1-15  2003-1-11)
 {
 echo true;

 }
 which doesn't work in some cases...

Actually the above should work in all cases as you're comparing two strings 
constants :)

In any case if your dates are in ISO format (-MM-DD) then simple 
comparison using , , ==, etc should always work fine.

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

/*
Who cares if it doesn't do anything?  It was made with our new
Triple-Iso-Bifurcated-Krypton-Gate-MOS process ...
*/


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




Re: [PHP] Re: Session vars vs. POST/GET vars?

2003-01-11 Thread Jason Wong
On Saturday 11 January 2003 18:39, Noel Wade wrote:
 Nevermind, just found the $HTTP_SESSION_VARS array...

If you're using a relatively recent version of PHP, you should use $_SESSION.

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

/*
Sic transit gloria mundi.
[So passes away the glory of this world.]
-- Thomas `a Kempis
*/


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




[PHP] global to superglobal

2003-01-11 Thread pippo
I have a database that was created on an earlier version of PostgreSQL and 
uses global variables with register_globals = on for php4.
I have migrated the database to postgresql-7.3.1 with mod_php-4.2.3 and 
have set the register_globals to on. In order to use the default setting of 
register_globals = off, I need to reprogram my php files.
I would appreciate some suggestions on how to go about modifying the code. 
Is there a script that could be run on each file to convert to the 
superglobals that would work with the register_globals off?
I also need to know the exact syntax: for example, one current line is -

include $DOCUMENT_ROOT/../lib/somefile.conf;

Someone did suggest the following:

include $_SERVER['DOCUMENT_ROOT'].'/../lib/somefile.conf';

however, there is a difference in the use of the quotation marks and I do 
not understand the use of the . and ..

Could someone explain, please?

PJ



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



Re: [PHP] Loading Information into an array.

2003-01-11 Thread Jason Wong
On Saturday 11 January 2003 06:53, Philip J. Newman wrote:
 I have a table with images and comments.

 if i have $x amout of images that each have a comment.

 the comments are displayed in the center colum of the table with the images
 loading left and right of each comment.

 http://www.philipnz.com/example.jpg

 I can get the images to load in their left and right position, how ever i
 can't get the right array to print each comment with the image.

 Any help would be cool.

Showing us your code would be even cooler!

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

/*
There are things that are so serious that you can only joke about them
- Heisenberg
*/


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




[PHP] rintones using php

2003-01-11 Thread Arvindv
Hi,

Were can i get   scripts to send rintones/graphics to mobile phones using
php ?.

Arvind





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




Re: [PHP] global to superglobal

2003-01-11 Thread pippo
At 04:16 AM 1/12/2003 +0800, you wrote:

On Sunday 12 January 2003 03:45, [EMAIL PROTECTED] wrote:

 I have a database that was created on an earlier version of PostgreSQL and
 uses global variables with register_globals = on for php4.
 I have migrated the database to postgresql-7.3.1 with mod_php-4.2.3 and
 have set the register_globals to on. In order to use the default setting of
 register_globals = off, I need to reprogram my php files.
 I would appreciate some suggestions on how to go about modifying the code.
 Is there a script that could be run on each file to convert to the
 superglobals that would work with the register_globals off?

If only it was that easy ;)


That should be: If only it were that easy - subjunctive, :)) sorry, it's 
my English studies that keep coming back at me


The best thing to do is crank up error reporting to maximum (errors AND
notices). You should see a lot of undefined or uninitialized variables
notices/warnings. Find out where those variables are coming from (GET, POST
or whatever) and change them appropriately. Eg you have a form with
method=POST and a single text element called 'name'. Instead of using just
$name in your code you need to use $_POST['name'].

 I also need to know the exact syntax: for example, one current line is -

 include $DOCUMENT_ROOT/../lib/somefile.conf;

 Someone did suggest the following:

 include $_SERVER['DOCUMENT_ROOT'].'/../lib/somefile.conf';

 however, there is a difference in the use of the quotation marks and I do
 not understand the use of the . and ..

It used to be that $DOCUMENT_ROOT was a predefined variable in the global
scope. Thus you could use it directly in a string like in your first
statement. Now DOCUMENT_ROOT can only be obtained from the $_SERVER array.

Between strings and variables the period (.) acts as a concatenation 
operator.
The second statement can be reformatted to make it clearer:

  $_SERVER['DOCUMENT_ROOT'] . '/../lib/somefile.conf';

Hopefully you can clearly see that the left side is equivalent to
$DOCUMENT_ROOT and the right side is just a string. The '..' in the string on
the right has nothing to with PHP, it's just the standard way to denote the
parent directory.

Single-quoted strings are literal strings, double-quoted strings does 
variable
expansion.

The second statement can also be rewritten as:

  {$_SERVER['DOCUMENT_ROOT']}/../lib/somefile.conf;

Thanks, Jason. This helps somewhat.

Most of the variables should be fairly obvious, I should think. So, it 
should not be too difficult to do some search  replace of stuff like the 
$_SERVER['DOCUMENT_ROOT'] stuff. I suppose I could then try to run the 
stuff with error reporting maxed out.
Does that seem about right or should I start with the error reports and go 
at it one by one. Being terribly lazy, I suppose makes me want to find 
shortcuts.
I understand laziness is also a sign of genius... :))

PJ




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



[PHP] Rintones using php

2003-01-11 Thread Arvindv
Hi,

Were can i get   scripts to send rintones/graphics to mobile phones using
php ?.

Arvind



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




Re: [PHP] global to superglobal

2003-01-11 Thread Jason Wong
On Sunday 12 January 2003 03:45, [EMAIL PROTECTED] wrote:

 I have a database that was created on an earlier version of PostgreSQL and
 uses global variables with register_globals = on for php4.
 I have migrated the database to postgresql-7.3.1 with mod_php-4.2.3 and
 have set the register_globals to on. In order to use the default setting of
 register_globals = off, I need to reprogram my php files.
 I would appreciate some suggestions on how to go about modifying the code.
 Is there a script that could be run on each file to convert to the
 superglobals that would work with the register_globals off?

If only it was that easy ;)

The best thing to do is crank up error reporting to maximum (errors AND 
notices). You should see a lot of undefined or uninitialized variables 
notices/warnings. Find out where those variables are coming from (GET, POST 
or whatever) and change them appropriately. Eg you have a form with 
method=POST and a single text element called 'name'. Instead of using just 
$name in your code you need to use $_POST['name'].

 I also need to know the exact syntax: for example, one current line is -

 include $DOCUMENT_ROOT/../lib/somefile.conf;

 Someone did suggest the following:

 include $_SERVER['DOCUMENT_ROOT'].'/../lib/somefile.conf';

 however, there is a difference in the use of the quotation marks and I do
 not understand the use of the . and ..

It used to be that $DOCUMENT_ROOT was a predefined variable in the global 
scope. Thus you could use it directly in a string like in your first 
statement. Now DOCUMENT_ROOT can only be obtained from the $_SERVER array.

Between strings and variables the period (.) acts as a concatenation operator. 
The second statement can be reformatted to make it clearer:

  $_SERVER['DOCUMENT_ROOT'] . '/../lib/somefile.conf';

Hopefully you can clearly see that the left side is equivalent to 
$DOCUMENT_ROOT and the right side is just a string. The '..' in the string on 
the right has nothing to with PHP, it's just the standard way to denote the 
parent directory.

Single-quoted strings are literal strings, double-quoted strings does variable 
expansion.

The second statement can also be rewritten as:

  {$_SERVER['DOCUMENT_ROOT']}/../lib/somefile.conf;

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

/*
Positive, adj.:
Mistaken at the top of one's voice.
-- Ambrose Bierce, The Devil's Dictionary
*/


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




[PHP] fopen with nasty pathnames

2003-01-11 Thread Mat Harris
i have a database with unix path names of mp3s like:

Patti Smith/Horses [1975]/01-Gloria.mp3

which have to keep the spaces for part of another application. If i let 
the shell escape them from an ls command, i can get:

Patti\ Smith/Horses\ \[1975\]/01-Gloria.mp3

but fopen will still refuse saying file not found. I have tried escaped 
and unescaped amnd yes, I am very sure the file is there.

How can I get fopen to accept a path like this?

cheers.

--
Mat Harrison			Network Systems Administrator
[EMAIL PROTECTED]	www.genestate.com


msg92622/pgp0.pgp
Description: PGP signature


Re: [PHP] Suggestions on FAQ application?

2003-01-11 Thread The Head Sage
I don't believe a FAQ application actualy has been written yet... I haven't seen one 
on Hotscript.com or PHP Resources. But if you have found one, please let me know 
as i'm interested in one as well.

- Daniel TheHeadSage Spain
Founder of Voidsoft.


On 10 Jan 2003 at 21:51, Jeff Lewis wrote:

 Why re-invent what is already written? I'm well aware that it's easy to
 write but there may be something out there already that suits my needs and
 has some features that I hadn't thought of. If you don't have a suggestion
 on a package please spare me the rude replies which seem to run rampant on
 here lately...
 
 Jeff
 - Original Message -
 From: Timothy Hitchens (HiTCHO) [EMAIL PROTECTED]
 To: 'Jeff Lewis' [EMAIL PROTECTED]; 'php-gen' [EMAIL PROTECTED]
 Sent: Friday, January 10, 2003 9:39 PM
 Subject: RE: [PHP] Suggestions on FAQ application?
 
 
  It is a 30 minute write... not that hard!!
 
 
  Timothy Hitchens (HiTCHO)
  Open Platform Consulting
  e-mail: [EMAIL PROTECTED]
 
   -Original Message-
   From: Jeff Lewis [mailto:[EMAIL PROTECTED]]
   Sent: Saturday, 11 January 2003 12:37 PM
   To: php-gen
   Subject: [PHP] Suggestions on FAQ application?
  
  
   I've checked Hotscripts and I can't findanything relatively
   new or that suits my needs. I was wondering if anyone uses a
   FAQ program that they could suggest?
  
   Jeff
  
 
 
 
 
 
 
 

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




Re: [PHP] php5 cvs

2003-01-11 Thread Danny Shepherd
It includes the latest CVS build of ZendEngine 2.0 - AFAIK it hasn't even
reached beta status yet, so don't even think about using it for production
work. That said, I didn't have any problems building it and it seems pretty
stable.

A list of changes and features can be found at
http://www.php.net/ZEND_CHANGES.txt.

HTH

Danny.

- Original Message -
From: electroteque [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, January 11, 2003 6:50 PM
Subject: [PHP] php5 cvs


 hi guys just noticed php5 cvs in the snaps page , does this have the zend
 2.0 engine ? more specific question has it got the proper OO built in yet
?



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



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




php-general Digest 12 Jan 2003 00:36:55 -0000 Issue 1817

2003-01-11 Thread php-general-digest-help

php-general Digest 12 Jan 2003 00:36:55 - Issue 1817

Topics (messages 131240 through 131286):

Change Date
131240 by: Naqashzade, Sadeq
131242 by: Thomas Seifert
131243 by: Naqashzade, Sadeq
131249 by: Thomas Seifert
131272 by: Jason Wong

Re: Using $vars from include()d functions in the main programm and other functions
131241 by: Thomas Seifert

count characters without space
131244 by: harald.mohring.gmx.de
131246 by: Gerald Timothy Quimpo
131256 by: Jeffrey B. Ferland

Make thumbnail online
131245 by: Naqashzade, Sadeq
131250 by: Thomas Seifert
131283 by: Hugh Danaher

Date Comparison
131247 by: Dhaval Desai
131248 by: Matt
131273 by: Jason Wong

COM object
131251 by: jlord2002.libero.it
131252 by: Marco Tabini

How I can get one line from a file?
131253 by: Joskey Liaus
131254 by: Marco Tabini
131258 by: Gerald Timothy Quimpo

Re: Suggestions on FAQ application?
131255 by: Jeffrey B. Ferland
131259 by: John Nichel
131262 by: Jeff Lewis
131263 by: Jeff Lewis
131285 by: The Head Sage

Problem with Search Engine Friendly URLs under PHP  Windows XP
131257 by: Jonathan Chum
131261 by: Gerard Samuel
131267 by: Jonathan Chum

Re: Template tutorials?
131260 by: David Eisenhart

XML Cleanup Regex
131264 by: Gerard Samuel

Re: Is this possible with php?
131265 by: Rasmus Lerdorf
131268 by: Chris Hewitt
131269 by: Chris Hewitt

Sorting arrays
131266 by: Chris Kay

Free web-hosting
131270 by: Anton Gladky

php5 cvs
131271 by: electroteque
131286 by: Danny Shepherd

Re: Session vars vs. POST/GET vars?
131274 by: Jason Wong
131276 by: Jason Wong

global to superglobal
131275 by: pippo.bellnet.ca
131278 by: Jason Wong
131282 by: pippo.bellnet.ca

Re: version confusion - please help
131277 by: Jason Wong

Re: Loading Information into an array.
131279 by: Jason Wong

rintones using php
131280 by: Arvindv
131281 by: Arvindv

fopen with nasty pathnames
131284 by: Mat Harris

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]


--

---BeginMessage---
Hi,
How can I find time stamp for example 125 next days. or 03:30 hours next?

Regards,
S. Naqashzade
PS: Sorry for my bad english :-(



---End Message---
---BeginMessage---
http://de.php.net/manual/en/function.mktime.php

The most important part is 
mktime() is useful for doing date arithmetic and validation, as it will automatically 
calculate the correct value for out-of-range input.



Thomas

On Sun, 11 Jan 2004 16:12:01 +0330 [EMAIL PROTECTED] (Sadeq Naqashzade) wrote:

 Hi,
 How can I find time stamp for example 125 next days. or 03:30 hours next?
 
 Regards,
 S. Naqashzade
 PS: Sorry for my bad english :-(
 
 

---End Message---
---BeginMessage---

So Thanks, but can you get me some example code?

Regards,
Sadeq

Thomas Seifert [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 http://de.php.net/manual/en/function.mktime.php

 The most important part is
 mktime() is useful for doing date arithmetic and validation, as it will
automatically calculate the correct value for out-of-range input.



 Thomas

 On Sun, 11 Jan 2004 16:12:01 +0330 [EMAIL PROTECTED] (Sadeq Naqashzade) wrote:

  Hi,
  How can I find time stamp for example 125 next days. or 03:30 hours
next?
 
  Regards,
  S. Naqashzade
  PS: Sorry for my bad english :-(
 
 



---End Message---
---BeginMessage---

i.e.
// getting the current time in an array
$timeval=localtime();

// we want the time 3 hours in the future
$timeval[2] = $timeval[2]+3;

// calc the new timestamp
$timestamp=mktime ($timeval[2], $timeval[1], $timeval[0], $timeval[4], $timeval[3], 
i$timeval[5]);



An even better solution, you are talking about a unix-timestamp, right?

just add or subtract the the seconds from the current timestamp,
i.e.

// get the current timestamp
$timestamp=time();

// 1 minute = 60 seconds, 1 hour = 60 minutes, therefore 1 hour = 60*60 = 3600 seconds
// so we add 3600*3 to have the time in 3 hours
$timestamp = $timestamp + (3600*3);

// you can convert this time back to a readable format using strftime



Regards,

Thomas

On Sun, 11 Jan 2004 16:22:08 +0330 [EMAIL PROTECTED] (Sadeq Naqashzade) wrote:

 
 So Thanks, but can you get me some example code?
 
 Regards,
 Sadeq
 
 Thomas Seifert [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  http://de.php.net/manual/en/function.mktime.php
 
  The most important part is
  

RE: [PHP] Some help on PHP HTML please

2003-01-11 Thread Daniel Kushner
Hi Denis,

You should close the PHP tag (?) before outputing HTML.


Regards,
Daniel Kushner

_
Need hosting? http://thehostingcompany.us




-Original Message-
From: Denis L. Menezes [mailto:[EMAIL PROTECTED]]
Sent: Saturday, January 11, 2003 8:25 PM
To: PHP general list
Subject: [PHP] Some help on PHP  HTML please


HGello friends.

I have a database from which I take 2 variables as follows :
$CompanyWebsite
$CompanyLogo

I want to dynamically show two GIFs and when the user clicks on these, they
should go to http://www.hotmail.com and http://www.yahoo.com respectively. I
have problem only with the displaying(the error is parse error on the lines
containing a tags), for which I use the folowing code. Please tell me
where I am wrong.

?php
Print Organisation address   : .$row[CompanyAddress].
br\n.;
 Print Organisation website   :
.$row[CompanyWebsite].br\n. ; // I am displaying this
when testing only.
 Print Organisation logo   : .$row[CompanyLogo].br\n.
;?   // I am displaying this when testing only.

 a href=http://www.hotmail.com;img src=logos/constr12.gif width=100
height=100 border=0/a
a href=http://www.yahoo.com;img src=logos/constr12.gif width=100
height=100 border=0/a
?

Thanks
Denis



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




[PHP] Simple Form Processing

2003-01-11 Thread Kyle Babich
I just broke skin with php and I'm learning forms, which I'm not good
with at all.  These are snippets from post.html:

form method=get action=process.php enctype=multipart/form-data
and
input type=file name=image1 maxlength=750 allow=images/*br
input type=file name=image2 maxlength=750 allow=images/*br
input type=file name=image3 maxlength=750 allow=images/*br

but how would I pass the actual image on because when I do something like
this:
?php echo {$_GET[image1]};
?
as you could probably guess only the filename prints.

So how do I take the image instead of just the filename?

Thank you,
--
Kyle

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




[PHP] Sorry, PHP HTML

2003-01-11 Thread Denis L. Menezes
Hello friends.

I have a database from which I take 2 variables as follows :
$CompanyWebsite   
$CompanyLogo

I want to dynamically show two GIFs and when the user clicks on these, they should go 
to http://www.hotmail.com and http://www.yahoo.com respectively. I have problem only 
with the displaying(the error is parse error on the lines containing a tags), for 
which I use the folowing code. Please tell me where I am wrong.

?php
Print Organisation address   : .$row[CompanyAddress]. br\n.; 
 Print Organisation website   : .$row[CompanyWebsite].br\n. ;  
   // I am displaying this when testing only.
 Print Organisation logo   : .$row[CompanyLogo].br\n. ;?  
 // I am displaying this when testing only.

 Print a href=http://www.hotmail.com;img src=logos/constr12.gif width=100 
height=100 border=0/a;
Print a href=http://www.yahoo.com;img src=logos/constr12.gif width=100 
height=100 border=0/a;
?

Thanks
Denis


[PHP] Permission Denied

2003-01-11 Thread Stephen



Why do I get this error whenever I try to CHMOD something in 
PHP or create a directory (in this case):

Warning: mkdir(packs/bob) [function.mkdir]: Permission denied in 
c:\inetpub\wwwroot\phpiw\classes\class.cp.php on line 20

Here's line 20 of class.cp.php:

mkdir('packs/'.$package, 
0777);

Any help would be great!
Thanks,Stephen Cratonhttp://www.melchior.us

"What's the point in appearance if your true love, doesn't care about it?" 
-- http://www.melchior.us
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php5 cvs

2003-01-11 Thread electroteque
lol no , i am gonna try and upgrade my workfrom dinasour php3 to php 4.3, i
have a development box here @ home i just upgraded to the 4.3 release from
rc3 and am gonna try out version 5 then it doesnt matter how stable it is at
home really :D

Danny Shepherd [EMAIL PROTECTED] wrote in message
000b01c2b9d2$ae5e46c0$6400a8c0@DANNYS">news:000b01c2b9d2$ae5e46c0$6400a8c0@DANNYS...
 It includes the latest CVS build of ZendEngine 2.0 - AFAIK it hasn't even
 reached beta status yet, so don't even think about using it for production
 work. That said, I didn't have any problems building it and it seems
pretty
 stable.

 A list of changes and features can be found at
 http://www.php.net/ZEND_CHANGES.txt.

 HTH

 Danny.

 - Original Message -
 From: electroteque [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, January 11, 2003 6:50 PM
 Subject: [PHP] php5 cvs


  hi guys just noticed php5 cvs in the snaps page , does this have the
zend
  2.0 engine ? more specific question has it got the proper OO built in
yet
 ?
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 




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




[PHP] Some help on PHP HTML please

2003-01-11 Thread Denis L. Menezes
HGello friends.

I have a database from which I take 2 variables as follows :
$CompanyWebsite   
$CompanyLogo

I want to dynamically show two GIFs and when the user clicks on these, they should go 
to http://www.hotmail.com and http://www.yahoo.com respectively. I have problem only 
with the displaying(the error is parse error on the lines containing a tags), for 
which I use the folowing code. Please tell me where I am wrong.

?php
Print Organisation address   : .$row[CompanyAddress]. br\n.; 
 Print Organisation website   : .$row[CompanyWebsite].br\n. ;  
   // I am displaying this when testing only.
 Print Organisation logo   : .$row[CompanyLogo].br\n. ;?  
 // I am displaying this when testing only.

 a href=http://www.hotmail.com;img src=logos/constr12.gif width=100 
height=100 border=0/a
a href=http://www.yahoo.com;img src=logos/constr12.gif width=100 height=100 
border=0/a
?

Thanks
Denis


Re: [PHP] global to superglobal

2003-01-11 Thread Greg Beaver

[EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Most of the variables should be fairly obvious, I should think. So, it
 should not be too difficult to do some search  replace of stuff like the
 $_SERVER['DOCUMENT_ROOT'] stuff. I suppose I could then try to run the
 stuff with error reporting maxed out.
 Does that seem about right or should I start with the error reports and go
 at it one by one. Being terribly lazy, I suppose makes me want to find
 shortcuts.
 I understand laziness is also a sign of genius... :))

It will be best to start from the code and do search and replace (one by
one, dont' try anything fancy or you might waste time undoing your fixes).
Then finding things from error reports will be easier.

Take care,
Greg
--
phpDocumentor
http://www.phpdoc.org



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




RE: [PHP] Sorry, PHP HTML

2003-01-11 Thread Timothy Hitchens \(HiTCHO\)
I don't see the problem I can run the script with one issue that the
comments are outside of PHP parsing.

The other issue is that you are closing off for PHP but not opening up
in the second block!!

** what are you errors exactly!! are they notices about variables???


Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: [EMAIL PROTECTED]

 -Original Message-
 From: Denis L. Menezes [mailto:[EMAIL PROTECTED]] 
 Sent: Sunday, 12 January 2003 11:32 AM
 To: PHP general list
 Subject: [PHP] Sorry, PHP  HTML
 
 
 Hello friends.
 
 I have a database from which I take 2 variables as follows :
 $CompanyWebsite   
 $CompanyLogo
 
 I want to dynamically show two GIFs and when the user clicks 
 on these, they should go to  http://www.hotmail.com and 
 http://www.yahoo.com 
 respectively. I have problem only with 
 the displaying(the error is parse error on the lines 
 containing a tags), for which I use the folowing code. 
 Please tell me where I am wrong.
 
 ?php
 Print Organisation address   : 
 .$row[CompanyAddress]. br\n.; 
  Print Organisation website   : 
 .$row[CompanyWebsite].br\n. ; // I am 
 displaying this when testing only.
  Print Organisation logo   : 
 .$row[CompanyLogo].br\n. ;?   
 // I am displaying this when testing only.
 
  Print a href=http://www.hotmail.com;img 
 src=logos/constr12.gif width=100 height=100 
 border=0/a; Print a href=http://www.yahoo.com;img 
 src=logos/constr12.gif width=100 height=100 border=0/a; ?
 
 Thanks
 Denis
 


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




Re: [PHP] Permission Denied

2003-01-11 Thread Stephen
There's already a folder named packs but my problem was not having the /
before it. One more question. How can I dynamically get the path to the
current folder? Like your at http://www.bob.com/joe/index.php and you want
to get the http://www.bob.com/joe/ bit and do it dynamically?


- Original Message -
From: Chris Hayes [EMAIL PROTECTED]
To: Stephen [EMAIL PROTECTED]
Sent: Saturday, January 11, 2003 8:49 PM
Subject: Re: [PHP] Permission Denied


: At 02:40 12-1-2003, you wrote:
: Why do I get this error whenever I try to CHMOD something in PHP or
create
: a directory (in this case):
: 
: Warning: mkdir(packs/bob)
: [http://www.php.net/function.mkdirfunction.mkdir]: Permission denied in
: c:\inetpub\wwwroot\phpiw\classes\class.cp.php on line 20
: 
: Here's line 20 of class.cp.php:
: 
:  mkdir('packs/'.$package, 0777);
:
: I suppose you have no dir creation rights in the dir in which you want to
: add this.
:
: I also think you can only mkdir one directory at a time, if so you need to
: make 'packs' first, then 'bob'. But that would need testing.
:
:
:



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




Re: [PHP] fopen with nasty pathnames

2003-01-11 Thread Gerald Timothy Quimpo
On Sunday 12 January 2003 07:08 am, Mat Harris wrote:
 Patti\ Smith/Horses\ \[1975\]/01-Gloria.mp3

 but fopen will still refuse saying file not found. I have tried escaped
 and unescaped amnd yes, I am very sure the file is there.

 How can I get fopen to accept a path like this?

$in=fopen(a filename with spaces in it.mp3,r);

works for me.  how are you getting filenames?  it might be that it's
the directory reading functions that are giving you bad filenames.
(although, i just tried (not copy-pasted, so close but not exactly
what i tested):

   $dir=opendir(.);
   while(($dd=readdir($dir))!=false)
  print($dd\n);
   closedir($dir);

and that works for a directory that has files with spaces in them.
all filenames are printed, including the names that have spaces.

another possibility, are those backslashes just for displaying?  or
are they actually there in the filename on disk?  if the backslashes
are actual parts of the filename (they shouldn't be, but the world
is weird) then you'll need to escape them.  \\.

tiger

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

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




[PHP] displaying in the table problem

2003-01-11 Thread Denis L. Menezes
Hello Firends.

I have the following code. I am getting the query results but they are not displaying 
in the table. I presume there is something wrong with a } in the while statement. 
Can someone please tell me where I am wrong?

Quote :


html
head
titleUntitled Document/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head

body

pnbsp;/p
pnbsp; /p
?php
require 'common.inc';

if(!($link=mysql_pconnect($DB_SERVER,$DB_LOGIN,$DB_PASSWORD))){
  DisplayErrMsg(sprintf(internal error %d:%s\n,
 mysql_errno(),mysql_error()));
  return 0;
  }
 if ($link){
   Print ;
   }  else {
   Print No connection to the database;
   }
   if (!mysql_select_db(MyDomain_com)){
Print Couldn't connect database;
 } else {
 Print .br\n;
 }?
 
 
table width=75% border=1
  tr bgcolor=#006600 
tdstrongfont color=#FF size=2 face=Arial, Helvetica, 
sans-serifCompany's 
  name/font/strong/td
tdstrongfont color=#FF size=2 face=Arial, Helvetica, 
sans-serifCompany's 
  address/font/strong/td
tdstrongfont color=#FF size=2 face=Arial, Helvetica, 
sans-serifCompany's 
  website/font/strong/td
tdstrongfont color=#FF size=2 face=Arial, Helvetica, 
sans-serifCompany's 
  logo/font/strong/td
  /tr
  ?PHP 
  $sql=select * from CompanyData ;  
   if ($result=mysql_query($sql)) {
   $numofrows=mysql_num_rows($result);   
 }
  
 while($row=mysql_fetch_array($result)){ 
  ?
  tr 
td width=12% align=center height=6font face=Tahoma 
color=#00?php Print  $row[CompanyName] ;?/font  nbsp;/td
   td width=12% align=center height=6font face=Tahoma color=#00?php 
Print  $row[CompanyAddress] ;?/font  nbsp;/td
td width=12% align=center height=6font face=Tahoma 
color=#00?php Print  $row[Companywebsite] ;?/font  nbsp;/td
td width=12% align=center height=6font face=Tahoma 
color=#00?php Print  $row[Companytel] ;?/font  nbsp;/td
  /tr
/table
pnbsp;/p
/body
/html



Unquote

Thanks very much
denis


Re: [PHP] Simple Form Processing

2003-01-11 Thread Justin French
Hi,

the files themselves are available in the $_FILES array, but it's not as
simple as that.

may i recommend you start by copying the Examples 18-1 and 18-2 from this
page:
http://www.php.net/manual/en/features.file-upload.php

Once you've got THAT code working smoothly and understand what's happening,
THEN start modifying it to a 3-file form.

I'd personally push forms through using POST method rather than get whenever
possible -- especially when dealing with files... the manual does it this
way too :)


Justin



on 12/01/03 12:18 PM, Kyle Babich ([EMAIL PROTECTED]) wrote:

 I just broke skin with php and I'm learning forms, which I'm not good
 with at all.  These are snippets from post.html:
 
 form method=get action=process.php enctype=multipart/form-data
 and
 input type=file name=image1 maxlength=750 allow=images/*br
 input type=file name=image2 maxlength=750 allow=images/*br
 input type=file name=image3 maxlength=750 allow=images/*br
 
 but how would I pass the actual image on because when I do something like
 this:
 ?php echo {$_GET[image1]};
 ?
 as you could probably guess only the filename prints.
 
 So how do I take the image instead of just the filename?
 
 Thank you,
 --
 Kyle


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




Re: [PHP] Permission Denied

2003-01-11 Thread jacob
The user/group (commonly nobody.nogroup or nobody.nobody) that your web server 
runs under probably does not have the permissions necessary to chmod those 
directories (ie: they are owned by someone else).

Quoting Stephen [EMAIL PROTECTED]:

 Why do I get this error whenever I try to CHMOD something in PHP or create a
 directory (in this case):
 
 Warning: mkdir(packs/bob) [function.mkdir]: Permission denied in
 c:\inetpub\wwwroot\phpiw\classes\class.cp.php on line 20
 
 Here's line 20 of class.cp.php:
 
 mkdir('packs/'.$package, 0777);
 
 Any help would be great!
 
 Thanks,
 Stephen Craton
 http://www.melchior.us
 
 What's the point in appearance if your true love, doesn't care about it? --
 http://www.melchior.us



- End forwarded message -



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




Re: [PHP] rintones using php

2003-01-11 Thread Justin French
You'd need a server capable of sending them (I think it's an SMS gateway
hardware device, or something like that), which I think is more of an issue
than then PHP scripts involved...

Justin


on 12/01/03 6:57 AM, Arvindv ([EMAIL PROTECTED]) wrote:

 Hi,
 
 Were can i get   scripts to send rintones/graphics to mobile phones using
 php ?.
 
 Arvind
 
 
 
 


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




RE: [PHP] Amount of data in the database

2003-01-11 Thread Timothy Hitchens \(HiTCHO\)
Give this a go.. for each of the databases use:

SHOW TABLE STATUS FROM xx;

That will return a huge amount of size etc data!!



Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: [EMAIL PROTECTED]

 -Original Message-
 From: Denis L. Menezes [mailto:[EMAIL PROTECTED]] 
 Sent: Sunday, 12 January 2003 2:58 PM
 To: PHP general list
 Subject: [PHP] Amount of data in the database
 
 
 Hello friends.
 
 I have a need for checking how much data(in kb) exists of 
 each of the user members in the MySQL so that when they 
 upload more data I can restrict/warn them of the amount of 
 data they have on the server at present.
 
 can anyone please tell me how to check the amount of data on 
 the mysql for each record?
 
 thanks very much
 Denis
 


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




[PHP] OOP for Web Programming Paradigm

2003-01-11 Thread Victor
Hello. I have this question. When I program, I try to create a class for 
each table. Example below.

Now what some complain about, and logically so, is that this might 
impose an overhead (I load all data even if I just need a counter and 
NOT description).

So I say we can make a STATIC version of each Accessor with $cid as 
argument; But then they say what if i want to load an array of all 2000 
counters, for example. I say first get all the $cid's, then in an array, 
load a class for each one, etc.. That however makes lots of SQL calls 
instead of one big one. I suppose I can get all data and then load it 
into classes, but that seems like a bad approach, especially for 
calculated values.

What I am curious about is what paradigms do you guys use to address 
these issues? Is my paradigm good and it's worth to just provide static 
methods for frequently necessary fields to reduce overhead, or is there 
a better way of dealing with this stuff?

class Counter
{
   var $db;

   var $cid;
   var $counter;
   var $descr;

   /**
* Default Constructor
* @param int $cid - Counter ID
*/
   function Counter($cid=false)
   {
  global $db;
  $this-db = $db;
  if (isset($cid)  $cid) $this-load($cid);
   }

   /**
* Description
* @param int $cid - Counter ID
* @return bool
*/
   function load($cid=0)
   {
  if (!$cid) return false;

  $q = SELECT * FROM counter WHERE cid = $cid;
  $r = $this-db-getRow($q); // Using PEAR here.

  if (!DB::isError($r)) {
 $this-cid = $r[cid];
 $this-counter = $r[counter];
 $this-descr   = $r[descr];
 return true;
  }
  return false;
   }

   #
   # Accessor Methods
   #
   function getCid() { return $this-cid; }
   function getCounter() { return $this-counter; }
   function getDescr()   { return $this-descr; }

   #
   # Mutator Methods
   #
   function setCid($v) { $this-iaid= $v; }
   function setCounter($v) { $this-counter = $v; }
   function setDescr($v)   { $this-descr   = $v; }

   // Many other methods, etc Static methods, etc...
}



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



Re: [PHP] Format tables!!

2003-01-11 Thread Justin French

table width=400
tr
tdbname/b/td
tdbaddress/b/td
tdbphone/b/td
/tr
?
// connect to database excluded
// error checking and result checking excluded

$sql = select id,name,address,phone from contacts;
$result = mysql_query($sql);
while($myrow = mysql_fetch_array($result))
{
echo tr;
echo td{$myrow['name']}/td;
echo td{$myrow['address']}/td;
echo td{$myrow['phone']}/td;
echo /tr;
}
?
/table

You haven't really said what you want the checkboxes to do, but including
them in the while loop is easy, eg:

while($myrow = mysql_fetch_array($result))
{
echo tr;
echo tdinput type=checkbox name={$myrow['id']}
value=true/td;
echo td{$myrow['name']}/td;
echo td{$myrow['address']}/td;
echo td{$myrow['phone']}/td;
echo /tr;
}

To alternate the row colour between two colours in the loop, you need to:
a) initialise a counter $i
b) increase it by one every iteration of the loop
c) if $i is even, use colour a, else use colour b


table width=400
tr
tdnbsp;/td
tdbname/b/td
tdbaddress/b/td
tdbphone/b/td
/tr
?
// connect to database excluded
// error checking and result checking excluded

$i = 0;
$sql = select id,name,address,phone from contacts;
$result = mysql_query($sql);
while($myrow = mysql_fetch_array($result))
{
$i++;
if(is_int($i / 2)) { $col = #FF; } else { $col = #CC; }
echo tr bgcolor='{$col}';
echo tdinput type=checkbox name={$myrow['id']}
value=true/td;
echo td{$myrow['name']}/td;
echo td{$myrow['address']}/td;
echo td{$myrow['phone']}/td;
echo /tr;
}
?
/table


Untested code of course :)


Season to taste.


Justin



on 12/01/03 6:57 PM, Karl James ([EMAIL PROTECTED]) wrote:

 Hello people
 
 I was wondering if anyone had a good tutorial or script that I can use
 To where I can take a database table and have it print in tables, and
 allow me to edit the color
 And insert check boxes.
 
 Thanks
 Karl 
 
 


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




RE: [PHP] Changing permissions with mkdir?

2003-01-11 Thread Timothy Hitchens \(HiTCHO\)
Hmm that is strange... chmod it after then:

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



Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: [EMAIL PROTECTED]

 -Original Message-
 From: Ben Cheng [mailto:[EMAIL PROTECTED]] 
 Sent: Sunday, 12 January 2003 2:56 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Changing permissions with mkdir?
 
 
 When I run mkdir(path to new dir, 0777); I get a directory that has 
 owner and group set to nobody and drwxr-xr-x permission.  How do I 
 get the permission to be set to drwxrwxrwx?
 
 -Ben
 
 
 -- 
 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] Amount of data in the database

2003-01-11 Thread Denis L. Menezes
Thanks Timothy.

I want to find the amount of data for each member in the database using PHP
and displaying in a web page. I know how to query records of a member and
also know to display. Only I need to know the command for finding the
size(in bytes or kb) for each of these records :Something like seeing the
file sizes of each email in hotmail.


Thanks
Denis
- Original Message -
From: Timothy Hitchens (HiTCHO) [EMAIL PROTECTED]
To: 'Denis L. Menezes' [EMAIL PROTECTED]; 'PHP general list'
[EMAIL PROTECTED]
Sent: Sunday, January 12, 2003 1:29 PM
Subject: RE: [PHP] Amount of data in the database


 Give this a go.. for each of the databases use:

 SHOW TABLE STATUS FROM xx;

 That will return a huge amount of size etc data!!



 Timothy Hitchens (HiTCHO)
 Open Platform Consulting
 e-mail: [EMAIL PROTECTED]

  -Original Message-
  From: Denis L. Menezes [mailto:[EMAIL PROTECTED]]
  Sent: Sunday, 12 January 2003 2:58 PM
  To: PHP general list
  Subject: [PHP] Amount of data in the database
 
 
  Hello friends.
 
  I have a need for checking how much data(in kb) exists of
  each of the user members in the MySQL so that when they
  upload more data I can restrict/warn them of the amount of
  data they have on the server at present.
 
  can anyone please tell me how to check the amount of data on
  the mysql for each record?
 
  thanks very much
  Denis
 


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




RE: [PHP] Amount of data in the database

2003-01-11 Thread Timothy Hitchens \(HiTCHO\)
I haven't seen a way to get the size of an individual record.

What about using the max size of the fields in that table against number
of records eg:

255 char = x bytes etc etc = 156KB per record max



Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: [EMAIL PROTECTED]

 -Original Message-
 From: Denis L. Menezes [mailto:[EMAIL PROTECTED]] 
 Sent: Sunday, 12 January 2003 4:10 PM
 To: [EMAIL PROTECTED]; 'PHP general list'
 Subject: Re: [PHP] Amount of data in the database
 
 
 Thanks Timothy.
 
 I want to find the amount of data for each member in the 
 database using PHP and displaying in a web page. I know how 
 to query records of a member and also know to display. Only I 
 need to know the command for finding the size(in bytes or kb) 
 for each of these records :Something like seeing the file 
 sizes of each email in hotmail.
 
 
 Thanks
 Denis
 - Original Message -
 From: Timothy Hitchens (HiTCHO) [EMAIL PROTECTED]
 To: 'Denis L. Menezes' [EMAIL PROTECTED]; 'PHP 
 general list' [EMAIL PROTECTED]
 Sent: Sunday, January 12, 2003 1:29 PM
 Subject: RE: [PHP] Amount of data in the database
 
 
  Give this a go.. for each of the databases use:
 
  SHOW TABLE STATUS FROM xx;
 
  That will return a huge amount of size etc data!!
 
 
 
  Timothy Hitchens (HiTCHO)
  Open Platform Consulting
  e-mail: [EMAIL PROTECTED]
 
   -Original Message-
   From: Denis L. Menezes [mailto:[EMAIL PROTECTED]]
   Sent: Sunday, 12 January 2003 2:58 PM
   To: PHP general list
   Subject: [PHP] Amount of data in the database
  
  
   Hello friends.
  
   I have a need for checking how much data(in kb) exists of each of 
   the user members in the MySQL so that when they upload 
 more data I 
   can restrict/warn them of the amount of data they have on 
 the server 
   at present.
  
   can anyone please tell me how to check the amount of data on the 
   mysql for each record?
  
   thanks very much
   Denis
  
 
 
 -- 
 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] version confusion - please help

2003-01-11 Thread Jesse Cablek
Christian Stalberg mailto:[EMAIL PROTECTED] scribbled;

 what does debug_phpinfo.php read to get its information?
 

Not sure.

 When I run debug_phpinfo.php in my browser it says version 4.2.3
 

Assuming a UNIX box running Apache, and assuming this is a PHP module,
sounds right.

 But when I execute php -v at the command line I get 4.0.4pl1

Assuming the above would cause me to believe this is a separate CLI
compilation, which CLI PHP probably wasn't rebuilt when 4.2.3 was installed.

mod_php != CLI PHP, they can be completely different versions.

Too many assumptions, best give more information about the setup.

-jesse


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




[PHP] Re: php-general Digest 27 Mar 2002 13:15:24 -0000 Issue 1251

2003-01-11 Thread DCnFamily
I am looking for an old friend - Ralph Friedman.  I was doing an internet 
search and found this email address and am wondering if I may have found him 
here.
The Ralph I knew was part of a nomadic Christian community in the '70's.  We 
are looking for former members and have a yahoo email group.  
http://groups.yahoo.com/group/xbrethrengroup.
Thanks,
Katherine



Re: [PHP] php5 cvs

2003-01-11 Thread electroteque
hmm has the public and private function accessor changed ? i have been
building my classes with test() and _test() to differentiate from public and
private and have been waiting to try it out but i can still access both ! ??

Electroteque [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 lol no , i am gonna try and upgrade my workfrom dinasour php3 to php 4.3,
i
 have a development box here @ home i just upgraded to the 4.3 release from
 rc3 and am gonna try out version 5 then it doesnt matter how stable it is
at
 home really :D

 Danny Shepherd [EMAIL PROTECTED] wrote in message
 000b01c2b9d2$ae5e46c0$6400a8c0@DANNYS">news:000b01c2b9d2$ae5e46c0$6400a8c0@DANNYS...
  It includes the latest CVS build of ZendEngine 2.0 - AFAIK it hasn't
even
  reached beta status yet, so don't even think about using it for
production
  work. That said, I didn't have any problems building it and it seems
 pretty
  stable.
 
  A list of changes and features can be found at
  http://www.php.net/ZEND_CHANGES.txt.
 
  HTH
 
  Danny.
 
  - Original Message -
  From: electroteque [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Saturday, January 11, 2003 6:50 PM
  Subject: [PHP] php5 cvs
 
 
   hi guys just noticed php5 cvs in the snaps page , does this have the
 zend
   2.0 engine ? more specific question has it got the proper OO built in
 yet
  ?
  
  
  
   --
   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