[PHP] popping up download dialog box

2003-07-18 Thread Binay Agarwal
Hi every body !

I am writing a script which  pops up download dialog box on click of a Link. 

Headers i m sending out for downloading jpegs are:

header("Cache-control: private");
header("Content-Type: image/jpeg");
header("Content-Type: application/octet-stream");
header("Content-Length: $size");
header("Content-Disposition: attachment; filename=$fname");
header("Content-Transfer-Encoding: binary");
readfile($fname);

All these work well in MSIE 5.0+ and Netscape 4.7+ . But on Mac I.E its not popping up 
the dialog box rather it opens up the jpg file in the browser window. I don know where 
am i doing wrong. Please suggest me . I cracked my mind for hours but in vain. So 
please help me out.

Thanks in advance

Binay


Re: [PHP] popping up download dialog box

2003-07-18 Thread Binay Agarwal
Hi jason

Thanks for the quick suggestion. I tried removing the first content-type
header but still the problem reamains. I don know why??
Please let me know is there other way i can do the same?



Thanks
Binay

- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 18, 2003 4:00 PM
Subject: Re: [PHP] popping up download dialog box


> On Friday 18 July 2003 06:34, Binay Agarwal wrote:
> > Hi every body !
> >
> > I am writing a script which  pops up download dialog box on click of a
> > Link.
> >
> > Headers i m sending out for downloading jpegs are:
> >
> > header("Cache-control: private");
> > header("Content-Type: image/jpeg");
> > header("Content-Type: application/octet-stream");
> > header("Content-Length: $size");
> > header("Content-Disposition: attachment; filename=$fname");
> > header("Content-Transfer-Encoding: binary");
> > readfile($fname);
> >
> > All these work well in MSIE 5.0+ and Netscape 4.7+ . But on Mac I.E its
not
> > popping up the dialog box rather it opens up the jpg file in the browser
> > window. I don know where am i doing wrong. Please suggest me . I cracked
my
> > mind for hours but in vain. So please help me out.
>
> Having two Content-Type: headers is probably confusing the poor Macs. You
> don't want the first one anyway so remove it.
>
> --
> 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
> --
> /*
> When the speaker and he to whom he is speaks do not understand, that is
> metaphysics.
> -- Voltaire
> */
>
>
> --
> 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] help with explode.....

2003-07-24 Thread Binay Agarwal

> Okay... this probably isn't that hard to do... but I am just not sure to
> do it... so i will ask you guys... i amsure someone is going to have a
> one liner for me here!
>
> I am making a survey/poll builder everything is dynamic... there is an
> admin section where the user can make the new survey.. and set certain
> surveys as active but this where I am coming into some
> difficulties the program builds the form dynamically... all radio
> buttons... when the user submits the form i need to disect each form
> answer and then dump it into MySQL... So I need to know if I can do
> something like use the 'explode()' function no this... and assign them
> to variables... I need to draw out the radio button id and what they
> answered...

I really don know whether i got ur question or not. Probably ur questions is
abt fetching the radio buttons id and their corresponding values, when a
form is submitted .
Well if u have large number of radio buttons then give some common name to
all of them.
like radbut1, radbut2, radbut3 and so on

so u know anything starting from "radbut" is your radio button ..

now use $HTTP_POST_VARS or GET_VARS depending upon ur form method to
retrieve the variables/values pairs.
i.e
while(list($key,$value) = each($HTTP_POST_VARS))
{
if (eregi("radbut",$key)) // radio button
// Carry out operations u want

}




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



[PHP] Which templates to use??

2003-07-26 Thread Binay Agarwal
Hi all!

As a php developer i need to know how can i separate my "business logic tier" 
with "presentation". I mean wht all different kinds of php Templates are available and 
which one to go for better efficiency and speed? Where can i find the resources. 
Please help me out.

Thanks in advance

Binay


[PHP] FTP accounts

2003-08-04 Thread Binay Agarwal
Hi everybody!

can any body suggest me the good resources/snippet for creating and managing FTP 
accounts. 
My configuration includes:
Redhat : 7.0
Php - 4.0.6
Apache web server

Any help would be highly appreciated.

Thanks in advance

Binay


[PHP] Web tools for FTP accounts management

2003-08-04 Thread Binay Agarwal
Hi everybody!

can any body suggest me the good resources/snippet for creating and managing FTP 
accounts through web interface using PHP.

My configuration includes:
Redhat : 7.0
wu-ftpd (FTP Server)
Php - 4.0.6
Apache web server

Any help would be highly appreciated.

Thanks in advance

Binay



[PHP] PHP - Interpreted or Compiled Language

2003-08-14 Thread Binay Agarwal
Hi everybody

One basic question but still couldn't find the answer.

Is php Interpreted language or Compiled Language like C or C++.

Thanks in advance

Binay




Re: [PHP] PHP - Interpreted or Compiled Language

2003-08-14 Thread Binay Agarwal
Thanks jay for quick response

I'll tell you what really forced me to go in the matter of interpreted or
Compiled language.

In the heart of PHP 4+  is Zend Engine which compiles (often says) the php
code into some intermediate code called opcode and then Zend executor
executes them converting these opcodes to machine language. right??

If it is so why PHP is an Interpreted Language.

I have couple of more queries also.

1)Where to get information/resourse for PHP-GTK to be able to use it in the
application.
2) What are other options of compiling PHP.

Binay


- Original Message -
From: "Jay Blanchard" <[EMAIL PROTECTED]>
To: "Binay Agarwal" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, August 14, 2003 5:39 PM
Subject: RE: [PHP] PHP - Interpreted or Compiled Language


> [snip]
> Is php Interpreted language or Compiled Language like C or C++.
> [/snip]
>
> PHP is an interpreted language in most applications. However, the
> PHP-GTK is available and there are other options for compiling PHP.
>
>



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



[PHP] better understanding of ereg_replace and other functions

2003-08-16 Thread Binay Agarwal
Hi everybody,

Lot of places in manual i came across using "ereg_replace" or "ereg" is very resource 
intensive and hence its better to use "preg_replace" or "str_replace" or "strpos" if 
they do the jobs.

Now i am very curious to look at the source code (implementation) of these function so 
as to be able to decide the right choice for me. Can any one of you tell me where to 
find the source code of these functions. Do they require special privileges ??

Please help me out


Binay


[PHP] session.cookie_path problem

2003-08-18 Thread Binay Agarwal
Hi everybody

I am having problem with session.cookie_path. 
By deafult path is "/".

But what i think it should be client side path.. right?? In case client is win2k where 
does this cookie get saved.Any idea?

Binay


Re: [PHP] 2 questions

2003-08-23 Thread Binay Agarwal

- Original Message -
From: "Thomas Hochstetter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 23, 2003 5:33 PM
Subject: [PHP] 2 questions


> Hi guys.
>
> I have two questions for you today:
>
> 1. Weired login problem
> I am developinig a site for a conference where i have a login page for
> members. This page is called index.php and includes different types of
modules,
> according to the type of user logged on. The problem is now following:
> i have a login function hidden in a class, this function registers a bunch
> of variables. After the user has submited the details, index.php (which
calls
> the session_start()) calls the login function. Then i check whether a
session
> variable is present ($_SESSION['name']). If yes, we include the members
> area, otherwise we include the login table again. Now: on my test server
> (XP/Apache/php4.3.2) all is well. However, on the real server
(Linux/Apache/php4.0.x)
> it just includes the login table anyway, even if the login was successful.
I
> then have to click on the menu link again to include the member script.
> Why is that?

Check your register_globals setting in both ur test server and real server
and let me know.

>
> 2. Save a large amount of text to a file
> On the same page i have some type of cms going. The admin users can change
> txt files which relate to text on some of the general pages. I have now
found
> that it is only transmits a certain amount of text via GET to the function
> that writs to the files. Is there a restriction on passing text via url?
If yes
> (which will be the case), how could i do this otherwise?

Use POST instead of GET method... POST method allows u to even extend the
size of data being posted.

Hope this helps...

>
> Thanks so long...
>
> Thomas
> P.S: this list still rocks
>
> --
> COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
> --
> 1. GMX TopMail - Platz 1 und Testsieger!
> 2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
> 3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8.
e-Post
>
>
> --
> 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] Random selection

2003-08-23 Thread Binay Agarwal
Hi

You can use "select distinct names from table_name order by rand() limit 3".
Hope this helps and let me know.

cheers
Binay


- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 23, 2003 6:36 PM
Subject: [PHP] Random selection


> Hi,
>
> Can you help me with this one??
>
> In my mysql db i have a colum called names;
>
> In names their are:
>
> Frank
> Frank
> Bob
> Alice
> Bob
> Alice
> Jim
> Alice
> Frank
>
> I want to make a random selection (max 3 value's for example).. Only it
may not produce two times the same name. For example;
>
> This is the output:
>
> Frank, Jim, alice
>
> Wrong output
>
> Frank, Frank, Jim
>
> Please help!
>
> Thanks,
>
> Frank
>
>
>






> --
> 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] 2 questions

2003-08-25 Thread Binay Agarwal


- Original Message -
From: "Thomas Hochstetter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 24, 2003 12:54 AM
Subject: RE: [PHP] 2 questions


> The register globals is on with the live server, and off at home (my
version
> is 4.3.2, the other is 4.1.2). does that matter?
yes, it does matter .. Show me the snippet where u regestering/getting the
session variables if possible.

> Thanks for the other tip, shall try that ...
>
> Thomas
>
> - Original Message -
> From: "Thomas Hochstetter" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, August 23, 2003 5:33 PM
> Subject: [PHP] 2 questions
>
>
> > Hi guys.
> >
> > I have two questions for you today:
> >
> > 1. Weired login problem
> > I am developinig a site for a conference where i have a login page for
> > members. This page is called index.php and includes different types of
> modules,
> > according to the type of user logged on. The problem is now following:
> > i have a login function hidden in a class, this function registers a
bunch
> > of variables. After the user has submited the details, index.php (which
> calls
> > the session_start()) calls the login function. Then i check whether a
> session
> > variable is present ($_SESSION['name']). If yes, we include the members
> > area, otherwise we include the login table again. Now: on my test server
> > (XP/Apache/php4.3.2) all is well. However, on the real server
> (Linux/Apache/php4.0.x)
> > it just includes the login table anyway, even if the login was
successful.
> I
> > then have to click on the menu link again to include the member script.
> > Why is that?
>
> Check your register_globals setting in both ur test server and real server
> and let me know.
>
> >
> > 2. Save a large amount of text to a file
> > On the same page i have some type of cms going. The admin users can
change
> > txt files which relate to text on some of the general pages. I have now
> found
> > that it is only transmits a certain amount of text via GET to the
function
> > that writs to the files. Is there a restriction on passing text via url?
> If yes
> > (which will be the case), how could i do this otherwise?
>
> Use POST instead of GET method... POST method allows u to even extend the
> size of data being posted.
>
> Hope this helps...
>
> >
> > Thanks so long...
> >
> > Thomas
> > P.S: this list still rocks
> >
> > --
> > COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
> > --
> > 1. GMX TopMail - Platz 1 und Testsieger!
> > 2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
> > 3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8.
> e-Post
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
> --
> 1. GMX TopMail - Platz 1 und Testsieger!
> 2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
> 3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8.
e-Post
>
> --
> 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



[PHP] Cookie saving path on Clinet

2003-08-25 Thread Binay Agarwal
Hi Everybody

I know this is vague but couldn't find the answer.

Where (i mean system path) cookies are saved on Client's machine.

I though it is in windows/temp or temporaray internet files (in win 2000) but it 
wasn't there.

Please tell me.

Thanks
Binay


[PHP] Extracting EXIF/IPTC info from jpeg/tiff image files

2003-08-27 Thread Binay Agarwal
Hi everybody

I need to extract the information (EXIF and IPTC) from jpeg/tiff image files. After 
that i have to allow my client to modify and put them back in jpeg/tiff files.

I want to know whether php has got built-in support in terms of libraries to achieve 
the goal or i will have to load some external modules/software to do the same. In case 
external which all modules/software to refer?

Please let me know.

Thanks

Binay




[PHP] Extracting EXIF/IPTC info from jpeg and tiff files

2003-08-27 Thread Binay Agarwal
Hi everybody

I need to extract the information (EXIF and IPTC) from jpeg/tiff image files. After 
that i have to allow my client to modify and put them back in jpeg/tiff files.

I want to know whether php has got built-in support in terms of libraries to achieve 
the goal or i will have to load some external modules/software to do the same. In case 
external which all modules/software to refer?

Please let me know.

Thanks

Binay




Re: [PHP] converting date into database date format(newbie)

2003-08-29 Thread Binay Agarwal
Hi!

U can convert "8-Aug-03" into mysql date which requires -mm-dd format as
below.



Hope this helps and let me know.

Cheers

Binay

- Original Message -
From: "Anil Garg" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 29, 2003 11:01 AM
Subject: [PHP] converting date into database date format(newbie)


> Hi,
>
> I am a newbie to php.
>
> I am reading date in the format "08-Aug-03" from a text file. While
writing
> this date into the myqsl database's date column it shows '00-00-'.
> Is there a function or some other way to convert "08-Aug-03" type of dates
> in to format which is acceptable by date field of the mysql database.
>
> Thanks and regards
> Anil.
>
> --
> 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] server/browser dependancies?

2003-08-29 Thread Binay Agarwal
Hi!

Use 
 
instead of Find
and so

Hope this helps ..

Cheers
Binay


- Original Message -
From: "VB" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 29, 2003 11:36 AM
Subject: [PHP] server/browser dependancies?


> Hi,
>
> I am trying to come up with a form with more then one submit button, and
> am seeing some unexplainable results. Here is a small complete page to
> illustrate it:
>
>  cut here ===
> 
>  if (  $HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST"  ) {
> echo "action is " . $_POST["action"] . "\n";
> } else {
> ?>
> 
> 
> 
> Save
> 
> Find
> 
> 
> 
> 
> ===cut here==
> so, here are two buttons, one called Save and another one called Find.
> The idea is that $_POST["action"] will be set to the value of the button
> pressed. I tried it with php 4.3.0 and 4.3.2.
>
> The thing is that Mozilla 1.0.1 on Linux does behave this way:
> "action is Save" shows after hitting the 'Save' button, "action is Find"
> showa if the 'Find' button is pressed.
>
> IE of different versions though show only "action is Find", no matter
> what button I press!
>
> How is this at all possible - does the server's PHP code behave
> differently depensding on the client's browser type - I find it so hard
> to believe...
>
> Any ideas/suggestions on how to have browser invariant multiple submit
> buttons would be highly appreciated.
>
> --
> 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] problem with a mysql query with data from a form

2003-08-29 Thread Binay Agarwal

- Original Message -
From: "Vincent Fievet" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 29, 2003 11:55 AM
Subject: [PHP] problem with a mysql query with data from a form



-Message d'origine-
De : Vincent Fievet
Envoyé : mercredi 27 août 2003 10:44
À : '[EMAIL PROTECTED]'
Objet : problem with a mysql query with data from a form


hi,

i am a newbie to php and mysql, i run the easyphp kit ( php 4.2.0, Mysql
3.23.49 and phpmyadmin 2.2.6 )

i would like to use a select * from mytable where my variable like
'%$mystring%'
where $mystring come from a form



   '%Mike %
Communication Impliquant :
 
  
PC
   echo
  ...
  H10 Tango
   
  
 
1
...
10
  
  
 
  

so ,after choosing "PC" in the form,  in show.php i do a

$sql="SELECT * FROM journal WHERE a like '% $det%' OR de like '%$det%' order
by dateheure desc";
++
should be

$sql="SELECT * FROM journal WHERE a like '$det %' OR de like '$det %' order
by dateheure desc";
No need of prefixing $det with %
(blank space after $det.)

echo $sql;
and what i get is :

SELECT * FROM journal WHERE a like '%PC %' OR de like '%PC %' order by
dateheure desc
( note the blank space at the end of PC )
whitch doesnt get any record since the word i am looking is "PC" and not "PC
"
i used a "like" because the request should be used to find record with "PC
1" "PC" "PC 9" "PC12" ...

any ideas ?

Thanx

Vincent Fievet

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



[PHP] Tracking Bandwidth usage....

2003-09-01 Thread Binay Agarwal
Hi All,

I need to track the bandwidth usage of the different sites hosted on a server. How can 
i achieve this using PHP,Apache,mysql under Linux environment.

Please suggest me as it is urgently needed by client.

Thanks 

Binay


RE: [PHP] session variables

2003-09-01 Thread Binay Agarwal
Check out session.cookie_lifetime .. 
if lifetime =0 then session should disappear once you close the browser else it will 
stay the time specified in lifetime options.

Hope this helps and let me know.

Binay

"Diana Castillo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> I am having a weird problem, when I close all my browser windows and restart
> my application, the session variable which I set comes back suddenly, but
> only when I call a certain class .
> As far as I know the session variables should disappear when I close the
> browser.  Why would they suddenly come back?
> thank you