php-windows Digest 25 Aug 2003 06:58:02 -0000 Issue 1885
Topics (messages 21223 through 21234):
Re: please help with table again
21223 by: BQ777
21224 by: Duane Lakoduk
21229 by: Svensson, B.A.T. (HKG)
21231 by: Amzadi
problem in VB
21225 by: cmkpl
this is so difficult for me
21226 by: Thomas Edward Lawrence
21227 by: Donatas
21230 by: Svensson, B.A.T. (HKG)
Re: Form data
21228 by: la Sorour
So great , thank so much
21232 by: Thomas Edward Lawrence
21233 by: Thomas Edward Lawrence
Array question
21234 by: Disko_kex
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 ---
<?
$max_cols = 5;
$max_values = 15;
echo "<table>";
$max_rows = floor(bcdiv($max_values,$max_cols,2));
$counter = 0;
for($schleife=0; $schleife<$max_rows; $schleife++){
echo "<tr>";
for($schleife_cols=0; $schleife_cols<$max_cols; $schleife_cols++){
$counter++;
echo "<td>".$counter."</td>";
}
}
?>
have fun
-----Original Message-----
From: Thomas Edward Lawrence [mailto:[EMAIL PROTECTED]
Sent: Saturday, August 23, 2003 9:57 PM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] please help with table again
I want it echo 5 columns with 3 row , but it also echo numbers which
increase to follow columns like this , how I must write , please show me
again , thank you .
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Ok, try this;
<table border="1" width="100%">
<?php
$lastcol=0;
for($i=1; $i<4; $i++){
print "<tr>";
for($y=1; $y<6; $y++){
print "<td>".($y+$lastcol)."</td>";
}
print "</tr>";
$lastcol=$y;
}
?>
</table>
php, Duane
-----Original Message-----
From: Thomas Edward Lawrence [mailto:[EMAIL PROTECTED]
Sent: Saturday, August 23, 2003 11:57 PM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] please help with table again
I want it echo 5 columns with 3 row , but it also echo numbers which
increase to follow columns like this , how I must write , please show me
again , thank you .
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Are you trying to solve a particular problem or
do you want to learn to do programing?
I don't want to be rude, but the question you ask are
fairly basic programming knowledge, and I would recommend
you to get a good beginners book on programming.
Anyway, on to your question:
If you want to write a table, but alos need to manipulte
the contents in each field, then you need to make two
itterations, e.g. loops.
The outer loop will control how many rows you have, and the
inner will control how many columns you have. If you want to
manipulate the each values in the table it has to be done in
the inner loop.
The outer loop value will tell you wich row you currently
working on, and the inner loop value will tell you wich
column you work with. Just like a X-Y cordinate system.
For instance if you want a fixed value, different for each,
rows, then reuse the outer loops incrementer) and display
this value.
If you want to increase the numbers all the time, then locate
and incrementor in the inner loop and display this value.
And finaly as an exercice you should try to modify the code
so it displays the numbers a) in revers order, b) up-down and
top left, c) and rotate the matrix 90 degrees, e.g make it a
5 rows x 3 cols matris and display the numbers just as they
are in the 3x5 matrix, but rotated.
If you solve these three problem you will be much more confident
and better suited in handling itterations afterwards.
Kind reagrds,
//Anders
-----Original Message-----
From: Thomas Edward Lawrence
To: [EMAIL PROTECTED]
Sent: 2003-08-24 06:57
Subject: [PHP-WIN] please help with table again
I want it echo 5 columns with 3 row , but it also echo numbers which
increase to follow columns like this , how I must write , please show
me
again , thank you .
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Since you mentioned it, what do you think is the best entry level book
for programming PHP? I'd like to hear others opinions as well.
-----Original Message-----
From: Svensson, B.A.T. (HKG) [mailto:[EMAIL PROTECTED]
Sent: Sunday, August 24, 2003 8:41 AM
To: 'Thomas Edward Lawrence '; '[EMAIL PROTECTED] '
Subject: RE: [PHP-WIN] please help with table again
Are you trying to solve a particular problem or
do you want to learn to do programing?
I don't want to be rude, but the question you ask are
fairly basic programming knowledge, and I would recommend
you to get a good beginners book on programming.
Anyway, on to your question:
If you want to write a table, but alos need to manipulte
the contents in each field, then you need to make two itterations, e.g.
loops.
The outer loop will control how many rows you have, and the inner will
control how many columns you have. If you want to manipulate the each
values in the table it has to be done in the inner loop.
The outer loop value will tell you wich row you currently working on,
and the inner loop value will tell you wich column you work with. Just
like a X-Y cordinate system.
For instance if you want a fixed value, different for each, rows, then
reuse the outer loops incrementer) and display this value.
If you want to increase the numbers all the time, then locate and
incrementor in the inner loop and display this value.
And finaly as an exercice you should try to modify the code
so it displays the numbers a) in revers order, b) up-down and top left,
c) and rotate the matrix 90 degrees, e.g make it a 5 rows x 3 cols
matris and display the numbers just as they are in the 3x5 matrix, but
rotated.
If you solve these three problem you will be much more confident and
better suited in handling itterations afterwards.
Kind reagrds,
//Anders
-----Original Message-----
From: Thomas Edward Lawrence
To: [EMAIL PROTECTED]
Sent: 2003-08-24 06:57
Subject: [PHP-WIN] please help with table again
I want it echo 5 columns with 3 row , but it also echo numbers which
increase to follow columns like this , how I must write , please show
me again , thank you .
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
how to link the vb to php by dll of php
so i can input the script in vb and get outout through vb
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 19/8/2003
--- End Message ---
--- Begin Message ---
I have an array $row["pictures"] which includes 15 pictures , I want to
echo it like this , this is so difficult for me ,
picture1 picture2 picture3 picture4 picture5
picture6 picture7 picture8 picture9 picture10
picture11 picture12 picture13 picture14 picture15
this is my code ;
<?
mysql_connect('localhost', '', '');
mysql_select_db("myshop");
$result= mysql_query("select * from productlist where id=$mn") ;
$i = 0;
$cnt = mysql_num_rows($result);
while ($i <= $cnt)
{
$row = mysql_fetch_array($result) ;
$i++ ;
$_SESSION["picture($i)"] = $row["pictures"] ;
echo "<tr><td><img src=". $row["pictures"] ."></td></tr>" ;
}
?>
--- End Message ---
--- Begin Message ---
This is how I would do it
<?
mysql_connect('localhost', '', '');
mysql_select_db("myshop");
$result= mysql_query("select * from productlist where id=$mn") ;
$cnt = mysql_num_rows($result);
$columns = 5; //number of columns in your table
for ($i = 0; $i != ceil ($cnt / $columns); $i++)
{
echo '<tr>'
for ($j = 0; $j != $columns; $j++)
{
$row = mysql_fetch_array($result);
$_SESSION["picture(".($i * $columns + $j).")"] = $row["pictures"];
echo "<td><img src=". $row["pictures"] ."></td>" ;
}
echo '</tr>';
}
?>
Sorry if there are any bugs here, I didn't test it :)
Cheers,
Donny
-----Original Message-----
From: Thomas Edward Lawrence [mailto:[EMAIL PROTECTED]
Sent: Sunday, August 24, 2003 11:56 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] this is so difficult for me
I have an array $row["pictures"] which includes 15 pictures , I want to
echo it like this , this is so difficult for me ,
picture1 picture2 picture3 picture4 picture5
picture6 picture7 picture8 picture9 picture10
picture11 picture12 picture13 picture14 picture15
this is my code ;
<?
mysql_connect('localhost', '', '');
mysql_select_db("myshop");
$result= mysql_query("select * from productlist where id=$mn") ;
$i = 0;
$cnt = mysql_num_rows($result);
while ($i <= $cnt)
{
$row = mysql_fetch_array($result) ;
$i++ ;
$_SESSION["picture($i)"] = $row["pictures"] ;
echo "<tr><td><img src=". $row["pictures"] ."></td></tr>" ;
}
?>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
You need two loops for that, just like the code
that somebody posted for you. Reuse that code,
and it will probabley work out oki fine with you.
-----Original Message-----
From: Thomas Edward Lawrence
To: [EMAIL PROTECTED]
Sent: 2003-08-24 11:56
Subject: [PHP-WIN] this is so difficult for me
I have an array $row["pictures"] which includes 15 pictures , I want to
echo it like this , this is so difficult for me ,
picture1 picture2 picture3 picture4 picture5
picture6 picture7 picture8 picture9 picture10
picture11 picture12 picture13 picture14 picture15
this is my code ;
<?
mysql_connect('localhost', '', '');
mysql_select_db("myshop");
$result= mysql_query("select * from productlist where id=$mn") ;
$i = 0;
$cnt = mysql_num_rows($result);
while ($i <= $cnt)
{
$row = mysql_fetch_array($result) ;
$i++ ;
$_SESSION["picture($i)"] = $row["pictures"] ;
echo "<tr><td><img src=". $row["pictures"] ."></td></tr>" ;
}
?>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
you'll have to put this piece of code in the form your submitting to to grab
your form variables:
extract($_POST);
extract($_GET);
see this link:
http://www.ithome.org/page.php?page=2
--------------------------
From: "Muhammad Imran" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject: [PHP-WIN] Form data
Date: Fri, 22 Aug 2003 07:56:59 +0500
MIME-Version: 1.0
Received: from pb1.pair.com ([216.92.131.4]) by mc3-f21.law16.hotmail.com
with Microsoft SMTPSVC(5.0.2195.5600); Thu, 21 Aug 2003 07:56:45 -0700
Received: (qmail 67434 invoked by uid 1010); 21 Aug 2003 14:56:38 -0000
Received: (qmail 67265 invoked from network); 21 Aug 2003 14:56:30 -0000
X-Message-Info: JGTYoYF78jGHSAAv19JF6fYchPnBN8Lr
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
list-help: <mailto:[EMAIL PROTECTED]>
list-unsubscribe: <mailto:[EMAIL PROTECTED]>
list-post: <mailto:[EMAIL PROTECTED]>
Delivered-To: mailing list [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
Return-Path: [EMAIL PROTECTED]
X-OriginalArrivalTime: 21 Aug 2003 14:56:46.0124 (UTC)
FILETIME=[70F436C0:01C367F4]
How i can process my form data, my form contain just one text input
field and .php code have to show it but when i press ""SUBMIT" button my
page url does not change nor the input text seen thier. my php code is :
<html>
<body>
<p>Welcome<?php echo ($Applicant); ?>!</p>
</body>
</html>
html form just send the input text with Applicant text field data. However
my php and apache is working fine. Do any one have idea.
Imran
_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus
--- End Message ---
--- Begin Message ---
So great , thank so much , I am just a beginner , thanks all people who are
intersted in and
anwser my questions , thank you .
...............................
"Donatas" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> This is how I would do it
>
> <?
> mysql_connect('localhost', '', '');
> mysql_select_db("myshop");
> $result= mysql_query("select * from productlist where id=$mn") ;
> $cnt = mysql_num_rows($result);
> $columns = 5; //number of columns in your table
>
> for ($i = 0; $i != ceil ($cnt / $columns); $i++)
> {
> echo '<tr>'
> for ($j = 0; $j != $columns; $j++)
> {
> $row = mysql_fetch_array($result);
> $_SESSION["picture(".($i * $columns + $j).")"] = $row["pictures"];
> echo "<td><img src=". $row["pictures"] ."></td>" ;
> }
> echo '</tr>';
> }
> ?>
>
> Sorry if there are any bugs here, I didn't test it :)
>
> Cheers,
> Donny
>
>
> -----Original Message-----
> From: Thomas Edward Lawrence [mailto:[EMAIL PROTECTED]
> Sent: Sunday, August 24, 2003 11:56 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] this is so difficult for me
>
> I have an array $row["pictures"] which includes 15 pictures , I want to
> echo it like this , this is so difficult for me ,
>
> picture1 picture2 picture3 picture4 picture5
>
> picture6 picture7 picture8 picture9 picture10
>
> picture11 picture12 picture13 picture14 picture15
>
>
> this is my code ;
>
> <?
> mysql_connect('localhost', '', '');
> mysql_select_db("myshop");
> $result= mysql_query("select * from productlist where id=$mn") ;
> $i = 0;
> $cnt = mysql_num_rows($result);
> while ($i <= $cnt)
> {
> $row = mysql_fetch_array($result) ;
> $i++ ;
> $_SESSION["picture($i)"] = $row["pictures"] ;
> echo "<tr><td><img src=". $row["pictures"] ."></td></tr>" ;
> }
> ?>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
So great , thank so much , I am just a beginer , thanks all people who are
intersted in and
anwser my questions , thank you .
...................
"Donatas" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> This is how I would do it
>
> <?
> mysql_connect('localhost', '', '');
> mysql_select_db("myshop");
> $result= mysql_query("select * from productlist where id=$mn") ;
> $cnt = mysql_num_rows($result);
> $columns = 5; //number of columns in your table
>
> for ($i = 0; $i != ceil ($cnt / $columns); $i++)
> {
> echo '<tr>'
> for ($j = 0; $j != $columns; $j++)
> {
> $row = mysql_fetch_array($result);
> $_SESSION["picture(".($i * $columns + $j).")"] = $row["pictures"];
> echo "<td><img src=". $row["pictures"] ."></td>" ;
> }
> echo '</tr>';
> }
> ?>
>
> Sorry if there are any bugs here, I didn't test it :)
>
> Cheers,
> Donny
>
>
> -----Original Message-----
> From: Thomas Edward Lawrence [mailto:[EMAIL PROTECTED]
> Sent: Sunday, August 24, 2003 11:56 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] this is so difficult for me
>
> I have an array $row["pictures"] which includes 15 pictures , I want to
> echo it like this , this is so difficult for me ,
>
> picture1 picture2 picture3 picture4 picture5
>
> picture6 picture7 picture8 picture9 picture10
>
> picture11 picture12 picture13 picture14 picture15
>
>
> this is my code ;
>
> <?
> mysql_connect('localhost', '', '');
> mysql_select_db("myshop");
> $result= mysql_query("select * from productlist where id=$mn") ;
> $i = 0;
> $cnt = mysql_num_rows($result);
> while ($i <= $cnt)
> {
> $row = mysql_fetch_array($result) ;
> $i++ ;
> $_SESSION["picture($i)"] = $row["pictures"] ;
> echo "<tr><td><img src=". $row["pictures"] ."></td></tr>" ;
> }
> ?>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
If I have an array like this > [0] => 1 [1] => 2 [2] => 3 ... [99] =>
100
If I want to select [50] => 51 and store the value that's 2 positions
before and 1 position after, how can I do?
If I want to know what position value 71 have?
I have search the PHP-manual and found some functions as prev, next, pos
etc. But with these commands I have to loop thru the array every time to
reach the the values and positions. It has to be an easier way to do it.
// jocke
--- End Message ---