Re: [PHP] Trouble with sin()

2004-07-22 Thread Ashwin Purohit
It's giving you sin(20) in radians, not in degrees (which is what you
seem to want). It's not a bug.

On Thu, 22 Jul 2004 12:17:19 -0400, Ashwin Purohit [EMAIL PROTECTED] wrote:
 It's giving you sin(20) in radians, not in degrees (which is what you
 seem to want). It's not a bug.
 
 
 
 On Thu, 22 Jul 2004 17:40:21 +0200, Marcus Strube [EMAIL PROTECTED] wrote:
  Hi,
 
  i'm working with PHP 5.0.0 (Linux) and have some trouble using function sin().
  In PHPs opinion
 
  sin(20)
 
  is
 
  0.912945250728
 
  I have had a look at the bug.php.net, but couldn`t find anything. Is it a bug
  or am I just misunderstanding something??
 
  Marcus
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 --
 Ashwin Purohit
 


-- 
Ashwin Purohit

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



Re: [PHP] Trouble with sin()

2004-07-22 Thread Ashwin Purohit
If you want it in degrees, use sin(deg2rad(20);

 On Thu, 22 Jul 2004 12:17:19 -0400, Ashwin Purohit [EMAIL PROTECTED] wrote:
  It's giving you sin(20) in radians, not in degrees (which is what you
  seem to want). It's not a bug.

  On Thu, 22 Jul 2004 17:40:21 +0200, Marcus Strube [EMAIL PROTECTED] wrote:
   Hi,
   i'm working with PHP 5.0.0 (Linux) and have some trouble using function sin().
   In PHPs opinion
   sin(20) is
   0.912945250728
   I have had a look at the bug.php.net, but couldn`t find anything. Is it a bug
   or am I just misunderstanding something??
  
   Marcus
-- 
Ashwin Purohit

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



Re: [PHP] a stupid question

2004-06-24 Thread Ashwin Purohit
Maybe it has to be Some text.aFunction();.sometext; with the
semicolon after the function.
I don't really know, just guessing.

On Thu, 24 Jun 2004 16:44:53 -0500, Blake Schroeder [EMAIL PROTECTED] wrote:
 
 Hey
 
 I cant figureout the syntax please help
 
 echo Some text.aFunction().some more text;
 
 The function is not working.
 
 Thanks
 
 -B
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
Ashwin Purohit

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



Re: [PHP] Can I detect size of files which are too large to upload?

2004-06-18 Thread Ashwin Purohit
$userfile=$_FILES['userfile']['tmp_name'];
$userfile_error=$_FILES['userfile']['error'];
if ($userfile_error  0) 
{echo 'Problem: ';
switch($userfile_error) 
{case 1: echo 'File exceeded upload maximum filesize'; break;
case 2: echo 'File exceeded maximum file size'; break;
case 3: echo 'File only partially uploaded'; break;
case 4: echo 'No file uploaded'; break;
}exit;}

You can use a switch format like I have done previously shown above.
Each file error is mentioned in a different case.
-- 
Ashwin Purohit

On Fri, 18 Jun 2004 10:50:04 -0700, Pablo Gosse [EMAIL PROTECTED] wrote:
 
 Hi folks.  I'm just tweaking the file manager portion of my CMS, and am
 wondering if there is any way I can identify the size of an uploaded
 file which exceeded the upload_max_filesize?  I'd like to be able to
 tell the user the size of the file they tried to upload, in addition to
 telling them the allowable maximum size.
 
 It would seem logical to me that I would not be able to do this, since
 if the file exceeds the limit set by upload_max_filesize then the upload
 should not continue past that point.
 
 Is this an accurate assumption?
 
 Cheers and TIA.
 
 Pablo

-- 
Ashwin Purohit

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



Re: [PHP] Can I detect size of files which are too large to upload?

2004-06-18 Thread Ashwin Purohit
Here's a professional explanation:

http://de3.php.net/manual/en/features.file-upload.errors.php

 On Fri, 18 Jun 2004 10:50:04 -0700, Pablo Gosse [EMAIL PROTECTED] wrote:
 
  Hi folks.  I'm just tweaking the file manager portion of my CMS, and am
  wondering if there is any way I can identify the size of an uploaded
  file which exceeded the upload_max_filesize?  I'd like to be able to
  tell the user the size of the file they tried to upload, in addition to
  telling them the allowable maximum size.
 
  It would seem logical to me that I would not be able to do this, since
  if the file exceeds the limit set by upload_max_filesize then the upload
  should not continue past that point.
 
  Is this an accurate assumption?
 
  Cheers and TIA.
 
  Pablo

-- 
Ashwin Purohit

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



Re: [PHP] Problem with mail()

2004-06-17 Thread Ashwin Purohit
So what do you get as the error message? Does it just return failed?
Also, I think using parentheses with echo statements like yours is
unnecessary.

 Keith Aldridge wrote:
 New to php, can't see the problem with mail().

?php
 if (mail($to, $subj, $body)) { echo Successful send; }
 else { echo Failed; }
 ?

-- 
Ashwin Purohit

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



Re: [PHP] Read Last Lines of a Text File

2004-06-16 Thread Ashwin Purohit
Or maybe execution time limit.
[snip]
I've created the code below, but since this file is so large
(currently 8 MB) it won't work.
[/snip]
I would guess you are running into your php memory_limit.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_
Is your PC infected? Get a FREE online computer virus scan from McAfee® 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

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


Re: [PHP] Converting Hex to RGB

2004-06-09 Thread Ashwin Purohit
Chris,
I think that maybe the function imagecreatetruecolor() is the problem; I'll 
try just imagecreate instead when I get home.

Thanks,
Ashwin Purohit.
_
MSN 9 Dial-up Internet Access fights spam and pop-ups – now 3 months FREE! 
http://join.msn.click-url.com/go/onm00200361ave/direct/01/

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


[PHP] Converting Hex to RGB

2004-06-08 Thread Ashwin Purohit
Hello Everyone,
I would like to know if there is some way to write a script so that I can 
input a Hex color code and have it output to RGB coordinates so as to 
prevent users from having to search for the color codes? I will use that 
feature so that I can create dynamic images.

Thanks in advance,
Ashwin Puroit.
_
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/

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


Re: [PHP] Converting Hex to RGB

2004-06-08 Thread Ashwin Purohit
I tried to make this image creation tool, but for some reason the background 
color is not changing, even if I input new hex color codes into it (I tried 
'substringing' them), the background always shows up black. The funny thing 
is, at the end of the script, it shows the correct RGB values extracted from 
the hex code. Any ideas?

---CODE:-
html
title Button Generator /title
body
form name=image001 action=button.php method=post
pinput type=text width=50 name=text size=50Text/p
p#input name=hexcode type=text size=6 maxlength=6 width=6
   Background Color (Hexadecimal Color Code)/p
   input type=submit name=Submit value=Generate Image/form
?php
// --
$R = @hexdec(substr($hexcode,0,2));
$G = @hexdec(substr($hexcode,2,2));
$B = @hexdec(substr($hexcode,4,2));
//---
header(Content-type: image/jpeg);
 if(!isset($text)) {$text ='';}
 if(!isset($s)) $s=50;
 $text = stripslashes($text);
 $font = 'C:\Program Files\Apache 
Group\Apache2\htdocs\graphics\fonts\PORKYS.TTF';
 $size = imagettfbbox($s,0,$font,$text);
 $dx = abs($size[2]-$size[0]);
 $dy = abs($size[5]-$size[3]);
 $xpad=11;
 $ypad=11;
 $im = imagecreatetruecolor($dx+$xpad,$dy+$ypad);
 $background = ImageColorAllocate($im,$R,$G,$B);
 $shadow = ImageColorAllocate($im, 0,0,0);
 $txtcolor = ImageColorAllocate($im, 255,255,255);
 ImageRectangle($im,0,0,$dx+$xpad-1,$dy+$ypad-1,$shadow);
 ImageRectangle($im,0,0,$dx+$xpad,$dy+$ypad,$txtcolor);
 ImageTTFText($im, $s, 0, (int)($xpad/2)+1, $dy+(int)($ypad/2), $shadow, 
$font, $text);
 ImageTTFText($im, $s, 0, (int)($xpad/2), $dy+(int)($ypad/2)-1, $txtcolor, 
$font, $text);
 imagejpeg($im, '1.jpeg', 60);
echo 'img src=1.jpeg';
ImageDestroy($im);
echo 'br'.$R.'br'.$G.'br'.$B.'br';
// --
?
/body
/html

END CODE---
Thanks again,
Ashwin Purohit
It's fairly simple...
the hex color code is just: #RRGGBB
So use the string functions to separate out each color (probably substr) 
then use hexdec to convert it into a decimal number.

Chris
Ashwin Purohit wrote:
Hello Everyone,
I would like to know if there is some way to write a script so that I can 
input a Hex color code and have it output to RGB coordinates so as to 
prevent users from having to search for the color codes? I will use that 
feature so that I can create dynamic images.

Thanks in advance,
Ashwin Purohit.
_
MSN Toolbar provides one-click access to Hotmail from any Web page – FREE 
download! http://toolbar.msn.click-url.com/go/onm00200413ave/direct/01/

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


Re: [PHP] Converting Hex to RGB

2004-06-08 Thread Ashwin Purohit
Sorry Please view the script here (I didn't know it would convert to HTML):
http://www.thegarlic.homeip.net/graphics/button.txt
Thanks.
_
Is your PC infected? Get a FREE online computer virus scan from McAfee® 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

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


[PHP] Text file wont' have newlines?

2004-05-29 Thread Ashwin Purohit
Hi everybody,
I have this script in a file that allows users to upload files, and I want 
to know who submitted what so I write $userfile_name and $credit1(their 
name) to CREDIT.txt in the same directory like so :

$credit = $userfile_name.': '.$credit1.\n;
$fp = fopen('CREDIT.txt','a');
fwrite($fp, $credit);
fclose($fp);
But every new submission ends up on the same line, there is never a line 
break in the text. Any suggestions?

Thanks,
AMP
_
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/

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


Re: [PHP] Text file wont' have newlines?

2004-05-29 Thread Ashwin Purohit
Ok, thanks much! It works now.
Needs a new line and return.
fwrite($fp, ($credit . \n\r) );
Hi everybody,

I have this script in a file that allows users to upload files, and I 
want
to know who submitted what so I write $userfile_name and $credit1(their
name) to CREDIT.txt in the same directory like so :

$credit = $userfile_name.': '.$credit1.\n;
$fp = fopen('CREDIT.txt','a');
fwrite($fp, $credit);
fclose($fp);

But every new submission ends up on the same line, there is never a line
break in the text. Any suggestions?

Thanks,
AMP

_
FREE pop-up blocking with the new MSN Toolbar  get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/

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



_
Stop worrying about overloading your inbox - get MSN Hotmail Extra Storage! 
http://join.msn.click-url.com/go/onm00200362ave/direct/01/

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


[PHP] Making comments on website items, etc...

2004-04-22 Thread Ashwin Purohit
Hi all,

I have a website where I have uploaded a few of my drawings, etc. I want to 
know how to write a simple php script so that people can post comments 
beneath the pictures for all to view. If somebody could point me to some 
tutorial or run me through real quick, it'd be much appreciated. Thanks.

AMP

_
Is your PC infected? Get a FREE online computer virus scan from McAfee® 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

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


[PHP] Comments beneath Images

2004-04-22 Thread Ashwin Purohit
Hi all,

I have a website where I have uploaded a few of my drawings, etc. I want to 
know how to write a simple php script so that people can post comments 
beneath the pictures for all to view. If somebody could point me to some 
tutorial or run me through real quick, it'd be much appreciated. Thanks.

AMP

_
MSN Toolbar provides one-click access to Hotmail from any Web page – FREE 
download! http://toolbar.msn.com/go/onm00200413ave/direct/01/

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