On Thu, 17 Jul 2008 04:43:13 -0700 (PDT) wrote Captain Paralytic
<paul_lautman@y ahoo.com>:
As I don't know how to move or to be moved I only can react here.
As ob_start was new to me it took some experimenting to learn to
handle it. I did not succeed. Besides it was all about a more
user-friendly way avoiding an unnecessary click. I got the impression
that by using ob_start etcetera the visitor is urged to keep a lot of
content on his computer. The only reason to write this that I want to
know if I'm right in this. Or is this all happening on the server?
<paul_lautman@y ahoo.com>:
>On 17 Jul, 08:55, Annette Block <wrote:
>
>I'm going to move this discussion across to comp.lang.php, which is
>where it should be sitting.
>
>The way to overcome this problem is to use a buffer (see ob_start())
>to hold the output. Then, if you find that you need to issue the
>header call, you can use
>while ob_end_clean();
>to clear the buffer. No headers will have been issued then. If you
>find that you need to output the existing traffic, use ob_end_flush().
>On Wed, 16 Jul 2008 23:59:16 +0100 wrote "Paul Lautman"
><paul.laut...@ btinternet.com> :
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>I'm sorry to say no. Before calling header() a lot of traffic has been
>sent. But thank you.
>Annette- Hide quoted text -
>>
>- Show quoted text -
><paul.laut...@ btinternet.com> :
>>
>>
>>
>>
>>
>Annette Block wrote:
>On Wed, 16 Jul 2008 20:32:31 +0100 wrote "Paul Lautman"
><paul.laut...@ btinternet.com> :
>On Wed, 16 Jul 2008 20:32:31 +0100 wrote "Paul Lautman"
><paul.laut...@ btinternet.com> :
>>>Annette Block wrote:
>>>From a database of flowering plants (and ferns actually) visitors
>>>can select a genus name and the narrow the search for species of
>>>that genus. Then links are offered to the plants found.
>>>The code is:
>>>....
>>>$sql = "SELECT nr, genus, species FROM flplants WHERE genus =
>>>$gname"; $result = mysql_query($sq l) or die (mysql_error()) ;
>>>$number = mysql_numrows($ result);
>>>echo "You asked for $gname. ";
>>>echo "We have the next $number of species to offer:<br>";
>>>while($row = mysql_fetch_arr ay($result))
>>>{
>>>echo "<a href=\"plant.ph p?nr=$row[0]\">"."$gname "." ".
>>>$row[2]."</a><br>";
>>>}
>>>....
>>>From a database of flowering plants (and ferns actually) visitors
>>>can select a genus name and the narrow the search for species of
>>>that genus. Then links are offered to the plants found.
>>>The code is:
>>>....
>>>$sql = "SELECT nr, genus, species FROM flplants WHERE genus =
>>>$gname"; $result = mysql_query($sq l) or die (mysql_error()) ;
>>>$number = mysql_numrows($ result);
>>>echo "You asked for $gname. ";
>>>echo "We have the next $number of species to offer:<br>";
>>>while($row = mysql_fetch_arr ay($result))
>>>{
>>>echo "<a href=\"plant.ph p?nr=$row[0]\">"."$gname "." ".
>>>$row[2]."</a><br>";
>>>}
>>>....
>>>So far, so good.
>>>However, rather often there is only one row. Now I wonder if there
>>>is a possiblity to guide the visitor in that case directly to the
>>>file instead of clicking that one link.
>>>I guess it should be something like
>>>if ($number ==1)
>>>{// code directly to plant.php with the right nr}
>>>else
>>>{//the above mentioned part from "You asked...}
>>>However, rather often there is only one row. Now I wonder if there
>>>is a possiblity to guide the visitor in that case directly to the
>>>file instead of clicking that one link.
>>>I guess it should be something like
>>>if ($number ==1)
>>>{// code directly to plant.php with the right nr}
>>>else
>>>{//the above mentioned part from "You asked...}
>>>Thank you
>>>Annette Block
>>>Annette Block
>>>This isn't really a MySQL question.
>>>Look at the php header() function with the Location: keyword
>>>Look at the php header() function with the Location: keyword
>In that case: sorry for posting in the wrong group.
>Annette
>Annette
>No problem, hope the answer helped.
>I'm sorry to say no. Before calling header() a lot of traffic has been
>sent. But thank you.
>Annette- Hide quoted text -
>>
>- Show quoted text -
>I'm going to move this discussion across to comp.lang.php, which is
>where it should be sitting.
>
>The way to overcome this problem is to use a buffer (see ob_start())
>to hold the output. Then, if you find that you need to issue the
>header call, you can use
>while ob_end_clean();
>to clear the buffer. No headers will have been issued then. If you
>find that you need to output the existing traffic, use ob_end_flush().
As ob_start was new to me it took some experimenting to learn to
handle it. I did not succeed. Besides it was all about a more
user-friendly way avoiding an unnecessary click. I got the impression
that by using ob_start etcetera the visitor is urged to keep a lot of
content on his computer. The only reason to write this that I want to
know if I'm right in this. Or is this all happening on the server?
Comment