php-windows Digest 24 Jan 2003 05:18:53 -0000 Issue 1552

Topics (messages 18047 through 18063):

Cookies and redirect issues with XP
        18047 by: Ellen Emerson
        18048 by: Rich Gray
        18061 by: Cam Dunstan

Re: PDF extensions seems to do not work properly on IE
        18049 by: Dash McElroy
        18054 by: Leonardo Javier Belén
        18055 by: Scott Carr
        18057 by: Leonardo Javier Belén
        18063 by: MH

MySQL Statement Failing in PHP
        18050 by: Dominic
        18051 by: Dash McElroy
        18052 by: Scott Carr

Re: printing (might be OT)
        18053 by: Luis Ferro

Help!
        18056 by: paradiddles
        18058 by: Dash McElroy

Re: graphics not displaying
        18059 by: Steph Jobes

Re:Subject: printing (might be OT)
        18060 by: Neil Smith

print problem
        18062 by: yuegong

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Hello,

I am new to the list so please forgive me if this issue has been covered
recently... I spent some time browsing previous posts online but did not see
anything like the problem I am having.

I have a system in place using sort of a fuse box methodology...  An index
page that includes modules based on an "action" variable passed in the URL.

-----------------------------
1) The index page first checks for the existence of "authorized" cookie
2) If not found show login screen
3) Login screen accepts username and password - submits to database lookup
4) If found, send the user to a page that sets a cookie and redirects back
to the index page
5) Now (after setting the cookie) the index page should find the cookie and
show the list of actions the user can take
-----------------------------

This works great with Windows 98 SE and all browsers I can test with -
(IE5 - IE 6, Netscape and Opera) BUT it has a problem if the operating
system is Win XP.

What happens with XP is: we accept username and password, look it up, it's
OK - we send them to the page that sets the cookie and redirects...

The index page does NOT find a cookie so shows them the login screen again
(and again and again!)

This does not seem to be a cookies problem... The person can go to another
site (written in ColdFusion) that sets a cookie to decide whether to count
the person...  the cookie is set fine on this site and the person is only
counted once no matter how many time they goto that page... however, no
redirecting is done on this site.

The problem seems to be a combined issue of cookies/redirecting and not
reading the cookie.

If anyone else has encountered something similar I would love to hear from
you!

Thanks very much,
Ellen Emerson
[EMAIL PROTECTED]




--- End Message ---
--- Begin Message ---
IIRC there is a problem with v4.1.2 of PHP on IIS - is that your platform? I
encountered this problem and had to implement a hack to get around it
however in my case it affected all clients not just XP so it may not be the
same issue...
Rich
-----Original Message-----
From: Ellen Emerson [mailto:[EMAIL PROTECTED]]
Sent: 23 January 2003 16:25
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Cookies and redirect issues with XP


Hello,

I am new to the list so please forgive me if this issue has been covered
recently... I spent some time browsing previous posts online but did not see
anything like the problem I am having.

I have a system in place using sort of a fuse box methodology...  An index
page that includes modules based on an "action" variable passed in the URL.

-----------------------------
1) The index page first checks for the existence of "authorized" cookie
2) If not found show login screen
3) Login screen accepts username and password - submits to database lookup
4) If found, send the user to a page that sets a cookie and redirects back
to the index page
5) Now (after setting the cookie) the index page should find the cookie and
show the list of actions the user can take
-----------------------------

This works great with Windows 98 SE and all browsers I can test with -
(IE5 - IE 6, Netscape and Opera) BUT it has a problem if the operating
system is Win XP.

What happens with XP is: we accept username and password, look it up, it's
OK - we send them to the page that sets the cookie and redirects...

The index page does NOT find a cookie so shows them the login screen again
(and again and again!)

This does not seem to be a cookies problem... The person can go to another
site (written in ColdFusion) that sets a cookie to decide whether to count
the person...  the cookie is set fine on this site and the person is only
counted once no matter how many time they goto that page... however, no
redirecting is done on this site.

The problem seems to be a combined issue of cookies/redirecting and not
reading the cookie.

If anyone else has encountered something similar I would love to hear from
you!

Thanks very much,
Ellen Emerson
[EMAIL PROTECTED]





--- End Message ---
--- Begin Message ---
Hmmmmm - I`ve had some suspicious problems with XP myself.  In my paranoia I
thought it was muckrosoft`s first awkward attempt to screw up the rapidly
expanding php community  - but I think it is some  kind of weird caching
issue in the OS itself.  Try setting the browser to the LEAST caching
possible (diagnostic only, we don`t have the luxury of controlling client`s
browser settings in real life of course).

How exactly are you redirecting? - with the header() function? - or a
snippit of javascript code sent?

CD.






----- Original Message -----
From: "Ellen Emerson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 24, 2003 3:25 AM
Subject: [PHP-WIN] Cookies and redirect issues with XP


> Hello,
>
> I am new to the list so please forgive me if this issue has been covered
> recently... I spent some time browsing previous posts online but did not
see
> anything like the problem I am having.
>
> I have a system in place using sort of a fuse box methodology...  An index
> page that includes modules based on an "action" variable passed in the
URL.
>
> -----------------------------
> 1) The index page first checks for the existence of "authorized" cookie
> 2) If not found show login screen
> 3) Login screen accepts username and password - submits to database lookup
> 4) If found, send the user to a page that sets a cookie and redirects back
> to the index page
> 5) Now (after setting the cookie) the index page should find the cookie
and
> show the list of actions the user can take
> -----------------------------
>
> This works great with Windows 98 SE and all browsers I can test with -
> (IE5 - IE 6, Netscape and Opera) BUT it has a problem if the operating
> system is Win XP.
>
> What happens with XP is: we accept username and password, look it up, it's
> OK - we send them to the page that sets the cookie and redirects...
>
> The index page does NOT find a cookie so shows them the login screen again
> (and again and again!)
>
> This does not seem to be a cookies problem... The person can go to another
> site (written in ColdFusion) that sets a cookie to decide whether to count
> the person...  the cookie is set fine on this site and the person is only
> counted once no matter how many time they goto that page... however, no
> redirecting is done on this site.
>
> The problem seems to be a combined issue of cookies/redirecting and not
> reading the cookie.
>
> If anyone else has encountered something similar I would love to hear from
> you!
>
> Thanks very much,
> Ellen Emerson
> [EMAIL PROTECTED]
>
>
>
>
>

--- End Message ---
--- Begin Message ---
I've used PDFlib a reasonable amount on *nix platforms, but it works just
fine in IE. Try saving the file to disk and opening it with a text editor
to see if there are any PHP errors corrupting the PDF output. I had this
happen a few times with uninitialized variables, or undefined functions or
what not. PDF readers don't like that stuff...

-Dash

Go placidly amid the noise and waste, and remember what value there may
be in owning a piece thereof.
                -- National Lampoon, "Deteriorata"

On Thu, 23 Jan 2003, [iso-8859-1] Leonardo Javier Belén wrote:

> Hi all!
>     I am facing a problem with PHP (binaries from php.net) over APACHE
> 1.3.x on Windows 95 and IE5&6 as a client (in both WinNT40 and Win95).
> The problem is as follows:
>     I need to use the pdf libraries (both cpdf and pdflib) and I cannto
> make work any sample. If i use the "hello world" from the documentation
> pack, which is with cpdf:
>
> <?php
> $cpdf = cpdf_open(0);
> cpdf_page_init($cpdf, 1, 0, 595, 842, 1.0);
> cpdf_add_outline($cpdf, 0, 0, 0, 1, "Page 1");
> cpdf_begin_text($cpdf);
> cpdf_set_font($cpdf, "Times-Roman", 30, "WinAnsiEncoding");
> cpdf_set_text_rendering($cpdf, 1);
> cpdf_text($cpdf, "Times Roman outlined", 50, 750);
> cpdf_end_text($cpdf);
> cpdf_moveto($cpdf, 50, 740);
> cpdf_lineto($cpdf, 330, 740);
> cpdf_stroke($cpdf);
> cpdf_finalize($cpdf);
> header("Content-type: application/pdf");
> header("Content-Disposition: filename=test.pdf");
> Header("Expires: 0");
> cpdf_output_buffer($cpdf);
> ?>
>
> the answer is always the same:  1. a dialog box asking me to discard the
> file based on the information on the control (which I suspect is a
> problem with the settings on IE but at least shows me it recognises the
> right control). 2. start to load the control and then a dialog box
> (during initialization of the control) tells me that the file is no
> available.
>
> Please help! I dont know what the problem is.
> Thanks in advance.
> Leonardo J. Belén. AFIP-AR.
>

--- End Message ---
--- Begin Message ---
----- Original Message -----
From: Leonardo Javier Belén
To: [EMAIL PROTECTED]
Sent: Thursday, January 23, 2003 10:51 AM
Subject: PDF extensions seems to do not work properly on IE


Hi all!
    I am facing a problem with PHP (binaries from php.net) over APACHE 1.3.x
on Windows 95 and IE5&6  as a client (in both WinNT40 and Win95). The
problem is as follows:
    I need to use the pdf libraries (both cpdf and pdflib) and I cannto make
work any sample. If i use the "hello world" from the documentation pack,
which is with cpdf:

<?php
$cpdf = cpdf_open(0);
cpdf_page_init($cpdf, 1, 0, 595, 842, 1.0);
cpdf_add_outline($cpdf, 0, 0, 0, 1, "Page 1");
cpdf_begin_text($cpdf);
cpdf_set_font($cpdf, "Times-Roman", 30, "WinAnsiEncoding");
cpdf_set_text_rendering($cpdf, 1);
cpdf_text($cpdf, "Times Roman outlined", 50, 750);
cpdf_end_text($cpdf);
cpdf_moveto($cpdf, 50, 740);
cpdf_lineto($cpdf, 330, 740);
cpdf_stroke($cpdf);
cpdf_finalize($cpdf);
header("Content-type: application/pdf");
header("Content-Disposition: filename=test.pdf");
Header("Expires: 0");
cpdf_output_buffer($cpdf);
?>

the answer is always the same:
1. a dialog box asking me to discard the file based on the information on
the control (which I suspect is a problem with the settings on IE but at
least shows me it recognises the right control).
2. start to load the control and then a dialog box (during initialization of
the control) tells me that the file is no available.

Please help! I dont know what the problem is.
Thanks in advance.
Leonardo J. Belén. AFIP-AR.

--- End Message ---
--- Begin Message ---
You need to check the disposition line.

Content-Disposition: inline; filename=genome.jpeg

I believe you are missing the semi-colon.
-- 
Scott Carr
Documentation Maintainer
http://documentation.openoffice.org
OpenOffice.org


Quoting Leonardo Javier Belén <[EMAIL PROTECTED]>:

> 
> ----- Original Message -----
> From: Leonardo Javier Belén
> To: [EMAIL PROTECTED]
> Sent: Thursday, January 23, 2003 10:51 AM
> Subject: PDF extensions seems to do not work properly on IE
> 
> 
> Hi all!
>     I am facing a problem with PHP (binaries from php.net) over APACHE 1.3.x
> on Windows 95 and IE5&6  as a client (in both WinNT40 and Win95). The
> problem is as follows:
>     I need to use the pdf libraries (both cpdf and pdflib) and I cannto make
> work any sample. If i use the "hello world" from the documentation pack,
> which is with cpdf:
> 
> <?php
> $cpdf = cpdf_open(0);
> cpdf_page_init($cpdf, 1, 0, 595, 842, 1.0);
> cpdf_add_outline($cpdf, 0, 0, 0, 1, "Page 1");
> cpdf_begin_text($cpdf);
> cpdf_set_font($cpdf, "Times-Roman", 30, "WinAnsiEncoding");
> cpdf_set_text_rendering($cpdf, 1);
> cpdf_text($cpdf, "Times Roman outlined", 50, 750);
> cpdf_end_text($cpdf);
> cpdf_moveto($cpdf, 50, 740);
> cpdf_lineto($cpdf, 330, 740);
> cpdf_stroke($cpdf);
> cpdf_finalize($cpdf);
> header("Content-type: application/pdf");
> header("Content-Disposition: filename=test.pdf");
> Header("Expires: 0");
> cpdf_output_buffer($cpdf);
> ?>
> 
> the answer is always the same:
> 1. a dialog box asking me to discard the file based on the information on
> the control (which I suspect is a problem with the settings on IE but at
> least shows me it recognises the right control).
> 2. start to load the control and then a dialog box (during initialization of
> the control) tells me that the file is no available.
> 
> Please help! I dont know what the problem is.
> Thanks in advance.
> Leonardo J. Belén. AFIP-AR.
> 
> 
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
--- End Message ---
--- Begin Message ---
Nothing happens. Its the same problem. It seems that IE does not understand
the data sent this way. Does anyone has a clue about how to solve it?
Thanks.

    Leonardo Javier Belén.
    AFIP-AR.


----- Original Message -----
From: "Scott Carr" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 23, 2003 5:27 PM
Subject: Re: [PHP-WIN] Fw: PDF extensions seems to do not work properly on
IE


> You need to check the disposition line.
>
> Content-Disposition: inline; filename=genome.jpeg
>
> I believe you are missing the semi-colon.
> --
> Scott Carr
> Documentation Maintainer
> http://documentation.openoffice.org
> OpenOffice.org
>
>
> Quoting Leonardo Javier Belén <[EMAIL PROTECTED]>:
>
> >
> > ----- Original Message -----
> > From: Leonardo Javier Belén
> > To: [EMAIL PROTECTED]
> > Sent: Thursday, January 23, 2003 10:51 AM
> > Subject: PDF extensions seems to do not work properly on IE
> >
> >
> > Hi all!
> >     I am facing a problem with PHP (binaries from php.net) over APACHE
1.3.x
> > on Windows 95 and IE5&6  as a client (in both WinNT40 and Win95). The
> > problem is as follows:
> >     I need to use the pdf libraries (both cpdf and pdflib) and I cannto
make
> > work any sample. If i use the "hello world" from the documentation pack,
> > which is with cpdf:
> >
> > <?php
> > $cpdf = cpdf_open(0);
> > cpdf_page_init($cpdf, 1, 0, 595, 842, 1.0);
> > cpdf_add_outline($cpdf, 0, 0, 0, 1, "Page 1");
> > cpdf_begin_text($cpdf);
> > cpdf_set_font($cpdf, "Times-Roman", 30, "WinAnsiEncoding");
> > cpdf_set_text_rendering($cpdf, 1);
> > cpdf_text($cpdf, "Times Roman outlined", 50, 750);
> > cpdf_end_text($cpdf);
> > cpdf_moveto($cpdf, 50, 740);
> > cpdf_lineto($cpdf, 330, 740);
> > cpdf_stroke($cpdf);
> > cpdf_finalize($cpdf);
> > header("Content-type: application/pdf");
> > header("Content-Disposition: filename=test.pdf");
> > Header("Expires: 0");
> > cpdf_output_buffer($cpdf);
> > ?>
> >
> > the answer is always the same:
> > 1. a dialog box asking me to discard the file based on the information
on
> > the control (which I suspect is a problem with the settings on IE but at
> > least shows me it recognises the right control).
> > 2. start to load the control and then a dialog box (during
initialization of
> > the control) tells me that the file is no available.
> >
> > Please help! I dont know what the problem is.
> > Thanks in advance.
> > Leonardo J. Belén. AFIP-AR.
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> -------------------------------------------------
> This mail sent through IMP: http://horde.org/imp/
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
I had a similar problem.  What I did was to create a refering page with a
link to the php page that creates the pdf and then suddenly it showed.  If
you call the PHP page directly all kind of weird things happen.  If you look
at the source of the new page (PHP one that creates the PDF) you will see
that it uses the <embed> tag to display the PDF.  It seems that is the only
way that I can display the created PDF's.  I did not do much more
investigating since this works fine for me.

Also I am using FPDF (ww.fpdf.org) instead of the normal PDF library, I find
it much easier and with less problems.

Mh

"Leonardo javier belén" <[EMAIL PROTECTED]> wrote in message
00ae01c2c329$43ec4bb0$[EMAIL PROTECTED]">news:00ae01c2c329$43ec4bb0$[EMAIL PROTECTED]...
> Nothing happens. Its the same problem. It seems that IE does not
understand
> the data sent this way. Does anyone has a clue about how to solve it?
> Thanks.
>
>     Leonardo Javier Belén.
>     AFIP-AR.
>
>
> ----- Original Message -----
> From: "Scott Carr" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, January 23, 2003 5:27 PM
> Subject: Re: [PHP-WIN] Fw: PDF extensions seems to do not work properly on
> IE
>
>
> > You need to check the disposition line.
> >
> > Content-Disposition: inline; filename=genome.jpeg
> >
> > I believe you are missing the semi-colon.
> > --
> > Scott Carr
> > Documentation Maintainer
> > http://documentation.openoffice.org
> > OpenOffice.org
> >
> >
> > Quoting Leonardo Javier Belén <[EMAIL PROTECTED]>:
> >
> > >
> > > ----- Original Message -----
> > > From: Leonardo Javier Belén
> > > To: [EMAIL PROTECTED]
> > > Sent: Thursday, January 23, 2003 10:51 AM
> > > Subject: PDF extensions seems to do not work properly on IE
> > >
> > >
> > > Hi all!
> > >     I am facing a problem with PHP (binaries from php.net) over APACHE
> 1.3.x
> > > on Windows 95 and IE5&6  as a client (in both WinNT40 and Win95). The
> > > problem is as follows:
> > >     I need to use the pdf libraries (both cpdf and pdflib) and I
cannto
> make
> > > work any sample. If i use the "hello world" from the documentation
pack,
> > > which is with cpdf:
> > >
> > > <?php
> > > $cpdf = cpdf_open(0);
> > > cpdf_page_init($cpdf, 1, 0, 595, 842, 1.0);
> > > cpdf_add_outline($cpdf, 0, 0, 0, 1, "Page 1");
> > > cpdf_begin_text($cpdf);
> > > cpdf_set_font($cpdf, "Times-Roman", 30, "WinAnsiEncoding");
> > > cpdf_set_text_rendering($cpdf, 1);
> > > cpdf_text($cpdf, "Times Roman outlined", 50, 750);
> > > cpdf_end_text($cpdf);
> > > cpdf_moveto($cpdf, 50, 740);
> > > cpdf_lineto($cpdf, 330, 740);
> > > cpdf_stroke($cpdf);
> > > cpdf_finalize($cpdf);
> > > header("Content-type: application/pdf");
> > > header("Content-Disposition: filename=test.pdf");
> > > Header("Expires: 0");
> > > cpdf_output_buffer($cpdf);
> > > ?>
> > >
> > > the answer is always the same:
> > > 1. a dialog box asking me to discard the file based on the information
> on
> > > the control (which I suspect is a problem with the settings on IE but
at
> > > least shows me it recognises the right control).
> > > 2. start to load the control and then a dialog box (during
> initialization of
> > > the control) tells me that the file is no available.
> > >
> > > Please help! I dont know what the problem is.
> > > Thanks in advance.
> > > Leonardo J. Belén. AFIP-AR.
> > >
> > >
> > > --
> > > PHP Windows Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> >
> > -------------------------------------------------
> > This mail sent through IMP: http://horde.org/imp/
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---
--- Begin Message ---
I am running a query in a php page that is coming back with no results.
When I run the same query in MySQL Console, it gives the results.  Any
thoughts?

mysql_select_db($database_Fund, $Fund);
$query_rsRegisteredClasses = sprintf("SELECT tlogin.FirstName,
tlogin.LastName, tcourse.Name, tschedule.Date, tschedule.StartTime,
tschedule.EndTime, tlogin.LoginName FROM ((tregistration INNER JOIN
tschedule ON tregistration.ScheduleUID = tschedule.ScheduleUID) INNER JOIN
tlogin ON tregistration.StudentUID = tlogin.LoginUID) INNER JOIN tcourse ON
tschedule.CourseUID = tcourse.ClassID WHERE tlogin.LoginName = '%s'",
$user_rsRegisteredClasses);
$rsRegisteredClasses = mysql_query($query_rsRegisteredClasses, $Fund) or
die(mysql_error());
$row_rsRegisteredClasses = mysql_fetch_assoc($rsRegisteredClasses);
$totalRows_rsRegisteredClasses = mysql_num_rows($rsRegisteredClasses);


--- End Message ---
--- Begin Message ---
I think you need to do a while() loop there instead of trying to grab the
results in one shot:

$row_rsRegisteredClasses = array();
while ($row = mysql_fetch_assoc($rsRegisteredClasses)) {
    $row_rsRegisteredClasses[] = $row; //populate this array with the $row array
}

That may or may not work, but you have to do a while loop to fetch all of
your results from a query.

-Dash

Dare to be naive.
                -- R. Buckminster Fuller

On Thu, 23 Jan 2003, Dominic wrote:

> I am running a query in a php page that is coming back with no results.
> When I run the same query in MySQL Console, it gives the results.  Any
> thoughts?
>
> mysql_select_db($database_Fund, $Fund);
> $query_rsRegisteredClasses = sprintf("SELECT tlogin.FirstName,
> tlogin.LastName, tcourse.Name, tschedule.Date, tschedule.StartTime,
> tschedule.EndTime, tlogin.LoginName FROM ((tregistration INNER JOIN
> tschedule ON tregistration.ScheduleUID = tschedule.ScheduleUID) INNER JOIN
> tlogin ON tregistration.StudentUID = tlogin.LoginUID) INNER JOIN tcourse ON
> tschedule.CourseUID = tcourse.ClassID WHERE tlogin.LoginName = '%s'",
> $user_rsRegisteredClasses);
> $rsRegisteredClasses = mysql_query($query_rsRegisteredClasses, $Fund) or
> die(mysql_error());
> $row_rsRegisteredClasses = mysql_fetch_assoc($rsRegisteredClasses);
> $totalRows_rsRegisteredClasses = mysql_num_rows($rsRegisteredClasses);
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
A quicky:

echo "$query_rsRegisteredClasses<br />"

To make sure the query is exactly what you are expecting.  Copy the exact SQL
statement and run in MySQLAdmin sql window.  

PHP to PHP, SQL statement to sql statement.

-- 
Scott Carr
Documentation Maintainer
http://documentation.openoffice.org
OpenOffice.org


Quoting Dominic <[EMAIL PROTECTED]>:

> I am running a query in a php page that is coming back with no results.
> When I run the same query in MySQL Console, it gives the results.  Any
> thoughts?
> 
> mysql_select_db($database_Fund, $Fund);
> $query_rsRegisteredClasses = sprintf("SELECT tlogin.FirstName,
> tlogin.LastName, tcourse.Name, tschedule.Date, tschedule.StartTime,
> tschedule.EndTime, tlogin.LoginName FROM ((tregistration INNER JOIN
> tschedule ON tregistration.ScheduleUID = tschedule.ScheduleUID) INNER JOIN
> tlogin ON tregistration.StudentUID = tlogin.LoginUID) INNER JOIN tcourse ON
> tschedule.CourseUID = tcourse.ClassID WHERE tlogin.LoginName = '%s'",
> $user_rsRegisteredClasses);
> $rsRegisteredClasses = mysql_query($query_rsRegisteredClasses, $Fund) or
> die(mysql_error());
> $row_rsRegisteredClasses = mysql_fetch_assoc($rsRegisteredClasses);
> $totalRows_rsRegisteredClasses = mysql_num_rows($rsRegisteredClasses);
> 
> 
> 
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
--- End Message ---
--- Begin Message --- What you say is possible but:

a) Where is created the file? PHP is a server side scripting language. All its actions are performed in the server context and then are sent as a block to the client that requested the action.

b) To print something in a button you have two options: either you use javascript to perform the printing operation, and in that case its a javascript issue in the client side of a client, or you send the printing request to the server, which will be a server side issue, performed by the server (in PHP or any other scripting language or code installed to that effect). In this case, you could print indeed, but the printing computer would be the server itself.

I think that you are looking for something like this:

<a href='javascript:void(0);' onclick='document.print();'>Print</a>

If you need to hide stuff before printing, then you will need to make a javascript function that handles that matter, prints, and after that restores the visibility of the hidden.

Cheers,
Luis Ferro
Teladigital.Net




Bobo Wieland wrote:

Hi!

I'm sorry if this is OT but I really need an answer to this question and I
can't find it anywhere...

I have a link on a page that basicly should work as a print-button. When you
click it, it should print some of the information that is currently
displayed and ad a header and footer of some sort.

The only way i know of doing this is using CSS and showing/hiding layers,
but it would be much easier if I could generate a file of some sort that
will be sent to the printer...

Is there a way to do this sort of thing with php, or could you guys please
help pointing me to some information about this...?

thanks!


:: bobo ::





---
[This E-mail scanned for viruses by Declude Virus]

--- End Message ---
--- Begin Message ---

Greetings everyone,

I successfully installed (locally) the php/mysql/apache bundle called swamp-0.1.1.

I created my 1st php file that I've attached along w/a very basic .html form that it is supposed to parse (from the bookPHP and MySQL Web Development by Welling and Thomason). the php file does not seem to recognize the text passed to PHP's simple echo construct tag.

When I click the "submit" button on the form, the php file is called up and displays "Sean's products" and "Order results"...but the text w/in the echo construct tag "Order processed" does not display.

I saved both the form and the php file locally in a dir. called www which is in the root of my swamp directory

 

Any ideas?

thanks.



----------------
"forget your lust for the rich man's gold. All that you need, is in your soul. You can do this if you try. All that I want for you my son, is to be satisfied"

  ~ Lynard Skynard



Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now--- End Message ---
--- Begin Message ---
Check your php.ini. register_globals = off would be your culprit.

Check www.php.net/register_globals for instructions on how to use the new
"superglobals" ($_POST, $_GET, etc) or change it to on. Restart Apache
after you change it.

(one more vote for a register_globals email bot...)

-Dash

One Page Principle:
        A specification that will not fit on one page of 8.5x11 inch
paper cannot be understood.
                -- Mark Ardis

On Thu, 23 Jan 2003, paradiddles wrote:

>
> Greetings everyone,
>
> I successfully installed (locally) the php/mysql/apache bundle called swamp-0.1.1.
>
> I created my 1st php file that I've attached along w/a very basic .html form that it 
>is supposed to parse (from the bookPHP and MySQL Web Development by Welling and 
>Thomason). the php file does not seem to recognize the text passed to PHP's simple 
>echo construct tag.
>
> When I click the "submit" button on the form, the php file is called up and displays 
>"Sean's products" and "Order results"...but the text w/in the echo construct tag 
>"Order processed" does not display.
>
> I saved both the form and the php file locally in a dir. called www which is in the 
>root of my swamp directory
>
>
>
> Any ideas?
>
> thanks.
>
>
>
> ----------------
> "forget your lust for the rich man's gold. All that you need, is in your soul. You 
>can do this if you try. All that I want for you my son, is to be satisfied"
>
>   ~ Lynard Skynard
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now

--- End Message ---
--- Begin Message ---
For anyone that's interested, I figured out what the problem was, though I
don't understand why.

My images were in a folder called "images." I wondered if that name was
conflicting with something in Apache. So I renamed the folder to "img" and
changed the image references to /img, and suddenly all of the images are
appearing. I knew it was something dumb like that.

If anyone knows why "images" didn't work and "img" works, I'd sure like to
hear about it!

Thanks,
Steph Jobes

"Steph Jobes" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I'm learning PHP, and I'm sure there is a simple answer to this question.
>
> I've created a simple test web site with each of the pages using PHP to
call
> included files for the header, footer, and navigational bar. The files for
> the header, footer, and navigational bar are simple HTML files with a few
> graphics. The main PHP pages also contain graphics. The PHP is working
> great - I even have a breadcrumb trail using PHP that is working great.
The
> header, footer, and navigational bar all come in to the calling pages.
> However, NONE of the graphics display for any of the included files or
main
> pages (whether they are php or html). I thought it might be my source
> references (which are relative), but even when I put in absolute
references,
> the graphics will not display.
>
> Part of the problem, I think, is that Apache running on our web server is
> the version that was supplied by Oracle. When I installed a downloaded
> version of Apache on the web server, my test site worked perfectly - BUT -
> the Oracle database functions were totally lost. I'm stuck using the
version
> of Apache that came with Oracle.
>
> The test site works perfectly on my test computer, where I'm running the
> standalone version of the Apache web server with Windows 98 and PHP
version
> 4.2.2 (running as a module).
>
> What is it about the Oracle's Apache that is keeping my graphics from
> displaying? Is there a setting that I am missing in the conf file?
>
> Server information:
> Windows NT 4.0 SP6a
> Oracle HTTP Server Powered by Apache/1.3.12 (Win32)
> PHP version 4.2.2 (running as a module)
>
> I will gladly supply more details if needed.
>
> Thanks so much for any help you can give me!
> Steph Jobes
>
>


--- End Message ---
--- Begin Message --- Sure Bobo - you can use Javascript to avoid the need to store your print file , together with CSS to format the page as you like.

Javascript : onclick="window.print()"

That will print the window (or offer a print dialog) in IE, NN4, Nav6, Moz, Opera etc etc.

For print formatting in CSS look up @media print on www.w3c.org - something like this (may not be supported in NN4 btw - though it shouldnt print background colors of images if they are on a white background. In fact mostof this will be borked on netscape but hey :)

Example :

@media print {

BODY {
background : white;
margin: 0.25in;
size: 210mm 297mm landscape;

/* or portrait */

font-family: Georgia, "Times New Roman", Times, serif;
font-size: 12pt;

/* prefer to use points for print not pixels cause of resolution dependency */

border : 1px solid #000000;
float: left;
}

.hidden {
display : none;
}

Give your print hidden elements a style of .hidden as specified. There are also attributes for page-break-before and page-break-after and so on. Nest your other print-only styles inside the @media print{ } making sure that you duplicate most of the body styles in some print renderable way (at least, specify a font & weight) - the print styles wil be overridden by the normal (screen) styles specified in your stylesheet - no need to specify @media screen for these. Fool around for a while and you avoid PHP entirely.

Use the force wisely, Luke :-)

Cheers,
Neil.



At 16:16 23/01/2003 +0000, you wrote:
Message-ID: <001601c2c2c0$bba8dab0$9df81e0a@elstudion>
From: "Bobo Wieland" <[EMAIL PROTECTED]>
Hi!

I'm sorry if this is OT but I really need an answer to this question and I
can't find it anywhere...

I have a link on a page that basicly should work as a print-button. When you
click it, it should print some of the information that is currently
displayed and ad a header and footer of some sort.

The only way i know of doing this is using CSS and showing/hiding layers,
but it would be much easier if I could generate a file of some sort that
will be sent to the printer...

Is there a way to do this sort of thing with php, or could you guys please
help pointing me to some information about this...?

thanks!

--- End Message ---
--- Begin Message ---
Hi 
Is there any way to set the page properties of browser by javascript before call 
'windows.print();', such as size, direction...

thanks
--- End Message ---

Reply via email to