Hmmm. Well they both work. Now I've learned two ways :)
Coming from Perl, Javascript, Delphi, ASP, etc. it's always fun to know
someone has done something different.
if (!strpos(...))
will be better...
Why?
The only thing I would love to know is why isn't error checking more
If you'd really like to develop your regex skills, and everyone should,
pickup Mastering Regular Expressions by Jeffrey Friedl(O'Reilly Press). Its
the best out there, and will probably teach you more than you thought
possible.
Jack
-Original Message-
From: Martin Thoma [mailto:[EMAIL
Andrew Kirilenko wrote:
Oops. Forgot about 0 return ;(
Which means ???
They both work for me, yeah? No?
This tells me that the user made a boo boo:
if((strpos($yourimage, \.jpg) !== false) || (strpos($yourimage, \.jpeg)
!== false))
So what does this do?
if((!strpos($yourimage, .jpg)) ||
See these. Reduire.phps probably has what you want.
http://www.collegesherbrooke.qc.ca/si/php/exemples/photos/afficher.phps
http://www.collegesherbrooke.qc.ca/si/php/exemples/photos/charger.phps
http://www.collegesherbrooke.qc.ca/si/php/exemples/photos/lire_binaire.phps
Hi,
I know how to make an error message when the connection is lost with the
database, with the @ and the OR DIE in the connection with the database.
Is there also a way to display a custom error message when this error is
displaid?
Warning: Supplied argument is not a valid MySQL result
Hi All,
Here is the problem:
I have a quey building form that returns results from a database as a form to generate
a new query.
On open, it shows a form, then on submit it shows resutls that are in a form
(checkboxes that let
you omit that record from the next query by $id).
What I want to do
Hi Chris, Just a small modification and it works!!!
Many thanks!
Syntax:
onclick=\document.pageform.action='$PHP_SELF#$value'; submit()\
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact
Ok, where can I find a tutorial about sending mail using fsockopen ?
***
Hi, is it possible to send SMTP mail if the server where are my pages
hosted forbids the use of the mail() function ? I mean, by opening a
sockets connection to an external SMTP server and writing the commands
there
Ok, where can I find a tutorial about sending mail using fsockopen ?
***
http://www.phpbuilder.com/columns/tim19990221.php3
Regards,
Johan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To
Hi !
Do I have to edit mu ini file to display pictures with php? Is it possible
to have pictures in include files?
Best regards
Ramyond LIlleødegård
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
In article C9F89DA57491D511BDAF00E0180C348103BFC0@ESADM01,
[EMAIL PROTECTED] (Sjoerd Van Oosten) wrote:
Is there also a way to display a custom error message when this error is
displaid?
Warning: Supplied argument is not a valid MySQL result resource in
Question:
I want to build php withd support for ORACLE 8i or 9i.
Normally you use the option with-oci=path-to-oraclehome. So far so good.
How can I achieve this when the oracle database is running on another
server?
Thx
Haemelinck Steve
Haemelinck.be - Developers Unite (Under construction )
Hello, a question again.
I have a pdf file which can be downloaded. How can i link to this file so,
that the file isn't opened in the browser (if acrobat reader is installed)
but the file download popup appears?
Greetings,
Sjoerd van Oosten
Digitaal
Hi, I'm Carlo.
Is there a way (probably javascript) to fill a text
field (or another form object) selecting from a select
box on a window different from that where's the text
filed ?
Ciao, Carlo
__
Abbonati a Yahoo! ADSL con
You can do that only if you've got a reference to the window you want to
change its properties.
the reference is obtained like this:
script
var w = window.open('file.htm');
w.document.theform.theControl.theProperty = someValue here;
/script
Carlo loiudice [EMAIL PROTECTED] wrote in message
Hello!
Is there is anyway to copy from a table to another but by applying a filter?
Example:
SELECT * FROM table1 WHERE (condition)
INSERT INTO table2 (the results of the last query)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
_lallous wrote:
Hello!
Is there is anyway to copy from a table to another but by applying a filter?
Example:
SELECT * FROM table1 WHERE (condition)
INSERT INTO table2 (the results of the last query)
Just try this one:
INSERT INTO table2 SELECT * FROM table1 WHERE (condition)
--
INSERT INTO table2 SELECT * FROM table1 WHERE (condition);
Easy, isn't it *grin*
Andrey Hristov
IcyGEN Corporation
http://www.icygen.com
BALANCED SOLUTIONS
- Original Message -
From: _lallous [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, November 16, 2001 1:16 PM
Subject:
On Fri, Nov 16, 2001 at 10:49:17AM +0100, Steve Haemelinck wrote:
Question:
I want to build php withd support for ORACLE 8i or 9i.
Normally you use the option with-oci=path-to-oraclehome. So far so good.
How can I achieve this when the oracle database is running on another
server?
Hi
Besides that I think this is the wrong mailing list for dealing with that
question:
Zip that pdf-file and link to the zipped file.
Everything else (AFAIK) won't work because this phenomenon is caused by the
client and not by the server.
Stefan Rusterholz, [EMAIL PROTECTED]
Hello all!
I want to use gettext for multilanguage webs, so I'm pleasing you to help
me.
When I use this: xgettext --keyword=_ file.php
on this file:
---
script language=JavaScript
!--
function zmen_cenu() {
This works for what I do:
Try this and fiddle with the variables.
$conn_id is your pointer to an FTP connection.
Familiarize yourself with the FTP functions in PHP if there are any doubts.
PART I: Put this in one script (say pdf_list.php):
// list server contents
if ((!$F) || ($F==)){
sorry..I'm quite new in this php-stuff
i've got a little problem
if I write
a$ = test;
b$ = test2;
data$ .= a$ . . b$ ;
echo data$;
it outputs:
test test2
instead of:
test test2
I really need that spaces..
any help?
thnx
--
PHP General Mailing List (http://www.php.net/)
this code seem incomplete:
window.opener.document.celkem.cena_celkem.value = ? echo _(nìjaký
blábol); ?
}
here's a fix:
function zmen_cenu() {
window.opener.document.celkem.cena_celkem.value = ? echo _(nìjaký
blábol); ?;
}
Pavel NováK [EMAIL PROTECTED] wrote in message
[EMAIL
Hi!
a$ = test;
b$ = test2;
data$ .= a$ . . b$ ;
echo data$;
it outputs:
test test2
instead of:
test test2
I really need that spaces..
any help?
HTML is normalizing all text; So any number of spaces, tabs newlines etc.
become one space ;
If you want a certain
In html anything more than one space will be represented as only one space,
so to overcome that you'll need to use nbsp; which is a non-breaking space.
To get three spaces in between a word you would do:
word1 nbsp; word2
and there will be exactly three spaces in between. I hope that helps!
I want to sent a script-result as a renamed html-document to the client.
I tried:
- header(Content-Disposition: inside; filename=name.html);
- header(Content-Disposition: inside; filename=\name.html\);
- header(Content-Disposition: inside;);
header(Content-filename=name.html);
even with a
Use the pre tag before the input, and /pre after it.
Andrey Hristov
IcyGEN Corporation
http://www.icygen.com
BALANCED SOLUTIONS
- Original Message -
From: Michiel van Heusden [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, November 16, 2001 2:30 PM
Subject: [PHP] stupid little
Hi List,
My ISP runs the PHP in Safe Mode, this is causing me a lot of trouble. In
safe mode how can I change the permission of a dir to 0777?, my problem is
that I've built a Content management system, and for every new people
inserted the system creates a Directorie and will upload things
Hello,
You can't change permissions in safe_mode.
and for every new people
inserted the system creates a Directorie and will upload things
Maybe you give the new people something like a autonumbered userid. So you
can created the dirs
/userid0/, /userid1/ etc. already by hand.
-
now it is the same problem without javascript:
FIRST file includes only this row:
input type=submit name=submit_dotaz value=?=_(Odeslat dotaz)?
class=tlacitko
SECOND file includes this:
?$str=_(Odeslat dotaz)?
input type=submit name=submit_dotaz value=?=_$str?
class=tlacitko
When I use:
Hi,
I've put in place a site using Nuke, however my server where the site is
hosted does not accept the mail(). It is disabled for security reasons.
How can I use the feedback section on the site if this function is disabled?
thxs in advance,
Stephen
--
PHP General Mailing List
Yeah,
It seems to be a black art to get the browsers to behave properly.
I don't know if it's relevant but I use Content-disposition and Content-type
rather than Content-Disposition and Content-Type and it seems to work for
me for inline;. I haven't tried inside;.
If you really can't get it
Look at the output buffer handling functions:
ob_handler etc.
These let you take the final (or intermediate) output of the script and do whatever
you want with it
e.g. save it, or in your case save it and empty it. In that case your user could have
a simple SAVE
button which ran the entire
Hi,
Does anyone know of a script/tutorial etc on displaying Microsoft SQL Server
records, lets say 20 at a time and on clicking NEXT it will display the next
20 records and if you click PREVIOUS the previos 20 records?
I have one for MYSQL but the catch is that MYSQL has something like:
select
Hi,
Lets say I want to get the current exchangerate from another page on the web
and use it in calculations on my own page. How do I retrieve info from
another site once someone access my page?
Tx
MH
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL
I always get strpos wrong.
So typically in this case I would do something like:
list($file,$ext) = explode('.',$yourimage);
if ($ext != 'jpg' or $ext != 'jpeg')
{
error...
}
(More properly we should make sure jpg or jpeg are at the very end of the filename
i.e. you probably
don't like
Hi,
i am writing a simple postcard-script. I use php 4 sessions and stores the
data in MySql with the sessionid as a unique id for the card.
The problem is - i can´t send more than one card with the same id. I can´t
find any way to get a new session id without closing the browser. In the
manual
so I know where is the problem:
input type=submit name=bla value=?=_(Odeslat dotaz)?
gettext is seeking through all of strings in the file, it thinks that one
string is:
?=_(
and second:
)?
And it doesn't work even with this:
value=?=_('Odeslat dotaz')?
or this:
value='?=_(Odeslat dotaz)?'
I'm confused. Is your problem serving up the images in your database to the web or
writing them out
to files on the server?
If it's serving images, I would expect you to have:
select myimage from db
Header(Content-type: image/jpeg);
echo $myrow[myimage];
exit();
etc.
If it's writing from
Note that you don't need to use xgettext to use gettext. It is simply a
time-saver that generates a template .po file for you. You can easily
create this text file yourself.
-Rasmus
On Fri, 16 Nov 2001, Pavel Novak wrote:
so I know where is the problem:
input type=submit name=bla
Henrik,
I think your problem is jsimply that you are not getting variable substitution
of $HTTP_GET_VARS[whatever] inside double quotes.
print whatever is $HTTP_GET_VARS[whatever];
is not safe.
You need
print whatever is {$HTTP_GET_VARS[whatever]};
or, (IMHO better),
print 'whatever
Nope. That is just the problem. session_destroy() only destroys the data
inside the session. Not the id.
But i actually solved it now. I am using the same algorithm as php itself to
create a new id everytime the page is loaded:
session_id( md5( uniqid( , 1 ) ) );
session_start();
-
Sorry for sending this message through the list, but I'm getting mail errors
when I try to send it directly.
- - - - -
Sorry it took so long. The generation scripts aren't very fleshed out,
and neither is the display format, but it's a good solid example of the
basic example. Every main
grab a copy of phpmailer .. it does exactly what you want
- Original Message -
From: Jaime Iniesta Aleman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, November 16, 2001 4:01 AM
Subject: [PHP] Sending mail without using mail()
Ok, where can I find a tutorial about sending
Hi
I have following problem:
I get a form with some fields having the same name.
PHP solves this problem by appending [] to the form-field-names which causes the
creation of arrays.
My problem now is, that I have to pass those variables further to another script (not
PHP) in exactly that order
Does anyone have some recommendations for database books. This is something that I
want to get
better versed in as I have gotten along by visualizing the database and its
relationship for small
projects, but I think I need a better base and more knowledge. Recommendations can
before both
If you know the setup of the form beforehand it is relatively easy to do
something like :
$string=$myfield1[0] $myfield2[0] $myfield1[1] $myfield2[1] etc...
However I remember one of my stupid mistakes awhile ago was mistakenly
giving two form fields the same name. My result was that the
take the query string as is:
$QUERY_STRING
in this case:
$qstring = myfield1=myfield2=aaacccmyfield1=;
and then pass it on as is again to whoever you want!
or you can parse it like:
$qstrings = split('', $qstring);
then split each pair:
$pairN = split('=', $qstrings[$i]);
name the checkbox as:
input type='checkbox' value='?=$field['id']?' name='selectedplayers'
where ID is used to identify this current field!
then read in the posted page as:
?
while (list(, $selected) = each($selectedplayers))
{
// $selected holds the ID of the field that was previously
Hi - my sysadmin tells me that PHP is compiled in, rather than loaded
as an Apache module.
I need to use
VirtualHost foo
php_value include_path .:/www/includes/foo
/VirtualHost
to get different include paths for different sites. How do I
accomplish this?
The manual says When using PHP
you can fopen() remote files!
$fp = fopen(www.site.com/infodir/exchange.txt,r);
$rates = fread($fp, ...);
fclose($fp);
Mindhunter [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi,
Lets say I want to get the current exchangerate from another page
I'm trying to create a form that supports multiple uploads (of up to 4
files), but does not require each of them. I've tried all the code
examples in the PHP documentation, and they don't appear to work with PHP
4.0.6. Basically, I get the file names returned in the arrays, but the
array that
Thanks for pointing me to phpinfo(), the field for the ./configure
command is my old one, I guess I'll go back and start from scratch, must
of forgot a step.
On Thu, 2001-11-15 at 21:06, Johan Holst Nielsen wrote:
I know it's probabally overkill but in the configure messages, it says
yes
When we open this url : http://localhost/index.php/test=2
Yep index.php/test=2 not index.php?test=2
Apache open the page index.php one time for every broke link he find in the
index.php page. Example :
?PHP
// Simple PHP test page
?
HTML
TITLESimple PHP test page/TITLE
BODY
PSimple PHP
Joe,
One approach that works for me is to have a separate IMAGE table with an automatically
generated
primary key image_id (auto_increment with MySQL). I don't use this store the image,
but just to
give me the unique name for the image file. I also use the IMAGE table to store away
the
On Fri, 2001-11-16 at 10:19, Matthew Luchak wrote:
If you know the setup of the form beforehand it is relatively easy to do
something like :
$string=$myfield1[0] $myfield2[0] $myfield1[1] $myfield2[1] etc...
However I remember one of my stupid mistakes awhile ago was mistakenly
giving
I have a script that when is executed parses and html file and writes the
contents to a text file.
I need to then read this text file from another apllication
Is there a way of timing this operation, so that my other app does not try
to access the file before being written?
--
PHP General
Thanks. It actually turned out that I wanted to do just:
$HTTP_POST_VARS[\\1]
in the regex (ie: removing the quotes entirely inside the array)
and it works just fine. Thanks for the info however.
On Friday 16 November 2001 09:37, George Whiffen wrote:
Henrik,
I think your problem is
If the other application is written in PHP you can use flock.
Matthew Luchak
Webmaster
Kaydara Inc.
[EMAIL PROTECTED]
-Original Message-
From: Caspar Kennerdale [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 16, 2001 11:00 AM
To: Php-General
Subject:
unfortunaelty its not in php- but director
-Original Message-
From: Matthew Luchak [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 16, 2001 16:03
To: Php-General
Subject: RE: [PHP] timing
If the other application is written in PHP you can use flock.
Hello,
Pat Hanna wrote:
I'm doing my senior exit project on database languages online. I'm asking
for help from anyone who can provide any information on the comparison
between the different languages. I'm comparing languages such as PHP, ASP,
ColdFussion, perl and any others that I might
Nate Carlson wrote:
I'm trying to create a form that supports multiple uploads (of up to 4
files), but does not require each of them. I've tried all the code
examples in the PHP documentation, and they don't appear to work with PHP
4.0.6. Basically, I get the file names returned in the
PEAR is another db abstraction layer, and potentially will be integrated
into PHP. I use it for all my DB access (in PHP) now. In fact, I'd say
it's more powerful and easier than using the mysql_ methods for example.
PEAR uses the standard factory design pattern to determine which DB it's
Peter Frlicka wrote:
Hello.
What does apache + php do if the user refreshes a page 10 times in a while
before the scripts finishes? do all 10 .php scripts finish or do the first 9
get aborted? how can i solve the problem that when someone clicks a lot on a
link (always the same link) the
Does anyone know if it is possible to load a dll at runtime that is not in
the extensions_dir configured in the php.ini? And if it is possible, how can
I do it?
Thanks in advance.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
Hi there. I have a table called IMAGES and I would like to retrieve all
image_ids and dump into an array. I'm new to php so any help would greatly
be appreciated. I started my code below, but am unsure what to do next :(
Thx Joe:)
'connect to db
$connectionToDBid = odbc_connect(codesnipits,
Hello,
Chris Bailey wrote:
PEAR is another db abstraction layer, and potentially will be integrated
into PHP. I use it for all my DB access (in PHP) now. In fact, I'd say
it's more powerful and easier than using the mysql_ methods for example.
PEAR is essencially a Perl DBI clone, so it
Hi George,
George Whiffen wrote:
I'm confused. Is your problem serving up the images in your database to the web or
writing them out
to files on the server?
Sorry for the confusion.. It was in writing out the database images to
files on the server. This is where my problem lies..
If
Sorry if I wasn't very clear abou tthis..
I don't need to echo the contents to be viewed on the web.. I'm already
doing that here:
http://www.wtoaction.org/caravan2001/
It's a matter of saving it to a file on the disk (from the database) so
I can manipulate it with djpeg, pnmscale, cjpeg
Hi all,
So a few weeks back on my Debian Sid box I had everything running
nicely, PHP4, Apache 1.3, and had it such that Multiviews were turned
on, and I could call /foo?id=1 and the file foo.php would register the
variable id as having a value of 1.
I dist-upgraded last weekend (now
I am writing files to my server using
$fp = fopen(myfile.txt, w);
this all works. However in the php manual it says that by using the w
switch that php will create the file if it doesn exist
However this does not seem to work
I can only write to a file that already exists and has CHMOD 777
Pat Hanna wrote:
I'm doing my senior exit project on database languages online. I'm asking
for help from anyone who can provide any information on the comparison
between the different languages. I'm comparing languages such as PHP, ASP,
ColdFussion, perl and any others that I might not know
The script I have:
?
$query = SELECT * FROM members ORDER BY MemberName ASC;
$player = MYSQL_QUERY($query);
$Aantal_play = MYSQL_NUM_ROWS($player);
$x=0;
while ($x $Aantal_play) :
$name = mysql_result($player,$x,MemberName);$name = $name +
NAME; ? tr
td
On Fri, 2001-11-16 at 17:49, Caspar Kennerdale wrote:
I am writing files to my server using
$fp = fopen(myfile.txt, w);
this all works. However in the php manual it says that by using the w
switch that php will create the file if it doesn exist
However this does not seem to work
I
check under what user Apache is running ( mostly nobody ). You have to give
write permission on the directory where you want the files to be to that
user. For security reasons, just don't give write access on your
document_root, instead create a directory outside ( or within) your
document_root
[EMAIL PROTECTED] (Daniel Berwig) wrote:
Does anyone know if it is possible to load a dll at runtime that is not in
the extensions_dir configured in the php.ini? And if it is possible, how can
I do it?
if anything dl() does it.
--
Henrik Hansen
--
PHP General Mailing List
The problem is that the php tries to load the dll from the extension_dir. Is
there a way to make it load from anywhere else?
Henrik Hansen [EMAIL PROTECTED] escreveu na mensagem
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
[EMAIL PROTECTED] (Daniel Berwig) wrote:
Does anyone know if it is
got it :) thx for looking
Joe Van Meer [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi there. I have a table called IMAGES and I would like to retrieve all
image_ids and dump into an array. I'm new to php so any help would greatly
be appreciated. I started
[EMAIL PROTECTED] (Daniel Berwig) wrote:
The problem is that the php tries to load the dll from the extension_dir. Is
there a way to make it load from anywhere else?
try to supply a path in dl().
--
Henrik Hansen
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail:
ahh
write permission the folder- duh- not thinkingtoday
thank alot
-Original Message-
From: R'twick Niceorgaw [mailto:[EMAIL PROTECTED]]
Sent: 16 November 2001 18:14
To: Caspar Kennerdale; Php-General
Subject: Re: [PHP] quick friday query
check under what user Apache is running (
Hi there. I have s a php page that randomly grabs an image's path from a db
field and displays it on my php page. My problem is that sometimes when I
refresh the image won't display. So I guess you can say I'm getting
intermittent images...sometimes it displays and sometimes not. I've checked
all
Hello,
Jtjohnston wrote:
See these. Reduire.phps probably has what you want.
http://www.collegesherbrooke.qc.ca/si/php/exemples/photos/reduire.phps
This is what I was looking for I think.. But it still gives me an
error.. This one actually got inserted right into the database:
br
Casper,
My guess would be that the folder that you are trying to write the file
to doesn't have the correct permissions to allow the webserver to write
to it.
Try that and let me know if it works!
Thank You
Brian Paulson
Sr. Web Developer
[EMAIL PROTECTED]
http://www.chieftain.com
It doesn't load the dll, when specifying the path (relative path neither
absolute path).
Any solution?
Daniel Berwig
Henrik Hansen [EMAIL PROTECTED] escreveu na mensagem
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
[EMAIL PROTECTED] (Daniel Berwig) wrote:
The problem is that the php
Sorry, couple post-Post changes..
The initial query should have been:
$sql = SELECT Image,Width,Height FROM Images WHERE ID='$ID';
The an echo of the UPDATE sql now looks like this:
UPDATE Images SET Thumbnail='
Warning: Supplied argument is not a valid Image resource in
Andrew Forgue wrote:
By putting brackets after the variable name [] in a form element
input type=text name=text[]
input type=text name=text[]
input type=text name=text[]
BLAAACH!!! Please add an index variable, as fields that you don't need
wil NOT be posted, so when you have several
if I give the user a search and he enters 'cat dog' I am going to want to
find all the results that have the word 'cat' or 'dog' in them, but I want
all the results that have 'cat' and 'dog' at the beginning of the results
because these would be more relevent. now how I see it is this, it aint
Jimmy Elab wrote:
input type=text name=text[?php echo $il ?]
When your not positioned straigth at your keyboard a ';' may
occasionally turn into an 'l'...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
my code looks something like this:
switch($id) {
case home: include(home.php);
break;
}
so links can be something like www.url.com?id=home
I have also tried to use require instead of include
When the desitred link is clicked, the page loads the new link, but also
includes my index page taked
Got it...if anyone's interested the code is below :)
/connect to db
$connectionToDBid = odbc_connect(codesnipits, joecode, joecode);
// sql statement
$sqlb = SELECT imagepath FROM IMAGES;
/ run the query and dump into $numberofrecords variable
$row = odbc_do($connectionToDBid, $sqlb);
//
On Fri, 16 Nov 2001, George Whiffen wrote:
Multi loads are fine for me in 4.0.3 at least, but I don't use arrays,
each upload has a different name (I gave up on form arrays at IE 3!).
Have you tried giving them unique names?
I was hoping to avoid that. :)
I'll give it a shot, though.
Hi all,
How can I send the values inside the array into a function for calculation?
Thank you,
Calvin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail:
How can I send the values inside the array into a function
for calculation?
function addValues( $arrayVar ) {
$reteval = 0;
foreach( $arrayVar as $element ) {
$retval += $element;
}
return $retval;
}
$myArray = array( 1, 2, 3, 4, 4 );
echo addValues( $myArray );
Chris
I'm using switches to make liunks like www.link.com?go=home
code :
switch($go) {
case home:include (home.php);
break;
}
etc, also tried require stead of include.
what i get is the requested liunk loaded on top of the index.php page on the
same page, check it out @ www.ribec.airann.com
what
I config PHP4.0.6 for Apache 1.3.12 on Win32
: in apache configuation file:
ScriptAlias /php/ C:/PHP/
AddType application/x-httpd-php .php
Action application/x-httpd-php /php/php.exe
then I test with phpinfo.php file in htdocs directory.
: phpinfo.php :
?php phpinfo(); ?
when I type:
hey
use exit; instead of break;
break breaks the switch statement and continues with the
code below, exit exits the script (en doesnt execute any
code below the switch statement)
Kees
-Original Message-
From: Ann Jamison [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 16, 2001
I'm cheap too. That's why I use a free editor that does support line
numbers, like ConTEXT (http://www.fixedsys.com/context/) or EMACS. It's
been a long time since I had debugged anything in PERL, but it seems to me
that knowing exactly which line the problem is occurring on is a lot more
Thanks for the thought Alex,
alas, unlike other languages, PHP handles ANY scalar value in a switch
statement, including variables
So now I an really stumped !!
I am gonna try a whole series of 'ifs' though and deal with the ugliness
of it !
thanks again for your post,
regards
richard
function scan_string($str) {
$forbid = array (coke, tylenol, ford);
$swap = array (pepsi, advil, chevrolet);
for ($i = 0; $i count ($forbid); $i++) {
eregi_replace($forbid[$i],$swap[$i],$str);
}
}
I run this script, and I know the array's load up and the for...do loop
1 - 100 of 131 matches
Mail list logo