[PHP] Re: Adding to a Date

2004-11-06 Thread Jason Barnett
There are probably a lot of ways to solve this problem, but the way I would do 
it:  create a timestamp out of whatever date you have, then add x * 24 * 60 * 60 
to it and convert from the timestamp back into whatever string format date you want.

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


[PHP] Re: Syntax problem - dynamic static member access

2004-11-06 Thread Jason Barnett
Jake, as you probably already know you usually have to give the class name when 
attempting to get a static variable, i.e.

YourClassName::$bob;
You *can* dynamically refer to a static class variable from within an object 
without knowing the name of the class; this is what self is for.  i.e.

class YourClassName {
  function getStatic($var) {
return self::$var;
  }
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Adding to a Date

2004-11-06 Thread Matt Cassarino
Hi,

I am trying to add "x" days to the current date for a calendar program that I 
am writing.  "x" represents any integer from 1 to 7.  So, for x=4, the program 
will get the current date

2004-11-06

and add 4 days to it:

2004-11-10

I need it to account for the next month if I want to add 4 days to 2004-11-29, 
so the result would be 2004-12-03, not 2004-11-33.  It would need the same 
functionality in moving the year to 2005-01-02 when I add 3 days to 2004-12-30. 
 

I hope that I've explained my objective clearly.  I have tried getting the date 
using

$today = date("Y-m-d");

and then trying to add "x" to it, but it only adds "x" to the year, not the day 
value.  So how can I get PHP to add "x" to the day value?  Any help would be 
awesome!  Thanks,

Matt

Matt Cassarino
206 484 4626
[EMAIL PROTECTED]
www.mattcass.com

Re: [PHP] Re: Using fonts in TrueType suitcases on a Mac?

2004-11-06 Thread Ken Tozier
On Nov 7, 2004, at 12:32 AM, David Schlotfeldt wrote:
I don't know if this will help you but you could try converting them.
Its hard to explain how to do .. but here is a start..
1) Burn the fonts to a Mac cd (burn the Cd for a mac.. not a PC.. if 
you do you will loose information)
2) Bring the cd to a windows machine and use MacDisk to read the cd. 
you can get macdisk from: macdisk.com
3) Grab the fonts off the Cd (using MacDisk)
4) Then use CrossFont (http://www.asy.com/) to convert them.

This maybe more work then its worth... but its one possible solution.
I don't own a PC and I'm developing for a dual G4 running OS 10.3. 
Would this type of conversion work when put back on a Mac?


Thanks,
David
Ken Tozier wrote:
I'm trying to use some of the truetype fonts on my mac with PHP's 
"imagettfbbox()" routine but since all my fonts are contained within 
suitcases, I don't know how to get them to work. I found one 
non-suitcase TrueType font that loads fine so I know the basic 
mechanism works and the script has the correct permissions to access 
fonts. Anyone know how to use TrueType Suitcases with PHP?
Thanks for any help
Ken
--
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] Object oriented??

2004-11-06 Thread Larry E . Ullman
Yes of course...but was confused since some says it is so and some 
says it
is not...So thought of asking the pros..
It is. PHP4 had limited support for OOP, though it was quite usable.
PHP5 goes further and provides pretty much everything else. See the
documentation on php.net for the complete language reference.
I guess this is where the OP's confusion stemmed from (Robert said Yes, 
I said No)! A liberal definition of OO is "An adjective applied to any 
system or language that supports the use of objects", under which PHP 
would qualify. But, in strict OO languages, everything must be done 
using objects. You can't even do a simple "Hello, World" without them 
(I could be wrong on this, of course). With that understanding PHP 
would not be OO.

So, in short, PHP __supports__ objects but does not __require__ them.
There's a good chance that 20 people will chime in now, with their own 
corrections.
Larry

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


RE: [PHP] Re: NMax

2004-11-06 Thread nate
Yeah definitely use COUNT(*) or mysql_num_rows() function.

Nate

-Original Message-
From: David Schlotfeldt [mailto:[EMAIL PROTECTED] 
Sent: Saturday, November 06, 2004 9:19 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: NMax

You could do it in a SQL statement

SELECT COUNT(*) FROM table_name;

This is less system intensive.

David


John Taylor-Johnston wrote:
> I might add, I do this, think there must be a better way?
> 
>  $mycounter = 0;
>  while ($mydata = mysql_fetch_object($news))
>  {
>   $mycounter++;
>  }
> 
> John Taylor-Johnston wrote:
> 
> 
>>How can I calculate how many records I have in a table?
>>John

-- 
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] PHP Accelerator

2004-11-06 Thread Jyry Kuukkanen
On Sun, 7 Nov 2004, raditha dissanayake wrote:

> David wrote:
> 
> > I need a PHP accelerator but am not sure which one to use. I would 
> > highly prefer to not use a commercial accelerator and need one that 
> > works with PHP 5. Does anyone recommend one out of the ones that exist?
> >
> this one:
> 
> > - Turck MMCache for PHP


I second that, unless you need it with latest PHP4.3.x, that Turck MMCache 
does not support currently. Then the free option known to work is 
PHP-Accelerator.

-- 
--Jyry
C|:-(C|:-/C|8-OC|8-/C|:-(

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



[PHP] Re: Using fonts in TrueType suitcases on a Mac?

2004-11-06 Thread David Schlotfeldt
I don't know if this will help you but you could try converting them.
Its hard to explain how to do .. but here is a start..
1) Burn the fonts to a Mac cd (burn the Cd for a mac.. not a PC.. if you 
do you will loose information)
2) Bring the cd to a windows machine and use MacDisk to read the cd. you 
can get macdisk from: macdisk.com
3) Grab the fonts off the Cd (using MacDisk)
4) Then use CrossFont (http://www.asy.com/) to convert them.

This maybe more work then its worth... but its one possible solution.
Thanks,
David
Ken Tozier wrote:
I'm trying to use some of the truetype fonts on my mac with PHP's 
"imagettfbbox()" routine but since all my fonts are contained within 
suitcases, I don't know how to get them to work. I found one 
non-suitcase TrueType font that loads fine so I know the basic mechanism 
works and the script has the correct permissions to access fonts. Anyone 
know how to use TrueType Suitcases with PHP?

Thanks for any help
Ken
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: NMax

2004-11-06 Thread David Schlotfeldt
You could do it in a SQL statement
SELECT COUNT(*) FROM table_name;
This is less system intensive.
David
John Taylor-Johnston wrote:
I might add, I do this, think there must be a better way?
 $mycounter = 0;
 while ($mydata = mysql_fetch_object($news))
 {
  $mycounter++;
 }
John Taylor-Johnston wrote:

How can I calculate how many records I have in a table?
John
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Syntax problem - dynamic static member access

2004-11-06 Thread Jake Press
Hello All,
I am having an interesting syntax problem. :(
I have been battling this little bugger for the last week and a half, I 
have exhausted google and numerous php channels in that time.

I am starting to beleive it could be a syntax that is sofar 
un-documented or an unclear syntax limitation (read as: bug?).


PHP Version:

PHP Version 5.1.0-dev
- And has been tested on numerous other builds/versions
Problem:

I am trying to access a static member of a class dynamically.
ie.
   $foo = 'className';
   echo $foo::$staticMember;
Example Code:
-
   
   
   // Define a class with a nice juicy static variable
   class bob {
   public static $type = 'safd';
   }
   
   // Lets chuck the name of the class into a variable...
   $foo = 'bob';
   
   // Just to show it all works lets do it manually
   echo bob::$type;
   
   // This is the line with the well-wicked parse error on the double colon
   echo $foo::$type;
   
   ?>
  

Note that the last line in this example code generated a syntax error:
   Parse error: parse error, unexpected T_PAAMAYIM_NEKUDOTAYIM, 
expecting ',' or ';' in /mnt/data0/www/twd/test.php on line 15
I'm aware that the current syntax is definately wrong, but for 
simplicity i think its a good example.

I think i have ruled out its an internal scoping issue within php by 
successfully using eval() to them same effect.
ie.
   eval('echo '. $foo .'::$type;');




Thanks in advance for any Thoughts, Answers and Comments

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


[PHP] Re: NMax

2004-11-06 Thread John Taylor-Johnston
I might add, I do this, think there must be a better way?

 $mycounter = 0;
 while ($mydata = mysql_fetch_object($news))
 {
  $mycounter++;
 }

John Taylor-Johnston wrote:

> How can I calculate how many records I have in a table?
> John

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



[PHP] NMax

2004-11-06 Thread John Taylor-Johnston
How can I calculate how many records I have in a table?
John

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



Re: [PHP] Object oriented??

2004-11-06 Thread Larry E . Ullman
Is PHP an object oriented language. If not is it gonna be?
PHP is not an object oriented language (like Java). Although PHP 
supports the creation of objects, you can still do pretty much 
everything without ever using OOP. I can't imagine PHP ever being 
turned into a true OO language, but I could be wrong on that.

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


Re: [PHP] Object oriented??

2004-11-06 Thread Robert Cummings
On Sat, 2004-11-06 at 22:53, Aalee wrote:
> Yes of course...but was confused since some says it is so and some says it
> is not...So thought of asking the pros..

It is. PHP4 had limited support for OOP, though it was quite usable.
PHP5 goes further and provides pretty much everything else. See the
documentation on php.net for the complete language reference.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] loking for a item in string?

2004-11-06 Thread Dustin Wish with INDCO Networks

I am opening a file and then have to look for a value inside the string. Is
there an easy way to do this? 

I need the value in this string for the var djLast = '45.11';

 




Re: [PHP] Object oriented??

2004-11-06 Thread Aalee
Yes of course...but was confused since some says it is so and some says it
is not...So thought of asking the pros..


"Robert Cummings" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Sat, 2004-11-06 at 21:44, Aalee wrote:
> > Hi there,
> > Is PHP an object oriented language. If not is it gonna be?
>
> Did you spend 10 seconds looking?
>
> Rob.
> --
> ..
> | InterJinn Application Framework - http://www.interjinn.com |
> ::
> | An application and templating framework for PHP. Boasting  |
> | a powerful, scalable system for accessing system services  |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for   |
> | creating re-usable components quickly and easily.  |
> `'

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



[PHP] Using fonts in TrueType suitcases on a Mac?

2004-11-06 Thread Ken Tozier
I'm trying to use some of the truetype fonts on my mac with PHP's 
"imagettfbbox()" routine but since all my fonts are contained within 
suitcases, I don't know how to get them to work. I found one 
non-suitcase TrueType font that loads fine so I know the basic 
mechanism works and the script has the correct permissions to access 
fonts. Anyone know how to use TrueType Suitcases with PHP?

Thanks for any help
Ken

Re: [PHP] Object oriented??

2004-11-06 Thread Robert Cummings
On Sat, 2004-11-06 at 21:44, Aalee wrote:
> Hi there,
> Is PHP an object oriented language. If not is it gonna be?

Did you spend 10 seconds looking?

Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] Object oriented??

2004-11-06 Thread Aalee
Hi there,
Is PHP an object oriented language. If not is it gonna be?
Cheers

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



Re: [PHP] PHP Accelerator

2004-11-06 Thread raditha dissanayake
David wrote:
I need a PHP accelerator but am not sure which one to use. I would 
highly prefer to not use a commercial accelerator and need one that 
works with PHP 5. Does anyone recommend one out of the ones that exist?

this one:
- Turck MMCache for PHP
 


--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PHP Accelerator

2004-11-06 Thread David
I need a PHP accelerator but am not sure which one to use. I would 
highly prefer to not use a commercial accelerator and need one that 
works with PHP 5. Does anyone recommend one out of the ones that exist?

Here are the ones I am aware of..but have no idea which ones are better 
than others.
- After Burner
- APC
- ionCube PHP Accelerator
- Turck MMCache for PHP

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


Re: [PHP] Recover POST form

2004-11-06 Thread M. Sokolewicz
Christian Ista wrote:
echo '';
print_r($_POST);
echo '';

I have something like that :
Array
(
[5980915] => on
[ToDo5980915] => N
[5941846] => on
[ToDo5941846] => N
[5916500] => on
[ToDo5916500] => N
[5907115] => on
[ToDo5907115] => N
[5900019] => on
[ToDo5900019] => N
[5899239] => on
[ToDo5899239] => N
[5897854] => on
[ToDo5897854] => N
[5896483] => on
[ToDo5896483] => N
[5893286] => on
[ToDo5893286] => N
[5865056] => on
[ToDo5865056] => N
[fa] => test
)
I'd like to access this array in a for loop from an array from 0 to 21 
(in this case). How to transform this array ?

I tried $_POST[2] but not work 
Thanks, 
look. Read a BASIC tutorial about how PHP works, and how to write 
scripts in PHP. Once you've done that, return here, and I guarantee you, 
the questions you've asked will be no more.

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


Re: [PHP] Recover POST form

2004-11-06 Thread Christian Ista

> I tried $_POST[2] but not work 

with arrays_keys :)

Thanks, 

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



Re: [PHP] Recover POST form

2004-11-06 Thread Christian Ista

> echo '';
> print_r($_POST);
> echo '';

I have something like that :

Array
(
[5980915] => on
[ToDo5980915] => N
[5941846] => on
[ToDo5941846] => N
[5916500] => on
[ToDo5916500] => N
[5907115] => on
[ToDo5907115] => N
[5900019] => on
[ToDo5900019] => N
[5899239] => on
[ToDo5899239] => N
[5897854] => on
[ToDo5897854] => N
[5896483] => on
[ToDo5896483] => N
[5893286] => on
[ToDo5893286] => N
[5865056] => on
[ToDo5865056] => N
[fa] => test
)

I'd like to access this array in a for loop from an array from 0 to 21 
(in this case). How to transform this array ?

I tried $_POST[2] but not work 

Thanks, 

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



Re: [PHP] Recover POST form

2004-11-06 Thread Greg Donald
On Sat, 6 Nov 2004 23:32:23 +0100, Christian Ista <[EMAIL PROTECTED]> wrote:
> In a PHP page I use a form with POST method.
> 
> I'd like in the action page recover all the variable posted. Could you tell
> me how to do that ?

They are available in the $_POST array.

echo '';
print_r($_POST);
echo '';


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



[PHP] Recover POST form

2004-11-06 Thread Christian Ista
Hello,

In a PHP page I use a form with POST method.

I'd like in the action page recover all the variable posted. Could you tell 
me how to do that ?

Thanks,

Christian, 

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



Re: [PHP] Problem with fopen(...) -

2004-11-06 Thread Jason Wong
On Saturday 06 November 2004 19:33, P M wrote:

Please do not top post.

> Well, since I'm using the latest version of the PHP plugin, it can't be
> that I'm using the $_FILES variable ($HTTP_POST_FILES is for older versions
> of php as far as I know). Nevertheless, I tried it.. and it didn't work.

Do the examples in the manual work for you? If so what are you doing 
differently from the examples?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
If *I* had a hammer, there'd be no more folk singers.
*/

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



Re: [PHP] images doesn't seem to cache

2004-11-06 Thread M. Sokolewicz
Anders Thoresson wrote:
 This code seems to work. Have I got it right?

 No. I have not. Sometimes the images are viewed from the cache, just to 
get downloaded from the server again next time, just a minute later, 
when I try again.

 My local development server is running IIS, my production server is 
running Apache. Where is the best place to look for If-Modified-Since? 
Is $_GET['If-Modified-Since'] a safe bet?
it won't be a php-parameter. Seen as the script isn't executed when the 
server decides it is the same as the cached version. So only if it deems 
not to be, then it runs the script, and when it does that, the script 
doesn't need to know anything about modified-since, because that checks 
has long since been passed.

This is all an issue between browser and server, and php can't interfere 
in between those. However, to do something about it, change the headers 
that you send abou caching. These are the pragma headers for HTTP/1.0 
(?), and the Cache-Control headers in HTTP/1.1


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


Re: Re: [PHP] Big table dump stopping in between

2004-11-06 Thread James Kaufman
On Sat, Nov 06, 2004 at 10:10:56AM -0500, Ritesh Nadhani wrote:
> 
> I even tried an HTTP utility but it is also stopping half way thru. I think its a 
> problem with ISPs server. Looks like some server option has to be configured. 
> 

What database is this again? I had a similar problem with an 'Enterprise class'
database. My solution was to update statistics. This gives clues to the
database engine on how best to do the qury. Before the update, my large, though
not as large as your result set, would just stop partly through. After updating
statistics, it worked fine.

-- 
Jim Kaufman
Linux Evangelist
public key 0x6D802619
---
Life is like an onion: you peel it off one layer at a time, and sometimes you
weep.
-- Carl Sandburg

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



Re: [PHP] Re: Question: Passing error messages

2004-11-06 Thread Stuart Felenstein

--- Daniel Schierbeck <[EMAIL PROTECTED]> wrote:

> Where are you redirecting the client to? An error
> page?

Either an error page or back out to a main page.

Stuart

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



Re: [PHP] images doesn't seem to cache

2004-11-06 Thread anders thoresson
 This code seems to work. Have I got it right?
 No. I have not. Sometimes the images are viewed from the cache, just 
to get downloaded from the server again next time, just a minute later, 
when I try again.

 My local development server is running IIS, my production server is 
running Apache. Where is the best place to look for If-Modified-Since? 
Is $_GET['If-Modified-Since'] a safe bet?

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


Re: [PHP] images doesn't seem to cache

2004-11-06 Thread anders thoresson
Your eyes are fine. You need to check for If-Modified-Since header, if 
the time is older than file modification time (filemtime()) send 
Last-Modified header and the image, else send 304 Not Modified response.
 This code seems to work. Have I got it right?
// Get the time the cache file was last modified
$lastModified = filemtime($pPath);
// Issue an HTTP last modified header
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $lastModified) . ' 
GMT');

if (isset($_GET['If-Modified-Since']))
{
// Split the If-Modified-Since (Netscape < v6 gets this wrong)
$modifiedSince = explode(';', $_GET['If-Modified-Since']);

// Turn the client request If-Modified-Since into a timestamp
$modifiedSince = strtotime($modifiedSince[0]);
}
else
{
$modifiedSince = 0;
}
// Compare time the content was last modified with client cache
if ($lastModified <= $modifiedSince)
{
header('HTTP/1.1 304 Not Modified');
}
else
{
$extention = substr($path, -3);
if ($extention == "jpg")
header("Content-type: image/jpeg");
if ($extention == "gif")
header("Content-type: image/gif");
if ($extention == "bmp")
header("Content-type: image/bmp");
if ($extention == "png")
header("Content-type: image/png");
readfile("$pPath");
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: Re: [PHP] Problem with fopen(...) -

2004-11-06 Thread P M

Well, since I'm using the latest version of the PHP plugin, it can't be that I'm using 
the $_FILES variable ($HTTP_POST_FILES is for older versions of php as far as I know). 
Nevertheless, I tried it.. and it didn't work.

To clarify my problem.. I'm using a form to get a file name and some other info 
(regular text boxes) where the file information is supposed to be stored in the 
$_FILES array (predefined by php). Though it seems that I can't use neither the [name] 
or the [tmp_name] field in this array to get the file name. The error occurs directly 
when I try to fopen(...) the file. I simply get the following error:

Warning: fopen("", "r") - No error in c:\code\wengine\aey.php on line 130

My MySQL db is working just fine, so is PHP (other code works), as well as the process 
of using other HTML form information for PHP processing (such as textboxes).

Does the error message above ring a bell to you? Thanks..

Arty

-Original Message-
From: Pankaj Kafley <[EMAIL PROTECTED]>
To: Arty <[EMAIL PROTECTED]>
Date: Fri, 5 Nov 2004 23:04:24 +0100
Subject: Re: [PHP] Problem with fopen(...) - "No error"??


Can you be more specific ? I actually had the same sort of problem
once but maybe it is not the same. But anyways I was getting null
everytime until I change $_FILES variable to $HTTP_POST_FILES. As by
suggested by someone else here.

Regards 


On Fri, 5 Nov 2004 21:08:17 +0100, Arty <[EMAIL PROTECTED]> wrote:
> I'm working against a table without problems, that is, as long as I insert and 
> retrieve texts and numerical values from various fields. However, I'm also using a 
> table for images, but I can't upload files correctly. This is the error I get :
> 
> Warning: fopen("", "r") - No error in c:\code\wengine\aey.php on line 130
> 
> Warning: fread(): supplied argument is not a valid File-Handle resource in 
> c:\code\wengine\aey.php on line 131
> 
> I have no clue what's the problem. I checked register_globals (on) but then again, 
> that shouldn't matter 'cause I'm using the $_FILES variable to access the file 
> information. Obviously, PHP thinks otherwise. It seems (from the warning "fopen("", 
> "r")" above), that even so, $_FILES[userfile][tmp_name] is not recognized and just 
> interpretated as null. I've tried $_FILES[userfile][name] also, but the same error 
> occurs. The second error is obviously just an effect from the first, so what am I 
> doing wrong here?? Any tips appreciated!
>
> Thanks,
> Arty
>
>

--
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: Question: Passing error messages

2004-11-06 Thread Daniel Schierbeck
Stuart Felenstein wrote:
I'm saying, currently if there is an error and the
script needs to exit, I'm doing this :
if ..error {
$_SESSION['ErMsg'] = "Submit Failure";
header (location: )
exit;
}
I want to know what alternatives there are to error
messages aside from using a session variable. 

Thank you ,
Stuart
Where are you redirecting the client to? An error page?
--
Daniel Schierbeck
Help spread Firefox (www.getfirefox.com): 
http://www.spreadfirefox.com/?q=user/register&r=6584

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


Re: [PHP] Re: Question: Passing error messages

2004-11-06 Thread Stuart Felenstein

--- Daniel Schierbeck <[EMAIL PROTECTED]> wrote:
 
> I'm not quite getting what you're saying - are you
> sending the error 
> messages on to a new page?! The usual and simple way
> of doing this is 
> the good 'ol OR operator:
> 

I'm saying, currently if there is an error and the
script needs to exit, I'm doing this :

if ..error {
$_SESSION['ErMsg'] = "Submit Failure";
header (location: )
exit;
}

I want to know what alternatives there are to error
messages aside from using a session variable. 

Thank you ,
Stuart

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



Re: [PHP] image uploads - part 2

2004-11-06 Thread Robby Russell
On Sat, 2004-11-06 at 03:58 -0800, Jaskirat Singh wrote:
> 4) database + dedicated =  err.. stupid? ;)

I should have clarified this more as to why I prefer the DB storage
method. I don't expect that my web application will be the only
interface to the data that I am storing the database. For some clients,
we build pyton interfaces that clients run on their desktop. We also
replicate our databases across a few servers and it's much easier to
keep track of the database than it is to make sure a bunch of
filesystem-stored files are too. Some of our client database machines
don't have a webservers so we don't program with just the web in mind. 

With storing in the database, we get transaction support and we know
that an image will not be deleted if it is being referenced by another
piece of data. Speed versus data integrity is something we have to
juggle per client as to what is more important. If you know how to
optimize your database (a stock pgsql db can be rather slow..) then the
speed differences are not enough of a factor for us to know that our
data just a bit more safer. 

-Robby

-- 
/***
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
*--- Now supporting PHP5 ---
/


signature.asc
Description: This is a digitally signed message part


[PHP] Re: Question: Passing error messages

2004-11-06 Thread Daniel Schierbeck
Stuart Felenstein wrote:
I've started getting into the habit of passing error
messages through session variables, particularly on
redirects.
From some peoples reaction on this list I gather it's
not the best practice.
What is an alternative way ? I believe it's through a
URL. not sure how to go about that method
Stuart
I'm not quite getting what you're saying - are you sending the error 
messages on to a new page?! The usual and simple way of doing this is 
the good 'ol OR operator:

do_something() or die('Couldn\'t do it, sorry...');
Well, maybe an IF then:
if (!do_something()) {
exit('Still can\' do it...');
}
But there are also much more sophisticated ways of doing it. Clarify 
exactly what you're trying to do, and we'll get back to them.

--
Daniel Schierbeck
Help spread Firefox (www.getfirefox.com): 
http://www.spreadfirefox.com/?q=user/register&r=6584

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


[PHP] Question: Passing error messages

2004-11-06 Thread Stuart Felenstein
I've started getting into the habit of passing error
messages through session variables, particularly on
redirects.
>From some peoples reaction on this list I gather it's
not the best practice.

What is an alternative way ? I believe it's through a
URL. not sure how to go about that method


Stuart

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



Re: [PHP] Re: Questions about mysql_real_escape_string and addslashes

2004-11-06 Thread Stuart Felenstein

--- "M. Sokolewicz" <[EMAIL PROTECTED]> wrote:

(http://www.php.net/manual/en/function.mysql-real-escape-string.php)


I have my eye on example 3: The Quote_Smart function. 
Do I have to list all the variables out though or is
there a way to have it check everything passing
through ?
What would nice is if I didn't have to put the
Quote_smart function in every query statement but have
it test everything? 

Stuart
> 
> 

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



Re: Re: [PHP] Big table dump stopping in between

2004-11-06 Thread Ritesh Nadhani
Hello,
> 
> From: Jason Wong <[EMAIL PROTECTED]>
> Date: 2004/11/06 Sat PM 06:01:28 EST
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Big table dump stopping in between
> 
> On Saturday 06 November 2004 05:43, Ritesh Nadhani wrote:
> 
> > In the script I connect to one our tables having more then 80K rows and
> > dump the data using echo command.
> >
> > When I run this page from my browser, the process always stops half way
> > thru and only half the data is dumped. I can reproduce this problem
> > everytime. I am on a 512Kbps DSL line.
> >
> > By stopping i mean from IE, about 50K rows are dumped and then the process
> > stops.
> >
> > I have even tried: set_time_limit (0) so that we have unlimited timeout but
> > its still giving the same error.
> 
> Do you actually get an error message?
> 

No.

> > Do I need to configure something in the server so that complete data is
> > dumped?
> 
> Have you ruled out the possibility that it's IE that's barfing? Try a 
> different browser and/or try using a download utility to just download the 
> page to file, or link to that page from another page so you can right-click 
> "Save link as...".
> 

I even tried an HTTP utility but it is also stopping half way thru. I think its a 
problem with ISPs server. Looks like some server option has to be configured. 

> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> Accuracy, n.:
>  The vice of being right
> */
> 
> -- 
> 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] Big table dump stopping in between

2004-11-06 Thread Jason Wong
On Saturday 06 November 2004 05:43, Ritesh Nadhani wrote:

> In the script I connect to one our tables having more then 80K rows and
> dump the data using echo command.
>
> When I run this page from my browser, the process always stops half way
> thru and only half the data is dumped. I can reproduce this problem
> everytime. I am on a 512Kbps DSL line.
>
> By stopping i mean from IE, about 50K rows are dumped and then the process
> stops.
>
> I have even tried: set_time_limit (0) so that we have unlimited timeout but
> its still giving the same error.

Do you actually get an error message?

> Do I need to configure something in the server so that complete data is
> dumped?

Have you ruled out the possibility that it's IE that's barfing? Try a 
different browser and/or try using a download utility to just download the 
page to file, or link to that page from another page so you can right-click 
"Save link as...".

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Accuracy, n.:
 The vice of being right
*/

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



Re: [PHP] Passing values from a new window

2004-11-06 Thread M Saleh EG
Javascript.
Simply just update ur fields at the parent window.

On onUnload even of the popup do this
self.opener.formName.fieldName.value=document.popupformName.popupfieldName.value;

Your keywords to check in Javascript papers are parent_window,
window_opener and Javascript DOM. If you're using Dreamweaver then ur
blessed by having a Javascript at the palm of ur hand.

HTH.


On Fri, 05 Nov 2004 13:03:31 -0800, Todd Cary <[EMAIL PROTECTED]> wrote:
> I have a button that creates a new window.  The surfer may enter data in
> the new window, and if he does, when the window is closed by the surfer,
> can the information update fields on the original page - the page/window
> from which the new window was created?
> 
> I have seen instances where the surfer can open a new window to get
> email addresses and these addresses appear in the first window.
> 
> Todd
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
M.Saleh.E.G
97150-4779817

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



Re: [PHP] Problem with fopen(...) - "No error"??

2004-11-06 Thread Jason Wong
On Friday 05 November 2004 22:04, Pankaj Kafley wrote:
> Can you be more specific ? I actually had the same sort of problem
> once but maybe it is not the same. But anyways I was getting null
> everytime until I change $_FILES variable to $HTTP_POST_FILES. As by
> suggested by someone else here.

A question for you (and the OP), are you using a relatively new version of 
PHP?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Are we on STRIKE yet?
*/

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



[PHP] Re: image uploads - part 2

2004-11-06 Thread M. Sokolewicz
Jaskirat Singh wrote:
Thanks  Robby Russell, Jason Wong , Greg Donald, raditha dissanayak and
every one else who answered part 1 of my email concerning image
uploads.
It was about where to store images uploaded by website users and
question was database vs filesystem and dedicated vs shared hosting 
and the conclusion I could understand was 

fast,secure,cheap pick any two 

1) database + shared = secure and cheap
2) filesystem + shared = fast and cheap
3) filesystem + dedicated = fast and secure
4) database + dedicated =  err.. stupid? ;)
For now I have decided to try option 1 and see how far I can go till
performance begins to become a limiting factor and then decide later if
I really need to, to choose between security and cost.
I have another question. I have used mysql mediumblob to store images.
They are jpeg files. When I retrieve that binary data with a query and
generate an image with PHP .. ie. I do

The image gets generated and displayed OK. But when I save that image
file on my work station it gets saved as a huge file .. a file which
was 36 Kb jpg when uploaded is saved as 5Mb bmp when downloaded.  The
data in mysql column is 36 Kb only. So why is it getting saved as such
a huge file and why bmp when header is 'image/jpeg'
*sighs*
IE
thanks
Jas
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Questions about mysql_real_escape_string and addslashes

2004-11-06 Thread M. Sokolewicz
Stuart Felenstein wrote:
First I'm a bit unsure , because in the manual it
states that you must use mysql_real_escape_string on
binary data.  So first question, what constitutues
binary data, a file or just an integer?
any data that might contain a null-byte (\0) is usually seen as the 
definition for binary files.

Second question - Since magic_quote_gpc is enabled on
my server (and I have no choice) - I gather I must use
addslashes()
why?
3rd- Some of the user input translates to an int value
where I later do a join for the actual label.  I
believe those fields are protected naturally since the
database won't accept anything but an int.
that is correct, however, remember that sql-injection attacks could 
still be made in such places.

4th - With both of these functions it looks like they
become part of the sql query.  I could use some help
in understanding how to set up variables using both
functions.  In otherwords, an example of how they get
coded.
Look at the examples in the documentation, they are all I could give 
you.. (http://www.php.net/manual/en/function.mysql-real-escape-string.php)

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


[PHP] Questions about mysql_real_escape_string and addslashes

2004-11-06 Thread Stuart Felenstein
First I'm a bit unsure , because in the manual it
states that you must use mysql_real_escape_string on
binary data.  So first question, what constitutues
binary data, a file or just an integer?

Second question - Since magic_quote_gpc is enabled on
my server (and I have no choice) - I gather I must use
addslashes()

3rd- Some of the user input translates to an int value
where I later do a join for the actual label.  I
believe those fields are protected naturally since the
database won't accept anything but an int.

4th - With both of these functions it looks like they
become part of the sql query.  I could use some help
in understanding how to set up variables using both
functions.  In otherwords, an example of how they get
coded.

Thank you ,
Stuart

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



[PHP] image uploads - part 2

2004-11-06 Thread Jaskirat Singh
Thanks  Robby Russell, Jason Wong , Greg Donald, raditha dissanayak and
every one else who answered part 1 of my email concerning image
uploads.

It was about where to store images uploaded by website users and
question was database vs filesystem and dedicated vs shared hosting 
and the conclusion I could understand was 

fast,secure,cheap pick any two 

1) database + shared = secure and cheap
2) filesystem + shared = fast and cheap
3) filesystem + dedicated = fast and secure
4) database + dedicated =  err.. stupid? ;)

For now I have decided to try option 1 and see how far I can go till
performance begins to become a limiting factor and then decide later if
I really need to, to choose between security and cost.

I have another question. I have used mysql mediumblob to store images.
They are jpeg files. When I retrieve that binary data with a query and
generate an image with PHP .. ie. I do



The image gets generated and displayed OK. But when I save that image
file on my work station it gets saved as a huge file .. a file which
was 36 Kb jpg when uploaded is saved as 5Mb bmp when downloaded.  The
data in mysql column is 36 Kb only. So why is it getting saved as such
a huge file and why bmp when header is 'image/jpeg'

thanks
Jas

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



[PHP] image uploads - part 2

2004-11-06 Thread Jaskirat Singh
Thanks  Robby Russell, Jason Wong , Greg Donald, raditha dissanayak and
every one else who answered part 1 of my email concerning image
uploads.

It was about where to store images uploaded by website users and
question was database vs filesystem and dedicated vs shared hosting 
and the conclusion I could understand was 

fast,secure,cheap pick any two 

1) database + shared = secure and cheap
2) filesystem + shared = fast and cheap
3) filesystem + dedicated = fast and secure
4) database + dedicated =  err.. stupid? ;)

For now I have decided to try option 1 and see how far I can go till
performance begins to become a limiting factor and then decide later if
I really need to, to choose between security and cost.

I have another question. I have used mysql mediumblob to store images.
They are jpeg files. When I retrieve that binary data with a query and
generate an image with PHP .. ie. I do



The image gets generated and displayed OK. But when I save that image
file on my work station it gets saved as a huge file .. a file which
was 36 Kb jpg when uploaded is saved as 5Mb bmp when downloaded.  The
data in mysql column is 36 Kb only. So why is it getting saved as such
a huge file and why bmp when header is 'image/jpeg'

thanks
Jas

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



Re: [PHP] best way to store images

2004-11-06 Thread raditha dissanayake
[EMAIL PROTECTED] wrote:
I'm trying to plan out the best way to develop an image hosting script for
my client.

 

You will find the answer in last week's archive.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php