Which brings us back to my original argument that the function isn't being
used properly. I was just wrong about how it was being used improperly.
array_search() returns NULL when there is no match.
$result = array_search($findme[$i], $fruit);
if (!is_null($result))
{
print "Key ($result) wa
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Leif K-Brooks) wrote:
> One more question. Is there any way to use this with part of a string?
> Example:
> function checkfruitlove($string){
> $fruitarray = array("apples","oranges");
> if($string == "I love ".in_array($fruitarray)."!"){
> $r
You can't know the input type through PHP. You could use Javascript to
determine the input type and pass that along with the array. However it may
be easier just to store the text field as a separate variable, and knowing
this, parse it into your languages array after both inputs have been passe
> I would agree that performance-wise, there may be little difference in
how fast a
> script runs. And
> for pre-defining variables, sure you can get away without doing that
and php will
> happily help you
> out. However, I find it easier to debug my code knowing whether or not
I
> remembered to a
See session.gc_maxlifetime in php.ini. The session timer is based on the
session file access (or modified?) timestamp. It gets reset every time the
session data is accessed, which is every time a page using that session is
requested.
Kirk
> -Original Message-
> From: Smileyq [mailto:[EMA
Hi,
I need a function or class to validate a form with a cuple of text areas
that are alloed to contain a few html tags ( etc) but not all,
and I need a script to validate the input from the fields and stop the
html elements that are not allowed.
Does anyone have a function or class handy that I
The coding style needs to match the register_globals setting in php.ini.
register_globals on:
$accountsession = $session;
$accountemail = $email;
session_register("accountsession");
session_register("accountemail");
register_globals off:
Do just like you have it below, except remove the calls
Here are a couple resources to help
your cause:
http://uk.php.net/strip_tags
And to get ideas on how to validate
forms intelligently:
http://www.zend.com/zend/spotlight/form-pro-php4.php
Regards,
Philip Olson
On Thu, 25 Apr 2002, Tarjei Huse wrote:
> Hi,
>
> I need a function or c
Hello,
Tarjei Huse wrote:
> Hi,
>
> I need a function or class to validate a form with a cuple of text areas
> that are alloed to contain a few html tags ( etc) but not all,
> and I need a script to validate the input from the fields and stop the
> html elements that are not allowed.
>
> Does a
Take a look at www.hotscripts.com
They probably have PHP form validiation and I know they have javascript form
validation.
Jason
-Original Message-
From: Tarjei Huse [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 25, 2002 1:00 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Form validation
Fair enough, I suppose at that point it is simply a matter of preference, though I
must maintain my
debug commentary... I really like knowing that the reason my $variable isn't
displaying anything is
because I speeled it $varaible. :-)
Cheers,
# Nathan
- Original Message -
From: "Max
I've been checking the PHP documentation, but can't
find a function that will delete a member of an array,
like such:
$a = array(1, 2, 3, 4, 5);
Use the function, say array_delete($a, 3); and that
will delete the third member in the array (which would
be 4 above), so that the array would contain
On Thursday, April 25, 2002, at 03:22 PM, Liam Gibbs wrote:
> I've been checking the PHP documentation, but can't
> find a function that will delete a member of an array,
> like such:
>
> $a = array(1, 2, 3, 4, 5);
>
> Use the function, say array_delete($a, 3); and that
> will delete the third
As far as I know there isn't such a function, what I do to achieve this:
1. find the position of the element you want to remove
2. slice the array into 2 arrays one contains all elements before this and
one contains all elements below this,
3. use shift to remove appropriate element
4. merge both
That's neat but I just read the docs. it says unset() won't work inside a
function, even if you pass by reference!
Anyways as far as you don't use functions to do the delete it will work
fine.
>
> On Thursday, April 25, 2002, at 03:22 PM, Liam Gibbs wrote:
>
> > I've been checking the PHP documen
On Thu, 2002-04-25 at 12:22, Liam Gibbs wrote:
> I've been checking the PHP documentation, but can't
> find a function that will delete a member of an array,
> like such:
>
> $a = array(1, 2, 3, 4, 5);
>
> Use the function, say array_delete($a, 3); and that
> will delete the third member in the
No. :-)
What I've had to do is add a dummy value, unset($array[4]) and then array_pop the
dummy value off
the array to get it out of there completely. The reason: unset will only remove
$array[4]'s value,
not the key.
There are plenty of other ways I'm sure, but simply unsetting has really mes
$layer is my array -
$currPos = array_search($HTTP_POST_VARS["selLayer"], $layer);
$arrB = array_slice($layer, $currPos);
$val = array_shift($arrB);
$arrA = array_slice($layer, 0, $currPos);
$layer = array_merge($arrA, $arrB);
// I do this to
On Thu, 2002-04-25 at 12:34, Nathan wrote:
> No. :-)
>
> What I've had to do is add a dummy value, unset($array[4]) and then array_pop the
>dummy value off
> the array to get it out of there completely. The reason: unset will only remove
>$array[4]'s value,
> not the key.
>
> There are plenty
This has probably been answered somewhere else, but I'm bashing my head
against a wall trying to find the answer.
I'm trying to call an external ASP file from a different server (for
e-commerce authorisation) and send POST data to it. The ASP will return
only a string (ie prints it!!) and I need
Hello,
Has a automatic way to change the position from 2 elements of a array
without use a aux variable?
Like that:
A = (1,3,2) --> A = (1, 2, 3)
Thanks,
Evandro
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Thu, 2002-04-25 at 12:32, Pushkar Pradhan wrote:
> That's neat but I just read the docs. it says unset() won't work inside a
> function, even if you pass by reference!
No, that is not at all what it says.
> Anyways as far as you don't use functions to do the delete it will work
> fine.
> > On
You can POST forms transparently between servers by using sockets.
Basically, your PHP file will simply send the POSTed data to a page and
will read it after that. Then you parse the ASP output and vuala!
Start here:
www.php.net/fsockopen
Good Luck!
Maxim Maletsky
Founder, Chief Developer
w
Apparently in 4.1.X this is true... I'd been running 4.0.6 for a long time (until
4.1.2 was
released), and must have coded it in the earlier version. I stand corrected! :-)
A simple test to see if your version supports this:
$value) {
echo $key." = ".$value."";
}
?>
If you're running a
I'm trying to do urlencode/urldecode:
my $layer[] contains: aban_railroads, airport_runways2001, blk_grps
this is what IE shows in my address window when I do the redirection:
http:///updateHTML.php?layer=a%3A3%3A%7Bi%3A0%3Bs%3A14%3A%22aban_railroads%22%3Bi%3A1%3Bs%3A19%3A%22airport_runways200
OK I wrote this function to delete a specific value in an array, it
shouldn¹t be hard to modify it to do what you need it to do. $num is the
value I want to delete, $cartVals is the array. If you have any questions
feel free to contact me. Cheers!
function cartRem($num) {
global $cartVals;
This brings up another issue, how the heck do you get data binding? For
the life of me I don't see where the _query functions support SQL like:
"SELECT AuthenticateUser(?,?)" where then the first param might be a
usernamd and the second would be a password. The idea is that without this
sort of t
Create yourself an SQL function that does that :-)
Sincerely,
Maxim Maletsky
Founder, Chief Developer
www.PHPBeginner.com // where PHP Begins
> -Original Message-
> From: Joshua b. Jore [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 25, 2002 10:26 PM
> Cc: [EMAIL PROTECTED]
>
-BEGIN PGP MESSAGE-
Comment: For info see http://www.gnupg.org
owGlWL9vHMcVlmy4IcDCQIC0L2qONJZLibGS4GDrN63QpkRFRyURDEGY2527Hd3s
znpmlucNYDduXLhwlyqA/4BUaVwZSJogQJIirowAKVykc7oAQrp8b3bvdu9ES5bM
I4i7mX1v3rz3fd97x083Xz770qsffPPOHz6JPv/p2b9+48+88Rf15QH5TBUzqk1F
uXJVkUrrvDEp5TKmAxLaSpHWlIkTSYK
Thanks for all your help, everyone, but both
suggestions (unset and array_slice) pretty much didn't
improve on my current way. I was jsut trying to find a
faster way, but unset doesn't seem to be working
properly (but I'll need to fiddle more) and the
array_slice way is just too intensive.
for($c
My example wasn't good.
I have a array of objects and want change its positions.
$array = (obj2, obj1, obj3) --> $array = (obj1, obj2, obj3).
Like TStringList.Exchange in Delphi.
Sort() don't work in this case, because I want sort based in a attribute of
the object.
Evandro
"Evandro Sestre
Regarding my previous post:
I found out that $QUERY_STRING contains the query:
layer=a%3A3%3A%7Bi%3A0%3Bs%3A14%3A%22aban_railroads%22%3Bi%3A1%3Bs%3A19%3A%22airport_runways2001%22%3Bi%3A2%3Bs%3A8%3A%22blk_grps%22%3B%7D
Now I am doing:
$layer = unserialize($QUERY_STRING);
or even unserialize(urldeco
Have you thought about swapping the elements, it's quite simple, I don't
know about more complicated methods using pointers
here's the code:
$layer is the array -
$currPos = array_search($HTTP_POST_VARS["selLayer"], $layer);
$temp = $layer[$currPos];
$layer[$currPos] = $layer[$cu
On Thursday, April 25, 2002, at 04:27 PM, Liam Gibbs wrote:
> Thanks for all your help, everyone, but both
> suggestions (unset and array_slice) pretty much didn't
> improve on my current way. I was jsut trying to find a
> faster way, but unset doesn't seem to be working
> properly (but I'll ne
Foo. Somehow I encrypted the last message.
--[PinePGP]--[begin]--
I think you misunderstood me. I already have a AuthenticateUser(TEXT,TEXT)
function that works great. What I don't understand is how to get PHP to
use place holders for data binding.
It's not PHP's place to do this.
That being said, check out ADODB. It's a data abstraction layer for several
different databases that will give you this functionality.
=C=
*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*
-Original Message-
From: Joshua b
I am using PHP to access a mysql database. I was told that what I need to
do needs to be done in PHP and not mysql. I can get mysql to order things
like this:
Select * from $temp2 where sea_id = '$sea_id' order by pts DESC
The problem is that if there is a tie (as in ranking 4 and 5 below), I
When I create an image, º becomes $. Actually a small $. (pratically
half-sized). Maybe it's a "s" with a tail. I really have never seen this
character before :-)
An example:
$im = @ImageCreate (450, 500)
or exit ("Cannot Initialize new GD image stream");
$background_color = ImageColorAl
I'm assuming it's that stray dollar sign you have in front of domxml_root.
J
Sebastian A. wrote:
> Hello,
>
> I have been recently doing experiments with the DOM XML function and I am
> (not surprisingly) having some problems with it. When I try to run the
> code below, I get an error saying
On Thu, 25 Apr 2002, Steve Buehler wrote:
> I am using PHP to access a mysql database. I was told that what I need to
> do needs to be done in PHP and not mysql. I can get mysql to order things
> like this:
> Select * from $temp2 where sea_id = '$sea_id' order by pts DESC
> The problem is that
On Thu, 25 Apr 2002, Evandro Sestrem wrote:
> My example wasn't good.
>
> I have a array of objects and want change its positions.
>
> $array = (obj2, obj1, obj3) --> $array = (obj1, obj2, obj3).
>
> Like TStringList.Exchange in Delphi.
>
> Sort() don't work in this case, because I want sort
On Thu, 25 Apr 2002, Pushkar Pradhan wrote:
> I'm trying to do urlencode/urldecode:
> my $layer[] contains: aban_railroads, airport_runways2001, blk_grps
> this is what IE shows in my address window when I do the redirection:
>
>http:///updateHTML.php?layer=a%3A3%3A%7Bi%3A0%3Bs%3A14%3A%22aban
This is what I was looking for!
Thank you very much.
"Miguel Cruz" <[EMAIL PROTECTED]> escreveu na mensagem
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Thu, 25 Apr 2002, Evandro Sestrem wrote:
> > My example wasn't good.
> >
> > I have a array of objects and want change its positions.
> >
On Thu, 25 Apr 2002, Leif K-Brooks wrote:
> on 4/25/02 1:58 PM, Miguel Cruz at [EMAIL PROTECTED] wrote:
>> On Thu, 25 Apr 2002, Leif K-Brooks wrote:
>>> Is there some array wildcard I can use? In other words, I have an
>>> array. Is there any wildcard function/character that will let me test
>>>
About all I would suggest is that you eliminate the unecessary function
calls substr and explode to optimize your code. I doubt prebuilt PHP
functions will help you here. This is perfectly valid method for deleting
elements in an array and it's about as fast as you're ever going to get. :)
-
First off, thank you Miguel and Nathan for responding.
The ordering changes. Here is what I have for my query:
$searchStmt="Select * from $temp2 where sea_id = '$sea_id'
order by pts DESC";
if($aa){$searchStmt .= ",$aa DESC";}
if($bb){$searchSt
On Thu, 25 Apr 2002 [EMAIL PROTECTED] wrote:
> does anybody know how to pass the correct username and password as a
> header to a directory with an .htaccess file.
>
> i tried
>
> header("Authorization: Basic username:password");
>
> like that and also where the username:password was base 64 en
> I need a function or class to validate a form with a cuple of text
areas
> that are alloed to contain a few html tags ( etc) but not all,
> and I need a script to validate the input from the fields and stop the
> html elements that are not allowed.
>
> Does anyone have a function or class handy
Is it possible to have sessions (via cookie) on a load balanced environment?
Therefore having
www1.test.com
and www2.test.com
and share the same sessions? The systems can access the same file-system,
but it seems that the session is not passed. Could this have something to do
with ses
Thank you for wanting to try and tackle this in PHP/MySQL. I will include
the code that I have and also the sql for the tables.
CREATE TABLE b863765470 (
team_id int(10) default NULL,
name varchar(30) default NULL,
sea_id int(10) default NULL,
w int(10) default '0',
l int(10) default '0
Yep, you guys are right! Thanks for the help
Robert
"Justin French" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I don't believe there is such a problem, because
>
>
>
> will get replaced with foo by the PHP parser. >> Thus by the
> time the content get
Couldn't you store the session information on disk using sessions.save
on an NFS volume that is shared between machines?
Dan
> -Original Message-
> From: Baumann Reto [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 25, 2002 3:39 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Load Balan
On Thursday, April 25, 2002, at 05:38 PM, Steve Buehler wrote:
> Thank you for wanting to try and tackle this in PHP/MySQL. I will
> include the code that I have and also the sql for the tables.
...
> Here is my Select statment
> Select * from $temp2 where sea_id = '$sea_id' order by pts DE
On Thu, 2002-04-25 at 14:01, Kevin Stone wrote:
> About all I would suggest is that you eliminate the unecessary function
> calls substr and explode to optimize your code. I doubt prebuilt PHP
> functions will help you here. This is perfectly valid method for deleting
> elements in an array and
> I think you misunderstood me. I already have a
AuthenticateUser(TEXT,TEXT)
> function that works great. What I don't understand is how to get PHP
to
> use place holders for data binding. This is more generic database
issue. I
> could have also written:
>
> "INSERT INTO foo (a,b) VALUES (?,?)"
>
Hi all,
Just looking to see if anyone knows of any ISP in Australia, that offers PHP
and MySQL for their customer usage.
Any information would be greatly appreciated.
Thanks,
Jim.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hello All,
I looking for a php ZIP/STORE LOCATOR for website..
Anyone knows where to look??
Thanks,
Andras Kende
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
What's your budget.
There are many here, but always at a premium in comparison to US servers.
Justin French
Creative Director
http://Indent.com.au
on 26/04/02 8:26 AM, Jim Koutoumis ([EMAIL PROTECTED]) wrote:
> Hi all,
>
> Just looking to see if any
Hello,
Andras Kende wrote:
> Hello All,
>
> I looking for a php ZIP/STORE LOCATOR for website..
>
> Anyone knows where to look??
I think you want this class:
http://www.phpclasses.org/browse.html/package/522.html
Regards,
Manuel LEmos
--
PHP General Mailing List (http://www.php.net/)
To u
I don't think performance should be as much of a concern as security.
When you get warnings about undefined variables, it should make you
think about where this variable's value is coming from. If
register_globals is off, then this isn't as much of an issue. If I use
$id, at least I know it's not
At 4:00 PM -0500 25/4/02, Joshua b. Jore wrote:
>"INSERT INTO foo (a,b) VALUES (?,?)"
$my_val_a = addslashes($HTTP_POST_VARS["val_a"]);
$my_val_b = addslashes($HTTP_POST_VARS["val_b"]);
$query = "INSERT INTO foo (a,b) VALUES ($my_val_a,$my_val_b)";
Or if you have magic_quotes_gpc turned on (the
Couldn't you use something like this:
header("Location: http://user:[EMAIL PROTECTED]/path/to/file.php";);
---John Holmes...
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 25, 2002 11:11 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] autho
Everyone on this list would write this stuff everyday. The catch is that my
needs change for almost every application, so I haven't written a class as
yet.
However, generally, what you want to achieve can be done easily.
I'd recommend you write down a list of EVERYTHING you'd like to achieve, a
> $my_val_a = addslashes($HTTP_POST_VARS["val_a"]);
> $my_val_b = addslashes($HTTP_POST_VARS["val_b"]);
> $query = "INSERT INTO foo (a,b) VALUES ($my_val_a,$my_val_b)";
>
> Or if you have magic_quotes_gpc turned on (the default) all vars
passed
> in from forms/cookies are quoted and SQL injection
I am working on an odler script which loads up in index.php and a URL is passed
usually like index.php?s=something
Now, around line 10 of index.php I do an include that pulls the value of s via
HTTP_POST_VARS and then I dump it into $start.
It used to work just fine and still does except on 4.
On Thu, Apr 25, 2002 at 03:03:43PM -0300, Pierre Arsenault wrote:
>
> session_cache_expire()
>
> How does this function work?
>
> I keep getting and error saying the function is undefined... , I'm using
> version 4.1.2, which session support built in. According to the
> documentation this fun
> I'd recommend you write down a list of EVERYTHING you'd like to
achieve,
> and
> then we can help you build some code to use, or recommend a class.
I'd recommend putting your validation and formatting together, too. I
hate it when some people enter names into my database in all caps, and
some a
Or save it to a common database... and it could have something to do with
session.cooke_domain.
A cooke set explicity to www1.test.com won't be viewable on www2.test.com,
but if you set the domain to ".test.com" it will...
On Thu, 25 Apr 2002, Dan Harrington wrote:
>
> Couldn't you store the se
> I am working on an odler script which loads up in index.php and a URL
is
> passed usually like index.php?s=something
>
> Now, around line 10 of index.php I do an include that pulls the value
of s
> via HTTP_POST_VARS and then I dump it into $start.
What do you mean you "dump it into $start"??
Excuse me, you're right. I was using this include as a "preprocess" step as
I was using ; to seperate arguments in the query string like this
index.php?s=something;t=thing
The preprocess step was breaking them apart and then I was doing this:
$start = isset($HTTP_GET_VARS['s']) ? $HTTP_GET_VARS
On Thu, 25 Apr 2002, John Holmes wrote:
> I'd recommend putting your validation and formatting together, too. I
> hate it when some people enter names into my database in all caps, and
> some all lowercase. So in my validation routine, I make sure that the
> name is only letters, (except for a pos
Greetings all,
Does anyone know of any Australian websites which have facilities to post
and look for PHP/MySQL/web application contracts???
(Or perhaps global sites with a high Australian user base)
Justin French
Creative Director
http://Indent.com.au
Hi to all,
I am wondering if there are other ways to redirect users other than using
header()?
I have a script that if the user doesn't have enough money to buy an item
then it directs to one page and if they do then it directs them back to the
referring page.
Is this possible?
Thanks
Jennife
I am trying to do an HTTP GET to pull down webpages, parse and store data
into a MySQL DB.
However the pages are using digest auth as outlines in RFC2617. I am unable
to generate the
correct MD5 hash from the following code for using MD5-sess:
$realm = "[EMAIL PROTECTED]";
$nonce
With header you can do by using
header("Location: http://www.site.com/some/page.php?some=var";);
here's a good article about it:
http://www.phpbeginner.com/columns/shobhan/browser
other than that, you can always include(). But this is a little bit of a
mess.
Sincerely,
Maxim Maletsky
Founde
You can use header() for that...just don't display anything before you
redirect them.
Otherwise you need a client side solution like a META REFRESH
---John Holmes...
> -Original Message-
> From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 25, 2002 5:10 PM
> To: [
Hi All,
When attempting to send an email through a PHP script via Apache, no emails
are sent. However if I use the standalone binary and run the same script
but on the console then it works fine.
Because of that I have a feeling that there is something in Sendmail which
is preventing the "nobod
On Fri, 26 Apr 2002, David Redmond wrote:
> When attempting to send an email through a PHP script via Apache, no emails
> are sent. However if I use the standalone binary and run the same script
> but on the console then it works fine.
>
> Because of that I have a feeling that there is something
Are you using headers in your mail script??? I'm no expert on sendmail at
all, but your host may require the From: [EMAIL PROTECTED] header before it
will send
It's worth a shot :)
Otherwise, does the binary and Apache version share the same php.ini
file
Justin French
--
At 25.04.2002 18:03, you wrote:
> When I create an image, º becomes $. Actually a small $. (pratically
>half-sized). Maybe it's a "s" with a tail. I really have never seen this
>character before :-)
>
> An example:
>
>$im = @ImageCreate (450, 500)
> or exit ("Cannot Initialize new GD imag
Hi,
I just thought I'd say thank's too all who responded to my question.
Very good answers! I ended up using strip_tags (after someone pointed it
out too me) kombinded with a couple of eregs.
Tarjei
John Holmes wrote:
>
> > I need a function or class to validate a form with a cuple of text
>
101 - 181 of 181 matches
Mail list logo