Re: [PHP] OT-Re: worm on th list

2003-08-22 Thread daniel
aparantly it was designed to slow the web down, and its proved that, but
also aparantly it infects by not even opening an attatchment but it could
possibly have vb script within a html email :\

 On Wed, Aug 20, 2003 at 11:11:43AM -0400, andu wrote:
 Is this worm/virus windows specific?


 It appears so but considering a good percent of users are MS/Outlook
 users this is a bad one. Got over 100 yesterday, 100+ the day before
 and looking at the same today. Considering I hardly ever have seen a
 wild virus emailed to me, this is a bad one.
 --
 Jerry M. Howell II

 --
 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] OT-Re: worm on th list

2003-08-22 Thread John Taylor-Johnston
Get your mail sysadmins to install spamassassin, which I believe is OpenSourced PHP, 
and the filter your {SPAM} directly into the garbaaage. if everyone did this, and 
therefore stopped opening dangerous mail, maybe we could slow some of this down. :) Oh 
well, just my 2¢



 On Wed, Aug 20, 2003 at 11:11:43AM -0400, andu wrote:
  Is this worm/virus windows specific?
 
 
 It appears so but considering a good percent of users are MS/Outlook
 users this is a bad one. Got over 100 yesterday, 100+ the day before and
 looking at the same today. Considering I hardly ever have seen a wild
 virus emailed to me, this is a bad one.
 --
 Jerry M. Howell II


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



Re: [PHP] OT-Re: worm on th list

2003-08-22 Thread [EMAIL PROTECTED]
Hi,

Though many consider netscape to be a poor alternative to explorer as a 
browser, it's far superior to outlook when it comes to mail. Far safer 
too. :-)). Most of us on linux use mozzilla for everything - browsing, 
chatting and email.

[EMAIL PROTECTED] wrote:

aparantly it was designed to slow the web down, and its proved that, but
also aparantly it infects by not even opening an attatchment but it could
possibly have vb script within a html email :\
 

On Wed, Aug 20, 2003 at 11:11:43AM -0400, andu wrote:
   

Is this worm/virus windows specific?

 

It appears so but considering a good percent of users are MS/Outlook
users this is a bad one. Got over 100 yesterday, 100+ the day before
and looking at the same today. Considering I hardly ever have seen a
wild virus emailed to me, this is a bad one.
--
Jerry M. Howell II
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
   





 



--
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.


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


Re: [PHP] OT-Re: worm on th list

2003-08-22 Thread Peter James
As an aside... I wonder what the ratio is of emails *from* the virus vs.
emails *about* the virus.  The latter certainly doesn't help the impulse
response of the attack. :-)

--
Peter James
Editor-in-Chief, php|architect Magazine
[EMAIL PROTECTED]

php|architect
The Magazine for PHP Professionals
http://www.phparch.com


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



Re: [PHP] OT-Re: worm on th list

2003-08-22 Thread daniel
yes my spamassasin does this it adds spam like {spam?} and viruses {virus?}
how can i filter that though in outlook like the damn thing only filters
emails.

 Get your mail sysadmins to install spamassassin, which I believe is
 OpenSourced PHP, and the filter your {SPAM} directly into the
 garbaaage. if everyone did this, and therefore stopped opening
 dangerous mail, maybe we could slow some of this down. :) Oh well, just
 my 2¢



 On Wed, Aug 20, 2003 at 11:11:43AM -0400, andu wrote:
  Is this worm/virus windows specific?
 
 
 It appears so but considering a good percent of users are MS/Outlook
 users this is a bad one. Got over 100 yesterday, 100+ the day before
 and looking at the same today. Considering I hardly ever have seen a
 wild virus emailed to me, this is a bad one.
 --
 Jerry M. Howell II


 --
 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] OT-Re: worm on th list

2003-08-22 Thread Ashley M. Kirchner
John Taylor-Johnston wrote:

Get your mail sysadmins to install spamassassin, which I believe is OpenSourced PHP

   SpamAssassin is perl combined with C-code.  Not PHP.

--
H| I haven't lost my mind; it's backed up on tape somewhere.
 +
 Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130
 IT Director / SysAdmin / WebSmith . 800.441.3873 x130
 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
 http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A. 





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


Re: [PHP] File upload + permissions + .htaccess in php

2003-08-22 Thread Nicholas Robinson
I've had this problem twice recently.

Once it was because I'd foolishly moved a script that used relative pathnames. 
The result was that I was trying to access a file outside the DocumentRoot 
and it didn't matter what the permissions on the file were, it wasn't trying 
to open that one at all!

The other time is more confusing. I'd gone through all directory and file 
ownerships and they were okay. In the end, in desperation, I chgrp'd the file 
to be mine (leaving ownership alone) and it worked. This is on my list of 
things to come back to!

HTH

Nick

On Thursday 21 Aug 2003 10:30 am, Ryan A wrote:
 Hi,
 I am trying to upload something into a directory on my server but always i
 am getting a permission denied ONLY from this server...i have tried it on 2
 other servers and they seem to be working fine but i have to get it working
 on this server as this server is the fastest and our production server.

 I have looked at the folder permissions and CHMODED/changed them from 644
 to 766 and finally 777 but am getting the same error, i then had a look at
 the php info file (http://jumac.com/phpinfo.php) and i see file_uploading
 is set to 1 and 1, safe mode is off, i am not too familier with file
 uploading so is this right? if not, how can i change it? hopefully via a
 .htaccess as I dont have access to the php.ini file directly.

 Let me again point out that this problem only seems to be on this server,
 the scripts including the upload is working perfectly on the other test
 servers/sites.

 Kindly reply,
 -Ryan A.


 We will slaughter you all! - The Iraqi (Dis)information ministers site
 http://MrSahaf.com


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



Re: [PHP] Your details

2003-08-22 Thread David Robley
In article [EMAIL PROTECTED], 
[EMAIL PROTECTED] says...
 This is the only time I'm glad I use Yahoo mail for this list. Seems
 either their AV software or their mangling of attachments provided
 some level of protection. Though I knew they were viri, I wanted to
 check one out. They came across as text files with nothing but the
 list signature in them.
 
 
 --- John W. Holmes [EMAIL PROTECTED] wrote:
  [EMAIL PROTECTED] wrote:
  
   Please see the attached file for details.
   
  
  Did anyone's AV pick up a virus in this email? It went right
  through 
  mine but obviously doesn't belong on this list. I just got the
  latest 
  definitions from Norton, too...

The list software is set to strip all attachments, I believe

Cheers
-- 
Quod subigo farinam

$email =~ s/oz$/au/o;
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: OT-Re: worm on th list

2003-08-22 Thread David Robley
In article [EMAIL PROTECTED], 
[EMAIL PROTECTED] says...
 Is this worm/virus windows specific?

Well, most of them are these days. Easy targets and all that...

-- 
Quod subigo farinam

$email =~ s/oz$/au/o;
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] Re: This is getting rediculus

2003-08-22 Thread David Robley
In article [EMAIL PROTECTED], [EMAIL PROTECTED] 
says...
 Some joker is  somehow making all are posts being sent to request
 subscriptions, help-list, unsubscriptions.. etc. I'm not sure how
 we can stop this nonsense.
 
 Part of the problem is there seems to be nobody in control of this
 list.  I have tried contacting several people about this but I
 haven't had any success.  
 
 Does anyone know who to contact about this?

Well, the list is run using ezmlm, and the default address for contacting 
a hooman bean in ezmlm is [EMAIL PROTECTED] ...

-- 
Quod subigo farinam

$email =~ s/oz$/au/o;
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



[PHP] count rows

2003-08-22 Thread John Taylor-Johnston
Help me out here. I want to get a numeral on the number of records in a table.
What is the function?

http://www.php.net/manual-lookup.php?pattern=fetch%2Browslang=en
http://www.php.net/manual-lookup.php?pattern=fetch%2Brecordslang=en

? :)
John


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



Re: [PHP] timestamp

2003-08-22 Thread John Taylor-Johnston
This is what I'm using so far. But I need to put in a time stamp to calculate if the 
visitor is new. I want to use the IP so if the ip saved in MySQL is older than 60 
minutes, it will write a new record, if not, don't:

$myconnection = mysql_connect($server,$user,$pass);
mysql_select_db($db,$myconnection);

$getaddr = $_SERVER['REMOTE_ADDR'];
$gethost = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$EntryDate = date(Y-m-d);

$sql = INSERT INTO $table (IPAddress,RemoteHost,EntryDate) 
values('$getaddr','$gethost','$EntryDate');
mysql_query($sql);

$myconnection = mysql_connect($server,$user,$pass);
mysql_select_db($db,$myconnection);
$result = mysql_query(SELECT * FROM $table, $myconnection);
$num_rows = mysql_num_rows($result);

echo document.write(\$num_rows visitors. \);;


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



Re: [PHP] count rows

2003-08-22 Thread [EMAIL PROTECTED]
mysql_num_rows gives the number of rows. But don't even think of doing 
it this way if you just want the number of rows and don't want the data.

The correct way is to use a query such as
[sql]
   select count(*) from table
[/sql]
this will return just one row and it wil tell you how many rows are in 
your table and your database will be a lot happier :-)

John Taylor-Johnston wrote:

Help me out here. I want to get a numeral on the number of records in a table.
What is the function?
http://www.php.net/manual-lookup.php?pattern=fetch%2Browslang=en
http://www.php.net/manual-lookup.php?pattern=fetch%2Brecordslang=en
? :)
John
 



--
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.


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


Re: [PHP] datetime

2003-08-22 Thread Marek Kilimajer
Best and fastest way is to let mysql format the date, look into mysql 
manual for DATE_FORMAT() function.

Dale Hersh wrote:

I am using a mssql database and I have a question regarding the datetime
type. When I write a date to the database it store the date in the following
format:
6/8/03
But when I extract the date from the database it returns the value in the
following format:
Jun 8 2003 12:00AM
Is there a nice function available in php that will format the date based
upon certain specification. I know that date() exists, but I that means I
would have to use mktime() which would require parsing the entire string and
breaking the string into the day, the month, the year. Furthermore, I would
then need a switch statement to convert the value Jun into the value 6.
I appreciate any help.

Thanks,
Dale




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


Re: [PHP] How to open random Flash page with hyperlink?

2003-08-22 Thread murugesan
Thanks for the message.
Can you please tell me how to do session authentication?.

-murugesan
- Original Message -
From: Cody Phanekham [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 22, 2003 10:05 AM
Subject: FW: [PHP] How to open random Flash page with hyperlink?


-Original Message-
 From: murugesan [mailto:[EMAIL PROTECTED]
  some more changes
  param name=movie value=?php echo $value ?
  embed src=?php echo $value ?/embed

Murugesan,

both ways are correct. Its just that i'm used to using the short open tag :)


http://au.php.net/manual/en/configuration.directives.php#ini.short-open-tag

http://au.php.net/manual/en/configuration.directives.php#ini.short-open-tag


short_open_tag  http://au.php.net/manual/en/language.types.boolean.php
boolean


Tells whether the short form (? ?) of PHP's open tag should be allowed. If
you want to use PHP in combination with XML, you can disable this option in
order to use ?xml ? inline. Otherwise, you can print it with PHP, for
example: ?php echo '?xml version=1.0'; ?. Also if disabled, you must
use the long form of the PHP open tag (?php ?).

Note: This directive also affects the shorthand ?=, which is identical to
? echo. Use of this shortcut requires short_open_tag to be on.


- Original Message -
From: Cody Phanekham   mailto:[EMAIL PROTECTED]
[EMAIL PROTECTED]
To:   mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
Sent: Friday, August 22, 2003 9:32 AM
Subject: RE: [PHP] How to open random Flash page with hyperlink?


Phillip,

pretty close. only a few things that are missing/incorrect.
my corrections are marked by a #


 -Original Message-
 From: Phillip Pang [mailto:[EMAIL PROTECTED]
 // random_menu.html
 head
 ?php
 $i = rand(0,3);
 ?
 /head

 body
 a href =  x http://www.x.com/random.php?i=$i
www.x.com/random.php?i=$ix/a
# you need to go back to php mode to use $i
a href =   http://www.x.com/random.php?i www.x.com/random.php?i=? echo
$i ?x/a

 /body

 ---

 // random.php
 head
 ?php
 $i = $_post[i];
# im pretty sure the value would be past via the GET method as the user
would be clicking the hyperlink, so it should look like
$i = $_GET[i];


 if ($i = = 0){
# there shouldnt be any spaces for the comparison
if ($i == 0){

 $value = a;
 }
 else if ($i = = 1){
# there shouldnt be any spaces for the comparison
else if ($i == 1){

 $value = b;
 }
 ...etc.
# dont forget to get out of php mode
?

 /head

 body
 object
 param name=movie value=$value
# need to go back to php mode to use $value
 param name=movie value=?php echo $value ?

 embed src=$value/embed
# need to go back to php mode to use $value
 embed src=?php echo $value ?/embed

 /object
 /body

 Please help if you know how to do this. Thanks in advance.

 phil*

-murugesan




*
This e-mail, including any attachments to it, may contain confidential
and/or personal information.
If you have received this e-mail in error, you must not copy, distribute, or
disclose it, use or take any action
based on the information contained within it.

Please notify the sender immediately by return e-mail of the error and then
delete the original e-mail.

The information contained within this e-mail may be solely the opinion of
the sender and may not necessarily
reflect the position, beliefs or opinions of Salmat on any issue.

This email has been swept for the presence of computer viruses known to
Salmat's anti-virus systems.

For more information, visit our website at  www.salmat.com.au.

*


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



Re: [PHP] Newbie Question

2003-08-22 Thread Phil King
Hi Everyone,

Thanks a lot for all your advice, I really appreciate it.

PHP / mysql is new to me so excuse my ignorance of the subject..

I will go get phpMyAdmin and give it a whirl.

Thanks again.

Phil.



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



[PHP] text area question

2003-08-22 Thread Angelo Zanetti


Hi this is slightly off topic but i hope i will be forgived.

I have a textarea and whenever my page loads and I click in it the cursor
nevers starts at the very beginning and I have to push the backspace buttton
until i get to the start. is there a property or something to fix this??

thanx in advance
angelo



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



Re: [PHP] text area question

2003-08-22 Thread Marek Kilimajer
Your textarea should be:
textarea name=  /textarea
and not
textarea name=  


/textarea

Angelo Zanetti wrote:

Hi this is slightly off topic but i hope i will be forgived.

I have a textarea and whenever my page loads and I click in it the cursor
nevers starts at the very beginning and I have to push the backspace buttton
until i get to the start. is there a property or something to fix this??
thanx in advance
angelo




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


[PHP] Need some help: Setup PHP5 beta with Windows XP/IIS 5.1

2003-08-22 Thread pt2002
Hi,

I would like to see this beta of php5, to make some tests with new OO
features.

I've been trying install it like a ISAPI module, but always get the error:
module not found!

With cgi, it throws another error with headers.

TIA



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



[PHP] [PHP]: CSV export

2003-08-22 Thread Kai Poppe
Hello NG !

I'm trying to export database entries to a CSV file for Excel.
Everything's working perfectly except that blob (long-text) fields that
contain line-breaks are being exported to different lines within the CSV. I
can't figure out how to convert the \n's respectively chr(13).chr(10) into
chars that tell Excel to accept a multi-field but not line-break within the
file itself.

Greetings

Kai



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



RE: [PHP] Mailing List Weirdness

2003-08-22 Thread Brian S. Drexler
Forge the headerspleasesomeone. :)

-Original Message-
From: Dan Van Derveer [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 21, 2003 1:19 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Mailing List Weirdness


Most mailing lists(I don't know about this one because I have yet to
unsubscribe) require confirmation of the unsub too. I was thinking maybe us
users can attempt to remove these other mailing lists for ourselves.

Dan

-Original Message-
From: Van Andel, Robbert [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 21, 2003 12:45 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Mailing List Weirdness

Is there no confirmation anymore when subscribing to the list??  I seem to
recall that once I added my email I got several emails from this mailing
list asking me to confirm the subscription.  These returned emails are a
pain in the a** if you ask me, or even if you don't :D

Robbert van Andel



-Original Message-
From: Jonatan Pugliese. [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 21, 2003 9:38 AM
To: Van Andel, Robbert; [EMAIL PROTECTED]
Subject: Re: [PHP] Mailing List Weirdness


yes
me too
- Original Message -
From: Van Andel, Robbert [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, August 21, 2003 1:35 PM
Subject: [PHP] Mailing List Weirdness


 The last two posts I sent to this mailing list produced a flurry of emails
 from various locations including majordomo stating it couldnt' understand
 the command I just sent it, a reply from a e-commerce site stating my
order
 has been received, and others.  Anyone else running into this?

 Robbert van Andel




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

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


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



RE: [PHP] text area question

2003-08-22 Thread Keith Higgs
Only if you're concerned about those few whitespace characters increasing your file 
size. Granted, there mey be PHP output related issues to a multi-line whitespace 
within an echo or print operation but, so far as the actual HTML is concerned, white 
space is white space and it should all be ignored by the browser's  rendering engine.

The suggested correction DOES do a lot for programming style by eliminating the 
superfluous space, and the possibility that you may introduce errors by inserting 
other code in that area.

D. Keith Higgs mailto:[EMAIL PROTECTED] 216-368-0559
 Case Western Reserve University, Webmaster / Database Analyst - University Library
 Additional Information at http://www.cwru.edu/UL/ and http://keith.cwru.edu/
Never overestimate the sanity of your sysadmin.

 No trees were killed in the creation of this message. 
 However, many electrons were terribly inconvenienced.

 -Original Message-
 From: Marek Kilimajer [mailto:[EMAIL PROTECTED] 
 Sent: Friday, August 22, 2003 07:08 AM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] text area question
 
 
 Your textarea should be:
 textarea name=  /textarea
 
 and not
 textarea name=  
 
 
 
 
 /textarea
 
 
 Angelo Zanetti wrote:
 
  
  Hi this is slightly off topic but i hope i will be forgived.
  
  I have a textarea and whenever my page loads and I click in 
 it the cursor
  nevers starts at the very beginning and I have to push the 
 backspace buttton
  until i get to the start. is there a property or something 
 to fix this??
  
  thanx in advance
  angelo
  
  
  
 
 
 -- 
 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] Getting browser resolution??

2003-08-22 Thread Bjarke Andersen
Hi

I've just started with PHP and i trying to find a function for getting the
screen resolution, if that i posible??
I need it to resize pictures, so that nomatter what resolution a user haves,
a picture allways uses for example 25% of the width of the screen...

I hope someone can help me!

Thanks
  Bjarke



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



RE: [PHP] Getting browser resolution??

2003-08-22 Thread Thijs Lensselink
This is done by JavaScript or some other client side programming language.
Remember that php is server side.

-Oorspronkelijk bericht-
Van: Bjarke Andersen [mailto:[EMAIL PROTECTED]
Verzonden: vrijdag 22 augustus 2003 14:48
Aan: [EMAIL PROTECTED]
Onderwerp: [PHP] Getting browser resolution??


Hi

I've just started with PHP and i trying to find a function for getting the
screen resolution, if that i posible??
I need it to resize pictures, so that nomatter what resolution a user haves,
a picture allways uses for example 25% of the width of the screen...

I hope someone can help me!

Thanks
  Bjarke



-- 
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] Results Page Numbering

2003-08-22 Thread Haseeb






hi,
i have a simple solutions for paging a large query result into pages.
format your SQL Query like this and it will work

$nTotal_No_Of_Results_Shown_On_A_Page=20;

if (empty($nCurrentPage))
 $nCurrentPage=1;

$tablename="tblusers"; // table from where the data is comming from
$fieldtosorton="user_name"; // a field on wich you want to sort the result returned
$where="user_enabled=1";  // any where clause

$strQuery="SELECT TOP ".$nTotal_No_Of_Results_Shown_On_A_Page."* FROM$tablename WHERE$fieldtosorton NOT IN (SELECT TOP " .($nTotal_No_Of_Results_Shown_On_A_Page * ($nCurrentPage -1)) ." ".$fieldtosorton." FROM ".$tablename." WHERE$where ORDER BY ".$fieldtosorton.") ".$where." ORDER BY ".$fieldtosorton;

this query will give you just the result that you want to show on the current page. all you have to do is maintain $nCurrentPage. if you change the query slightly you can get the total no of records and when you get total no of records then you can also get total no of pages.

HTH,
Haseeb








 IncrediMail - Email has finally evolved - Click Here

Re: [PHP]: CSV export

2003-08-22 Thread Christophe Chisogne
Kai Poppe wrote:
I'm trying to export database entries to a CSV file for Excel.
Everything's working perfectly except that blob (long-text) fields that
contain line-breaks are being exported to different lines within the CSV.
With excel CSV:
- \n is a record separator
- ; is the field separator (CSV = _Comma_ Separated Values ?!)
-  is used to enclose special chars in fields like ' ' and \n
-  is used in fields containing  to replace it
In a word, you just include the \n within surrounding quotes.
See
http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm
Hope it helps, but the CSV format isn't really a standard
(ex MySQL use escapes seq like \ for included  in fields)
--
Christophe Chisogne
Developper, Publicityweb sprl
http://www.publicityweb.com


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


[PHP] Question for you guys and gals

2003-08-22 Thread David Smith
Hi!
I have a problem. I have all my functions (currently) set aside in one
file, and I just require_once that page for all of the other pages that
may need any of those functions. In those functions I have it setup to
echo the link to the CSS page for my site (just a very lazy way of doing
it). My problem is on the sites that I use cookies or use the header to
redirect a page. How can I still have my CSS on my functions page and
not have problems with header errors because of this already being at
the top...recommendations?

David Smith
Programmable Solutions
[EMAIL PROTECTED]


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



Re: [PHP] Getting browser resolution??

2003-08-22 Thread Oli
Use javascript and pass to php:

script language=JavaScript
var SCRwidth  = window.screen.width;
var SCRheight = window.screen.height;
/script

Regards,

Oli

Thijs Lensselink [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 This is done by JavaScript or some other client side programming language.
 Remember that php is server side.

 -Oorspronkelijk bericht-
 Van: Bjarke Andersen [mailto:[EMAIL PROTECTED]
 Verzonden: vrijdag 22 augustus 2003 14:48
 Aan: [EMAIL PROTECTED]
 Onderwerp: [PHP] Getting browser resolution??


 Hi

 I've just started with PHP and i trying to find a function for getting the
 screen resolution, if that i posible??
 I need it to resize pictures, so that nomatter what resolution a user
haves,
 a picture allways uses for example 25% of the width of the screen...

 I hope someone can help me!

 Thanks
   Bjarke



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



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



Re: [PHP] Re: naughty words / filter

2003-08-22 Thread Jason Sheets
Try using str_ireplace, it is str_replace but is case insensitive.  
str_replace and str_ireplace both can take arrays as parameters for the 
needle, replacement value.  The string functions tend to be much faster 
than regular expressions, in any case you don't need the foreach..

Jason

Chris Kranz wrote:

// example #1: in the script the text in the variable $guestbook does not
get replaced.
?
$dirty_words = array(badword1,badword2,badword3);
$guestbook = stripslashes($message);
foreach ($dirty_words as $word){
$message = str_replace($word, , $guestbook);
}
echo $message;
?
.
   

this won't help your script work, but will tidy it up, but try using a
regular expression...
$dirty_words = array(|badword1|i,|badword2|i,|badword3|i); //the i
will make it case insensetive, which is extra useful...
$message = preg_replace( $dirty_words, , stripslashes($message) );
echo $message;


 



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


[PHP] imagick_readimage

2003-08-22 Thread manuel muñoz solera
hi!

I'm working with imagick_readimageand I can read formats like BMP or 
PICT but when I try to do imagick_readimage(sometif.tif) it doesn't 
seems to work (bur it doesn't return an error).

If I use the handler with another function like imagick_convert it 
returns me:

	Warning :  imagick_convert() expects parameter 1 to be resource, 
boolean given in /bla/bla/bla.php on line x

If I use mogrify in the line command I can handle tiff formats without 
problem, but not with the API

Can anyone help me? thanks a lot

manuel muñoz solera

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


Re: [PHP] Question for you guys and gals

2003-08-22 Thread CPT John W. Holmes
From: David Smith [EMAIL PROTECTED]
 I have a problem. I have all my functions (currently) set aside in one
 file, and I just require_once that page for all of the other pages that
 may need any of those functions. In those functions I have it setup to
 echo the link to the CSS page for my site (just a very lazy way of doing
 it). My problem is on the sites that I use cookies or use the header to
 redirect a page. How can I still have my CSS on my functions page and
 not have problems with header errors because of this already being at
 the top...recommendations?

You already know the answer, stop doing it the lazy way. Have a function
that creates your header with the CSS links and call that function only
after you've determined you don't need to set a cookie or another header().

Or cheat and use output buffering.

---John Holmes...


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



Re: [PHP] Question for you guys and gals

2003-08-22 Thread Curt Zirzow
* Thus wrote CPT John W. Holmes ([EMAIL PROTECTED]):
 From: David Smith [EMAIL PROTECTED]
  I have a problem. I have all my functions (currently) set aside in one
  file, and I just require_once that page for all of the other pages that
  may need any of those functions. In those functions I have it setup to
  echo the link to the CSS page for my site (just a very lazy way of doing
  it). My problem is on the sites that I use cookies or use the header to
  redirect a page. How can I still have my CSS on my functions page and
  not have problems with header errors because of this already being at
  the top...recommendations?
 
 You already know the answer, stop doing it the lazy way. Have a function
 ...
 
 Or cheat and use output buffering.

IMO, thats an even more lazy way of doing it.

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



php-general Digest 22 Aug 2003 16:06:36 -0000 Issue 2252

2003-08-22 Thread php-general-digest-help

php-general Digest 22 Aug 2003 16:06:36 - Issue 2252

Topics (messages 160375 through 160424):

Re: datetime
160375 by: Larry_Li.contractor.amat.com
160376 by: Cody Phanekham
160406 by: Marek Kilimajer

Re: Easy XML  PHP tutorials ?
160377 by: Burhan Khalid
160387 by: Joe Harman

Stopping Output
160378 by: Oliver
160389 by: Jean-Christian IMbeault

How to make an argument optional...confirmation...
160379 by: Jonathan Villa
160382 by: Ralph Guzman
160383 by: Tom Rogers
160384 by: Jonathan Villa

Re: google style paginating
160380 by: olinux

How to open random Flash page with hyperlink?
160381 by: Phillip Pang
160385 by: Cody Phanekham
160386 by: murugesan
160388 by: Cody Phanekham
160407 by: murugesan

Re: error when using $this
160390 by: Jean-Christian IMbeault

timestamp
160391 by: John Taylor-Johnston
160404 by: John Taylor-Johnston

Re: OT-Re: worm on th list
160392 by: Jerry M. Howell II
160393 by: daniel.electroteque.org
160394 by: John Taylor-Johnston
160395 by: jabber.raditha.com
160396 by: Peter James
160397 by: daniel.electroteque.org
160398 by: Ashley M. Kirchner
160401 by: David Robley

Re: File upload + permissions + .htaccess in php
160399 by: Nicholas Robinson

Re: Your details
160400 by: David Robley

Re: This is getting rediculus
160402 by: David Robley

count rows
160403 by: John Taylor-Johnston
160405 by: jabber.raditha.com

Re: Newbie Question
160408 by: Phil King

text area question
160409 by: Angelo Zanetti
160410 by: Marek Kilimajer
160414 by: Keith Higgs

Need some help: Setup PHP5 beta with Windows XP/IIS 5.1
160411 by: pt2002

Re: CSV export
160412 by: Kai Poppe

Re: Mailing List Weirdness
160413 by: Brian S. Drexler

Getting browser resolution??
160415 by: Bjarke Andersen
160416 by: Thijs Lensselink
160420 by: Oli

Results Page Numbering
160417 by: Haseeb

Re: : CSV export
160418 by: Christophe Chisogne

Question for you guys and gals
160419 by: David Smith
160423 by: CPT John W. Holmes
160424 by: Curt Zirzow

Re: naughty words / filter
160421 by: Jason Sheets

imagick_readimage
160422 by: manuel muñoz solera

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---
Use date() and strtotime() together. strtotime will convert date string 
into integer timestamp. Still have any questions, check these two 
functions online plz.








Dale Hersh [EMAIL PROTECTED]
08/22/2003 10:13 AM
 
To: [EMAIL PROTECTED]
cc: 
Subject:[PHP] datetime
 



I am using a mssql database and I have a question regarding the datetime
type. When I write a date to the database it store the date in the 
following
format:
6/8/03

But when I extract the date from the database it returns the value in the
following format:
Jun 8 2003 12:00AM

Is there a nice function available in php that will format the date based
upon certain specification. I know that date() exists, but I that means I
would have to use mktime() which would require parsing the entire string 
and
breaking the string into the day, the month, the year. Furthermore, I 
would
then need a switch statement to convert the value Jun into the value 6.

I appreciate any help.

Thanks,
Dale



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


---End Message---
---BeginMessage---
Convert Jun 8 2003 12:00AM to a timestamp which can then be used with the date() 
function to format the date to whatever format you want.

Lets say you've inserted the date as '6/8/03' and you want the data to remain the same 
when you retrieve it:

?
$ts = strtotime(Jun 8 2003 12:00AM);
echo date(n/j/y, $ts);
?

so all you have to do is replace Jun 8 2003 12:00AM with data retrieved from the DB

 -Original Message-
 From: Dale Hersh [mailto:[EMAIL PROTECTED]
 Sent: Friday, 22 August 2003 12:13
 To: [EMAIL PROTECTED]
 Subject: [PHP] datetime
 
 
 I am using a mssql database and I have a question regarding 
 the datetime
 type. When I write a date to the database it store the date 
 in the following
 format:
 6/8/03
 
 But when I extract the date from the database it returns the 
 value in the
 following format:
 Jun 8 2003 12:00AM
 
 Is there a nice function available in php that will format 
 the date based
 upon certain specification. I know that date() exists, but I 
 that means I
 would have to use mktime() which would require parsing the 
 

Re: [PHP] Question for you guys and gals

2003-08-22 Thread CPT John W. Holmes
From: Curt Zirzow [EMAIL PROTECTED]

  Or cheat and use output buffering.

 IMO, thats an even more lazy way of doing it.

I agree entirely. I hate even giving that option, but it is there. That's
why I said he could cheat :)

---John Holmes...


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



[PHP] isset bug?

2003-08-22 Thread Christian Calloway
Ok, here's the deal. I like to use $_GET and $_POST variables without values
to notify my scripts that some action must be taken. For example, given the
following URL:

http://blahdomain/blah.php?productid=1edit

or given the following form element:

input type=hidden name=edit

My blah.php script will check if edit set using the following line:

if (isset($_REQUEST[edit]))
{
..
}

and then it will take the appropriate actions (lets just say its updating a
record in the database). Locally I am running PHPv4.3.2, and everything
works fine. I have been working on a large web-based application for the
last month, and yesterday I put it up live. Our host unfortunately runs
PHPv4.2.1 and I have no access to the conf files (those bastards) and
globals are set to on. Low and behold, the isset function returns false when
a $_POST or $_GET variable is passed but contains no value, which would be
exactly the same thing as checking the variable itself:

if ($_REQUEST[edit]) { }

What I want and needed to do was check for the existance of the variable,
not whether it has a value. So is this a bug, a feature or just some random
happening? Thank guys

PHP ROCKS



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



[PHP] I wish I knew more about multi-dimensional arrays

2003-08-22 Thread Verdon vaillancourt
Hi, please don't chuckle (too loudly) at my attempts to learn ;)

I'm trying to create what I think would be a multi-dimensional array from a
mysql result set, to use in some example code I got off this list last week.

The example renedring code I want to work with is...

?php

$data = array('A', 'B', 'C', 'D', 'E', 'F', 'G');
$rowlength = 3;

echo (table);
for ($i = 0; $i  sizeof ($data); $i += $rowlength)
{
echo (tr);
for ($j = 0; $j  $rowlength; $j++)
{
if (isset ($data[$i+$j]))
{
echo (td{$data[$i+$j]}/td);
} else {
echo (tdnbsp;/td);
}
}
echo (/tr);
}
echo (/table);



?

I trying to create the $data array from my query results like this...

$sql = select * from table limit 0,5;
$result = mysql_query ($sql);
$number = mysql_numrows ($result);

for ($x = 0; $x  sizeof (mysql_fetch_array($result)); $x ++) {
$data = implode (',',$result[$x]);
}

I had hoped this would get me the six arrays on the page (where I could then
extract the values). I've also tried a number of similar approaches but am
consistently getting six error messages on the page along the lines of

Warning :  implode() [ function.implode ]: Bad arguments. in

I know I'm missing something basic and would appreciate any pointers.

Thanks,
Verdon


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



Re: [PHP] File upload + permissions + .htaccess in php

2003-08-22 Thread Ryan A
Hey,
Thanks for replying.

the paths i am using are as follows:

$UserUploadDir=/usr163/home/r/y/ryanknig/public_html/BWH-Ads-Images;
$UserUploadURL = http://jumac.com/BWH-Ads-Images;;

But they still dont workany ideas?

Thanks,
-Ryan





 I've had this problem twice recently.

 Once it was because I'd foolishly moved a script that used relative
pathnames.
 The result was that I was trying to access a file outside the DocumentRoot
 and it didn't matter what the permissions on the file were, it wasn't
trying
 to open that one at all!

 The other time is more confusing. I'd gone through all directory and file
 ownerships and they were okay. In the end, in desperation, I chgrp'd the
file
 to be mine (leaving ownership alone) and it worked. This is on my list of
 things to come back to!

 HTH

 Nick

 On Thursday 21 Aug 2003 10:30 am, Ryan A wrote:
  Hi,
  I am trying to upload something into a directory on my server but always
i
  am getting a permission denied ONLY from this server...i have tried it
on 2
  other servers and they seem to be working fine but i have to get it
working
  on this server as this server is the fastest and our production server.
 
  I have looked at the folder permissions and CHMODED/changed them from
644
  to 766 and finally 777 but am getting the same error, i then had a look
at
  the php info file (http://jumac.com/phpinfo.php) and i see
file_uploading
  is set to 1 and 1, safe mode is off, i am not too familier with file
  uploading so is this right? if not, how can i change it? hopefully via a
  .htaccess as I dont have access to the php.ini file directly.
 
  Let me again point out that this problem only seems to be on this
server,
  the scripts including the upload is working perfectly on the other test
  servers/sites.
 
  Kindly reply,
  -Ryan A.
 
 
  We will slaughter you all! - The Iraqi (Dis)information ministers site
  http://MrSahaf.com


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




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



Re: [PHP] I wish I knew more about multi-dimensional arrays

2003-08-22 Thread Ray Hunter
mysql result as a multi-dimensional array:

while( $row = mysql_fetch_array($result) ) {
  $rows[] = $row;
}

now you have a multi-dimensional array that contains each row in rows...

examples:
row 1 col 1 - $rows[0][0]
row 3 col 2 - $rows[3][2]

hth

--
bigdog


On Fri, 2003-08-22 at 10:37, Verdon vaillancourt wrote:
 Hi, please don't chuckle (too loudly) at my attempts to learn ;)
 
 I'm trying to create what I think would be a multi-dimensional array from a
 mysql result set, to use in some example code I got off this list last week.
 
 The example renedring code I want to work with is...
 
 ?php
 
 $data = array('A', 'B', 'C', 'D', 'E', 'F', 'G');
 $rowlength = 3;
 
 echo (table);
 for ($i = 0; $i  sizeof ($data); $i += $rowlength)
 {
 echo (tr);
 for ($j = 0; $j  $rowlength; $j++)
 {
 if (isset ($data[$i+$j]))
 {
 echo (td{$data[$i+$j]}/td);
 } else {
 echo (tdnbsp;/td);
 }
 }
 echo (/tr);
 }
 echo (/table);
 
 
 
 ?
 
 I trying to create the $data array from my query results like this...
 
 $sql = select * from table limit 0,5;
 $result = mysql_query ($sql);
 $number = mysql_numrows ($result);
 
 for ($x = 0; $x  sizeof (mysql_fetch_array($result)); $x ++) {
 $data = implode (',',$result[$x]);
 }
 
 I had hoped this would get me the six arrays on the page (where I could then
 extract the values). I've also tried a number of similar approaches but am
 consistently getting six error messages on the page along the lines of
 
 Warning :  implode() [ function.implode ]: Bad arguments. in
 
 I know I'm missing something basic and would appreciate any pointers.
 
 Thanks,
 Verdon
 


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



Re: [PHP] isset bug?

2003-08-22 Thread Curt Zirzow
* Thus wrote Christian Calloway ([EMAIL PROTECTED]):
 Ok, here's the deal. I like to use $_GET and $_POST variables without values
 to notify my scripts that some action must be taken. For example, given the
 following URL:
 
 http://blahdomain/blah.php?productid=1edit
 
 or given the following form element:
 
 input type=hidden name=edit

simply add a value=1 and it will fix your problem.

 
 My blah.php script will check if edit set using the following line:
 
 if (isset($_REQUEST[edit]))
 {
 ..
 }
 
 and then it will take the appropriate actions (lets just say its updating a
 record in the database). Locally I am running PHPv4.3.2, and everything
 works fine. I have been working on a large web-based application for the
 last month, and yesterday I put it up live. Our host unfortunately runs
 PHPv4.2.1 and I have no access to the conf files (those bastards) and
 globals are set to on. Low and behold, the isset function returns false when
 a $_POST or $_GET variable is passed but contains no value, which would be
 exactly the same thing as checking the variable itself:
 


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] timestamp

2003-08-22 Thread John Taylor-Johnston
Anyone? Please :)

John Taylor-Johnston wrote:

 This is what I'm using so far. But I need to put in a time stamp to calculate if the 
 visitor is new. I want to use the IP so if the ip saved in MySQL is older than 60 
 minutes, it will write a new record, if not, don't:

 $myconnection = mysql_connect($server,$user,$pass);
 mysql_select_db($db,$myconnection);

 $getaddr = $_SERVER['REMOTE_ADDR'];
 $gethost = gethostbyaddr($_SERVER['REMOTE_ADDR']);
 $EntryDate = date(Y-m-d);

 $sql = INSERT INTO $table (IPAddress,RemoteHost,EntryDate) 
 values('$getaddr','$gethost','$EntryDate');
 mysql_query($sql);

 $myconnection = mysql_connect($server,$user,$pass);
 mysql_select_db($db,$myconnection);
 $result = mysql_query(SELECT * FROM $table, $myconnection);
 $num_rows = mysql_num_rows($result);

 echo document.write(\$num_rows visitors. \);;

--
John Taylor-Johnston
-
If it's not open-source, it's Murphy's Law.

  ' ' '   Collège de Sherbrooke:
 ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
   - Université de Sherbrooke:
  http://compcanlit.ca/
  819-569-2064



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



[PHP] CMS question.

2003-08-22 Thread Edmond Baroud
Hi all,

I have a friend who have paid a developper to build him a CMS. This honest 
programmer did that (supposedly developped it on his own), encoded the CMS 
with Ioncube and did some other unethical activities as well. To make a long 
story short, I have read some articles about decoding and cracking the source 
/ reverse engineering, and it looks like it is time consuming and also 
illegal.

I have taken snapshots of the CMS and put them available to whoever is 
interested in giving me a hand to see if this CMS is an open source one?
note the php files: categories_list.php, content_list.php and 
content_edit.php.
the CM is also capable to upload in batch... ?
It might be a mix of CMS and an Image Gallery script pakcage.. I also see that 
Smarty (template engine) is installed in the same root directory of the CMS, 
I am not familiar with Smarty, and since the code is encoded I have no way to 
tell wether it's being used with it or not..

Any hints would be appreciated!

snapshots available here:
http://www.onlinecardonation.com/img1.jpg
http://www.onlinecardonation.com/img2.jpg
http://www.onlinecardonation.com/img3.jpg

PS: the CMS is not used for the website above where I put the images :)

Thanks!

Ed.

-- 
Edmond Baroud 
Senior UNIX sysadmin mailto:[EMAIL PROTECTED]
Fingerprint  140F 5FD5 3FDD 45D9 226D  9602 8C3D EAFB 4E19 BEF9
UNIX is very user friendly, it's just picky about who its friends are.



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



Re: [PHP] timestamp

2003-08-22 Thread Gabriel Guzman
On Thu, 2003-08-21 at 22:23, John Taylor-Johnston wrote:
 Not teasing, I know I could do this with some ready made script, but I want to make 
 my own.
 
 I'm making a counter.
 
 CREATE TABLE `counter` (
   `IPAddress` VARCHAR NOT NULL ,
   `RemoteHost` VARCHAR NOT NULL ,
   `TimeStamp` TIMESTAMP NOT NULL,

try not naming your timestamp column a reserved word...  just a guess

   `Date` VARCHAR NOT NULL
 )
 
 
 Question 1, how do I create a timestamp, (My SQL above does not work.), if this is 
 indeed what I want to do.

see above

 Question 2, how can I read TimeStamp and if the elapsed time between visits is more 
 than 60 minutes, I insert a new record?

umm... look at:

http://us4.php.net/time
and
http://www.mysql.com/doc/en/DATETIME.html

one thing to look out for is php and mysql deal with time in different
ways, so you may have to do some conversion... but this should get you
started. 

 Where do I start?

the above 2 links.



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



RE: [PHP] Re: rich text editing

2003-08-22 Thread Andy Crain
The only problem in doing so, for me at least, is in editing text
created by htmlarea. Nonsupported users who get a normal textarea
pre-loaded with html generated by htmlarea could break tags, etc., on
updates. I wrote a class I use to work around this by: determining which
type of textarea they'll get (wysiwyg htmlarea or plain textarea), and
if they're using a plain textarea and editing html, all html except for
bold, italics and underline tags are replaced with markers. The plain
textarea user then can add standard bb style tags, [b], [i], etc., then
on submit the bb tags will be converted to html, and the original html
will be added back in, properly nested, etc. If you'd like to use it,
I'd be happy to email it. I'm sure it could use a few extra sets of
eyes.
Andy

 -Original Message-
 From: Nelson Rodríguez-Peña Alarcón [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 21, 2003 6:46 PM
 To: Redmond Militante
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Re: rich text editing
 
 Hi,
 
 Redmond Militante wrote:
  
  (...) what do people generally do when using an activex rich text
  editor and the user is using a non supported browser?
 
 You can display a textarea. It'd allow users to edit/add content in a
 simpler, less powered way.
 
 --
 regards,
 
 
 Nelson Rodríguez-Peña A.
 Diseño y Desarrollo Web y Multimedia
 
 
 
 --
 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] isset bug?

2003-08-22 Thread Christian Calloway
What I was trying to avoid is exactly that. It would require changing links
and hidden fields throughout the entire application, which would take hours
to track down. I am looking for a nice lazy and easy fix.


Curt Zirzow [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 * Thus wrote Christian Calloway ([EMAIL PROTECTED]):
  Ok, here's the deal. I like to use $_GET and $_POST variables without
values
  to notify my scripts that some action must be taken. For example, given
the
  following URL:
 
  http://blahdomain/blah.php?productid=1edit
 
  or given the following form element:
 
  input type=hidden name=edit

 simply add a value=1 and it will fix your problem.

 
  My blah.php script will check if edit set using the following line:
 
  if (isset($_REQUEST[edit]))
  {
  ..
  }
 
  and then it will take the appropriate actions (lets just say its
updating a
  record in the database). Locally I am running PHPv4.3.2, and everything
  works fine. I have been working on a large web-based application for the
  last month, and yesterday I put it up live. Our host unfortunately runs
  PHPv4.2.1 and I have no access to the conf files (those bastards) and
  globals are set to on. Low and behold, the isset function returns false
when
  a $_POST or $_GET variable is passed but contains no value, which would
be
  exactly the same thing as checking the variable itself:
 


 Curt
 -- 
 I used to think I was indecisive, but now I'm not so sure.



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



[PHP] File upload restrictive permissions

2003-08-22 Thread Doug Parker
Recently I had a problem with file uploading on a server I use, and the
problem was that the tmp/ directory was not set.  Now that it has been set,
the images do upload, but the file permissions end up being very
restrictive - something like (-rw---) - so the images obviously do not
show up on the web.  I know I could login and chmod tihs, but since we have
clients upload their own images, it goes without saying that this would be a
major inconvenience.  Our sysadmin, who is relatively clueless, suggested
that I add a php chmod function to my scripts.  I suppose this would work,
but I don't understand why my scripts once worked without this function -
the files uploaded and were web-viewable.  I checked both the target
directory and tmp/ directory, and both are fit for web viewing.

Any ideas as to how I could fix this?

Thanks...



http://www.phreshdesign.com



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



Re: [PHP] timestamp

2003-08-22 Thread John Taylor-Johnston
I'm creating a counter.

I want a timestamp where I can calculate if a time stamp is older than one hour, if so 
do X, if not do Y.

Gabriel Guzman wrote:
http://us4.php.net/time
and
http://www.mysql.com/doc/en/DATETIME.html

I have looked at both, especially http://www.mysql.com/doc/en/DATETIME.html
I got my fields to work. Did something stupid.

I'm using timestamp(14) which makes MMDDHHMMSS
therefore: 20030822033746 becomes:
2003-08-22-03:37:46 (I don't get a lot of sleep I guess :)  )

But this is a little difficult to extract a calculation.
In Javascript, however, it seems easier.

script
var expdate = new Date();

//# Cookie Stuff
#
// COOKIE EXPIRATION VARIABLES
// Set cookie to expire in 12 hours
// 1000 milliseconds (milliseconds per second)
// * 60 milliseconds (seconds per minute)
// * 60 milliseconds (minutes per hour)
// * 12 milliseconds (hours per day)
// * 1 milliseconds (days)
// -
// = 12 hours

expdate.setTime (expdate.getTime() + (1000*60*60*12*1));
/script

Is this the way to go in PHP? And how do I do it? Or is there a better way to have a 
timestamp?

John

---snip this is the code I have so far -

CREATE TABLE `counter` (
  `id` int(10) NOT NULL auto_increment,
  `IPAddress` varchar(100) NOT NULL default '',
  `RemoteHost` varchar(100) NOT NULL default '',
  `EntryDate` date NOT NULL default '-00-00',
  `MyTimeStamp` timestamp(14) NOT NULL,
  `MyTime` time NOT NULL default '00:00:00',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM AUTO_INCREMENT=6 ;

$myconnection = mysql_connect($server,$user,$pass);
mysql_select_db($db,$myconnection);

$getaddr = $_SERVER['REMOTE_ADDR'];
$gethost = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$EntryDate = date(Y-m-d);

$sql = INSERT INTO $table (IPAddress,RemoteHost,EntryDate)
values('$getaddr','$gethost','$EntryDate');

mysql_query($sql);

$myconnection = mysql_connect($server,$user,$pass);
mysql_select_db($db,$myconnection);

$result = mysql_query(SELECT * FROM $table, $myconnection);
$num_rows = mysql_num_rows($result);

echo document.write(\$num_rows visitors. \);;



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



Re: [PHP] timestamp

2003-08-22 Thread Gabriel Guzman
On Fri, 2003-08-22 at 11:50, John Taylor-Johnston wrote:
 I'm creating a counter.
 
 I want a timestamp where I can calculate if a time stamp is older than one hour, if 
 so do X, if not do Y.

so, you have the timestamp already correct?  in your mysql db.  all you
should need to do is get the unix timestamp from that field: 

SELECT UNIX_TIMESTAMP(whateveryourtimestampfieldiscalled) from mytable
where foo;

and compare it to the current time from php:

$timeStampTime = value you got from DB;
$currentTime = time();

these are just integers, so you can easily look to see if the timestamp
is over an hour old.  A unix timestamp is simply the number of seconds
that have elapsed since the beginning of the unix epoch, so if you know
how many seconds there are in an hour, you can determine if the
$timeStampTime is over an hour old.

something like: 

if $timeStampTime + 3600  $currentTime { 
  echo I'm over an hour old; 
} else {
  echo I'm not an hour old;
}

should work. 

hth,
gabe.


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



[PHP] '' Sign in _GET Parameter

2003-08-22 Thread Pushpinder Singh Garcha
Hello All,

 I am using an application where I retrieve user profile from a MySQL 
DB using the Company Name .  I pass the name of the company to the PHP 
script as a '$_GET' parameter. e.g. when the name of the company is 
'IBM'. , the URL with the query string would look like :
http://masterstream.com/CRM/full_profile_1.php?name=IBM

Now one of the records had a name : PSG  Inc. , in this case the URL 
with the query string would look like
http://masterstream.com/CRM/full_profile_1.php?name=PSG%20%20Inc.

However in the case of the latter I am not able to pull out any records 
from the MySQL database. It says that no records with the name were 
found.   I went ahead and tweaked the name of the company, to remove 
the  sign in 'PSG  Inc.'   Now the query works fine.  Can some one 
throw some light here. I am sure something minor is to be done when 
passing the name of the company in the parent script.

Thanks in advance
--Pushpinder



[PHP] anyone have any idea as to how to display a message after a page has started loading??

2003-08-22 Thread Jeffrey D. Means
I am looking for a way to say please wait generating thumbnails... while
actually doing so.  I have tried calling the JavaScript alert() function
before starting the image processing but it waits for the page to
complete loading before displaying the alert box.  anyone have any ideas
on this??  BTW: at the time I am trying to display a message I have
already started output to the browser.
 
---
Jeffrey D. Means
CIO for MeansPC
[EMAIL PROTECTED]
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/2003
 


Re: [PHP] anyone have any idea as to how to display a messageafter a page has started loading??

2003-08-22 Thread Matt Babineau
Perhaps you wrap a table around your image and set the background= of
the table to an image of the same size that says Loading Thumbnails,
then when the image loads, it loads over the background.

Matt

On Fri, 2003-08-22 at 15:08, Jeffrey D. Means wrote:
 I am looking for a way to say please wait generating thumbnails... while
 actually doing so.  I have tried calling the JavaScript alert() function
 before starting the image processing but it waits for the page to
 complete loading before displaying the alert box.  anyone have any ideas
 on this??  BTW: at the time I am trying to display a message I have
 already started output to the browser.
  
 ---
 Jeffrey D. Means
 CIO for MeansPC
 [EMAIL PROTECTED]
  
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/2003
  


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



Re: [PHP] '' Sign in _GET Parameter

2003-08-22 Thread Gabriel Guzman
On Fri, 2003-08-22 at 12:05, Pushpinder Singh Garcha wrote:
 Hello All,
 
   I am using an application where I retrieve user profile from a MySQL 
 DB using the Company Name .  I pass the name of the company to the PHP 
 script as a '$_GET' parameter. e.g. when the name of the company is 
 'IBM'. , the URL with the query string would look like :
 http://masterstream.com/CRM/full_profile_1.php?name=IBM
 
 Now one of the records had a name : PSG  Inc. , in this case the URL 
 with the query string would look like
 http://masterstream.com/CRM/full_profile_1.php?name=PSG%20%20Inc

no, this is not how it should look... the '' in the above query string
is saying the variable 'name' ends and a new variable follows.  If you
are submitting this in a form using method=get... it should look
something like:  

?name=PSG+%26+Inc

if you are really passing this in a form using method=get, then this
should be handled automatically. 

how are you accessing the passed variable?  

$_GET['name']  ?? 




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



Re: [PHP] '' Sign in _GET Parameter

2003-08-22 Thread CPT John W. Holmes
From: Pushpinder Singh Garcha [EMAIL PROTECTED]

   I am using an application where I retrieve user profile from a MySQL
 DB using the Company Name .  I pass the name of the company to the PHP
 script as a '$_GET' parameter. e.g. when the name of the company is
 'IBM'. , the URL with the query string would look like :
 http://masterstream.com/CRM/full_profile_1.php?name=IBM

 Now one of the records had a name : PSG  Inc. , in this case the URL
 with the query string would look like
 http://masterstream.com/CRM/full_profile_1.php?name=PSG%20%20Inc.

 However in the case of the latter I am not able to pull out any records
 from the MySQL database. It says that no records with the name were
 found.   I went ahead and tweaked the name of the company, to remove
 the  sign in 'PSG  Inc.'   Now the query works fine.  Can some one
 throw some light here. I am sure something minor is to be done when
 passing the name of the company in the parent script.

The  character separates variables in the query string, so it must be
encoded if it appears in the data. Take a look at
http://us2.php.net/urlencode

---John Holmes...


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



Re: [PHP] timestamp

2003-08-22 Thread CPT John W. Holmes
From: John Taylor-Johnston [EMAIL PROTECTED]


 I'm creating a counter.

 I want a timestamp where I can calculate if a time stamp is older than one
hour, if so do X, if not do Y.

SELECT * FROM Table WHERE timestamp_column  NOW() - INTERVAL 60 MINUTE

will give you all rows that have a timestamp column that's over 60 minutes
old. Adapt to your needs.

---John Holmes..


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



Re: [PHP] timestamp

2003-08-22 Thread John Taylor-Johnston
Indeed easier than I thought?! :)
timestamp(14) is ok :)
Thanks John!
John
-- 
http://compcanlit.ca/

Quoting CPT John W. Holmes [EMAIL PROTECTED]:
 SELECT * FROM Table WHERE timestamp_column  NOW() - INTERVAL 60 MINUTE
 will give you all rows that have a timestamp column that's over 60 minutes
 old. Adapt to your needs.
 ---John Holmes..

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



RE: [PHP] anyone have any idea as to how to display a message after a page has started loading??

2003-08-22 Thread Dan Joseph
Hi,

 I am looking for a way to say please wait generating thumbnails... while
 actually doing so.  I have tried calling the JavaScript alert() function
 before starting the image processing but it waits for the page to
 complete loading before displaying the alert box.  anyone have any ideas
 on this??  BTW: at the time I am trying to display a message I have
 already started output to the browser.

Try looking up the flush() function on php.net.  That _might_ do what you
want.

-Dan Joseph


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



[PHP] Re: Getting browser resolution??

2003-08-22 Thread erythros
you don't need to get the screen resolution for that. if you still want the
screen resolution you'll have to look at javascript. just assign the
pictures width to 25%. no matter the screen size, or resolution ie will set
the picture to 25% of the window. it's pure html...

img src=image.jpg width=25% /


Bjarke Andersen [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi

 I've just started with PHP and i trying to find a function for getting the
 screen resolution, if that i posible??
 I need it to resize pictures, so that nomatter what resolution a user
haves,
 a picture allways uses for example 25% of the width of the screen...

 I hope someone can help me!

 Thanks
   Bjarke





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



Re: [PHP] '' Sign in _GET Parameter

2003-08-22 Thread Pushpinder Singh Garcha
Thanks for the link,

$link = $row['company'];
a href=\full_profile_1.php?name=', urlencode($link),' \
However this does not seem to work / what am I missing ?

Thanks
-Pushpinder


On Friday, August 22, 2003, at 03:23 PM, CPT John W. Holmes wrote:

From: Pushpinder Singh Garcha [EMAIL PROTECTED]

  I am using an application where I retrieve user profile from a MySQL
DB using the Company Name .  I pass the name of the company to the PHP
script as a '$_GET' parameter. e.g. when the name of the company is
'IBM'. , the URL with the query string would look like :
http://masterstream.com/CRM/full_profile_1.php?name=IBM
Now one of the records had a name : PSG  Inc. , in this case the URL
with the query string would look like
http://masterstream.com/CRM/full_profile_1.php?name=PSG%20%20Inc.
However in the case of the latter I am not able to pull out any 
records
from the MySQL database. It says that no records with the name were
found.   I went ahead and tweaked the name of the company, to remove
the  sign in 'PSG  Inc.'   Now the query works fine.  Can some one
throw some light here. I am sure something minor is to be done when
passing the name of the company in the parent script.
The  character separates variables in the query string, so it must be
encoded if it appears in the data. Take a look at
http://us2.php.net/urlencode
---John Holmes...

--
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] Clean Up the sand box time

2003-08-22 Thread John Taylor-Johnston
This is my favourite question. Can I clean up my 'if then' statements a tad?
Must be a cleaner way?
Still learning, still having fun :)
Thanks,
John

 $news = mysql_query($sql) or die(print document.write(\.mysql_error().\););

 $found = 0;
 while ($mydata = mysql_fetch_object($news))
 {
  if($getaddr == $mydata-IPAddress)
  {
  $found = 1;
  }
 }

  if ($found  0)
  {
  echo document.write(\$getaddr already visited. \);;
  }else{
  echo document.write(\insert $getaddr into $table. \);;
  }




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



Re: [PHP] isset bug?

2003-08-22 Thread Robert Cummings
This should help:

http://www.php.net/manual/en/function.array-key-exists.php

Cheers,
Rob.


On Fri, 2003-08-22 at 13:26, Curt Zirzow wrote:
 * Thus wrote Christian Calloway ([EMAIL PROTECTED]):
  Ok, here's the deal. I like to use $_GET and $_POST variables without values
  to notify my scripts that some action must be taken. For example, given the
  following URL:
  
  http://blahdomain/blah.php?productid=1edit
  
  or given the following form element:
  
  input type=hidden name=edit
 
 simply add a value=1 and it will fix your problem.
 
  
  My blah.php script will check if edit set using the following line:
  
  if (isset($_REQUEST[edit]))
  {
  ..
  }
  
  and then it will take the appropriate actions (lets just say its updating a
  record in the database). Locally I am running PHPv4.3.2, and everything
  works fine. I have been working on a large web-based application for the
  last month, and yesterday I put it up live. Our host unfortunately runs
  PHPv4.2.1 and I have no access to the conf files (those bastards) and
  globals are set to on. Low and behold, the isset function returns false when
  a $_POST or $_GET variable is passed but contains no value, which would be
  exactly the same thing as checking the variable itself:
  
 
 
 Curt
 -- 
 I used to think I was indecisive, but now I'm not so sure.
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



[PHP] PHP and directory permissions

2003-08-22 Thread Lowell Allen
I developed a script which updates some static HTML pages. The script
creates temporary files and opens them for writing. It then reads the HTML
content of PHP-generated pages and writes that to the temp files. If that's
successful, it copies the temp files to the static files, thus updating
them. This worked without problem for several months, but recently started
throwing a permissions error:

 Warning: fopen(temp_list_auctions.html): failed to open stream:
 Permission denied in
 /home/williams/public_html/generate_auction_lists.php on line 55
 Unable to open temporary file (temp_list_auctions.html) for writing.

The same script still works fine in public_html/dev, which is a directory I
use for testing. I asked the commercial host why this has become a problem
and why it works in public_html/dev but not in public_html. Here's the reply
(which does not explain why it once worked):

 The reason the problem occurs in the public_html directory is because
 the directory is owned by user: williams group: nobody. Your account is
 setup like this so no one can write into your root directory, except a perl
 script or a PHP script on your site executed as a CGI. By chmoding the
 public_html directory to 777 you make the ownership settings useless. The
 directory named dev is owned by user: williams group: williams so your PHP
 script has no trouble writing to it with 757 permissions.
 
 So you could either chmod the public_html directory to 777 or we could chown
 the directory to user: williams group: williams.

I don't want the public_html directory set to 777, but I certainly want PHP
to be able to update files. Is there a security problem with having
public_html owned by user: williams, group: williams? Would it be better to
rewrite my script so that it doesn't need to create files?

Comments on the best approach for security and reliability would be
appreciated.

--
Lowell Allen


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



Re: [PHP] Clean Up the sand box time

2003-08-22 Thread Robert Cummings
Absolutely, the best way *tongue in cheek* is to format as follows:

$news = mysql_query($sql) or die( print document.write(\.mysql_error().\););

$found = 0;
while( $mydata = mysql_fetch_object( $news ) )
{
if( $getaddr == $mydata-IPAddress )
{
$found = 1;
}
}

if( $found  0 )
{
echo document.write(\$getaddr already visited. \);;
}
else
{
echo document.write(\insert $getaddr into $table. \);;
}

Look how neat that is, who could possibly come up with a better style of
formatting than that!?

Cheers,
Rob.


On Fri, 2003-08-22 at 17:26, John Taylor-Johnston wrote:
 This is my favourite question. Can I clean up my 'if then' statements a tad?
 Must be a cleaner way?
 Still learning, still having fun :)
 Thanks,
 John
 
  $news = mysql_query($sql) or die(print document.write(\.mysql_error().\););
 
  $found = 0;
  while ($mydata = mysql_fetch_object($news))
  {
   if($getaddr == $mydata-IPAddress)
   {
   $found = 1;
   }
  }
 
   if ($found  0)
   {
   echo document.write(\$getaddr already visited. \);;
   }else{
   echo document.write(\insert $getaddr into $table. \);;
   }


-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



RE: [PHP] anyone have any idea as to how to display a message aftera page has started loading??

2003-08-22 Thread Robert Cummings
Also make sure you don't have output buffering or compression on for the
page in question.

Cheers,
Rob.


On Fri, 2003-08-22 at 16:42, Dan Joseph wrote:
 Hi,
 
  I am looking for a way to say please wait generating thumbnails... while
  actually doing so.  I have tried calling the JavaScript alert() function
  before starting the image processing but it waits for the page to
  complete loading before displaying the alert box.  anyone have any ideas
  on this??  BTW: at the time I am trying to display a message I have
  already started output to the browser.
 
   Try looking up the flush() function on php.net.  That _might_ do what you
 want.
 
 -Dan Joseph
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



[PHP] Trading senerio

2003-08-22 Thread Joaco
I am trying to create an interface that will allow two users do do a trade
of items live on the web. What I want to happen, and I have seen it done on
other sites, is open a window that both people see on their machine and are
able to offer trades. Once the trade is accepted by both people, the system
should update the database.

How can I create such an iterface?



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



Re: [PHP] Re: google style paginating

2003-08-22 Thread Rob Yelvington
The Pear Pager class works like a champeen, too.  It'll paginate results 
however you'd like it to.

~Rob

Chris W. Parker wrote:
Robert Cummings mailto:[EMAIL PROTECTED]
on Thursday, August 21, 2003 4:46 PM said:

Don't retrieve ALL the queries then
only display a subset. Otherwise what's the point of using the LIMIT
clause for conservation of resources?  The SELECT COUNT( * ) FROM
foo query is usually optimized to be extremely fast so the first
query is almost negligible in contrast to the second.


Heh... I've never really used COUNT() so I'll have to see how much it
speeds up my searching. :)
Good idea!

Chris.


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


[PHP] float precision format not being kept

2003-08-22 Thread Rob Yelvington
I have a list of floats that I need to put into an array, when I put 
them into an array manually the floats lose their format, for example:

$a = array(1=3.50807443617658E-4);

print $a[1] returns: 0.00035080744361766

I'm familiar with round() and all the math functions, but I'm stumped.

Any light anyone can shed on this would be appreciated.  ;)

Thanks,

~Rob Yelvington

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


Re: [PHP] WYSIWYG editor for PHP

2003-08-22 Thread Rob Yelvington
Active State's Komodo and Zend Studio are both awesome!  I used to use 
Dreamweaver, but it's syntax highlighting stinks...IMHO.

~Rob

Bix wrote:
I use dreamweaver in live data mode quite often, really works a treat!

Set up a a site and in the testing server, just set it as /beta or the like,
then edit your script, and run it in live data and you can feed it
post/get/cookie data on the fly.
Jay Blanchard [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
[snip]
I need a WYSIWYG editor for PHP. That is all.
Can any1 advice me one( or more :-) )?
[/snip]
Dreamweaver?




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


[PHP] need help figuring out how to delete rows?

2003-08-22 Thread Deadsam
Hi Im making a chatroom using flash and php, the one problem Im having is
deleting rows.
What I'm looking for is when they click on the button to send the message
into php--mySql  it will also
check to see how many rows are in that table and if they are greater then
40, then to delete the rows
over 40, starting with the oldest ones ASC. I thought about using the chatID
number but that will change
everytime. So I was thinking of having it check for how many rows there is
if its greater then 40 rows then
delete thgose over 40 ASC.
Hope I explained it good enough :)
Anyhow if anyone has a solution for this I would really appreciate it.
Thanks in advance
Deadsam




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



[PHP] PHPOPENCHAT: he script tried to execute a method or access a property of an incomplete object.

2003-08-22 Thread Robert Mena
Hi,

I've installed and tested phpopenchat 3.0b2 in my
development machine (Apache/1.3.27 (Unix) 
(Red-Hat/Linux) mod_ssl/2.8.12 OpenSSL/0.9.6
PHP/4.3.0) with no problems.

When I moved to the real server (PHP Version 4.3.2)
it keeps giving me this answer

Fatal error: Unknown(): The script tried to execute a
method or access a property of an incomplete object.
Please ensure that the class definition
badodb_mysql/b of the object you are trying to
operate on was loaded _before_ the session was started
in /var/www/html/chat/include/class.Chat.inc on line
1130

I've used the test.php script that comes with no
problem (it basically tests for user/password,
existance of directories)

Any ideias ?

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



[PHP] Server variables on IIS

2003-08-22 Thread Sid
Hello,

I am trying to migrate a PHP script and just realized that the IIS server I am working 
on does not have the REQUEST_URI, SCRIPT_FILE_NAME and DOCUMENT_ROOT server variables. 
This makes the script malfunction.

Does anyone know how I can get these variables?

If you would like to see info on this server go to http://216.95.232.174/info.php

Thank you,

- Sid


[PHP] eval function

2003-08-22 Thread Matthias Wulkow
Hi php-general,

I have a question about eval();

I'm having multiple pagenames I store in a database. I also have a lot
of functions starting with content and then the name of the pages
taken from the database. Ex: pagenames = about,download functions =
contentAbout(), contentDownload().
Now I would like to have a loop of if to make the decision which
function to use, like:
for($i = 0; $i  sizeof($databasepagename);$i++){
  if($_SERVER[PHP_SELF] == $databasepagename[$i])
eval(content.$databasepagename[$i].(););
}
but that doesn't work...

How could I achieve that? Thanks for answering...

SvT

-- 
Who is the ennemy?


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



[PHP] Deleting same values from an array

2003-08-22 Thread Stephen Craton
Hello,

I have an array called $stems that has a bunch of numbers in it like 2, 5, 4, 4, 2, 6, 
8. What I want to do is delete a section of the array that has the same number. In the 
example of the numbers I listed, I'd want to delete one of the number 4's, and one of 
the number 2's so that it would read this: 2, 5, 4, 6, 8 instead. I'm really clueless 
as to how to do this, any ideas?

Thanks,
Stephen Craton

[PHP] STRING_FORMAT

2003-08-22 Thread Dale Hersh
I have looked in the online manual for mssql and it describes a function
called string_format that will allow one to format your data stored in your
database. I am just not sure how to use it in a select statement and I can't
seem to find any examples of how to use it.

Any ideas?

Thanks,
Dale




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



Re: [PHP] STRING_FORMAT

2003-08-22 Thread Curt Zirzow
* Thus wrote Dale Hersh ([EMAIL PROTECTED]):
 I have looked in the online manual for mssql and it describes a function
 called string_format that will allow one to format your data stored in your
 database. I am just not sure how to use it in a select statement and I can't
 seem to find any examples of how to use it.

Where exactly is this string_format described ?



Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



[PHP] Shortcuts/aliases/sym-links?

2003-08-22 Thread Dan Phiffer
Has anybody out there written code to facilitate the maintanance
(reading/resolving, writing) of Windows's shortcuts, Mac OS's aliases, or
Unix's symbolic links? I couldn't find anything in the File System section
of PEAR, but maybe there's other code out there for this sort of thing? Or
maybe something built into the core language that I'm not aware of?

Thanks for any pointers,
-Dan



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



Re: [PHP] Deleting same values from an array

2003-08-22 Thread John W. Holmes
Stephen Craton wrote:
Hello,

I have an array called $stems that has a bunch of numbers in it like 2, 5, 4, 4, 2, 6, 8. What I want to do is delete a section of the array that has the same number. In the example of the numbers I listed, I'd want to delete one of the number 4's, and one of the number 2's so that it would read this: 2, 5, 4, 6, 8 instead. I'm really clueless as to how to do this, any ideas?
Wild guess here, but maybe array_unique()??? ;)

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals  www.phparch.com





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


Re: [PHP] Server variables on IIS

2003-08-22 Thread John W. Holmes
Sid wrote:

Hello,

I am trying to migrate a PHP script and just realized that the IIS server I am working on does not have the REQUEST_URI, SCRIPT_FILE_NAME and DOCUMENT_ROOT server variables. This makes the script malfunction.

Does anyone know how I can get these variables?

If you would like to see info on this server go to http://216.95.232.174/info.php
You have all of the info you need. If you don't have a variable present 
on your info.php page, then it's just not there. Take combinations of 
what is available and make what you need. That's your only option.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals  www.phparch.com





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


[PHP] linking via SSH to another server.

2003-08-22 Thread Vail, Warren
It appears that I need to use exec() to execute the ssh command to, in turn, execute a 
command on a distant machine.  Are there better ways to do this?
 
Any tricks to retrieving the output of the remote command?  Do I need to use scp for 
this?
 
My server using Linux, and remote machines may be Sun or AIX.
 
thanks,
 
Warren Vail


Re: [PHP] float precision format not being kept

2003-08-22 Thread John W. Holmes
Rob Yelvington wrote:

I have a list of floats that I need to put into an array, when I put 
them into an array manually the floats lose their format, for example:

$a = array(1=3.50807443617658E-4);

print $a[1] returns: 0.00035080744361766

I'm familiar with round() and all the math functions, but I'm stumped.
I don't know if any of these work or not, but it's about all I could find:

http://www.faqchest.com/prgm/php-l/php-01/php-0108/php-010814/php01080315_24951.html

http://www.visualbasicforum.com/t35177.html

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals  www.phparch.com





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


Re: [PHP] Deleting same values from an array

2003-08-22 Thread Stephen Craton
Haha, thanks. I was looking at array functions earlier but didn't think to
look at it since it seemed like something completely different. Oh well,
thanks!

Thanks,
Stephen Craton
- Original Message - 
From: John W. Holmes [EMAIL PROTECTED]
To: Stephen Craton [EMAIL PROTECTED]
Cc: PHP List [EMAIL PROTECTED]
Sent: Friday, August 22, 2003 6:43 PM
Subject: Re: [PHP] Deleting same values from an array


 Stephen Craton wrote:
  Hello,
 
  I have an array called $stems that has a bunch of numbers in it like 2,
5, 4, 4, 2, 6, 8. What I want to do is delete a section of the array that
has the same number. In the example of the numbers I listed, I'd want to
delete one of the number 4's, and one of the number 2's so that it would
read this: 2, 5, 4, 6, 8 instead. I'm really clueless as to how to do this,
any ideas?

 Wild guess here, but maybe array_unique()??? ;)

 -- 
 ---John Holmes...

 Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

 PHP|Architect: A magazine for PHP Professionals  www.phparch.com








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



[PHP] Access denied problem, please help

2003-08-22 Thread Ryan A
Hi,
I am trying to upload something into a directory on my server but always i
am getting a permission denied ONLY from this server...i have tried it on 2
other servers and they seem to be working fine but i have to get it working
on this server as this server is the fastest and our production server.

I have looked at the folder permissions and CHMODED/changed them from 644 to
766 and finally 777 but am getting the same error, i then had a look at the
php info file (http://jumac.com/phpinfo.php) and i see file_uploading is set
to 1 and 1, safe mode is off, i am not too familier with file uploading so
is this right? if not, how can i change it? hopefully via a .htaccess as I
dont have access to the php.ini file directly.

These are my paths:
$UserUploadDir=/usr163/home/r/y/ryanknig/public_html/BWH-Ads-Images;
$UserUploadURL = http://jumac.com/BWH-Ads-Images;;


Let me again point out that this problem only seems to be on this server,
the scripts including the upload is working perfectly on the other test
servers/sites.

Kindly reply,
-Ryan A.



We will slaughter you all! - The Iraqi (Dis)information ministers site
http://MrSahaf.com



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



[PHP] Making a cookie never expire

2003-08-22 Thread Stevie D Peele
How can I make a cookie never expire?

Thanks,

Stevie


The best thing to hit the internet in years - Juno SpeedBand!
Surf the web up to FIVE TIMES FASTER!
Only $14.95/ month - visit www.juno.com to sign up today!

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



Re: [PHP] Access denied problem, please help

2003-08-22 Thread Jim Lucas
how about giving the specs on all three servers?

So WE can see the differences.

Jim Lucas
- Original Message - 
From: Ryan A [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 22, 2003 5:39 PM
Subject: [PHP] Access denied problem, please help


 Hi,
 I am trying to upload something into a directory on my server but always i
 am getting a permission denied ONLY from this server...i have tried it on
2
 other servers and they seem to be working fine but i have to get it
working
 on this server as this server is the fastest and our production server.

 I have looked at the folder permissions and CHMODED/changed them from 644
to
 766 and finally 777 but am getting the same error, i then had a look at
the
 php info file (http://jumac.com/phpinfo.php) and i see file_uploading is
set
 to 1 and 1, safe mode is off, i am not too familier with file uploading so
 is this right? if not, how can i change it? hopefully via a .htaccess as I
 dont have access to the php.ini file directly.

 These are my paths:
 $UserUploadDir=/usr163/home/r/y/ryanknig/public_html/BWH-Ads-Images;
 $UserUploadURL = http://jumac.com/BWH-Ads-Images;;


 Let me again point out that this problem only seems to be on this server,
 the scripts including the upload is working perfectly on the other test
 servers/sites.

 Kindly reply,
 -Ryan A.



 We will slaughter you all! - The Iraqi (Dis)information ministers site
 http://MrSahaf.com



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




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



[PHP] safe_mode_include_dir

2003-08-22 Thread Mark Clarkstone
does this include sub dirs ?

--
bye



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



Re: [PHP] Re: google style paginating

2003-08-22 Thread Robert Cummings
IMHO a PEAR pager package sounds like a sledgehammer when all that's
needed is a hammer.

Cheers,
Rob.

On Fri, 2003-08-22 at 17:59, Rob Yelvington wrote:
 The Pear Pager class works like a champeen, too.  It'll paginate results 
 however you'd like it to.
 
 ~Rob
 
 
 Chris W. Parker wrote:
  Robert Cummings mailto:[EMAIL PROTECTED]
  on Thursday, August 21, 2003 4:46 PM said:
  
  
 Don't retrieve ALL the queries then
 only display a subset. Otherwise what's the point of using the LIMIT
 clause for conservation of resources?  The SELECT COUNT( * ) FROM
 foo query is usually optimized to be extremely fast so the first
 query is almost negligible in contrast to the second.
  
  
  Heh... I've never really used COUNT() so I'll have to see how much it
  speeds up my searching. :)
  
  
  Good idea!
  
  Chris.

-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



[PHP] What's user_dir?

2003-08-22 Thread DvDmanDT
End
(stopps some mail daemons or whatever I hope)
Can someone explain the user_dir and doc_root directives for me..?

; The directory under which PHP opens the script using /~username used only
; if nonempty.

isn't easy enought for me to understand.. Will PHP like filenametranslate it
or what?

Thanks in advance...
-- 
// DvDmanDT
MSN: [EMAIL PROTECTED]
Mail: [EMAIL PROTECTED]



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



Re: [PHP] Making a cookie never expire

2003-08-22 Thread John W. Holmes
Stevie D Peele wrote:

How can I make a cookie never expire?
You can't.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals  www.phparch.com





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


[PHP] auto_prepend_file

2003-08-22 Thread Dennis Gearon
Is there any settings that will silently disable the ability  for a  
.htaccess file to use the

   php_value auto_prepend_value some file name

directive? Some safe mode thing, or an ini setting or something?

The people at the host I'm at just CAN'T seem to get it working on my 
site. It's an ensim site.

I have errors turned on, and it doesn't even give an error. It's like 
the line doesn't exist.

If I had a browning light with some sabotted tungsten carbide slugs, I'd 
fix the G*^(*^N server,

after three days of messing with this. :-)



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


[PHP] Using PHP to get size of mySQL data?

2003-08-22 Thread Jeff Lewis
I want to query a table of text articles and when selecting them I am
wondering if I can grab the actual size of the articles in question.
 
So if someone has two articles, I want to see if they have reache 100kb
in total.
 
Does that make sense to anyone? is that possible with PHP?
 
Jeff 


Re: [PHP] Using PHP to get size of mySQL data?

2003-08-22 Thread Robert Cummings
Untested, but looks about right:

select sum( length( article_text ) ) as total
from articles_table
where user_id = 'user to match;

This is SQL though, so it's kinda OT.

Cheers,
Rob.


On Fri, 2003-08-22 at 22:45, Jeff Lewis wrote:
 I want to query a table of text articles and when selecting them I am
 wondering if I can grab the actual size of the articles in question.
  
 So if someone has two articles, I want to see if they have reache 100kb
 in total.
  
 Does that make sense to anyone? is that possible with PHP?
  
 Jeff 
-- 
.-.
| Worlds of Carnage - http://www.wocmud.org   |
:-:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.|
`-'

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



Re: [PHP] eval function

2003-08-22 Thread Tom Rogers
Hi,

Saturday, August 23, 2003, 8:38:32 AM, you wrote:
MW Hi php-general,

MW I have a question about eval();

MW I'm having multiple pagenames I store in a database. I also have a lot
MW of functions starting with content and then the name of the pages
MW taken from the database. Ex: pagenames = about,download functions =
MW contentAbout(), contentDownload().
MW Now I would like to have a loop of if to make the decision which
MW function to use, like:
MW for($i = 0; $i  sizeof($databasepagename);$i++){
MW   if($_SERVER[PHP_SELF] == $databasepagename[$i])
MW eval(content.$databasepagename[$i].(););
MW }
MW but that doesn't work...

MW How could I achieve that? Thanks for answering...

MW SvT

MW -- 
MW Who is the ennemy?

This should do it:

eval('${content.$databasepagename}[$i]();');

-- 
regards,
Tom


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