[PHP] file upload via email

2004-04-22 Thread Yury B .
Hi,

I believe there is possibility to upload html and other types of 
files to the site location via email. Using Cron I can make script to 
retreave POP3 email messages with sertain content/attachments which 
would be translated to the form of files and site update can be done 
this way. The question is - does anybody know actual script for doing 
that? I'm not really advanced PHP developer so any help or suggestion 
would be appreciated.

Yury

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



Re: [PHP] image upload

2003-10-06 Thread Yury B .
Sorry, there was typo in the code I sent previously. Here is the 
right code but the same problem - secont image is with incorrect 
header:

?php
$nw=100; //The Width Of The Thumbnails
//$rw=400;

$ipath = ./pics; //Path To Place Where Images Are Uploaded.
$tpath = ./thumbs;//Path To Place Where Thumbnails Are Uploaded

function LoadJpeg ($imgname) {
   $im = @imagecreatefromjpeg ($imgname); /* Attempt to open */
   if (!$im) { /* See if it failed */
   $im  = imagecreate (150, 30); /* Create a blank image */
   $bgc = imagecolorallocate ($im, 255, 255, 255);
   $tc  = imagecolorallocate ($im, 0, 0, 0);
   imagefilledrectangle ($im, 0, 0, 150, 30, $bgc);
   /* Output an errmsg */
   imagestring ($im, 1, 5, 5, Error loading $imgname, $tc);
   }
   return $im;
}

$dimensions = getimagesize($file);

$thname = $tpath/$file_name;
//$rname = $ipath/$file_name;

$w=$dimensions[0];
$h=$dimensions[1];

$c=$nw/$w;
//$c2=$rw/w;
$nh=$h*$c; //The Height Of The Thumbnails
//$rh=$h*$c2; //The Height Of The Large Pictures

$img = LoadJpeg($file);
//$img2 = LoadJpeg($file);
$thumb = imagecreatetruecolor($nw,$nh);
//$large = imagecreatetruecolor($rw,$rh);

imagecopyresampled($thumb,$img,0,0,0,0,$nw,$nh,$w,$h);
//  imagecopyresampled($large,$img2,0,0,0,0,$rw,$rh,$w,$h);
imagejpeg($thumb,$thname,95);
//  imagejpeg($large,$rname,95);

imagedestroy($img2);
?

On 6 Oct 2003 at 8:09, Jason Wong wrote:

 On Monday 06 October 2003 00:32, Yury B. wrote:
  Hi I need to upload two resized images out from one jpg image. I use
  following code to do it:
 
 [snip]
 
 
  This code is working perfectly but produces only one uploaded and
  resized image (I comented out the lines that I add for second image)
  If I take out comments from the code on the second image - this
  script doesn't work - it produces two files on the server but only
  one of them is working the other one shows error of wrong hedding.
  How should I upload two resized files? I know it's possible but how
  can I fit everything in one portion of code?
 
 Check the values of all your variables -- in particular $rw, as it doesn't 
 seem to be initialised.
 
 -- 
 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
 --
 /*
 One thing about the past.
 It's likely to last.
   -- Ogden Nash
 */
 

God is our provider 
http://www.body-builders.org/

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



Re: [PHP] image upload

2003-10-06 Thread Yury B .
Thank you for all help I have just figured out that there is other 
variable prob. See pointer ---:

?php
$nw=100; //The Width Of The Thumbnails
//$rw=400;

$ipath = ./pics; //Path To Place Where Images Are Uploaded.
$tpath = ./thumbs;//Path To Place Where Thumbnails Are Uploaded

function LoadJpeg ($imgname) {
   $im = @imagecreatefromjpeg ($imgname); /* Attempt to open */
   if (!$im) { /* See if it failed */
   $im  = imagecreate (150, 30); /* Create a blank image */
   $bgc = imagecolorallocate ($im, 255, 255, 255);
   $tc  = imagecolorallocate ($im, 0, 0, 0);
   imagefilledrectangle ($im, 0, 0, 150, 30, $bgc);
   /* Output an errmsg */
   imagestring ($im, 1, 5, 5, Error loading $imgname, $tc);
   }
   return $im;
}

$dimensions = getimagesize($file);

$thname = $tpath/$file_name;
//$rname = $ipath/$file_name;

$w=$dimensions[0];
$h=$dimensions[1];

$c=$nw/$w;
-- //$c2=$rw/w; 
$nh=$h*$c; //The Height Of The Thumbnails
//$rh=$h*$c2; //The Height Of The Large Pictures

$img = LoadJpeg($file);
//$img2 = LoadJpeg($file);
$thumb = imagecreatetruecolor($nw,$nh);
//$large = imagecreatetruecolor($rw,$rh);

imagecopyresampled($thumb,$img,0,0,0,0,$nw,$nh,$w,$h);
//  imagecopyresampled($large,$img2,0,0,0,0,$rw,$rh,$w,$h);
imagejpeg($thumb,$thname,95);
//  imagejpeg($large,$rname,95);

imagedestroy($img2);
?

On 6 Oct 2003 at 8:09, Jason Wong wrote:

 On Monday 06 October 2003 00:32, Yury B. wrote:
  Hi I need to upload two resized images out from one jpg image. I use
  following code to do it:
 
 [snip]
 
 
  This code is working perfectly but produces only one uploaded and
  resized image (I comented out the lines that I add for second image)
  If I take out comments from the code on the second image - this
  script doesn't work - it produces two files on the server but only
  one of them is working the other one shows error of wrong hedding.
  How should I upload two resized files? I know it's possible but how
  can I fit everything in one portion of code?
 
 Check the values of all your variables -- in particular $rw, as it doesn't 
 seem to be initialised.
 
 -- 
 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
 --
 /*
 One thing about the past.
 It's likely to last.
   -- Ogden Nash
 */
 

God is our provider 
http://www.body-builders.org/

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



[PHP] image upload

2003-10-05 Thread Yury B .
Hi I need to upload two resized images out from one jpg image. I use 
following code to do it:

?php
$nw=100; //The Width Of The Thumbnails
//$rn=400

$ipath = ./pics; //Path To Place Where Images Are Uploaded.
$tpath = ./thumbs;//Path To Place Where Thumbnails Are Uploaded

function LoadJpeg ($imgname) {
   $im = @imagecreatefromjpeg ($imgname); /* Attempt to open */
   if (!$im) { /* See if it failed */
   $im  = imagecreate (150, 30); /* Create a blank image */
   $bgc = imagecolorallocate ($im, 255, 255, 255);
   $tc  = imagecolorallocate ($im, 0, 0, 0);
   imagefilledrectangle ($im, 0, 0, 150, 30, $bgc);
   /* Output an errmsg */
   imagestring ($im, 1, 5, 5, Error loading $imgname, $tc);
   }
   return $im;
}

$dimensions = getimagesize($file);

$thname = $tpath/$file_name;
//$rname = $ipath/$file_name;

$w=$dimensions[0];
$h=$dimensions[1];

$c=$nw/$w;
//$c2=$rw/w;
$nh=$h*$c; //The Height Of The Thumbnails
//$rh=$h*$c2; //The Height Of The Large Pictures

$img = LoadJpeg($file);
//$img2 = LoadJpeg($file);
$thumb = imagecreatetruecolor($nw,$nh);
//$large = imagecreatetruecolor($rw,$rh);

imagecopyresampled($thumb,$img,0,0,0,0,$nw,$nh,$w,$h);
//  imagecopyresampled($large,$img2,0,0,0,0,$rw,$rh,$w,$h);
imagejpeg($thumb,$thname,95);
//  imagejpeg($large,$rname,95);

imagedestroy($img2);
?
This code is working perfectly but produces only one uploaded and 
resized image (I comented out the lines that I add for second image) 
If I take out comments from the code on the second image - this 
script doesn't work - it produces two files on the server but only 
one of them is working the other one shows error of wrong hedding. 
How should I upload two resized files? I know it's possible but how 
can I fit everything in one portion of code?

Yury

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



[PHP] Redirect URL

2003-09-22 Thread Yury B .
Hi 

I have form in file register.php. The action of this form is the same 
- register.php the form validation script is included in this file 
like include(mail.php) In mail.php there is two sections - one is 
working if user didn't complete form properly another if everything 
okay. So, I need form to show the different page (let's say 
success.htm) if everything was filled right. I include the following 
in the mail.php file if everything is okay: header(Location: 
http://test.my/success.htm;); But it doesn't work even though all the 
files are in 
the same directory. 
it shows:
Warning: Cannot modify header information - headers already sent by 
(output started at z:\home\test.my\www\register.php:5) in 
z:\home\test.my\www\mail.php on line 41

What is wrong?

Yury

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



[PHP] COUNT(*)

2003-08-01 Thread Yury B .
Hi

I used to use old fashioned mysql quieries but moderm mysql 
apparently became more flexible so. I want to understand how to use 
some of the new features like COUNT(*)

Let's say I have
$result=SELECT COUNT(*) FROM pet;
$sql=mysql_query($result);
while ($row=mysql_fetch_array($sql)){
$pet_name=$row['pet_name'];
echo ..;
}

the question is how do I actually retrieve the number of rows of sql 
query result?

Yury

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



[PHP] Re: textarea rich replacement?

2003-07-16 Thread Yury B .
I know that you can set up HTMLArea and others for your needs. You 
can take away all functions that you don't need or hide them. All 
this triks you can find in manual

Yury

On 15 Jul 2003 at 16:21, Justin French wrote:

 Hi all,
 
 I've looked at both editize(.com) and HTMLArea, both of which are 
 in-browser Rich Text editor replacements (written in java) for the 
 standard textarea.
 
 Unfortunately, they both allow far too much control... at most I only 
 want to offer H1, H2, P, B, A and I -- no colors, no images and please 
 please please no tables :)
 
 Is anyone familiar with such a product?
 
 It doesn't have to be open source at all -- quite prepared to pay for 
 something if it works.
 
 
 Regards,
 Justin
 
 

God is our provider 
http://www.body-builders.org/


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



[PHP]inheritance

2003-06-30 Thread Yury B .
Hi

I'm with PHP for 4 years now but have feeling that my code doesn't 
have much order. I only started to use functions, it helped me a lot 
but I believe if I would learn to wirk with classes that would be 
what I need. 
The question: 
I have class A, class B, and class C
now class C extends B
that means I can use all variables and functions of class B in class 
C like $this-B();
but what to do if I also need functions and variables of class A in 
class C? Can I do class B extends class A and class C extends 
class B and then to use functions and variables of class A in class 
C like $this-B()-A(); ? 
I think I can't do it this way but still would like to ask it in 
here. 
If I can't do it this way - tell me how can I do it?

Thank you,

Yury

God is our provider 
http://www.body-builders.org/


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



[PHP] Re: GD library update

2003-06-21 Thread Yury B .
Thank you the problem is solved, I just downloaded php_gd2.dll from 
gd site and inabled it in php.ini Now everything is working as it 
should.

Yury

On 19 Jun 2003 at 17:24, Andrei BEJENARU wrote:

 
 Yury B . [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Hi,
  I need to use function imagecreatetruecolor() in my script but it
  doesn't work on my local apache+php+mysql on XP server. It works fine
  on the real server though but i need to play with it around. What do
  I need to do to get it work? from docs I understand I need gd 2.0.1
  or higher, well how to get it and how to install?
 
  Thank you,
 
  Yury
 
 The gd library is shipped with the PHP distribution, so you should simply
 upgrade to version 4.3.1 or 4.3.2.
 You must download the big zip distribution, as it has all the needed
 libraries.
 Follow the instructions in the install readme file and you should have no
 problems.
 
 Andrei BEJENARU
 
 
 

God is our provider 
http://www.body-builders.org/


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



[PHP] GD library update

2003-06-19 Thread Yury B .
Hi,
I need to use function imagecreatetruecolor() in my script but it 
doesn't work on my local apache+php+mysql on XP server. It works fine 
on the real server though but i need to play with it around. What do 
I need to do to get it work? from docs I understand I need gd 2.0.1 
or higher, well how to get it and how to install?

Thank you,

Yury
God is our provider 
http://www.body-builders.org/


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