[PHP] problem with storing & displaying image in db

2001-04-24 Thread Keyur Kalaria

Hello everybody,

I am facing a strange problem while uploading and displaying images in a
database table.

I have taken blob field to store the images.

Images which are less then around 100kb are stored & displayed properly but
images which are greater than 100kb are giving problems while displaying
although no errors were generated while inserting them in database.

what could be the problem ? is it due to the blob type ?

i am using the following statements to insert the file to database.

insert.php
***
$imgsize=GetImageSize($photofile);
$photo=addslashes(fread(fopen($photofile, "r"), filesize($photofile)));
$query="insert into photo(photoformat,photo,photowidth,photoheight) values
('$photoformat','$photo',$imgsize[0],$imgsize[1])";

$photoformat, $photofile are the input fields of the form which is
submitted.

***

in my html pages i use the following  :



and my display.php is as follows:

display.php
***
$query="select * from photo where id='$id'";
$result=mysql_query($query);
$photo_rec=mysql_fetch_array($result);
Header( "Content-type: image/$photo_rec[photoformat]; name=".microtime());
echo $photo_rec["photo"];

***


Thanks in advance

Keyur
$$$



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] include file by .htaccess

2001-04-24 Thread Keyur Kalaria

Hello,

How can I include any html or php file via .htaccess .

I want to include an html file in a site contaning around 1000 pages. I want
to add  header & footer dynamically on these pages .
Is there any way to include header & footer on these pages using .htaccess
file.


thanks in advance

keyur
$$$



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] include file by .htaccess

2001-04-24 Thread Keyur Kalaria

Hello,

How can I include any html or php file via .htaccess .

I want to include an html file in a site contaning around 1000 pages. I want
to add  header & footer dynamically on these pages . Is there any way to
include header & footer on these pages using .htaccess file.


thanks in advance

keyur
$$$


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] problem with storing & displaying image in db

2001-04-24 Thread Keyur Kalaria

Hello everybody,

I am facing a strange problem while uploading and displaying images in a
database table.

I have taken blob field to store the images.

Images which are less then around 100kb are stored & displayed properly but
images which are greater than 100kb are giving problems while displaying
although no errors were generated while inserting them in database.

what could be the problem ? is it due to the blob type ?

i am using the following statements to insert the file to database.

insert.php
***
$imgsize=GetImageSize($photofile);
$photo=addslashes(fread(fopen($photofile, "r"), filesize($photofile)));
$query="insert into photo(photoformat,photo,photowidth,photoheight) values
('$photoformat','$photo',$imgsize[0],$imgsize[1])";

$photoformat, $photofile are the input fields of the form which is
submitted.

***

in my html pages i use the following  :



and my display.php is as follows:

display.php
***
$query="select * from photo where id='$id'";
$result=mysql_query($query);
$photo_rec=mysql_fetch_array($result);
Header( "Content-type: image/$photo_rec[photoformat]; name=".microtime());
echo $photo_rec["photo"];

***


Thanks in advance

Keyur
$$$




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] checkbox validation

2001-04-24 Thread Keyur Kalaria

Hi jacky,

put an empty square bracket after the variable name as follows:


assuming that your above statement is in a loop we will have following
structure:
*




etc...





now when you submit the form, an array named id[ ] will be posted .
this array will contain the number of elements/checkbox  which were checked
on.
so out of 25 checkboxes if you select only 5 checkboxes, then the size of
the array id[ ] will be only 5.

so with another loop you can retrieve all the values as follows:
***
$i=0;
while($i
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 19, 2001 1:13 AM
Subject: [PHP] checkbox validation


Hi all
I have a form with the checkbox like this

$query="select id from foo";
$result=($query,$con);
while ($row = mysql_fetch_array($result))
 {

 }
submit button and stuffs here...


After I submit to next page, at next page, how do I check which check box is
checked?
like this?

if ($id=="on") {
do something
}else{
do something
}

I did try this but did not work, what am i suppose to do to achieve this?
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include file using .htaccess

2001-04-23 Thread Keyur Kalaria

thanks for that , it is working fine.

keyur


- Original Message -
From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
To: "Keyur Kalaria" <[EMAIL PROTECTED]>
Cc: "php" <[EMAIL PROTECTED]>
Sent: Saturday, April 21, 2001 9:18 PM
Subject: Re: [PHP] include file using .htaccess


> Make sure AllowOverride includes Options and put these lines in your
> .htaccess:
>
> php_value auto_prepend_file header.html
> php_value auto_append_file footer.html
>
> -Rasmus
>
> On Sat, 21 Apr 2001, Keyur Kalaria wrote:
>
> > Hello,
> >
> > How can I include any html or php file via .htaccess ?
> >
> > I want to include an html file in a site contaning around 1000 pages. I
want
> > to add  header & footer dynamically on these pages .
> > Is there any way to include header & footer on these pages using
.htaccess
> > file.
> >
> >
> > thanks in advance
> >
> > keyur
> > $$$
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] problem with storing & displaying image in db

2001-04-21 Thread Keyur Kalaria

Hello everybody,

I am facing a strange problem while uploading and displaying images in a
database table.

I have taken blob field to store the images.

Images which are less then around 100kb are stored & displayed properly but
images which are greater than 100kb are giving problems while displaying
although no errors were generated while inserting them in database.

what could be the problem ? is it due to the blob type ?

i am using the following statements to insert the file to database.

insert.php
***
$imgsize=GetImageSize($photofile);
$photo=addslashes(fread(fopen($photofile, "r"), filesize($photofile)));
$query="insert into photo(photoformat,photo,photowidth,photoheight) values
('$photoformat','$photo',$imgsize[0],$imgsize[1])";

$photoformat, $photofile are the input fields of the form which is
submitted.

***

in my html pages i use the following  :



and my display.php is as follows:

display.php
***
$query="select * from photo where id='$id'";
$result=mysql_query($query);
$photo_rec=mysql_fetch_array($result);
Header( "Content-type: image/$photo_rec[photoformat]; name=".microtime());
echo $photo_rec["photo"];

***


Thanks in advance

Keyur
$$$





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] include file using .htaccess

2001-04-21 Thread Keyur Kalaria

Hello,

How can I include any html or php file via .htaccess ?

I want to include an html file in a site contaning around 1000 pages. I want
to add  header & footer dynamically on these pages .
Is there any way to include header & footer on these pages using .htaccess
file.


thanks in advance

keyur
$$$




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] store array in a file?

2001-04-16 Thread Keyur Kalaria

Hello Jaxon,

use serialize() & unserialize() as follows:

$store_in_file=serialize(your_array);
//and store the details of $store_in_file in your file/database.

//while retrieving read the data from file/database into store_in_file and
then use the following.
$retrieve_from_file=unserialize($store_in_file);

$retrieve_from_file will be similar to "your_array"

read the php4.0 & greater manual you will find these functions to be very
helpful..


hope this serves your purpose.

regards

Keyur
$$$




- Original Message -
From: "jaxon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 16, 2001 5:02 AM
Subject: [PHP] store array in a file?


>
> Hey all, can someone make a recommendation here?
>
> I want to keep site structural info pulled from a database in an array,
and
> store it in a flat file that can eliminate the database hit.
>
> Then I'll just delete the file when structure changes, and regenerate it
> with a call to a recreation script that does the necessary sql once.
>
> So
>  - does this make sense?
>  - how to sore the array in a flat file
>  - any way to make the array global once loaded?
>
> Thanks for any pointers!
>
> cheers,
> jaxon
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] antifraud logic for voting poll, banner clicks

2001-04-13 Thread Keyur Kalaria

Hello everybody,

I am working on a banner exchange site and a site rating script.

Can anyone suggest me how to avoid the fraud rating and fraud banner clicks.
What all things we need to take care for the same etc.

Thanks in advance.

Keyur


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Need a URL....

2001-04-13 Thread Keyur Kalaria

it is 

http://marc.theaimsgroup.com/

regards
keyur


- Original Message - 
From: "rm" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, April 14, 2001 11:23 AM
Subject: [PHP] Need a URL


> My hard drive died, lost my bookmarks.  Can someone
> post the url of the site that archives this list...it
> was marc something or otherneed to find a piece of
> code I know was posted to this listthank
> 
> rm
> 
> __
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail. 
> http://personal.mail.yahoo.com/
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] how to get num of sessions vars?

2001-04-13 Thread Keyur Kalaria

Hey Dave,

you can try the following:

num = sizeof($HTTP_SESSION_VARS);


regards
keyur


- Original Message - 
From: "phpman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 13, 2001 8:40 PM
Subject: [PHP] how to get num of sessions vars?


> I thought this would work..
> 
> $num = count($HTTP_SESSION_VARS);
> 
> ..but it doesn't. I can access the session vars themselves, so I know
> they're there. Help.
> 
> -Dave
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] site review

2001-04-11 Thread Keyur Kalaria

Hello everybody,

I recently developed this site :  http://www.goodlookingindia.com  .
I am adding many more sections in it. 

Pl. let me know how can i improve the performance of this site.
Your reviews will be very helpful to me.

Thanks in advance.

Keyur
$$$






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] user login

2001-04-10 Thread Keyur Kalaria

You can use session management

keyur


- Original Message -
From: "george" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 10, 2001 8:19 PM
Subject: [PHP] user login


> I know it is possible, I'm just not sure how, but I want a user to log
into
> the site  then if they enter information into a form the database not only
> stores the form info but also who entered it, so I would have a field
called
> user and it would either get theinformation from a cookie,which I have
> already tried but am not having much luck with or is there a way of
avoiding
> cookies altogether and using the database on it's own,  which would suit
me
> better.
>
>  Thanks in Advance
>
> George
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Review

2001-04-10 Thread Keyur Kalaria

Hello everybody,

I recently developed this site :  http://www.goodlookingindia.com  .
I am adding many more sections in it. 

Pl. let me know how can i improve the performance of this site.
Your reviews will be very helpful to me.

Thanks in advance.

Keyur
$$$





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Commercial sites that use PHP

2001-04-10 Thread Keyur Kalaria

this is a commercial site.

site :  http://www.goodlookingindia.com

pl. send me your complete reviews on it . it will be very very helpful to
me.

-
keyur
$$$


- Original Message -
From: "Phil Labonte" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 10, 2001 7:22 PM
Subject: [PHP] Commercial sites that use PHP


> Can anyone send me a list of large commercial web sites that use PHP?
>
> I am trying to move to PHP here at work but I need some examples to
impress
> the boss!!!
>
> Thanks
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Upload file from my local C:

2001-04-10 Thread Keyur Kalaria

Hi Reiniger,

try this : copy(addslashes($file),"1.dat")

hope it is clear.

keyur



- Original Message - 
From: "Christian Reiniger" <[EMAIL PROTECTED]>
To: "HK Woo" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, April 10, 2001 4:15 PM
Subject: Re: [PHP] Upload file from my local C:


On Monday 09 April 2001 18:35, you wrote:
> Christian
>
> Below is my script.
>
>  if (!copy($file,"1.dat")) {
> echo "error"; }
> else {
> echo "successful";
> }
> ?>
>
> NOTE: where $file is passed by other html using form.

how? using a  ?
Then re-read the file uploading chapter in the manual

> > I use a command "copy" to upload a file from my local win machine to
> > webserver. However, it is not successful. It prompts that "Warning:
> > Unable to open 'D:\\PHP\\upload1.php' for reading:". I would like to
> > know what is the problem

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

A - American Association Against Acronym Abuse

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] what does this error means?

2001-04-10 Thread Keyur Kalaria

Hi Jacky,

This means that your key 1 i,e the first field in the table is a primary key
and the table contains a record which has a value 10 in the first field.

Hope this is clear.

Keyur
$$$


- Original Message -
From: "Jacky@lilst" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 11, 2001 3:55 AM
Subject: [PHP] what does this error means?


> When Itried to insert a record into a table, It looks like the record was
> never inserted into table so I use mysql_error() and the error message
show
> up:
> "Duplicate entry '10' for key 1"
> What does that tell me?
> Jack
> [EMAIL PROTECTED]
> "There is nothing more rewarding than reaching the goal you set for
> yourself"
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] page counter

2001-04-09 Thread Keyur Kalaria

Hi wen,

Make sure that the counter file is readable by the user apache or user
nobody which ever is your default webserver user. If it is not then just
chown it to nobody or chmod it to 777 and you are done.

Keyur


- Original Message -
From: "Keyur Kalaria" <[EMAIL PROTECTED]>
To: "Wen Ni" <[EMAIL PROTECTED]>
Sent: Tuesday, April 10, 2001 12:25 PM
Subject: Re: [PHP] page counter


> Hi
>
> Make sure that the counter file is readable by the user apache or user
> nobody which ever is your default webserver user.
> If it is not then just chown it to nobody or chmod it to 777 and you are
> done.
>
> Keyur
>
>
>
>
> - Original Message -
> From: "Wen Ni" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, April 10, 2001 11:08 AM
> Subject: [PHP] page counter
>
>
> > I got an example from the internet about the PHP page counter.  However
> > after several testing on the coding, I still met the problem which I
> > don't understand.  Please help me.
> >
> >  > $counter_file =
> > "/home/venus/public_html/qa/doccon/doc_distribution/count.txt";
> >
> > $counter_file_line = file($counter_file);
> >
> > $counter_file_line[0]++;
> >
> > print "counter=$counter_file_line\n";
> > $cf = fopen($counter_file,"w");
> > fputs($cf, "$counter_file_line[0]");
> > fclose($cf);
> >
> > echo $counter_file_line[0];
> >
> > ?>
> >
> > problems:
> >
> > Warning:
> >
fopen("/home/venus/public_html/qa/doccon/doc_distribution/count.txt","w")
> > - Permission denied in
> > /home/venus/public_html/qa/doccon/doc_distribution/New.php on line 9
> >
> > Warning: Unable to find file identifier 0 in
> > /home/venus/public_html/qa/doccon/doc_distribution/New.php on line 10
> >
> > Warning: Unable to find file identifier 0 in
> > /home/venus/public_html/qa/doccon/doc_distribution/New.php on line 11
> >
> >
> > 
> >
> > Thanks
> >
> > from: Wendy
> >
>
>
> --
--
> 
>
>
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]