php-general Digest 12 Aug 2006 03:12:39 -0000 Issue 4288

Topics (messages 240539 through 240555):

Re: problem with Firefox print preview?
        240539 by: gustav.varupiraten.se
        240542 by: Paul Scott
        240544 by: Al

Re: List Meeting NNOT
        240540 by: David Robley

Problem Creating a New SSL Cert in Apache2
        240541 by: Mike

Re: calendar Q
        240543 by: Jef Sullivan

Compiling and iconv
        240545 by: Ray Hauge

Re: OT? Verifying mail was received
        240546 by: Chris W. Parker

Re: A way to stop spam on this list
        240547 by: Michelle Konzack

suphp problem
        240548 by: Michelle Konzack

requests from 2nd window breaks my program
        240549 by: afan.afan.net
        240550 by: Jochem Maas
        240551 by: Andrew Kreps
        240552 by: Andrew Kreps

Problem Loading Extension
        240553 by: Ray Hauge
        240554 by: Michael B Allen
        240555 by: Ray Hauge

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:
        php-general@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
> Hi all,
>
> I've developed this site in PHP and its basically finished, now I have a
> problem with the printing and print preview.
> I have a dynamic table that can span various pages depending on the
> number of records pulled from the database.
>
> The print preview (and printed page) doesnt print the first few rows but
> instead just prints blank then only prints the last line of the table on
> a new page. The table is embedded inside a fieldset component. Im not
> sure if its a mozilla/firefox bug because it seems fine in IE.
>
> Has anyone come across this problem before?
>
> Thanks in advance
> Angelo
>
Seems like it is a standard html-problem.
IE shows most webbpages, even if they're not strictly html-coded from the
standard of html.
FireFox is more sensitive about the strict html-code.

Best regards
/Gustav Wiberg

> --
> ------------------------------------------------------------------------
> Angelo Zanetti
> Systems developer
> ------------------------------------------------------------------------
>
> *Telephone:* +27 (021) 469 1052
> *Mobile:*       +27 (0) 72 441 3355
> *Fax:*            +27 (0) 86 681 5885
> *
> Web:* http://www.zlogic.co.za
> *E-Mail:* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
On Fri, 2006-08-11 at 14:58 +0200, Angelo Zanetti wrote:

> The print preview (and printed page) doesnt print the first few rows but 
> instead just prints blank then only prints the last line of the table on 
> a new page. The table is embedded inside a fieldset component. Im not 
> sure if its a mozilla/firefox bug because it seems fine in IE.

This is more of a CSS issue. You should be using a "printer friendly"
CSS for printing. 

AFAIK there is no PHP code that will help here.

I would suggest googling for printer friendly CSS or try at csszen.com
or something. 

Another way of looking at it, would be to use a stream to write to
IPP:// ...

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm 

--- End Message ---
--- Begin Message ---
Angelo Zanetti wrote:
Hi all,

I've developed this site in PHP and its basically finished, now I have a problem with the printing and print preview. I have a dynamic table that can span various pages depending on the number of records pulled from the database.

The print preview (and printed page) doesnt print the first few rows but instead just prints blank then only prints the last line of the table on a new page. The table is embedded inside a fieldset component. Im not sure if its a mozilla/firefox bug because it seems fine in IE.

Has anyone come across this problem before?

Thanks in advance
Angelo


I'm very familiar with the problem.  Suggest:

All modern browsers are W3C compliant.  IE6 is not; but, IE7 will be.
You may as well fix it now.  Otherwise, you'll need to do later this year for 
IE7.

To fix the problem, start by running the W3C markup and css validators. If you are not using css for presentation; do so. Get your code to generate W3C compliant html code. Check it with Firefox. If necessary, which is rare, you many need to check the client's browser type and send a special IE6 version of the page.

Al.......

--- End Message ---
--- Begin Message ---
Ligaya Turmelle wrote:

> tedd wrote:
>> At 7:22 AM +0200 8/10/06, Paul Scott wrote:
>> 
>>> On Wed, 2006-08-09 at 18:54 -0500, Jay Blanchard wrote:
>>>
>>>>  Yes, but not everyone can get to or goes to conferences. And this
>>>>  would stand on its own don'tcha think? I think that Chicago is
>>>>  perfect, because it is centrally located (kinda') and a neat place to
>>>>  boot.
>>>>
>>>
>>> Kinda...Chicago is a bit of a drive for us in Cape Town, South
>>> Africa... ;)
>>>
>>> --Paul
>> 
>> 
>> Start driving now and remember to roll up the windows.
>> 
>> tedd
> Wonder if I can get a scuba diving tank large enough...
> 
Also whether you can inflate the tyres enough to keep it afloat...



Cheers
-- 
David Robley

Words are not food, though sometimes we must eat them.
Today is Pungenday, the 4th day of Bureaucracy in the YOLD 3172. 

--- End Message ---
--- Begin Message ---
Windows Server
Apache2
OpenSSL

I am new to working with SSL Certs so I am sure I did something wrong
somewhere. Where???? I have no idea!

We needed an SSL Cert for our website. I created the CSR using

openssl req -new -out uwm.csr

answered all of the questions, went to GoDaddy and did a copy and paste into
their text area, and created a certificate. I took the output of the
certificate key, created a notepad file, copied the text into the file, and
named it uwm.crt.

I restarted apache and it would not start. Using the expired cert, apache
worked.

So where have I gone wrong? ALL help is GREATLY appreciated!

TIA

Mike 

--- End Message ---
--- Begin Message ---
I like using mktime() whenever I pull dates from a database.
Get your date from the query, store it to a value:

$val = mktime($qval);

Then you can compare any part of the date you want by using
date(). 

if( date( "m", date(now)) == date( "m", $val ))

m = month



Jef
-----Original Message-----
From: William Stokes [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 10, 2006 11:23 PM
To: php-general@lists.php.net
Subject: Re: [PHP] calendar Q

Ok. Thanks.

One more question. I have dates as a datetime in DB. Like 2006-08-11 
08:20:00 and I'm playing only with date part in the calendar 2006-08-11. So 
how to compare this date to the datetime info in DB? Do I need to use 
DATE_FORMAT or someting like this in the query?

Thanks
-Will



""Richard Lynch"" <[EMAIL PROTECTED]> kirjoitti 
viestissä:[EMAIL PROTECTED]
> On Thu, August 10, 2006 12:14 pm, William Stokes wrote:
>> I have a calendar script that displays a simple mini calendar view one
>> month
>> at a time. User can click any date and the calendar opens another page
>> that
>> displays that date's events. I would like to highlight to the mini
>> calendar
>> view dates that have an event in database. So what would be a simple
>> way to
>> check for events while the selected months days are printed to screen?
>
> Depending on the number of records, the PHP<->MySQL connection speed,
> and the indexes or lack thereof on your date column...
>
> 1. You could do a query for each date like:
> select count(*) from events where whatdate = '$date'
>
> 2. You could pre-fill an array with dates that have an event:
> select whatdate from events
> where whatdate >= '$month/1/$year'
> and whatdate < '{$month+1}/1/$year' /*might need something better here*/
> group by whatdate
> order by whatdate
> while (list($whatdate) = mysql_fetch_row($result)){
>  $event_date[$whatdate] = true;
> }
> Then, while filling out the calendar, just check:
> if (isset($event_date[$date])){
>  //color it as having events
> }
>
> -- 
> Like Music?
> http://l-i-e.com/artists.htm 

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

--- End Message ---
--- Begin Message ---
I use Slackware linux, and XMLRPC is not compiled in by default with my 
distro, so I'm compiling PHP myself.  It's always been a simple enough task.  
First I get and install the required xmlrpc-epi libraries, and then I compile 
PHP telling it where I just installed them.  Now I get this error message:

undefined reference to `libiconv'

when compiling PHP.  I did some searching, and the only thing I've found in 
reference to this error was a bug in version 4.3.10.  Has anyone run into 
this issue, or have some suggestions?

I have checked that /usr/include/iconv.h is there, and it defines all the 
iconv_* and iconv compiler flags etc.  I can also vouch that using iconv on 
the command line works just fine.

Thanks,
-- 
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
www.americanstudentloan.com
1.800.575.1099

--- End Message ---
--- Begin Message ---
tedd <mailto:[EMAIL PROTECTED]>
    on Thursday, August 10, 2006 7:59 PM said:

> Not a php solution, but send them all a buck via PayPal. For $90
> you'll learn if their email addresses are correct.
> 
> That should be cheaper than writing a program to figure it out for
> you, if it can be done.

Here's an even better idea. Why don't YOU send me the $90 and then I'll
keep it. How about that?



Chris.

--- End Message ---
--- Begin Message ---
Late answer,

but I was coming back yesterday from Palestine, after the Israelien
Terror Authority had arrest me for making tonns of photos and Videos
about Israeli military crime... (shooting children and pregnant women)


Am 2006-06-19 10:23:06, schrieb Denis Gerasimov:

> I am very tired of deleting spam messages received from PHP mailing lists
> and I think we all are.

Hmm I do not know, what you are talking about, but in the last 2 month
I have received no singel SPAM...

Are you using Windows?
Is your E-Mail hit by a spamer directly?

I was wondering about...

I use Debian Sarge/3.1, fetchmail, procmail, maildrop, courier, php5

Greetings
    Michelle Konzack
    Systemadministrator
    Tamay Dogan Network
    Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack   Apt. 917                  ICQ #328449886
                   50, rue de Soultz         MSM LinuxMichi
0033/6/61925193    67100 Strasbourg/France   IRC #Debian (irc.icq.com)

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

I have around 8000 VHosts and normaly do not use "suphp" for security
reason.  All VHosts have there own UID/GID and the Apache VHosts are
setup with

    User        $UID
    Group       $GID

Now I have added to a singel VHost directive

    <ifModule mod_actions.c>
        Action  application/x-httpd-php  /cgi-bin/php5
    </ifModule>

and NOT restarted Apache as written.  I have killed it and then started
from scratch but nothing is working...

Then I have removed "libapache-mod-php5" and now Mozilla let me download
the php files and if I use <http://domain/server-info> I see the
"mod_actions" enabled and the "Action" is configured.  Now I have 
restarted the Server again and I get an error 500.

The problem is, that I need "libapache-mod-php5" on all VHosts,
but php-cgi only on 7.

So what is the secret to get "suphp" running?

Yet I have reinstalled "libapache-mod-php5" and the Website is working
again, but I can not use 'fopen("/home/server/log/some.log", "a")'.

I need "suphp" only on those 7 VHosts, since the must write to some
files OUTSIDE of the $DOCUMENTROOT but in the USERSPACE of the VHost.

Greetings
    Michelle Konzack


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack   Apt. 917                  ICQ #328449886
                   50, rue de Soultz         MSM LinuxMichi
0033/6/61925193    67100 Strasbourg/France   IRC #Debian (irc.icq.com)

--- End Message ---
--- Begin Message ---
I'll try to explain my problem as better as I can. Please, be "gentle" :)

I developed a program for our salespeople (only them, no public) where
they can order items for their customers. Order form is made of 6 pages
(order info, items info, artwork, ad copies,...). Also, they use the same
program to manipulate saved/submitted orders, send confirmation to
customers, requests to suppliers,... Code works fine. But this morning I
found a bug that if Salesperson open 2nd window in this program, since it
has the same session id, it would make a mess with session. I.e., on 1st
window I'm doing an order. Order ID, customer ID, transaction ID are
stored in session table. In the middle of the order I open 2nd window to
check a price on an other customer order. After I opened that order "new"
order ID and customer ID are stored now in session table and the order
(1st window) is now broken or goes to wrong place.
Or, I'm sending request for approval of an order to customer. But, second
before I submit the request, I open an order of other customer. Other
customer ID is now stored in session table and conf. email goes to wrong
place.
There are few more scenarios of "bug make mess".

Did anybody had a problem with "2nd window" and how is it solved? What's
wrong with structure/idea I used to make a program?
Any comment will be helpful to determine or give me an idea how to fix
this bug.

Thanks for any help.

-afan

--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:
> I'll try to explain my problem as better as I can. Please, be "gentle" :)
> 
> I developed a program for our salespeople (only them, no public) where
> they can order items for their customers. Order form is made of 6 pages
> (order info, items info, artwork, ad copies,...). Also, they use the same
> program to manipulate saved/submitted orders, send confirmation to
> customers, requests to suppliers,... Code works fine. But this morning I
> found a bug that if Salesperson open 2nd window in this program, since it
> has the same session id, it would make a mess with session. I.e., on 1st
> window I'm doing an order. Order ID, customer ID, transaction ID are
> stored in session table. In the middle of the order I open 2nd window to
> check a price on an other customer order. After I opened that order "new"
> order ID and customer ID are stored now in session table and the order
> (1st window) is now broken or goes to wrong place.
> Or, I'm sending request for approval of an order to customer. But, second
> before I submit the request, I open an order of other customer. Other
> customer ID is now stored in session table and conf. email goes to wrong
> place.
> There are few more scenarios of "bug make mess".
> 
> Did anybody had a problem with "2nd window" and how is it solved? What's
> wrong with structure/idea I used to make a program?

the problem is not '2nd Window' but rather that you are using the session id
to uniquely indentify an order [manipulation] process/transaction (which 
consists
of multiple http requests) ...

a very crude idea below (you have to add a request variable named 'ordertransid'
in all links pointing to pages that have to act on an existing order 
transaction,
leaving it out would generate a new order transaction (on the relevant page[s])
for which you can then use the newly appointed transaction id to point 
subsequent
pages to the transaction that was just created:

function getOrderTransactionData()
{
        if (!$_SESSION['ordertransstack']) {
                $_SESSION['ordertransstack'] = array();
        }

        $transid = @$_REQUEST['ordertransid'];
        if (!$transid || !isset($_SESSION['ordertransstack'][$transid])) {
                $transid = count($_SESSION['ordertransstack']);
                $_SESSION['ordertransstack'][$transid] = 
initNewOrderTransactionData();
        } else {
                $data = $_SESSION['ordertransstack'][$transid]; 
        }

        return array('ordertransid' => $transid, 'data' => 
$_SESSION['ordertransstack'][$transid]);
}

function setOrderTransactionData($data)
{
        if (!$_SESSION['ordertransstack']) {
                $_SESSION['ordertransstack'] = array();
        }

        $transid = @$_REQUEST['ordertransid'];
        if ($transid && isset($_SESSION['ordertransstack'][$transid])) {
                $_SESSION['ordertransstack'][$transid] = $data;
                return true;
        }

        return false;
}

function deleteOrderTransaction()
{
        $transid = @$_REQUEST['ordertransid'];
        if ($transid && isset($_SESSION['ordertransstack'][$transid])) {
                unset($_SESSION['ordertransstack'][$transid]);
                return true;
        }

        return false;
}


list($orderTransId, $orderTransData) = getOrderTransactionData();

on rereading your post - your storing session data in a db, why bother; secondly
it sounds like you just overwriting the session record with a new transaction
id rather than adding a new transaction id [record] and leaving any already 
existing
transactions available.

basically pass the transaction id around when you need to keep referring to
an existing transactions and maintain a 'stack' of active transactions.


> Any comment will be helpful to determine or give me an idea how to fix
> this bug.
> 
> Thanks for any help.
> 
> -afan
> 

--- End Message ---
--- Begin Message ---
Based on the general description you've given, I could imagine adding
a 'step number' in your session.  Then validate it against what step
is being loaded.  So, if you set your Session 'step' variable to 5,
and page 6 is loaded, that would seem OK.  If your Session 'step'
variable is 6, and page 2 is loaded, that could throw an error.

I should note that I think my solution is treating the symptom rather
than the disease.  I don't know enough about your application to tell
you what the right solution should be, but I think there must be a
more graceful way to handle this.

On 8/11/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
I'll try to explain my problem as better as I can. Please, be "gentle" :)

Did anybody had a problem with "2nd window" and how is it solved? What's
wrong with structure/idea I used to make a program?
Any comment will be helpful to determine or give me an idea how to fix
this bug.


--- End Message ---
--- Begin Message ---
For what it's worth, I like Jochem's solution much better than the one
I gave you.  :)

On 8/11/06, Jochem Maas <[EMAIL PROTECTED]> wrote:
a very crude idea below (you have to add a request variable named 'ordertransid'
in all links pointing to pages that have to act on an existing order 
transaction,
leaving it out would generate a new order transaction (on the relevant page[s])
for which you can then use the newly appointed transaction id to point 
subsequent
pages to the transaction that was just created:

--- End Message ---
--- Begin Message ---
Hello everyone,

I successfully compiled PHP 4.4.3 and PHP 5.1.4 today.  I'm having a problem 
with loading the PDFLib extension (pdflib_php.so).  It works fine in PHP 4, 
but PHP5 is not loading it.  I do know that I have the file in the correct 
location (same as the mysql.so file), and when I take out mysql.so, then 
mysql functions are not available.  I am not sure why this module is not 
loading.

I checked the error_log, and I didn't get any error messages at all.  STFW 
didn't give me a whole lot of information.  Anyone have any ideas of where to 
look to find out why it's not loading?

Thanks,
-- 
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
www.americanstudentloan.com
1.800.575.1099

--- End Message ---
--- Begin Message ---
On Fri, 11 Aug 2006 17:50:12 -0500
Ray Hauge <[EMAIL PROTECTED]> wrote:

> Hello everyone,
> 
> I successfully compiled PHP 4.4.3 and PHP 5.1.4 today.  I'm having a problem 
> with loading the PDFLib extension (pdflib_php.so).  It works fine in PHP 4, 
> but PHP5 is not loading it.  I do know that I have the file in the correct 
> location (same as the mysql.so file), and when I take out mysql.so, then 
> mysql functions are not available.  I am not sure why this module is not 
> loading.
> 
> I checked the error_log, and I didn't get any error messages at all.  STFW 
> didn't give me a whole lot of information.  Anyone have any ideas of where to 
> look to find out why it's not loading?

Was the module compiled for 5? Check the apache error.log. If the .so
can't resolve a symbol or similar, usually that type of error appears in
the apache error log. Also, of course the .so needs to be in the right
location and the php.ini needs the appropriate extension directive.

Mike

-- 
Michael B Allen
PHP Active Directory SSO
http://www.ioplex.com/

--- End Message ---
--- Begin Message ---
On Friday 11 August 2006 18:15, Michael B Allen wrote:
> On Fri, 11 Aug 2006 17:50:12 -0500
>
> Ray Hauge <[EMAIL PROTECTED]> wrote:
> > Hello everyone,
> >
> > I successfully compiled PHP 4.4.3 and PHP 5.1.4 today.  I'm having a
> > problem with loading the PDFLib extension (pdflib_php.so).  It works fine
> > in PHP 4, but PHP5 is not loading it.  I do know that I have the file in
> > the correct location (same as the mysql.so file), and when I take out
> > mysql.so, then mysql functions are not available.  I am not sure why this
> > module is not loading.
> >
> > I checked the error_log, and I didn't get any error messages at all. 
> > STFW didn't give me a whole lot of information.  Anyone have any ideas of
> > where to look to find out why it's not loading?
>
> Was the module compiled for 5? Check the apache error.log. If the .so
> can't resolve a symbol or similar, usually that type of error appears in
> the apache error log. Also, of course the .so needs to be in the right
> location and the php.ini needs the appropriate extension directive.
>
> Mike

Thanks for the info.  I found out I had to download the latest version of 
PDFlib to support PHP 5.1.X.  It's working fine now.

-- 
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
www.americanstudentloan.com
1.800.575.1099

--- End Message ---

Reply via email to