Re: [PHP] How does one obtain the resolution of an image in PHP?

2006-03-17 Thread John Hinton

- Edwin - wrote:

Hi!

On Thu, 16 Mar 2006 14:31:38 -0500
John Hinton [EMAIL PROTECTED] wrote:

  

Simon M. Campden-Main wrote:


Well, there's the meat of it, isn't it?  I wonder how Paint
Shop Pro comes up with PPI (Image - Image information). 
I have several thousand scanned images with resolution

ranging from 72 PPI up to 1200 PPI (As reported by Paint
Shop Pro) and want to discard, or more likely tag as
rejected, any that suffer a resolution of less than 150
PPI.  As you might imagine, I find the thought of
doing it manually with Paint Shop Pro repugnant.
  


Okay, if it was scanned at 72ppi then you can't really print
it out again even with a near-similar quality. However, having
an image with a 72ppi does NOT necessarily mean that you
have an image unsuitable for printing.

  

PPI or pixels per inch is a printing term.



Last time I checked, dpi is the printing term. (^_^)

  dpi (dots per inch) - printer
  ppi (pixels per inch) - monitor/screen

  
Still missing it.. Yes, dpi is a printing term.. but has absolutely 
nothing to with with images. dpi or Dots per Inch is purely a term 
that describes the limits of your printer. If for instance, we are 
talking about an ink jet printer with a 600 x 600 dpi capability, with 
black and three colors, that printer can print any of the four color or 
not print in a space 1/600th of an inch as it moves along. And there is 
no blending within that one dot... it's simply one of the colors or left 
the white or the paper color.


One might think that an image should be scanned at 600 dpi to provide 
and equal quality, but really you can scan at a much reduced resolution 
and get the same results with a basic inkjet color printer, because the 
scan will most often be done at 16.7 million colors.. the printer only 
has 4(+paper color) so it really takes a 4x4 dot area or so to start to 
get close to matching a single pixel. Now, lets don't even go there on 
printers. The above is greatly understated and was how old inkjets 
worked.. much has changed and I really haven't followed exactly what 
they are doing now, but obviously it seems that there is a blending over 
top of other colors in today's printers. Just trying to provide 
simple theory, quick to type, easy to grasp.


So, yet still ppi is being misrepresented.. Please stop doing this.

If you don't believe me try this. Open a quality paint program. In fact, 
Macromedia's Fireworks in the image sizing dialog  box separates pixel 
dimensions from ppi putting ALL ppi function under the heading of Print 
Size. The example.


Open or create an image 600 pixels x 300 pixels.

Make sure you stay at 100% zoom factor.

Set the printing Pixels/Inch to 150, but don't let the program change 
the Pixel dimensions. You will be given a print size of 4 x 2. The 
image will take up 600 x 300 pixels of your monitor screen space.


Now with that same image, change only the resolution to 300. Leave the 
pixel dimensions the same (one has to be careful with the locking of 
proportions and samplings to be sure the program doesn't change the 
pixel dimensions when changing the Pixel/Inch). You will now see that 
the print size is 2 x 1, but yet the image size on the screen has not 
changed sizes.


A pixel is a pixel to a monitor. A pixel is sent thru an algorithm on 
the way to a printer and by and large, print quality has to be much 
greater than monitor quality to 'look' as good. Basically, you can't get 
a 4 wide image on the screen to look as good when printed at 4 wide.


A general guideline is images for print should be no less than 150 ppi, 
newspaper quality, and 300 to 600 is recommended for color brochures and 
near photo quality. So, using our example above and assuming the 
printing company has requested 300 ppi images, that image at 600 x 300 
which fills a major portion of one's monitor screen, can only be printed 
under this constraint at a maximum of 2 inches x 1 inch. If you're going 
to print, check with the printer before beginning as print quality is 
generally rising at all levels.


The question of throwing away all images with 72dpi is irrelevant.

The questions are:
What resolution, pixels per inch, do you want to print at? Lets assume 300.
What size are the images in pixels? Lets assume 1200 x 900. (I know, odd 
size but easy math to follow)
Are you happy with printing these images at 4 inches x 3 inches? ((1200 
pixels / 300 pixels per inch = 4 inches) x (900 pixels / 300 pixels per 
inch = 3 inches))

If yes, keep the image.

If you started with an 8 x 10, scanning at 72dpi and are happy with 
150ppi, you can get a good print out at 4 x 5. If you want 300ppi, then 
2 x 2.5 inches.. and so on.


Also, if working in .jpg filetypes, there is normally a quality setting 
in the paint program. If you're going to print, set it to the highest. 
If to the web, medium to medium high is generally not a noticeable 
difference. My testing showed that these settings affect the number

Re: [PHP] How does one obtain the resolution of an image in PHP?

2006-03-16 Thread John Hinton

Simon M. Campden-Main wrote:


Well, there's the meat of it, isn't it?  I wonder how Paint Shop Pro comes 
up
with PPI (Image - Image information).  I have several thousand scanned 
images
with resolution ranging from 72 PPI up to 1200 PPI (As reported by Paint 
Shop

Pro) and want to discard, or more likely tag as rejected, any that suffer a
resolution of less than 150 PPI.  As you might imagine, I find the thought 
of

doing it manually with Paint Shop Pro repugnant.

  

PPI or pixels per inch is a printing term. It has nothing to do with
viewing on a monitor as a monitor's pixel setting is your set
resolution, as in 800x600, 1024x768, 1600x1200.. etc. This is a
constantly debated urban legend. A pixel on a monitor is a pixel...

Pixels per inch are used in the printing world and relates to how many
pixels are used to provide one inch of printed space. Obviously, at
least up to the limits of the printer being used, a high PPI setting
produces a higher quality 'printed' image.

If you don't believe me, use your paint program, change the PPI of an
image and notice how the image doesn't change size on the screen. Also,
do this and switch the image size display back and forth between inches
and pixels.. the pixel count doesn't change, only the inches change..
but again... that's the printing world and has nothing to do with
display on a monitor or webbrowser.

So, an image 10,000pixels by 10,000pixels will be huge on screen. If set
to a resolution of 1000ppi, the image would be printed at 10 x 10, but
you still can't view the whole image on a monitor without zooming out.
If resolution we set to 10,000dpi, the image would print as 1 x 1, but
you still wouldn't be able to view it on a monitor (unless you have an
awesome multi-display setup that can reach 10,000 pixels wide and tall).
That's the bottom line.

So, I keep seeing 'display size' when I'm thinking the term should be
'printed size'.

John Hinton

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



Re: [PHP] Help Defending against Email Injection Attacks

2006-02-06 Thread John Hinton

Greg Schnippel wrote:


Has anyone developed a really good defense against email injection attacks?

I'm waging a prolonged campaign against these luser hordes on a number
of non-profit sites I help maintain. I've tried to secure all of the
feedback forms using the function below that I cobbled together from
various php security sites on the web. I also set it up so that every
time a 'successful' attempt is made, it gets logged to a database
before it is emailed.

The script worked well for 2-3 weeks and I enjoyed watching the
spammers bounce off of the firewall. Unfortunately, they finally
figured out how to get through last night and sent out hundreds of
emails on a couple dozen sites. I quickly took all of the forms down
to plug the breach but I can't keep them down indefinitely.

Few questions -

- Does anyone have a better regex to use to detect email injection
attacks? Part of the problem seems to be that they figured out what
values I'm searching for and created a new attack that uses character
references (ex. #089; etc) to get through.

- The successful attacks that I logged in my database weren't helpful
because they had already been converted to HTML. Is there a better way
to store _exactly_ what they entered into the field in the database?

- Another way to stop these attacks would be to reject any mail field
over a specified length. Is there a limit to how long an email address
can be? I don't want to set a limit (ex. 50 chars) that excludes

- The most foolproof solution I can think of would be to continue
logging the successful entries to a database and _not_ send the email.
That way even if they get through, no emails get sent. The form would
log the feedback and send an email to the admin that a comment is
available for viewing. Is it time to abandon using mail() for all user
contributed data?

Looking forward to the discussion,

- schnippy
 

I've been running FormMail.pl.. yeah, not php.. but.. you may want to 
take a look at what it does to prevent this sort of thing. It requires 
the form be filled out from the page on the server.. seems like it does 
some remote address checking and dumps out if too many come in from the 
same IP. Also, it only allows the recipient to be a valid user on the 
server. We've been pretty successful with it so far.. knocking on wood 
very rapidly.


The bottom line, you might find some nice routines which you could 
enable to create some of the same lines of defense within a php script.


Best,
John Hinton



#---
/**
* Secures field against email header injection attacks.
*
* USAGE:
*  secureFeedbackValue($_POST[to]);
*  mail($_POST[to], $_POST[subject], $_POST[message]);
*
* @param $value value to be cleansed of evil
*/

function secureFeedbackValue( $value )
{
# mail adress(ess) for reports...
$report_to = [EMAIL PROTECTED];

# array holding strings to check...
$suspicious_str = array
(
   \r,
   \n,
bcc,
cc:,
boundary=,
charset,
content-disposition,
content-type,
content-transfer-encoding,
errors-to,
in-reply-to,
message-id,
mime-version,
multipart/mixed,
multipart/alternative,
multipart/related,
reply-to,
x-mailer,
x-sender,
x-uidl
);

// remove added slashes from $value...

$value = stripslashes($value);

foreach($suspicious_str as $suspect)
{
# checks if $value contains $suspect...
if(eregi($suspect, strtolower($value)))
{
$ip = (empty($_SERVER['REMOTE_ADDR'])) ? 'empty' : 
$_SERVER['REMOTE_ADDR'];
$rf = (empty($_SERVER['HTTP_REFERER'])) ? 'empty' : 
$_SERVER['HTTP_REFERER'];
$ua = (empty($_SERVER['HTTP_USER_AGENT'])) ? 'empty' :
$_SERVER['HTTP_USER_AGENT'];
$ru = (empty($_SERVER['REQUEST_URI'])) ? 'empty' : 
$_SERVER['REQUEST_URI'];
$rm = (empty($_SERVER['REQUEST_METHOD'])) ? 'empty' :
$_SERVER['REQUEST_METHOD'];

if(isset($report_to)  !empty($report_to))
{
@mail
(
$report_to
,[ABUSE] mailinjection @  . $_SERVER['HTTP_HOST'] . 
 by  . $ip
,Stopped possible mail-injection @  . 
$_SERVER['HTTP_HOST'] .
by  . $ip .  ( . date('d/m/Y
H:i:s') . )\r\n\r\n .
*** IP/HOST\r\n . $ip . \r\n\r\n .
*** USER AGENT\r\n . $ua . \r\n\r

Re: [PHP] 4 Digit ID with Leading Zeros

2005-12-15 Thread John Hinton

Rahul S. Johari wrote:


Ave,

I'm looking into the ZEROFILL option now. Didn't know about it before but it
looks promising and probably is my solution. I'll get back.

Thanks a ton!

On 12/15/05 10:24 AM, Jim Moseby [EMAIL PROTECTED] wrote:

 

Zerofill in mysql will do it. But, many mysql 'clients' don't 'display' 
the zeros. As best that I remember, phpMyAdmin does show the zeros, so 
be careful as what you 'see' might not really be what you 'get'. Seems 
like there are issues with the viewing of this in Excel as well.. 
Friggin programs that think they are smarter that people


Anyway, that'll do the mysql side of it for you.

John Hinton

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



Re: [PHP] href links not working in XP

2005-12-11 Thread John Hinton

Marlin Unruh wrote:


M wrote:


Marlin Unruh wrote:

Sure, here is the main function and the function that sends the 
files/links to the browser. This works fine on two w2k machines, but 
not on our XP machine. If I place the mouse pointer over the link on 
the web page it shows correct in the IE status bar. Example:( 
file:///c:/suncosys/act/2d/file_name.vc6 )




Does it work if you copypaste the link? It might be a security feature.

If I right click on the link and select [copy shortcut], then paste it 
in the address bar the application loads as it should. If I select 
[print target] it also loads as it should but the print dialog also 
opens. If I right click and select [open] nothing happens, same as if 
I left click.


Regards,


What is a .vc6 filetype? I bet you have a security setting in the 
browser that doesn't allow opening that filetype on click... but you are 
able to force the issue with direct input... but then again, I could 
just be all wet behind the ears.


John Hinton

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



Re: [PHP] Optimizing Images

2005-12-06 Thread John Hinton

Tim Traver wrote:


Hi all,

ok, I'm trying to write a script to optimize images for the web, but I 
can't seem to figure out how to go about reducing the color pallete, 
and therefor reducing the size of the images.


I'm trying to be generic about it so that users can optimize GIF's and 
JPG's or even PNG's. I can't find much in the way of code on the net 
about doing this...


Does anyone have any suggestions as to maybe some freely available 
scripts or classes that can help me figure this out ???


Thanks,

Tim.

If you're working from a Linux box, do some studying on imagemagik. It 
has scads of tools and uses one of the best optimization algorythms I've 
seen. A very powerful tool.. can do low res, watermarks, resizing.. and 
on and on and on.


John Hinton

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



Re: [PHP] ICQ

2005-10-12 Thread John Hinton

Al Hafoudh wrote:


is it possible to connect to icq,  send messages and etc? thanx

I looked all over that place for such a function some time back. I did 
find several, but all were very old. The problem was they were all based 
on the ICQ account number. Thinking about allowing such through the ICQ 
network was an invitation to easy spamming. Just write a script rolling 
through numbers and sending a message. I believe ICQ disabled this feature.


If you find out differently, please post your findings back to this list 
as I have a client with this very request which I was unable to fulfill.


Best,
John Hinton

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



[PHP] PHP and MySQL and resouce limits

2005-07-20 Thread John Hinton
I don't get it... I have been upping my memory limit for PHP. 32megs 
now... and am making calls to a database on a different server. I see 
the loads run up on the other server as it cruches the numbers.. and PHP 
is in the process of creating a single little page with about 40 numbers 
on it, from these returns. Now, I do know I'm crunching a LOT of data in 
this instance, but it seems like MySQL is doing the work and that PHP 
shouldn't be hitting 32 my 32meg wall. Running the same query on a 
smaller dataset doesn't hit this limit, so I know it's not a function of 
the PHP code itself.


So, I must be missing something, why is PHP somehow tied to the work 
MySQL is doing? As in memory usage seems that MySQL should be simply 
sending PHP the returns on its commands... hm


Thanks,
John Hinton

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



Re: [PHP] Strange notation to create object

2005-06-23 Thread John Hinton

Michael Stepanov wrote:

With a return receipt attached

and I'm wondering if we all return the receipt each time someone forgets 
about this on various mailing lists, would the 6583 subscribers actually 
returned the receipt, would it break the habit?


All in fun... sorry Michael.. it just happened to be yours that finally 
convinced me to send this. I just get tired of the interruption of my 
delete process.


Best,
John Hinton

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



Re: [PHP] LDAP and .htaccess

2005-04-27 Thread John Hinton
Bret Walker wrote:
I'm not too sure, but it seems to be having an effect you any text 
showing up in your emails.

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


Re: [PHP] Re: PHP Designer 2005

2005-04-26 Thread John Hinton
Greg Donald wrote:
On 4/26/05, Lester Caine [EMAIL PROTECTED] wrote:
 

I have had exactly the same problem with a number of
home brew applications.
   

What's that mean, 'home brew' ?
The application seems very professional to me, even if it is free.
 

Home brew... like free stuff... stuff you don't spend money for is only 
equal in value to the amount spent...

Free stuff is no good for instance... PHP tongue in cheek
John Hinton
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Best Server OS

2005-03-28 Thread John Hinton
Phil Neeb wrote:
I'm lookin for some opinions on this one ...
What do you think the best OS is for running a server with PHP and 
MySQL?  If you're going to say Linux, please, which Linux OS, there 
are so many.

Gracias,
Phil
Being an old RedHatter.. Since 5.1.. I like RedHat flavors.
If you want MySQL 3 versions, CentOS EL 3.4 is a free Redhat Enterprise 
Linux clone.

For MySQL 4.x... CentOS EL 4 is out. Also has selinux if you want to 
take that on. All quality stuff that you can rely on in a mission 
critical environment.

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


[PHP] Still fighting setcookie

2005-03-27 Thread John Hinton
OK, I created this most simplistic script..
 Begin Script---
?php
if(isset($value))
{
 setcookie(mycookie,$value);
}
define (Login, 0);
define (DataReturn, 1);
function login() {
echo form ACTION=\$_SERVER[PHP_SELF]?action=1\ METHOD=\post\ 
ENCTYPE=\multipart/form-data\;
echo Type value: input name=\value\ type=\text\;
echo input name=\submit\ type=\submit\;
echo /form;
}

function datareturn(){
print_r($_COOKIE);
echo  is the \$_COOKIE data;
}
if (empty ($action))
  $action = 0;
switch ($action) {
case Login:
  login();
  break;
case DataReturn:
  datareturn();
  break;
default:
  die (Unknown action code ($action));
}
?
End Script
I would expect the return on action=1 to report the set cookie, but 
instead, it has no data. If I then reload the browser, the cookie 
appears. How can I get the cookie to set without this reload? What am I 
missing?

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


[PHP] setcookie issue

2005-03-26 Thread John Hinton
Seems my old setcookie scripts are busted in php with globals off.
--begin code--
?
if(isset($_POST[tpassword]))
{
   setcookie (writer, $_GET[twriter]);
   setcookie (password, $_POST[tpassword]);
}
$action = $_REQUEST['action'];
define (Login, 0);
define (Entrance, 1);
define (Continue_Campaign, 2);
define (Finish_Campaign, 3);
# LOGIN PAGE 
###

function login(){
include ('config.php');
   $query = SELECT * FROM atable;
   $result = mysql_db_query($DBName, $query, $Link) or
   print (Query Failed);
   printf (centerform METHOD=\post\ 
ENCTYPE=\multipart/form-data\ ACTION=\%s?action=%d\\n,
   $PHP_SELF, Entrance);
   echo tabletrtd\n;
   echo Writer Name: /tdtdselect name=\twriter\ size=\0\ 
VALUE=\$writer\\n;
   while ($row = mysql_fetch_array($result)) {
   echo option value=\ . $row[0] . \ . $row[0] . \n;
   }
   echo /select;
   echo /td/trtrtdPassword: /tdtdINPUT TYPE=password 
NAME=\tpassword\ SIZE=10 VALUE=\$password\\n;
   echo trtd colspan=\2\INPUT TYPE=\submit\ NAME=\button\ 
VALUE=\Enter Reporter Area\/td/tr;
   echo /td/tr/table;
   echo /center/form;
---end code-

When I run this, the cookies aren't transfered to the second action 
switch on the first load, but if I hit reload, they appear. So, to the 
user, they are presented with logging in twice unless they know this odd 
trick.

Any ideas about how to make this work on the first time through? This is 
driving me nuts on two sites at the moment.

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


Re: [PHP] setcookie issue

2005-03-26 Thread John Hinton
Chris Shiflett wrote:
John Hinton wrote:
Seems my old setcookie scripts are busted in php with globals off.

Use $_COOKIES['name'].
Chris
The thing is, on the next action switch
print_r($_COOKIE);
returns empty until I refresh the browser. So, thusly, the second page 
load brings in the cookies.

And sorry about that $_GET I left in the earlier post. I was trying 
about anything to see if I was missing something totally.

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


[PHP] MySQL Join

2002-12-31 Thread John Hinton
Stuck on this join temp

From one table I need to 

mysql_query(CREATE TEMPORARY TABLE temp TYPE=HEAP SELECT DISTINCT
field1, field2 FROM $table);

both field1 and field2 have various repeating data and I need to return
only the first occurance of the distinct data along with the rest of the
data selected below for only those distinct rows.

$result = mysql_query(SELECT $table.field3, $table.field2,
$table.field1, $table.field4 FROM $table LEFT OUTER JOIN temp ON
$table.indexfield0 = temp.indexfield0 ORDER BY $table.field1 DESC);

Running the above kills the distinct select and returns all of the rows.
I see where it is broken in that temp.indexfield0 is not being collected
into the temp table, but as indexfield0 is a primary key, all values are
distinct and when added to the select distinct statement, all rows are
returned.

Is there any way to 

SELECT field0, (DISTINCT field1, field2) FROM table? Sure would make
this easy!

or SELECT field0 WHERE DISTINCT field1, field2 FROM table?

There seems to be very little information anywhere on DISTINCT

-- 
John Hinton - Goshen, VA.
http://www.ew3d.com

Those who dance are considered insane 
by those who can't hear the music

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




[PHP] Resource limit/performance questions

2002-12-20 Thread John Hinton
I'm working on a php/mysql ap, which looks as though it will be dealing
with an average of

160,000 rows of short text entries =
32 megs of drives space

Anybody have ideas about what if any limits I might hit? And how I might
be able to determine any limits at this point when we have only 2 weeks
(.6 megs and 2600 rows) of what will be 2 years of data? I have full
access to my linux server. I notice that when executing one set of
statements for one page, it is now using in the 80 to 90% range of CPU
states, and works for maybe 3 or 4 seconds to return the querys. I am at
present doing this testing on a 550 mhz processor, but will be running
the ap on a dual 500s.

Am I getting totally out of hand in thinking I can do this?

TIA
-- 
John Hinton - Goshen, VA.
http://www.ew3d.com

Those who dance are considered insane 
by those who can't hear the music

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




Re: [PHP] Resource limit/performance questions

2002-12-20 Thread John Hinton
In one main instance, I'm doing 10 querys on an array of 26 unique
objects extracted from the database. So, I suppose it is running 260
queries on 2600 lines of code.

Marco Tabini wrote:
 
 IMHO it depends on the amount of operations you have to perform on your
 rows. If manipulating 2,600 rows takes several seconds, then either
 you're performing some really complicated data manipulation or your db
 could use some optimization. I have an application that manipulates
 ~150,000 rows on a Pentium II 350 MHz and that takes at most half a
 second (although I'm doing really simple statistical stuff).
 
 Cheers,
 
 Marco
 --
 
 php|architect - The Magazine for PHP Professionals
 The monthly magazine dedicated to the world of PHP programming
 
 Check us out on the web at http://www.phparch.com!
 
   
 
 Subject: [PHP] Resource limit/performance questions
 Date: Fri, 20 Dec 2002 15:31:58 -0500
 From: John Hinton [EMAIL PROTECTED]
 To: [EMAIL PROTECTED] [EMAIL PROTECTED]
 
 I'm working on a php/mysql ap, which looks as though it will be dealing
 with an average of
 
 160,000 rows of short text entries =
 32 megs of drives space
 
 Anybody have ideas about what if any limits I might hit? And how I might
 be able to determine any limits at this point when we have only 2 weeks
 (.6 megs and 2600 rows) of what will be 2 years of data? I have full
 access to my linux server. I notice that when executing one set of
 statements for one page, it is now using in the 80 to 90% range of CPU
 states, and works for maybe 3 or 4 seconds to return the querys. I am at
 present doing this testing on a 550 mhz processor, but will be running
 the ap on a dual 500s.
 
 Am I getting totally out of hand in thinking I can do this?
 
 TIA
 --
 John Hinton - Goshen, VA.
 http://www.ew3d.com
 
 Those who dance are considered insane
 by those who can't hear the music
 
 --
 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

-- 
John Hinton - Goshen, VA.
http://www.ew3d.com

Those who dance are considered insane 
by those who can't hear the music

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




Re: [PHP] Resource limit/performance questions

2002-12-20 Thread John Hinton
I was wondering if this would grow linearly... as the data collects? So,
if it takes 3 seconds to do 2600 rows, will it take 30 seconds to do
26000 rows? I am using a simple for statement to send the 26 records
through the 10 querys.

A typical select is:

SELECT DISTINCT DATE_FORMAT(date, '%Y%m%d'), field2 FROM $table WHERE
field2 NOT LIKE '$anoption' AND field3 LIKE '$field2[$i]' AND
TO_DAYS(NOW()) - TO_DAYS(date) = 30;

This select is run over with five different date = numbers... then done
without the DISTINCT again over the same five time periods.

The array of records being sent through the 10 querys should not grow
too very large (26 in fact is a fairly high representation of what would
be average), whereas the number of records will grow at a fairly
predictable rate, with the same basic number of records added each day.

I should have said records, instead of objects. (too many sessions with
crAccess, too little time talking to real people about databases)

Now... would you spell that querys or queries?

Marco Tabini wrote:
 
 Well, then, assuming your complexity grows linearly, I guess you'll have
 to wait a few minutes with 160,000 rows on which you can expect to
 perform 16,000 queries...
 
 You mention that you perform the queries on objects--can you elaborate
 on this point?
 
 Marco
 --
 
 php|architect - The Magazine for PHP Professionals
 The monthly magazine dedicated to the world of PHP programming
 
 Check us out on the web at http://www.phparch.com!
 
   
 
 Subject: Re: [PHP] Resource limit/performance questions
 Date: Fri, 20 Dec 2002 15:47:07 -0500
 From: John Hinton [EMAIL PROTECTED]
 To: Marco Tabini [EMAIL PROTECTED]
 CC: [EMAIL PROTECTED] [EMAIL PROTECTED]
 References: [EMAIL PROTECTED]
  [EMAIL PROTECTED]
 
 In one main instance, I'm doing 10 querys on an array of 26 unique
 objects extracted from the database. So, I suppose it is running 260
 queries on 2600 lines of code.
 
 Marco Tabini wrote:
 
  IMHO it depends on the amount of operations you have to perform on your
  rows. If manipulating 2,600 rows takes several seconds, then either
  you're performing some really complicated data manipulation or your db
  could use some optimization. I have an application that manipulates
  ~150,000 rows on a Pentium II 350 MHz and that takes at most half a
  second (although I'm doing really simple statistical stuff).
 
  Cheers,
 
  Marco
  --
  
  php|architect - The Magazine for PHP Professionals
  The monthly magazine dedicated to the world of PHP programming
 
  Check us out on the web at http://www.phparch.com!
 

 
  Subject: [PHP] Resource limit/performance questions
  Date: Fri, 20 Dec 2002 15:31:58 -0500
  From: John Hinton [EMAIL PROTECTED]
  To: [EMAIL PROTECTED] [EMAIL PROTECTED]
 
  I'm working on a php/mysql ap, which looks as though it will be dealing
  with an average of
 
  160,000 rows of short text entries =
  32 megs of drives space
 
  Anybody have ideas about what if any limits I might hit? And how I might
  be able to determine any limits at this point when we have only 2 weeks
  (.6 megs and 2600 rows) of what will be 2 years of data? I have full
  access to my linux server. I notice that when executing one set of
  statements for one page, it is now using in the 80 to 90% range of CPU
  states, and works for maybe 3 or 4 seconds to return the querys. I am at
  present doing this testing on a 550 mhz processor, but will be running
  the ap on a dual 500s.
 
  Am I getting totally out of hand in thinking I can do this?
 
  TIA
  --
  John Hinton - Goshen, VA.
  http://www.ew3d.com
 
  Those who dance are considered insane
  by those who can't hear the music
 
  --
  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
 
 --
 John Hinton - Goshen, VA.
 http://www.ew3d.com
 
 Those who dance are considered insane
 by those who can't hear the music
 
 --
 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

-- 
John Hinton - Goshen, VA.
http://www.ew3d.com

Those who dance are considered insane 
by those who can't hear the music

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




[PHP] One php returning several htmls

2002-12-19 Thread John Hinton
I'll go into index.php and return a portion of the html code, upon
clicking a link, I'll return another portion of the html code.

My question is what seems to be the best/cleanest/fastest method for
doing this?

I've done this with forms and the PHP_SELF action method... Wondering
about simple links and alternatives.
-- 
John Hinton - Goshen, VA.
http://www.ew3d.com

Those who dance are considered insane 
by those who can't hear the music

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




Re: [PHP] Static constants? Server persistent?

2002-09-29 Thread John Hinton

Jean-Christian Imbeault wrote:

 Mike Mannakee wrote:


 Just out of curiosity, what problem are you trying to solve?  
 Including a
 file is so easy and takes so little time I wonder how this could be a
 problem.


 Good question, glad you asked.

 I have a header on all my pages. The header is HTML and contains 
 images.So of course I do an include(header.html) on all my pages 
 ...

 The header is about 20K, having PHP read 20k off the disk everytime a 
 user visits my page seemed inneficient. So I was trying to find a way 
 to get PHP to cache the file in memory so it wouldn't have to read it 
 off disk all the time ...

 I have lots of bandwidth but not enough money to pay for a proper 
 SCSI/RAID disk set. All I have is a poor 7,2000 IDE HD. So the less 
 disk seeks thebetter :)

 Jc


If you are running under Linux.. load it up with RAM... the OS will hold 
any recent disk reads in cache... particularly a simple html document 
with a few locally held images. I've watched disk access on some of my 
boxes, some sites serving 1gig per day, and the disk just barely blips 
along... most being served from cache. Linux rules!

John Hinton



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




[PHP] Bet this is a dead horse

2002-09-28 Thread John Hinton

Sorry, just signed on... due to this question... hope this horse ain't 
too dead.

Anyway, I have a need to run a SSI inside of a PHP page. Only thing I 
have found so far is that maybe Apache 2.0 will handle this feature? Is 
there anyway to get this to work under Linux/Apache?

-- 
John Hinton - Goshen, VA.
http://www.ew3d.com

Those who dance are considered insane
by those who can't hear the music


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




Re: [PHP] Include...

2002-09-28 Thread John Hinton

Chuck \PUP\ Payne wrote:

Hi,

I am trying to start using inc files. But I am this this error

Warning: Failed opening '/local/htdocs/movies/style.inc' for inclusion
(include_path='.:/usr/share/php') in /local/htdocs/movies/lmenu.php on line
3

I have this in my lmenu.php

Include (/local/htdocs/movies/style.inc);

So can't someone telling me what I am doing wrong. I thought .inc where
easy.


Chuck Payne



  

PHP gets lost a lot with regards to where it is. Try
Include (style.inc);

With what you have, assuming lmenu.php is in /local/htdocs/movies, it is 
likely looking for
/local/htdocs/movies/local/htdocs/movies/style.inc
It is finicky!

John Hinton





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