[PHP-DB] textarea data and printing

2003-03-12 Thread Rajesh Fowkar
Hi,

We are accepting Detailed description of the item in
Textarea/Textarea.

Is there any function which can return full words without breaking the
lines. The data is stored in a PostgreSQL database in varchar field.

item_detail_description varchar(200)

I am assuming that the user need not press the 'enter' key at the end of
each line. Hence by using the 'carriage return' code this function
cannot be written. I was interested in knowing if any such function
already exists.

Thanks in advance.

Peace

--
Rajesh
:
[ GNU/Linux One Stanza Tip (LOST) ]###

Sub : Locating a command (whereis)   LOST #126

To locate the  binary, source, and  manual page for a command,
try : whereis command [e.g. whereis man].  See man pages for
detailed filter options) 
For merely knowing where it lies: which command

[EMAIL PROTECTED]##
:

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



Re: [PHP-DB] php and local printing

2003-03-04 Thread Rajesh Fowkar
On Tue, Mar 04, 2003 at 06:45:54AM -0800, Mark wrote:

It dopesn't seem like you got an answer to this. 

Spot on. Yours is the first reply.

To print locally,
you'll need to use Jscript of something similar on the local end.
I've only seen this work in IE, but I haven't looked into it too
deeply. To print to the server, you'll probably need to shell out to
the OS.

Using javascript window.print() I get the print dialogue box. But what
I needed was I have got a text file which on server I can print using lp
filename. Similar thing but without any print dialogue box at the
client end.


HTH or at least starts a discussion...

Hope so.

Thank you for the reply.

Peace

--
Rajesh
:
[ GNU/Linux One Stanza Tip (LOST) ]###

Sub : Linux Commands (#4)LOST #056

For a newbie introduction to Linux commands and shotcuts visit
URL: http://sunsite.dk/linux-newbie/Linux_commands.htm

[EMAIL PROTECTED]##
:

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



[PHP-DB] php and local printing

2003-03-03 Thread Rajesh Fowkar
Hello,

What is the best way to print on a locally connected printer from php ?

For printing we want to give the user three options :

1. Screen

2. Local Printer

3. Server Printer

What you guys are using for printing on locally connected printer from
php.

Thanks in advance.

Peace

--
Rajesh
:
[ GNU/Linux One Stanza Tip (LOST) ]###

Sub : kill-proc (killing user process by an user)LOST #285

#!/bin/sh
ps -aef | grep $USER
echo -en Process-No to kill : ; read P_ID
kill $P_ID
 
[EMAIL PROTECTED]
:

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



Re: [PHP-DB] Re: php date manupulation functions

2003-02-16 Thread Rajesh Fowkar
On Sun, Feb 16, 2003 at 08:14:57AM -0800, David Chamberlin wrote:



David Elliott wrote:
try

?
echo date(d,$dbdate).br;
echo date(m,$dbdate).br;
echo date(y,$dbdate).br;
?

I thought date() took a timestamp, not a string.  Here's what I do:

$timestamp = $dbdate;
echo date(d,$timestamp)
echo date(m,$timestamp)


I did this :

$dob= explode('-', $aAns[dob]);

This gives me an array of $dob with yy, mm and dd.

Thanks to those who replied.

Peace

--
Rajesh

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




[PHP-DB] php date manupulation functions

2003-02-15 Thread Rajesh Fowkar
Hello,

There seems to be very few date manupulation functions in php.

In my php form I am displaying select combos for day, month and year.

Now while updating the form I want to retrieve the date and take out day,
month and year from that date and display the correct selection in the
combo. I could not find any function like say

day($dbdate);
month($dbdate);
year($dbdate);

Am I missing something ? Is there anyway to accomplish the above ? or I
will have to store these three values separatly in the database rather than
as a date.

Thanks in advance.


Peace

--
Rajesh *  [EMAIL PROTECTED]  *  http://www.symonds.net/~rajesh/
Powered By : Debian GNU/Linux 3.0 (Woody) - [Kernel 2.4.18(ext3),Mutt 1.5.1i]
Women are always anxious to urge bachelors to matrimony; is it from charity,
or revenge?
-- Gustave Vapereau

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




[PHP-DB] php oops

2003-02-11 Thread Rajesh Fowkar
Hello,

Is there any site which contains some tutors or some details regarding
OOPS (Object Oriented Programming) using PHP ?

Thanks in advance.

Peace

--
Rajesh
:
[ GNU/Linux One Stanza Tip (LOST) ]###

Sub : Console boot (debian systems)  LOST #045

To boot into  console with  xdm/ gdm/ kdm installed, changing
at /etc/inittab does not help.  Use the [update-rc.d] program
meant for changing init parameters in Sys-V init process. All 
system startup links for /etc/init.d/xdm will be removed. viz
   
#update-rc.d -f xdm remove(or gdm / kdm)

[EMAIL PROTECTED]###
:

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




Re: [PHP-DB] Make thumbnail of a jpg image.

2003-01-30 Thread Rajesh Fowkar
On Thu, Jan 30, 2003 at 09:41:37PM -0800, Rene Groothuis (Aeqis) wrote:

Hi All,

Small question: How can I make a thumbnail of a jpg image?

Your help is appreciated.

Take a look at the following Image manupulation functions in PHP :

ImageCreateFromJPEG()
ImageCopyResized()
ImageJPEG()



Peace

--
Rajesh
:
[ GNU/Linux One Stanza Tip (LOST) ]###
  
Sub : Searching for strings in files LOST #172

In order to search for a string in some files, use:
grep string filename1 [filename2 filename3 ...]
This will  print out the  filename  and the  lines in the file
that contain the string.  Type 'man grep' for details.

From : freebsd fortune##
:

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




Re: [PHP-DB] Help/Advice/Suggestions need to Upload 9 images on one submit button.

2003-01-28 Thread Rajesh Fowkar
On Tue, Jan 28, 2003 at 10:44:47PM +0100, Geckodeep wrote:

Hi Rajesh



First of all I'd like to thank you for your time.

No hassles.


I got the script working in a way that it feeds my DB table, but I am
getting this error message: Warning: copy() [function.copy]: Unable to
access in upload1.php on line 28.

this is what I have in the 28th line :
if(!copy($_FILES['img_name1']['tmp_name'],
./repor_images/$_FILES['img_name1']['tmp_name'])):;

I have never come across the above error message. It looks like copy
function is not allowed on the webserver.


for the moment I am trying it with one field and I am waiting to see if it's
working, and  I'll had the rest with the Captions to go with the images.

One thing I've forgot to say is though in my database instead of just having
the name of the image copied from the source (Form Field) I have the whole
path in the field (  /var/www/12/1/7/-/site/www/php1PWwsF  ), is it normal
or what?.

In my application, I am uploading the file and than creating a thumbnail
from it and storing both image as well as thumbnail in mysql blob field.

if (!is_uploaded_file($_FILES['Imagefile1']['tmp_name']))
{
$sErrorStr .= Error Uploading File: '$Imagefile1'. .
   Either the File Type is Invalid or some connectivity problem, 
Check out ;
}
else
{
$imgtype = $_FILES['Imagefile1']['type'];
copy($_FILES['Imagefile1']['tmp_name'], './tmp/downloadedfile1.jpg');
$filename = './tmp/downloadedfile1.jpg';
create_thumbnail($filename, $imgtype, $escaped_image, $escaped_thumbnail);
}


I've looked up in the PhpManual for copy() and it says it takes two
arguments, in that case if I did put it in this way will it work
copy($img_name1,/repor_images/$id.$img_name1); // $img_name1 as the source
and repor_images/$id.$img_name1 as the destination,

Should work.

I also have few questions.

Does that mean I have to have 9 copy functions as above, and just change the
img_nameX?.

Yes. 


Do I have to mention File size and file type for all the file Fields in the
form or will it be ok just to mention once just above the submit button?.

I feel it is required for all the fields. More experienced souls on the
list, please comment.


Peace

--
Rajesh
:
[ GNU/Linux One Stanza Tip (LOST) ]###
  
Sub : Spell check within MuttLOST #157

If you have the ispell package  (interactive spelling checker)
installed, and maybe your preferred dictionary file iamerican,
ibritish (whatever), press i after finishing composition and
prior to sending mail (under mutt) ... 

[EMAIL PROTECTED]###
:

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




Re: [PHP-DB] Help/Advice/Suggestions need to Upload 9 images on one submit button.

2003-01-27 Thread Rajesh Fowkar
On Mon, Jan 27, 2003 at 05:05:02PM +0100, Geckodeep wrote:

Hi,

Can any one guide me through the uploading file procedure please?
Should I use copy() function to copy the image file to a temp file and
rename it to the real name and then reference the name in the data base.
Or is there any other way.
Should say though my Service Provider does not support exec(cp $picture
/full/path/to/joesauto/images/$picture_name) as explained in one of the
article in phpbuilder by Willim Samplonius.

All file system functions are not supported ?

Otherwise you case use copy() function rather than exec().

copy($_FILES['Imagefile1']['tmp_name'], 
'./full/path/to/joesauto/images/$_FILES['Imagefile1']['tmp_name']');

Here Imagefile1 is the 'name' in the html form.

td width=30%bPicture 1 (jpeg/png/gif)/b/td
td
   input type=hidden name=MAX_FILE_SIZE value=2
   input maxLength=128 name=Imagefile1 type=file ACCEPT=image/png, image/jpeg, 
image/jpg, image/gif
/td

HTH

Peace

--
Rajesh
:
[ GNU/Linux One Stanza Tip (LOST) ]###
  
Sub : Lesser known commands (tac)LOST #165

Everybody has heard of cat, to concatanate files  and print to
standard output. But have you heard of tac ? This reads file
reverse. Try 'tac somefile.txt' and have a look ...  or better
still 'tac somesound.au  /dev/audio' ... Enjoy !

[EMAIL PROTECTED]
:

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




Re: [PHP-DB] Basic HTTP authentication

2003-01-24 Thread Rajesh Fowkar
On Fri, Jan 24, 2003 at 11:50:09AM -0800, web man wrote:

hi GUys
Please this may sound too elementary but 
I need your help.
How can I configure apache httpd.con file in
order to support the use of Basic HTTP authentication.
I am using apache 1.3.26 on windows.

Take a look at the Apache manual. Everything there is to the point,
precise and very easy to understand.

Peace

--
Rajesh
:
[ GNU/Linux One Stanza Tip (LOST) ]###

Sub : Knowing contents of .tbz files LOST #358

Knowing the contents of a .tbz file is a one step process:
$tar -tyvf filename.tbz | less
A .tbz file is essentially a bzipped-tarball (.tar.bz) file.

[EMAIL PROTECTED]
:

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




[PHP-DB] difference between two dates

2003-01-19 Thread Rajesh Fowkar
Hello,

In my application I am accepting Day, Month and Year from a Select List.
What I want to do is calculate the age of the person based on the above
selection.

$cboDD is the day variable
$cboMM is the month variable
$cboYY is the year variable

I tried this :

$dobtimestamp = mktime(0,0,0,$cboMM,$cboDD,$cboYY);
$todaytimestamp = time();
$txtAge = ($todaytimestamp - $dobtimestamp)/86400;

It does not give me the expected output.

Can anybody suggest something ?

Thanks in advance.


Peace

--
Rajesh *  [EMAIL PROTECTED]  *  http://www.symonds.net/~rajesh/
Powered By : Debian GNU/Linux 3.0 (Woody) - [Kernel 2.4.18(ext3),Mutt 1.5.1i]
What we anticipate seldom occurs; what we least expect generally happens.
-- Bengamin Disraeli

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




Re: [PHP-DB] difference between two dates

2003-01-19 Thread Rajesh Fowkar
On Sun, Jan 19, 2003 at 09:34:02AM -0500, John W. Holmes wrote:

 I tried this :
 
 $dobtimestamp = mktime(0,0,0,$cboMM,$cboDD,$cboYY);
 $todaytimestamp = time();
 $txtAge = ($todaytimestamp - $dobtimestamp)/86400;
 
 It does not give me the expected output.
 
 Can anybody suggest something ?

Keep your mktime() as it is, that's correct. Then use something like
this to calculate the age:

$age = date('Y',$now) - date('Y',$dob) -
((date('z',$now)=date('z',$dob)) ? 0 : 1);

where $dob and $now are the appropriate unix timestamps that you've
already got calculated with mktime() and time().

Thanks a lot. 

Peace

--
Rajesh
:
[ GNU/Linux One Stanza Tip (LOST) ]###

Sub : ext3 file system   LOST #034

To implement ext3 filesystem have a good look here (Cool) :
http://www.uow.edu.au/~andrewm/linux/ext3/ext3-usage.html

[EMAIL PROTECTED]###
:

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




[PHP-DB] Empty date passing to Postgres Stored Procedure from PHP

2003-01-16 Thread Rajesh Fowkar
Hi,

In my application I am passing a date field to the postgres stored
procedure. The problem is when the date field is blank.

My code is like this :

-
THBill Date:/TH
TD
   INPUT TYPE=text NAME=txtBillDate 
  VALUE=? echo $txtBillDate ? SIZE=10 MAXLENGTH=10
/TD
-

I pass the parameters to the stored procedure like this :

-
$sSql = select grn_actions
 ('FREE','$sYearId','$sUserId',1,1,'$hdnGrnType',
 '$txtGrnNumber','$txtGrnDate', '', '', '',
 '$txtSupplierCode','$txtBillNumber','$txtBillDate',
 '$txtChallanNumber','$ParamStr') as tr_id;
-

No if in the above case $txtBillDate is blank, php throws the following
error :

-
PostgreSQL query failed: ERROR: Bad date external representation '' in
/home/rajesh/public_html/inv/php/INVGoodsReceiptNoteFreeAddUpd.php on
line 478
-

My stored procedure declaration is as below :

-
CREATE FUNCTION
grn_actions(varchar,char,char,integer,integer,char,char,date,char,char,char,char,varchar,date,varchar,varchar)
returns char as '
DECLARE
vdocument_type   alias for $1;
cyear_id alias for $2;
cuser_id alias for $3;
iform_id alias for $4;
iaction_id   alias for $5;
cgrn_typealias for $6;
cgrn_number  alias for $7;
dgrn_datealias for $8;
cpurchase_order_year_id  alias for $9;
cpurchase_order_type alias for $10;
cpurchase_order_number   alias for $11;
csupplier_code   alias for $12;
vbill_number alias for $13;
dbill_date   alias for $14;
vchallan_number  alias for $15;
funcparam_stralias for $16;
-

Can anybody tell me how should I pass the date in case it is blank ? The
above field txtBillDate can be blank is certain cases.

Thanks in advance.

Peace

--
Rajesh
:
[ GNU/Linux One Stanza Tip (LOST) ]###

Sub : Linux Commands (#1)LOST #021

No consolidated command list. Do an ls for the following dirs:
/sbin, /usr/sbin   ... for system related commands
/bin, /usr/bin, /usr/local/bin   ... for user commands
/usr/X11R6/bin  ... for X program commands

[EMAIL PROTECTED]
:

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




[PHP-DB] inserting spaces in the select combo box

2003-01-12 Thread Rajesh Fowkar
Hi,

I am trying to align the three values in the select combo box but it is
not working. The code is below :

for($nRow=0; $nRow  $nNumRows; $nRow++)
{
$aAns = pg_fetch_array($lResult, $nRow, PGSQL_ASSOC);

$JoinedValue = $aAns[location_code] . $aAns[section_code] .
   $aAns[part_number] .
   $aAns[uom] . $aAns[item_short_description];
echo option value='$JoinedValue' .
str_pad(trim($aAns[item_short_description]),25,'-') .
| . $aAns[location_code]. / . $aAns[section_code] . / .
$aAns[part_number] .
 /option;
};

The size of item_short_description is 25. But when it is retrieved from
the database it is of the actual size of the description. Due to this
everything in the select box looks zigzag. str_pad though puts spaces
those are not considered spaces in html. I think I will have to put
something like nbsp;. 

Can anybody help me in the above problem.

Thanks in advance.

Peace 

--
Rajesh
:
[ GNU/Linux One Stanza Tip (LOST) ]###

Sub : bash keystrokes (#4)   LOST #337

C-l : clear screen  [C = Ctrl key]
C-_ : undo last action
C-r : reverse search in history with completion as you type 
  (even searches through different arguments)

[EMAIL PROTECTED]##
:

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




[PHP-DB] Textarea, File Upload field setting values

2003-01-04 Thread Rajesh Fowkar
Hi,

I can write a code like :

input type=text name=txtfield1 value=? $txtfield1 ?

Thus I can set the value of $txtfield1 and it is reflected in the above
textbox.

How can such thing be done with TextArea and File upload ?

input maxLength=128 name=Imagefile type=file 
value=? echo $Imagefile ?

textarea name=txtDescription rows=25 cols=80 
maxlength=1000 value=? $txtDescription ?/textarea

The above stuff is not working. Is it possible to accomplish the above
stuff ? I need this since I am calling the same form on submit for
validation and hence will need the values of the above also to remain
intact in case of error in any other fields.

Thanks in advance.

Peace

--
Rajesh *  [EMAIL PROTECTED]  *  http://www.symonds.net/~rajesh/
Powered By : Debian GNU/Linux 3.0 (Woody) - [Kernel 2.4.18(ext3),Mutt 1.5.1i]
It's not the valleys in life I dread so much as the dips.
-- Garfield

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