php-windows Digest 18 Feb 2003 11:04:55 -0000 Issue 1593
Topics (messages 18565 through 18572):
< Previous and Next > Buttons
18565 by: Matt Babineau
18566 by: J.Veenhuijsen
18571 by: Chris Kranz
PHP Classes, what the heck??
18567 by: Matt Babineau
18569 by: Matt Hillebrand
Re: Warnings
18568 by: Brian 'Bex' Huff
mail() CC: header
18570 by: Matt Hillebrand
Re: String Compare
18572 by: Ferzan
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 ---
Hi All-
I was wondering what the best way to create previous and next buttons
when pulling products from a database? I haven't had much luck so far
and was wondering if someone had an easy / efficient way to accomplish
this?
Thx-
M
--- End Message ---
--- Begin Message ---
I once used the script below on a dbase database.
Jochem
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title></title>
</head>
<body>
<script language="PHP">
$step=30;
$file_name='dbs/files.DBF';
$ret=dbase_open($file_name,0);
$max=dbase_numrecords($ret);
if (isset($start))
{
$start_record=$start;
}
$arr = dbase_get_record_with_names($ret,$i);
echo($file_name);
</script>
<div align="left">
<table border="0" width="1500" height="17">
<tr>
<td width="150" height="17" bgcolor="#FFCC00"><font face="Verdana"
size="1"><b>RECNO</b></font></td>
<script language="PHP">
while (list($key,$val) = each ($arr))
{
</script>
<td width="150" height="17" bgcolor="#FFCC00"><font
face="Verdana" size="1"><b><?php echo (strtoupper($key)) ?></b></font></td>
<script language="PHP">
}
</script>
</tr>
<script language="PHP">
for ($i=$start_record;$i<=$start_record+$step;$i++)
{
$arr = dbase_get_record_with_names($ret,$i);
</script>
<tr>
<td width="150" height="17"><font face="Verdana" size="1"><?php
echo($i); ?></font></td>
<script language="PHP">
while (list($key,$val) = each ($arr))
{
</script>
<td width="150" height="17"><font face="Verdana"
size="1"><?php echo($val) ?></font></td>
<script language="PHP">
}
</script>
</tr>
<script language="PHP">
}
</script>
</table>
</div>
<script language="PHP">
$next_start_record=$start_record+$step;
if ($next_start_record+$step>$max)
{
$next_start_record=$max-$step;
}
$prev_start_record=$start_record-$step;
if ($prev_start_record<0)
{
$prev_start_record=0;
}
</script>
<p><font face="Verdana" size="2"><b><a href="<?php
echo($PHP_SELF);?>?start=<?php echo($prev_start_record) ?>">PREV</a>
<a href="<?php echo($PHP_SELF);?>?start=<?php echo($next_start_record)
?>">NEXT</a>
</b></font></p>
</body>
</html>
Matt Babineau wrote:
Hi All-
I was wondering what the best way to create previous and next buttons
when pulling products from a database? I haven't had much luck so far
and was wondering if someone had an easy / efficient way to accomplish
this?
Thx-
M
--- End Message ---
--- Begin Message ---
Sorry I can't be much more help than this... but lookup the LIMIT
function for MySQL. If you track how many records your displaying on
each page, and what record your on, it's pretty straight forward to make
next, prev page navigation. Next and prev will obviously have pointers
to whatever record your currently on, and it should be fairly straight
forward...
Hope this helps anyway...
chris kranz
fatcuban.com
-----Original Message-----
From: Matt Babineau [mailto:[EMAIL PROTECTED]]
Sent: 17 February 2003 15:03
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] < Previous and Next > Buttons
Hi All-
I was wondering what the best way to create previous and next buttons
when pulling products from a database? I haven't had much luck so far
and was wondering if someone had an easy / efficient way to accomplish
this?
Thx-
M
--- End Message ---
--- Begin Message ---
I have read a little about PHP classes, my question is what good are
they really? What are some examples that I can use these to my
advantage? Are there any really good tutorials about these aside from
the PHP.net site?
Thx~!
Matt
--- End Message ---
--- Begin Message ---
Matt,
Object Oriented Programming (OOP) is good because it promotes code reuse
and code encapsulation. Well, PHP4 doesn't do a good job of this. I love
OOP, but I'm waiting for PHP5 to do any OO with PHP. Stick to procedural
PHP for now, and you'll be just fine.
Matt Hillebrand
|-----Original Message-----
|From: Matt Babineau [mailto:[EMAIL PROTECTED]]
|Sent: Monday, February 17, 2003 9:54 AM
|To: [EMAIL PROTECTED]
|Subject: [PHP-WIN] PHP Classes, what the heck??
|
|
|I have read a little about PHP classes, my question is what
|good are they really? What are some examples that I can use
|these to my advantage? Are there any really good tutorials
|about these aside from the PHP.net site?
|
|Thx~!
|
|Matt
|
--- End Message ---
--- Begin Message ---
you guys should really search the archives for answers, this is a very
common problem:
http://marc.theaimsgroup.com/?l=php-windows&w=2&r=1&s=headers+already+sent&q=b
Here's the thing... the session stuff is done with HTTP cookies. Some
people do it with session vars in every URL, but most of the time its
cookies.
Anyway, HTTP cookies have to be sent in the HTTP headers of the request,
along with content type, content length, etc. After you send them, you
can start sending HTML text.
If you try to set session vars or cookies in the middle of a PHP page,
it will fail, because the HTTP headers are already set. You can only do
session and header manipulation at the ABSOLUTE TOP of your PHP page.
No white space whatsoever.
You can get around this limitation by setting 'output_buffering' to some
number in your 'php.ini' file... most likely your dev box has this set,
but your ISP does not.
--
Brian 'Bex' Huff
[EMAIL PROTECTED]
Phone: 952-903-2023
Fax: 952-829-5424
I had the same message the other day. My line 5 is where I call a
function. I had a </table> tag as the very last line of a function but
had it outside the closing brace } so I moved </table> inside the
closing brace } and the problem went away.
-----Original Message-----
From: Bobo Wieland [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 15, 2003 7:34 AM
To: [EMAIL PROTECTED]
Subject: Warnings
What does this mean:
Warning: Cannot send session cookie - headers already sent by (output
started at
/customers/pingstkyrkan.net/pingstkyrkan.net/httpd.www/fp/index.php:1)
in
customers/pingstkyrkan.net/pingstkyrkan.net/httpd.www/fp/index.php on
line 5
Warning: Cannot send session cache limiter - headers already sent
(output
started at
/customers/pingstkyrkan.net/pingstkyrkan.net/httpd.www/fp/index.php:1)
in
/customers/pingstkyrkan.net/pingstkyrkan.net/httpd.www/fp/index.php on
line
5
The php-file worked perfectly well on my local machine...
.bobo
--- End Message ---
--- Begin Message ---
Has anyone here successfully sent CC headers with mail()? It simply
won't work for me. I get different errors depending on which mail server
I use.
Matt
--- End Message ---
--- Begin Message ---
Brennan Mann <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello Everybody,
>
> Is there a way to do a hex view on strings. Right now my if statement is
> evaluating to false when I compare these two strings:
> S1: 1000
> S2: 1000
> If ($s1 == $s2) should evaluate to true not to false.
> I tried a couple different things to see if I could get it the statement
to
> evaluate to true and this worked:
> if($string1 == "1000"), but I can't get it to work with both variables.
Both
> variables are string type. Any Ideas?
>
> Thanks,
> Brennan
>
>
--- End Message ---