RE: [PHP] header() function for displaying an opened PDF document.

2003-10-13 Thread Bertrand Moulard
Might not be connected at all, but I had a similar problem with pdf stored
in a postgreSQL database as large object. The content type was set to pdf,
but ie wouldn't open it. It turned up that it was because there was a CRLF
at the end of one of my script, which spoiled the whole output. Pretty dumb
thing, but it kept me busy for a good hour. If you're desperate for a
solution, look for an unwanted new line somewhere in your file out of the ?
? tags.

good luck

.b

-Original Message-
From: Scott Fletcher [mailto:[EMAIL PROTECTED]
Sent: 13 October 2003 22:15
To: [EMAIL PROTECTED]
Subject: [PHP] header() function for displaying an opened PDF document.


I seem to be having problem with sending the PDF document to the browser to
be open on screen.  I kept getting the error message, it say 'Windows cannot
open this file'.  Here's my sample script, so what am I doing wrong?...

--snip--
header(Content-Type: application/pdf);
header(Content-Length: '40736');
header(Content-Disposition: inline; filename='junk.pdf');
--snip--

Thanks,
 Scott F.

--
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] header() function for displaying an opened PDF document.

2003-10-13 Thread Bertrand Moulard
now that I'm rethinking of it, I solved the problem by using the brilliant
python program tcpwatch, which logs all the http data going in and out your
browser. Very easy to run and so handy (not only for this problem). Would
find the url for dld if you want.

cheers

.b

-Original Message-
From: Scott Fletcher [mailto:[EMAIL PROTECTED]
Sent: 13 October 2003 22:15
To: [EMAIL PROTECTED]
Subject: [PHP] header() function for displaying an opened PDF document.


I seem to be having problem with sending the PDF document to the browser to
be open on screen.  I kept getting the error message, it say 'Windows cannot
open this file'.  Here's my sample script, so what am I doing wrong?...

--snip--
header(Content-Type: application/pdf);
header(Content-Length: '40736');
header(Content-Disposition: inline; filename='junk.pdf');
--snip--

Thanks,
 Scott F.

--
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] xml in php5.0.0beta1

2003-10-12 Thread Bertrand Moulard
Not to sure about what I'm saying, but if I remember well my readings
regarding php5 and xml, I think it implements the gnome libxml2, not libxml,
which is much better.
Hopefully php + xml will be less of a pain in the arse after the 5 is out.

cheers

.b

-Original Message-
From: Dennis Heuer [mailto:[EMAIL PROTECTED]
Sent: 12 October 2003 15:19
To: [EMAIL PROTECTED]
Subject: [PHP] xml in php5.0.0beta1


Hello -

Does the new xml api provide high level function calls (does it map the
libxml api)?

Regards

Dennis Heuer

--
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] Display a JPG Image

2003-10-10 Thread Bertrand Moulard


-Original Message-
From: Pushpinder Singh Garcha [mailto:[EMAIL PROTECTED]
Sent: 10 October 2003 17:06
To: [EMAIL PROTECTED]
Subject: [PHP] Display a JPG Image


Hello Everyone,

   I am trying to display a JPG image to a use, who has logged in. Some 
research on google revealed a way to do this. I am using the following 
code to display it.

if (session_is_registered(valid_user)){

if(session_is_registered(cmi)){

header(Content-type: image/jpg);
$file = docs/picture1.jpg;
header(Content-disposition: attachment; filename=$file );
readfile($file);

 } 

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



RE: [PHP] Display a JPG Image

2003-10-10 Thread Bertrand Moulard
try image/jpeg

cheers

.b

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



RE: [PHP] problem transferring a variable using POST

2003-10-09 Thread Bertrand Moulard
you might try to do some processing on the value
get the HTTP_POST_VARS[...], put it in a variable and see its type
(gettype()). Might give you some hints.

-Original Message-
From: Davy Campano [mailto:[EMAIL PROTECTED]
Sent: 09 October 2003 16:57
To: [EMAIL PROTECTED]
Subject: [PHP] problem transferring a variable using POST


I am having a problem with a form.  I am trying to have a form pass a
variable so that I can update an item.  I think the problem is that the
variable (ticketed) is being read as text instead of a number.  These
are the tests I have run.

This statement works:
$sql = 'UPDATE wo SET status = 1 WHERE ticket = 1'

This statement does not:
$sql = 'UPDATE wo SET status = 1 WHERE ticket =
$HTTP_POST_VARS[ticketed]'

Any suggestions...

If I do echo $HTTP_POST_VARS[ticketed];
It returns a 1

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



RE: [PHP] problem transferring a variable using POST

2003-10-09 Thread Bertrand Moulard
Applying all these things your line should look like this:

$sql = UPDATE wo SET status = 1 WHERE ticket = {$_POST['ticketed']};

$_POST['ticketed'] : this is not an array but value isn't it ?

.b

-Original Message-
From: Chris W. Parker [mailto:[EMAIL PROTECTED]
Sent: 09 October 2003 17:08
To: Davy Campano; [EMAIL PROTECTED]
Subject: RE: [PHP] problem transferring a variable using POST


Davy Campano mailto:[EMAIL PROTECTED]
on Thursday, October 09, 2003 8:57 AM said:

 This statement works:
 $sql = 'UPDATE wo SET status = 1 WHERE ticket = 1'
 
 This statement does not:
 $sql = 'UPDATE wo SET status = 1 WHERE ticket =
 $HTTP_POST_VARS[ticketed]'
 
 Any suggestions...
 
 If I do echo $HTTP_POST_VARS[ticketed];
 It returns a 1

First of all you should be using $_POST and not $HTTP_POST_VARS (that is
of course if your version of php supports it).

Secondly, it's not working because (1) you are wrapping the sql
statement in single quotes which does not evaluate variables, it's a
string literal. You should change all those ' to , and (2) arrays are
treated differently than regular variables inside a string. They MUST be
wrapped with { } to be evaluated.

Third, it's a bad practice to not properly quote your array references.
In other words, the word ticketed should have single quotes around it.

Applying all these things your line should look like this:

$sql = UPDATE wo SET status = 1 WHERE ticket = {$_POST['ticketed']};


hth.
chris.

p.s. it's a Very Bad Idea(tm) to grab data directly from $_GET or $_POST
and put it to work before doing any validation on it.

p.p.s. I'm not positive about this but I'd be willing to bet that every
value gathered from $_GET or $_POST is considered a string and not
numeric. Think about it, how would $_POST know that ticketed is meant
to be an integer or a string?


-- 
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

-- 
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 transferring a variable using POST

2003-10-09 Thread Bertrand Moulard
fair enough, $_POST is an array, but what about $_POST['ticketed'] ? Just
want to make sure about this {} thingie

.b

-Original Message-
From: Chris W. Parker [mailto:[EMAIL PROTECTED]
Sent: 09 October 2003 17:22
To: Bertrand Moulard; Davy Campano; [EMAIL PROTECTED]
Subject: RE: [PHP] problem transferring a variable using POST


Bertrand Moulard mailto:[EMAIL PROTECTED]
on Thursday, October 09, 2003 9:20 AM said:

 $_POST['ticketed'] : this is not an array but value isn't it ?

Try print_r($_POST); and see what you get.


c.

--
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 transferring a variable using POST

2003-10-09 Thread Bertrand Moulard
it does, thanks

-Original Message-
From: Chris W. Parker [mailto:[EMAIL PROTECTED]
Sent: 09 October 2003 17:28
To: Bertrand Moulard; Davy Campano; [EMAIL PROTECTED]
Subject: RE: [PHP] problem transferring a variable using POST


Bertrand Moulard mailto:[EMAIL PROTECTED]
on Thursday, October 09, 2003 9:24 AM said:

 fair enough, $_POST is an array, but what about $_POST['ticketed'] ?
 Just want to make sure about this {} thingie

?php

echo This is the password $_POST['password'];
echo This is THE password {$_POST['password']};

?

The output of this page is the following:


Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE,
expecting T_STRING or T_VARIABLE or T_NUM_STRING in
/home/cparker/public_html/oop/loginp.php on line 30

It's choking on the first echo statement.

Does that make sense now?



chris.

-- 
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

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



[PHP] Get the name of the form

2003-10-09 Thread bertrand moulard
Hello

does anyone know if the name of a form is stored somewhere in the predefined
variables ($_POST, $_REQUEST, whatever)

cheers

.b

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



RE: [PHP] Get the name of the form

2003-10-09 Thread Bertrand Moulard
it is a POST, didn't find anything in the doc about that. I reckon php
doesn't handle that as the name is more a html id than part of the form, but
need to make sure before telling my work mates to come up with another
proposal ;-)

.b

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: 09 October 2003 18:02
To: bertrand moulard; [EMAIL PROTECTED]
Subject: RE: [PHP] Get the name of the form


[snip]
does anyone know if the name of a form is stored somewhere in the
predefined
variables ($_POST, $_REQUEST, whatever)
[/snip]

So much testing, so little time. It would be in either the GET or POST
array I would imagine, dependent on the form method.

--
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] Get the name of the form

2003-10-09 Thread Bertrand Moulard
Damn that's what I was thinking... thanks you

.b

-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED]
Sent: 09 October 2003 18:06
To: Bertrand Moulard
Cc: Jay Blanchard; PHP-General
Subject: RE: [PHP] Get the name of the form


On Thu, 2003-10-09 at 13:03, Bertrand Moulard wrote:
 it is a POST, didn't find anything in the doc about that. I reckon php
 doesn't handle that as the name is more a html id than part of the form,
but
 need to make sure before telling my work mates to come up with another
 proposal ;-)

I don't think you can can get the form name unless you pass it along
yourself in a hidden field.

Cheers,
Rob.


 .b

 -Original Message-
 From: Jay Blanchard [mailto:[EMAIL PROTECTED]
 Sent: 09 October 2003 18:02
 To: bertrand moulard; [EMAIL PROTECTED]
 Subject: RE: [PHP] Get the name of the form


 [snip]
 does anyone know if the name of a form is stored somewhere in the
 predefined
 variables ($_POST, $_REQUEST, whatever)
 [/snip]

 So much testing, so little time. It would be in either the GET or POST
 array I would imagine, dependent on the form method.

 --
 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


--
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

--
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