On 16 June 2008 21:58, Richard Kurth advised:
I am looping through a database of files that are numbers 1 through 10
if number 1 is in the database I what to print out the first table
below if it is not then print the else section below. Then
loop through
the database to see if 2 through 10
I am looping through a database of files that are numbers 1 through 10
if number 1 is in the database I what to print out the first table
below if it is not then print the else section below. Then loop through
the database to see if 2 through 10 are there and do the same thing. Of
course what
Richard Kurth wrote:
I am looping through a database of files that are numbers 1 through 10
if number 1 is in the database I what to print out the first table
below if it is not then print the else section below. Then loop through
the database to see if 2 through 10 are there and do the same
Wolf wrote:
Richard Kurth wrote:
I am looping through a database of files that are numbers 1 through
10 if number 1 is in the database I what to print out the first
table below if it is not then print the else section below. Then loop
through the database to see if 2 through 10 are there and
Richard Kurth wrote:
Wolf wrote:
Richard Kurth wrote:
Could you please give me an idea where to start looking
while($row=mysql_fetch_array($sql_result)){
if ($row[number]==1) {
tr
td File 1/td
tdThis is the file/td
tdDelete/td
/tr
}else{
tr
tdFile1/td
td/td
tdAdd/td
/tr
}
}
What is the
i am not sure what u want to do, for this case you need to tell us
about your database table
structure. i quess you have table like this.. assume the table name is
table1 and there are ten
column in it file1..file10 respectively
|table1 |
|member_id |
|file1|
|file2
I am trying to loop through a $_POST variable. It comes from a text
area and it will have data like many email address or just one listed
with a space or on a new line. I can't seam to get the data to extract
properly. I have tried this below
$array = explode(' ', $_POST['emails']);
I am trying to get one email at a time and run it through the loop and
process it but if I have more than one email in the text area it gives
me nothing and does not run
What kind of problems are you having in extracting the data?
On Dec 30, 2007, at 4:29 PM, Richard Kurth wrote:
I am trying
On Sun, December 30, 2007 5:29 pm, Richard Kurth wrote:
I am trying to loop through a $_POST variable. It comes from a text
area and it will have data like many email address or just one listed
with a space or on a new line. I can't seam to get the data to extract
properly. I have tried
When I do a var_dump($_POST['emails']); it has all the emails in it
string(65) [EMAIL PROTECTED] [EMAIL PROTECTED]
[EMAIL PROTECTED]
I will validate the emails after I get the loop to work
$memberid comes from a part of the script I did not show you $memberid
=$_POST[members_id];
safe_query
You might want to check the loop alone and check each value of $value:
$array = explode(' ', $_POST['emails']);
foreach($array as $value) {
print '$value'br;
}
if it works that way, at least you narrow down the possibilities of
weirdness.
On Dec 30, 2007, at 5:34 PM, Richard Kurth
Okay.
Now var_dump($array) and see what it has.
On Sun, December 30, 2007 6:34 pm, Richard Kurth wrote:
When I do a var_dump($_POST['emails']); it has all the emails in it
string(65) [EMAIL PROTECTED] [EMAIL PROTECTED]
[EMAIL PROTECTED]
I will validate the emails after I get the loop to work
looks like that is my problem it is not separating the emails
string(67) [EMAIL PROTECTED] [EMAIL PROTECTED]
[EMAIL PROTECTED]
array(1) { [0]= string(67) [EMAIL PROTECTED] [EMAIL PROTECTED]
[EMAIL PROTECTED] }
$array = explode(' ', $_POST['emails']);
what should I use for spaces or next line
You should use whatever is actually BETWEEN the emails, which could be
anything...
See the thread about Tedd's bazaar (sic) problem and use the technique
there to see what you are actually getting.
You may even need to resort to a split instead of explode if newlines,
spaces, and
Hi.
On Monday 31 December 2007 00:34, Richard Kurth wrote:
When I do a var_dump($_POST['emails']); it has all the emails in it
string(65) [EMAIL PROTECTED] [EMAIL PROTECTED]
[EMAIL PROTECTED]
Then this simple regex should do you; just use it instead of explode:
$AddressList =
Say I have an array containing ten items, and I want to display them
in a table as follows:
5 4 3 2 1
10 9 8 7 6
What's the best way to loop through that array to do that? My
thinking gets me to create a loop for 5 through 1, repeated twice, and
the second time I add '5' to
Ashley M. Kirchner wrote:
Say I have an array containing ten items, and I want to display
them in a table as follows:
5 4 3 2 1
10 9 8 7 6
What's the best way to loop through that array to do that? My
thinking gets me to create a loop for 5 through 1, repeated twice, and
the
Ashley M. Kirchner wrote:
Say I have an array containing ten items, and I want to display
them in a table as follows:
5 4 3 2 1
10 9 8 7 6
What's the best way to loop through that array to do that? My
thinking gets me to create a loop for 5 through 1, repeated twice, and
the
?php
$arr = array(5, 4, 3, 2, 1, 10, 9, 8, 7, 6,);
echo 'table border=1';
echo 'tr';
for ($x=0,$y=sizeof($arr); $x$y; ++$x) {
echo td{$arr[$x]}/td;
if ($x == 4) {
echo
Brad Bonkoski wrote:
Something like this perhaps...
$arr = array(...);
$per_row = 5;
$elem = count($arr);
for($i=0; $i$elem; $i++) {
if( $i == 0 )
echo tr;
else if( $i % $per_row == 0 )
echo /trtr;
echo td$arr[$i]/td;
}
That simply displays things in order, 1 through 5,
If you know the array elements, you may not need to loop. Why not just echo
the particular array elements i.e. td?php echo $array[2]; ?/td for
example?
$arr = array(...);
$first_row = '';
$second_row = '';
for ($i=4; $i=0; $i--){
$first_row = $first_row . td{$arr[$x]}/td;
$second_row = $second_row . td{$arr[$x + 5]}/td;
}
print 'tr' . $first_row . '/tr';
print 'tr' . $second_row . '/tr';
On Nov 16, 2006, at 3:19 PM, Ashley M.
So in other words, you have an array like $arr = array
(1,2,3,4,5,6,7,8,9,10) but you want it to render on the page as:
5 4 3 2 1
10 9 8 7 6
right?
-D
On Nov 16, 2006, at 1:35 PM, Ashley M. Kirchner wrote:
Darrell Brogdon wrote:
$arr = array(5, 4, 3, 2, 1, 10, 9, 8, 7, 6,);
The
Darrell Brogdon wrote:
So in other words, you have an array like $arr =
array(1,2,3,4,5,6,7,8,9,10) but you want it to render on the page as:
5 4 3 2 1
10 9 8 7 6
right?
That would be correct. James Tu provided a solution that I think
will work. I'm always open to other suggestions of
At 1:19 PM -0700 11/16/06, Ashley M. Kirchner wrote:
Say I have an array containing ten items, and I want to display
them in a table as follows:
5 4 3 2 1
10 9 8 7 6
What's the best way to loop through that array to do that? My
thinking gets me to create a loop for 5 through 1,
At 11/16/2006 12:19 PM, Ashley M. Kirchner wrote:
Say I have an array containing ten items, and I want to display
them in a table as follows:
5 4 3 2 1
10 9 8 7 6
What's the best way to loop through that array to do that? My
thinking gets me to create a loop for 5 through 1,
Greetings All,
I have a problem that I usually solve in MySQL pretty easily, but using
PEAR identifiers are not working.
Any suggestions.
I want to loop through a result set in two different while loops that
are not nested.
I am able to do in it MySQl as follows
$sql=Some query;
$result =
Shouldn't it be;
$sql=Some query;
$result = $conn-query($sql);
//V VVV
while ($row = $conn-fetchArray($result)) {
echo $row['hey'];
}
// V VVV
while ($row2 = $conn-fetchArray($result)) {
echo $row2['otherhey'];
}
On Wed, May 24, 2006 at 02:28:33PM -0600, Phillip S. Baker wrote:
Greetings All,
I have a problem that I usually solve in MySQL pretty easily, but using
PEAR identifiers are not working.
Any suggestions.
I want to loop through a result set in two different while loops that
are not
A little OT but i think it is important :
I really would not write this code like this .
You are making too many queries to the database . If u have 100 rows in first
table and 200 rows returned from second query , you make 100*200 queries to
the database !
Try using SQL Joins. Like this :
Sorry .
The correct SQL should be:
$query =select * from cforum cf INNER JOIN scforum ON
cforum.id=scforum.cfid;
:)
On Tuesday April 4 2006 11:58, Georgi Ivanov wrote:
A little OT but i think it is important :
I really would not write this code like this .
You are making too many queries
i am creating a forum and i am having trouble getting the database
information in to an html table
i believe it has somthing to do with the placement of the while
loops because they repeat the segment of code over untill the
statment returns false, thus adding extra html.. you guys are the
benifactor wrote:
i am creating a forum and i am having trouble getting the database information
in to an html table
i believe it has somthing to do with the placement of the while loops because
they repeat the segment of code over untill the statment returns false, thus
adding extra html..
Richard K Miller wrote:
Good afternoon. I'm having trouble getting PHP to loop from A through
Z. Here is what I tried, coming from a C background:
for ($l = A; $l = Z; $l++)
echo $l;
I use this:
for($i='a'; $i != 'aa'; $i++){
print $i;
|
--
PHP General Mailing List
Good afternoon. I'm having trouble getting PHP to loop from A
through Z. Here is what I tried, coming from a C background:
for ($l = A; $l = Z; $l++)
echo $l;
// Returns A, B, C, ..., X, Y, Z, AA, AB, AC, AD, AE, ... YX, YY,
YZ. (26 * 26 results!)
Interestingly, if I make it a
Good afternoon. I'm having trouble getting PHP to loop from A through Z.
Here is what I tried, coming from a C background:
for ($l = A; $l = Z; $l++)
echo $l;
// Returns A, B, C, ..., X, Y, Z, AA, AB, AC, AD, AE, ... YX, YY, YZ. (26 *
26 results!)
Interestingly, if I make it a less
Good afternoon. I'm having trouble getting PHP to loop from A
through Z. Here is what I tried, coming from a C background:
for ($l = A; $l = Z; $l++)
echo $l;
// Returns A, B, C, ..., X, Y, Z, AA, AB, AC, AD, AE, ... YX, YY,
YZ. (26 * 26 results!)
Interestingly, if I make it a less
Good afternoon. I'm having trouble getting PHP to loop from A
through Z. Here is what I tried, coming from a C background:
for ($l = A; $l = Z; $l++)
echo $l;
// Returns A, B, C, ..., X, Y, Z, AA, AB, AC, AD, AE, ... YX, YY, YZ.
(26 * 26 results!)
Interestingly, if I make it a less
Jack Jackson wrote:
Forgive me if this comes twice: my ISP had a service blackout for three
hours and I don't know what went:
If my last post read (and I see that it did) that I was defending myself
as opposed to falling ALL OVER my sword, I apologize: allow me to be clear:
No, you're all
This is something dumb I am doing but:
Trying to pull all names of publishers in db. This sql:
SELECT art.art_id,art.publisher_id,publisher.publisher_name,
FROM art
LEFT JOIN publisher
ON publisher.publisher_id=art.publisher_id
pulls (in phpmyadmin) four rows:
artID pubID Publisher_name
Sent: Sunday, June 05, 2005 4:37 PM
Subject: [PHP] looping through an array problem
This is something dumb I am doing but:
Trying to pull all names of publishers in db. This sql:
SELECT art.art_id,art.publisher_id,publisher.publisher_name,
FROM art
LEFT JOIN publisher
On 6/5/05, Jack Jackson [EMAIL PROTECTED] wrote:
I'd like to stop the NY Sun from appearing twice! What have i missed here?
There's nothing wrong with your PHP code as such (although you could
filter out duplicates there if you wanted), all you should need to do
is add the DISTINCT keyword to
Jack Jackson wrote:
This is something dumb I am doing but:
Trying to pull all names of publishers in db. This sql:
its a mysql question in disguise, maybe...:
SELECT DISTINCT art.art_id,art.publisher_id,publisher.publisher_name
FROM art
LEFT JOIN publisher
ON
On Sun, 2005-06-05 at 16:37, Jack Jackson wrote:
This is something dumb I am doing but:
Trying to pull all names of publishers in db. This sql:
SELECT art.art_id,art.publisher_id,publisher.publisher_name,
FROM art
LEFT JOIN publisher
ON publisher.publisher_id=art.publisher_id
pulls
Thanks for all the replies. Jochem, thank you for this code, which will
take me all night to understand (though I bet it works). I also note
that SELECT DISTINCT worked here, too
Also as many of you noticed before me, the art_id was in there as a fly
in the ointment.
Thanks all!
Jochem
Jack Jackson wrote:
Thanks for all the replies. Jochem, thank you for this code, which will
take me all night to understand (though I bet it works). I also note
that SELECT DISTINCT worked here, too
Also as many of you noticed before me, the art_id was in there as a fly
in the ointment.
by
M. Sokolewicz wrote:
Jack Jackson wrote:
Thanks for all the replies. Jochem, thank you for this code, which
will take me all night to understand (though I bet it works). I also
note that SELECT DISTINCT worked here, too
Also as many of you noticed before me, the art_id was in there as a
Jack Jackson wrote:
M. Sokolewicz wrote:
Jack Jackson wrote:
Thanks for all the replies. Jochem, thank you for this code, which
will take me all night to understand (though I bet it works). I also
note that SELECT DISTINCT worked here, too
Also as many of you noticed before me, the
Forgive me if this comes twice: my ISP had a service blackout for three
hours and I don't know what went:
If my last post read (and I see that it did) that I was defending myself
as opposed to falling ALL OVER my sword, I apologize: allow me to be clear:
No, you're all correct and M.
Ah. I just remembered one reason I had done it involving the art_id field:
I have more publishers in the db than are currently associated with
artworks. I don't want a publisher to appear unless there is at least
one image associated with it. So I did this to avoid having people see a
link to
If my last post read (and I see that it did) that I was defending myself
as opposed to falling ALL OVER my sword, I apologize: allow me to be clear:
No, you're all correct and M. Sokolewicz doubly so: I had
unintentionally selected fields from the wrong table for no reason other
than lack of
I'm trying to build an html table using the results from pg_meta_data()
but none of the access functions seem to work. I am getting results but
just can't seem to do anything with them.
Here's what I'm using to verify that results are being returned:
$connstring = dbname=pub_status
On Sunday 04 April 2004 08:22, Andy B wrote:
[snip]
i tried using while($_SESSION['guestbook']) but it proves in php's mind to
be blank or that whole statement gets ignored...
The above doesn't make sense, if you don't have anything inside your
while-loop which alters $_SESSION['guestbook']
hi...
i have a combo box that is filled with a query from an sql table...
this is its logic:
if $_SESSION['guestbook'] doesnt exist
then query database, fill $_SESSION['guestbook'] with its values from the db, turn the
value part of the option into the values from
Hi,
I have a config_inc.php file which has around 60 parameters set in it.
eg:
$db_name=something;
$db_user=root;
$db_pass=blah;
$x_installed_path=/home/blah/;
etc
I have a requirment of echoing out these statements to the client to show
him how his setup is:
eg:
echo DB_name=font color
Hello Ryan,
Wednesday, March 24, 2004, 5:29:33 PM, you wrote:
RA as you can imagine the above loop will save a crapload of time
RA instead of partially hard codeing each key and value but how do
RA I do this while reading from a file? and the other big problem is
RA the file contains one or two
From: Ryan A [EMAIL PROTECTED]
I have a config_inc.php file which has around 60 parameters set in it.
eg:
$db_name=something;
$db_user=root;
$db_pass=blah;
$x_installed_path=/home/blah/;
etc
I have a requirment of echoing out these statements to the client to show
him how his setup is:
-Original Message-
From: Ryan A [mailto:[EMAIL PROTECTED]
Sent: 24 March 2004 17:30
Hi,
I have a config_inc.php file which has around 60 parameters set in it.
eg:
$db_name=something;
$db_user=root;
$db_pass=blah;
$x_installed_path=/home/blah/;
etc
I have a requirment of
Second what Rich said, keep replies to the list, please. This can benifit
everyone.
---John Holmes...
- Original Message -
From: John W. Holmes [EMAIL PROTECTED]
To: Ryan A [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, March 24, 2004 1:22 PM
Subject: Re: [PHP] looping
Hey John,
$array1 = get_defined_vars();
include('yourfile.php');
$array2 = get_defined_vars();
$newvars = array_diff($array2,$array1);
foreach($newvars as $name = $value)
{ echo $name = font color=\green\$value/fontbr /\n; }
Cool, thanks, will try it out.
If there are multi-dimensional
require 'database.php';
$t_02 = subnets;
$sql_subs = mysql_query(SELECT * FROM $t_02,$db)or
die(mysql_error()); while(list($id,$sub,$msk,$dns01,$dns02,$rtrs,$rnge)
= mysql_fetch_array($sql_subs)) {
$num = mysql_num_rows($sql_subs);
for($z = 0; $z $num; $z++) {
$vlans[] = subnet
On Tue, 2004-01-06 at 15:04, Jas wrote:
require 'database.php';
$t_02 = subnets;
$sql_subs = mysql_query(SELECT * FROM $t_02,$db)or
die(mysql_error());while(list($id,$sub,$msk,$dns01,$dns02,$rtrs,$rnge)
= mysql_fetch_array($sql_subs)) {
$num = mysql_num_rows($sql_subs);
++)
echo $vlans[$z]br /\n;
Martin
-Original Message-
From: Jas [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 7 January 2004 9:05 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Looping problem?
require 'database.php';
$t_02 = subnets;
$sql_subs = mysql_query(SELECT * FROM $t_02,$db
On Wed, Jan 07, 2004 at 09:17:35AM +1100, Martin Towell wrote:
This is probably more like what you need.
I can't see why you'd need to loop through your results using two different
methods (while and for)
require 'database.php';
$t_02 = subnets;
$sql_subs = mysql_query(SELECT * FROM
On Tue, Jan 06, 2004 at 05:33:41PM -0500, joel boonstra wrote:
snip
I would recommend not simply doing a select *, but rather specifying
which columns you want. That way, if your database schema changes
(e.g., you add two more columns), your code won't break.
And, responding to myself,
Problem with looping over a CSV file (3 results for each line)? Here is
the CSV file contents...
MTPC-01,00:02:B3:A2:9D:ED,155.97.15.11
MTPC-02,00:02:B3:A2:B6:F4,155.97.15.12
MTPC-03,00:02:B3:A2:A1:A7,155.97.15.13
MTPC-04,00:02:B3:A2:07:F2,155.97.15.14
MTPC-05,00:02:B3:A2:B8:4D,155.97.15.15
Problem with looping over a CSV file (3 results for each line)?
Here is the script...
?php
$row = 1;
$file = fa.csv;
$id = fopen($file,r);
while($data = fgetcsv($id,100,,)) {
$num = count($data);
$row++;
for($c = 0; $c $num; $c++) {
echo host $data[0] {br /\nhardware
Shorter version of the script:
?
$line = file(fa.csv);
for($i=0;$icount($line);$i++){
$data = explode(,, $line[$i]);
echo host $data[0] {br /\nhardware ethernet $data[1];br
/\nfixed-address $data[2];br /\n}br /\n;
}
?
At 08:10 AM 12/30/2003, Jas wrote:
Problem with looping over a
Hi,
I have a list contained in a session var. I want to loop through the list,
getting the value of the current item, then do a query based on that value.
Is there an easy way to do this, or do I need to convert the list to an
array first? In the code below, $id isn't being set.
Here's my code
['sv_CampusList']);
foreach($tmpArr as $id) {
echo $id;
}
-Mensaje original-
De: James Johnson [mailto:[EMAIL PROTECTED]
Enviado el: miƩrcoles, 27 de agosto de 2003 4:45
Para: [EMAIL PROTECTED]
Asunto: [PHP] Looping through a list - Newbie question
Hi,
I have a list contained in a session var. I
From: James Johnson [EMAIL PROTECTED]
I have a list contained in a session var. I want to loop through the list,
getting the value of the current item, then do a query based on that
value.
Is there an easy way to do this, or do I need to convert the list to an
array first? In the code below,
To: James Johnson; [EMAIL PROTECTED]
Subject: Re: [PHP] Looping through a list - Newbie question
From: James Johnson [EMAIL PROTECTED]
I have a list contained in a session var. I want to loop through the
list, getting the value of the current item, then do a query based on
that
value
The code below is suppose to replace some images and links but when I run it
the page just seems to hang and eventually times out.
Am I Looping somewhere and not realising it?
Thanks
Zac
$i = $c01_1;
$imgLst = '';
function imgRplc($val){
global $imgLst;
global $i;
$imgLst .= div
On Wednesday 09 July 2003 21:12, Zac Hillier - Net Affectors wrote:
The code below is suppose to replace some images and links but when I run
it the page just seems to hang and eventually times out.
Am I Looping somewhere and not realising it?
print $i to find out?
--
Jason Wong - Gremlins
I have this javascript that enables browsing and selecting of a file. This
file location and name are then transferred further down in the form as an
option. Multiple files may be chosen as they are just added one below the
other. Anyway, when the form is submitted it is only retrieving the
On Sat, 2003-07-05 at 15:55, Micah Montoy wrote:
I have this javascript that enables browsing and selecting of a file. This
file location and name are then transferred further down in the form as an
option. Multiple files may be chosen as they are just added one below the
other. Anyway,
I think that will do it.
thanks,
- Original Message -
From: Lars Torben Wilson [EMAIL PROTECTED]
To: Micah Montoy [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Saturday, July 05, 2003 4:59 PM
Subject: Re: [PHP] looping through values from a field? Need hellp.
On Sat, 2003-07-05 at 15
:
$rListvalues = explode(,, $_POST['list2values']);
foreach through that and do your processing.
-Original Message-
From: Micah Montoy [mailto:[EMAIL PROTECTED]
Sent: Saturday, July 05, 2003 3:56 PM
To: [EMAIL PROTECTED]
Subject: [PHP] looping through values from a field? Need hellp.
1
05, 2003 4:59 PM
Subject: Re: [PHP] looping through values from a field? Need hellp.
On Sat, 2003-07-05 at 15:55, Micah Montoy wrote:
I have this javascript that enables browsing and selecting of a file.
This
file location and name are then transferred further down in the form as
an
option
On Sat, 2003-07-05 at 17:13, Micah Montoya wrote:
Ok. I gave it a shot but have run into one other question that I wasn't
able to find that was addressed by the article.
My select statement looks like this:
select name=imgList[] style=width:350; size=6 multiple/select
When I create the
That was the trick. Just the space was messing things up. Thanks.
- Original Message -
From: Lars Torben Wilson [EMAIL PROTECTED]
To: Micah Montoya [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Saturday, July 05, 2003 6:18 PM
Subject: Re: [PHP] looping through values from a field
Hi ppl,
I have a problem that probably very simple, but i cannot figure it out
right now
I need to get the field names of my database. I have a query like select
* from books and now i wanna have both the result and the field name. I
have been trying with mysql_field_name, but not
On Sun, 2 Feb 2003, Davy Obdam wrote:
Hi ppl,
I have a problem that probably very simple, but i cannot figure it out
right now
I need to get the field names of my database. I have a query like select
* from books and now i wanna have both the result and the field name. I
have been
Currently I have a script that reads an index file and from that index file it then
loops through all files in that directory based on the index.
Instead of one directory now I have several and I want to loop through each directory
and go to each directory's index file. Since there is no
On Wed, 8 Jan 2003, Jeff Lewis wrote:
pattern for the name if the indexes, I assume I need to create an array
holding the directory name and the associated index file name like so
$dirs = array(Sports = spindex.xml, Business News =
business.xml) etc
Now, I need help with the loop to whip
Hi All,
I'm reading a paramter file and a text file.
Per line of the text file I want to check if there is a word in there from
the parameter file.
However I need to open and read the parameter file for each line in the text
file. How can I change this?
Followin is the code I have.
?
if
Did you look at:
http://www.php.net/manual/en/function.file.php
Puts all lines in an array
Gr,
At 12:00 19-12-02 +0100, Jacob van Zanen wrote:
Hi All,
I'm reading a paramter file and a text file.
Per line of the text file I want to check if there is a word in there from
the parameter file.
Hiya
something like this
?
if ($FileContent = file(d:\MyPhp\\test.ora) AND $IniContent =
file(d:\MyPhp\initORA.ini)) {
foreach($FileContent AS $line) {
if (in_array($line, $iniContent)) {
echo $LineBR\n;
I'm reading a paramter file and a text file.
Per line of the text file I want to check if there is a word in there
from
the parameter file.
However I need to open and read the parameter file for each line in
the
text
file. How can I change this?
Can't you read the param file first into an
Hiya,
I am working on a generic JavaScript form checked, that takes the names
of the elements, with the first two letters being the type of element, so
its checks that it is right, if not gives a generic error message e.g. YOu
Need To Fill this in and selects it, or Sorry only numbers are
On Thursday 12 December 2002 04:13, Steve Vernon wrote:
Hiya,
I am working on a generic JavaScript form checked, that takes the names
of the elements, with the first two letters being the type of element, so
its checks that it is right, if not gives a generic error message e.g. YOu
Need
I am working on a generic JavaScript form checked, that takes the
names
of the elements, with the first two letters being the type of element,
so
its checks that it is right, if not gives a generic error message e.g.
YOu
Need To Fill this in and selects it, or Sorry only numbers are
- Original Message -
From: Chris Wesley [EMAIL PROTECTED]
To: PHP List [EMAIL PROTECTED]
On Wed, 4 Dec 2002, Stephen wrote:
This is only a snippet, there is more to it but for simplicities
sake...
Then I calculate it. My question is, how would I loop the adding? I
hope
you
PROTECTED]
Sent: Wednesday, December 04, 2002 9:01 PM
Subject: RE: [PHP] Looping Addition
Let me explain this as best I can. The user enters how many numbers he
wants
to add. This form goes to another page. This page loops a form field
and
it's name is num and after num is the number
One more question... If I then wanted to do this for the other operations
(such as multiplication, division, etc), how would I do that?
Assuming you've figured out how to do an array...
You'll have to loop through the values like in the code that others posted.
foreach($_POST['number'] as
:24 AM
Subject: Re: [PHP] Looping Addition
One more question... If I then wanted to do this for the other
operations
(such as multiplication, division, etc), how would I do that?
Assuming you've figured out how to do an array...
You'll have to loop through the values like in the code
On Thursday 05 December 2002 23:05, Stephen wrote:
So would I just put this?
foreach(%_POST['number'] as $num)
{
$output *= $num;
}
echo $output;
That's for multiplication.
Yes. Wouldn't it have been quicker for you to try it than to ask?
BTW make sure that none of $num is zero.
--
: Re: [PHP] Looping Addition
On Wed, 4 Dec 2002, Stephen wrote:
This is only a snippet, there is more to it but for simplicities sake...
Then I calculate it. My question is, how would I loop the adding? I hope
you
understand this now...
Ah!, I think I understand better now. You want to add
-
From: Stephen [EMAIL PROTECTED]
To: Chris Wesley [EMAIL PROTECTED]
Cc: PHP List [EMAIL PROTECTED]
Sent: Thursday, December 05, 2002 12:33 PM
Subject: Re: [PHP] Looping Addition
Continuing this even more...how would I use this same method only to
subtract?
What I'm doing right now would
, 2002 2:51 PM
Subject: Re: [PHP] Looping Addition
You simply need the absolute value of the difference. So taking Stephen's
example below..
$total = 0;
foreach( $_POST['nums'] as $number )
{
$total -= $number;// if users inputs 5 as first value result
equals -5
$total = abs($total
1 - 100 of 144 matches
Mail list logo