php-general Digest 3 May 2012 20:05:51 -0000 Issue 7799

Topics (messages 317758 through 317762):

Re: Retrieve pages from an ASP driven site
        317758 by: Terry Ally (Gmail)
        317759 by: Lester Caine
        317761 by: EPA WC

Why might fclose() block?
        317760 by: Andy Theuninck

Re: PHP Mailto() - Google now displaying HTML as Plain Text
        317762 by: Gerardo Benitez

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Tom,

Here is how you would paginate in PHP.

/****************************************/
// Number of records to show per page:
$display = 4;
// Determine how many records there are.
if (isset($_GET['np'])) {
$num_pages = $_GET['np'];
} else {
$query = "SELECT * FROM mytable";
$query_result = mysql_query ($query) or die (mysql_error());
$num_records = @mysql_num_rows ($query_result);
 if ($num_records > $display) {
$num_pages = ceil ($num_records/$display);
} else {
$num_pages = 1;
}
}
 // Determine where in the database to start returning results.
if (isset($_GET['s'])) {
$start = $_GET['s'];
} else {
$start = 0;
}


// Number of records to show per page:
$display = 4;
// Determine how many records there are.
if (isset($_GET['np'])) {
$num_pages = $_GET['np'];
} else {
$query3 = "SELECT * FROM mytable";
$query_result = mysql_query ($query3) or die (mysql_error());
$num_records = @mysql_num_rows ($query_result);
 if ($num_records > $display) {
$num_pages = ceil ($num_records/$display);
} else {
$num_pages = 1;
}
}
 // Determine where in the database to start returning results.
if (isset($_GET['s'])) {
$start = $_GET['s'];
} else {
$start = 0;
}
/****************************************/




On 3 May 2012 05:37, EPA WC <epawc...@gmail.com> wrote:

> Hi List,
>
> I am trying to write a crawler to go through web pages at
> http://www.freebookspot.es/CompactDefault.aspx?Keyword=. But I am not
> quite familiar with how asp uses _doPostBack function with the "next"
> button below the book list to advance to the next page. I hope someone
> who knows ASP well can help out here. I need to know how to retrieve
> next page with PHP code.
>
> Kind regards,
> Tom
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
*Terry Ally*
Twitter.com/terryally
Facebook.com/terryally
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
To print or not to print this email is the environmentally-searching
question!
Which has the highest ecological cost? A sheet of paper or constantly
switching on your computer and connecting to the Internet to read your
email?

--- End Message ---
--- Begin Message ---
Terry Ally (Gmail) wrote:
Here is how you would paginate in PHP.

Terry - Tom is not trying to create this in PHP, but read existing ASP pages.

Tom - I don't think that it's simply a matter of the ASP code here, but rather how they have constructed the set of information they are sending back. That is done in javascript, but the navigation buttons are simple form submit. BNext is submitted for 'next'.

Interestingly, the sales side seems to be .php ;)

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

--- End Message ---
--- Begin Message ---
Thanks Lester.

On Thu, May 3, 2012 at 3:49 AM, Lester Caine <les...@lsces.co.uk> wrote:
> Terry Ally (Gmail) wrote:
>>
>> Here is how you would paginate in PHP.
>
>
> Terry - Tom is not trying to create this in PHP, but read existing ASP
> pages.
>
> Tom - I don't think that it's simply a matter of the ASP code here, but
> rather how they have constructed the set of information they are sending
> back. That is done in javascript, but the navigation buttons are simple form
> submit. BNext is submitted for 'next'.
>
> Interestingly, the sales side seems to be .php ;)
>
> --
> Lester Caine - G8HFL
> -----------------------------
> Contact - http://lsces.co.uk/wiki/?page=contact
> L.S.Caine Electronic Services - http://lsces.co.uk
> EnquirySolve - http://enquirysolve.com/
> Model Engineers Digital Workshop - http://medw.co.uk//
> Firebird - http://www.firebirdsql.org/index.php
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
I'm currently seeing this in 5.3.10, although it's an intermittent
problem I've seen earlier versions too. Occasionally I get a "maximum
execution time" error when calling fclose() on a parallel port file
descriptor. Code looks like this:

$fp = fopen('/dev/lp0','w');
if ($fp){
   fwrite($fp,$LongStringOfData);
   fclose($fp);
}

The printer attached to the parallel port does print the data sent in
the fwrite line and the execution time error identifies the fclose
line. It does not appear to be OS dependent. I've seen the error in
both CentOS and Ubuntu as well as Windows (with LPT1: instead of
/dev/lp0).

What could cause fclose() to block rather than fail and return False?
Is there anything vaguely equivalent to socket_select that I can use
to wait for a blocking file descriptor with a specified timeout?

--- End Message ---
--- Begin Message ---
Do you know if the mailto script allow set headers?

Probably you must set a html header, something like this
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";


Regards,
Gerardo.

On Tue, May 1, 2012 at 5:14 PM, Marco Behnke <ma...@behnke.biz> wrote:

>
>
> Am 29.04.2012 22:31, schrieb Terry Ally (Gmail):
>
>> Hi all,
>>
>> I have been using a mailto() script for the last three years and from
>> April
>> 25, 2012 incoming HTML email in Goggle mail is displaying as Plain Text.
>>  Something clearly changed with Google. Perhaps there is some change I
>> need
>> to make with my script??
>>
>> $message .= "<p><b>Message:</b><**blockquote>  ".$m."</blockquote></p>";
>>
>>
> As far as I can see your main html tags are missing?
>
> $message = '<html><body>' . $message . '</body></html>';
>
>
> --
> Marco Behnke
> Dipl. Informatiker (FH), SAE Audio Engineer
> Zend Certified Engineer PHP 5.3
>
> Tel.: 0174 / 9722336
> e-Mail: ma...@behnke.biz
>
> Softwaretechnik Behnke
> Heinrich-Heine-Str. 7D
> 21218 Seevetal
>
> http://www.behnke.biz
>
>
>


-- 
Gerardo Benitez
-------------------------
Programador Web Freelance

--- End Message ---

Reply via email to