On Mon, 25 May 2009 02:11:24 -0400, pa...@quillandmouse.com (Paul M Foster)
wrote:
.
>
>This is why I originated a thread along these lines some time ago. I
>sympathize with your pain, being a C programmer as well. Apparently, PHP
>plays fast and loose with types when doing == comparison
On Mon, May 25, 2009 at 12:46:16PM +1000, Clancy wrote:
> For some time I have been working on a text based database, in which each
> entry contains
> one or more lines of data, with the various fields delimited by semicolons,
> e.g.
>
> A;b;20GM;Restaurant;090508
> n;;;Arintji;;
> a;Federati
With the initial explode, I may be wrong but I don't think it's possible to
force every entry to be string-typed. However, this little snippet could
help:
$foo = explode(';', $db);
foreach($foo as &$bar) {
$bar = settype($bar, 'string);
}
which will set each element's type to string, but is hardl
For some time I have been working on a text based database, in which each entry
contains
one or more lines of data, with the various fields delimited by semicolons, e.g.
A;b;20GM;Restaurant;090508
n;;;Arintji;;
a;Federation Square;;;
p;9663 9900;;;9663 9901;;i...@arintji.com.au;
All was goin
Ivo F.A.C. Fokkema wrote:
Ah, thanks. Misunderstood the question, then. Thought just checking if
it's a file in that directory was what's needed.
You were right. :)
I did not plan on looking-in anything other than one or two hard-coded
folder locations. But, it is good to know the details. ;)
On Mon, 28 Aug 2006 19:39:49 -0400, Robert Cummings wrote:
> On Mon, 2006-08-28 at 16:50 +0200, Ivo F.A.C. Fokkema wrote:
>> On Mon, 28 Aug 2006 09:47:02 +0100, Stut wrote:
>> > Micky Hulse wrote:
>> >> I am looking for the most secure/efficient way to compare these two
>> >> strings:
>> >>
>> >>
Robert Cummings wrote:
Readfile works great, it's the same as file_get_contents() and then
Ah, good to hear. :D
issuing an echo. You may want to also stored content generated by web
users outside of the web tree. There may not be any issue with how you
[...]
with PHP tags and accesses it dir
On Mon, 2006-08-28 at 17:07 -0700, Micky Hulse wrote:
> Hi Robert,
>
> Robert Cummings wrote:
> > How are these saved files then imported into the content? Are they
> > included or do you retrieve the contents using something like file(),
> > file_get_contents(), or fread() and then echo it? If yo
Hi Robert,
Robert Cummings wrote:
How are these saved files then imported into the content? Are they
included or do you retrieve the contents using something like file(),
file_get_contents(), or fread() and then echo it? If you are using
Currently I am using readfile() (plus some other securit
On Mon, 2006-08-28 at 16:28 -0700, Micky Hulse wrote:
> Wow, thanks for all the great information folks (Stut, Ivo, Rob, and David.)
>
> I really appreciate all of the top-notch advice and expert information. :D
>
> Looks like I have a lot to think about...
>
> Currently, I hard-code the paths t
On Mon, 2006-08-28 at 16:50 +0200, Ivo F.A.C. Fokkema wrote:
> On Mon, 28 Aug 2006 09:47:02 +0100, Stut wrote:
>
> > Micky Hulse wrote:
> >> I am looking for the most secure/efficient way to compare these two
> >> strings:
> >>
> >> /folder1/folder2/folder3/folder4/
> >> /folder1/folder2/folder3/
Wow, thanks for all the great information folks (Stut, Ivo, Rob, and David.)
I really appreciate all of the top-notch advice and expert information. :D
Looks like I have a lot to think about...
Currently, I hard-code the paths to the folders that house the files I
want my CMS to edit (via a co
On Mon, 2006-08-28 at 09:47 +0100, Stut wrote:
> Micky Hulse wrote:
> > I am looking for the most secure/efficient way to compare these two
> > strings:
> >
> > /folder1/folder2/folder3/folder4/
> > /folder1/folder2/folder3/folder4/file.php
> >
> > Basically I am trying to setup as many security
On Mon, 28 Aug 2006 09:47:02 +0100, Stut wrote:
> Micky Hulse wrote:
>> I am looking for the most secure/efficient way to compare these two
>> strings:
>>
>> /folder1/folder2/folder3/folder4/
>> /folder1/folder2/folder3/folder4/file.php
>>
>> Basically I am trying to setup as many security featu
Micky Hulse wrote:
> Hi,
>
> I am looking for the most secure/efficient way to compare these two
> strings:
>
> /folder1/folder2/folder3/folder4/
> /folder1/folder2/folder3/folder4/file.php
>
> Basically I am trying to setup as many security features as possible for
> a simplistic (home-grown/ha
Stut wrote:
First of all make sure you are sending both strings through realpath
(http://php.net/realpath) to remove any symbolic links and relative
references. Then you can compare the two strings. The way you're doing
it will work but it's probably not very efficient. This is what I use...
$va
Micky Hulse wrote:
> I am looking for the most secure/efficient way to compare these two
> strings:
>
> /folder1/folder2/folder3/folder4/
> /folder1/folder2/folder3/folder4/file.php
>
> Basically I am trying to setup as many security features as possible for
> a simplistic (home-grown/hand-coded)
Hi,
I am looking for the most secure/efficient way to compare these two strings:
/folder1/folder2/folder3/folder4/
/folder1/folder2/folder3/folder4/file.php
Basically I am trying to setup as many security features as possible for
a simplistic (home-grown/hand-coded) CMS...
This appears to wo
Hi folks,
well, I have a really dumb question:
I have the following script at http://www.tisys.org/misc/test.php:
Now I call it like this:
http://www.tisys.org/misc/test.php?
license=0701770160811371731660412452242420381052542100071831272071031621
17160180165221170166096217228128
And in
if (isset($_POST['Submit'])) {
//echo "post equals".$_POST['x']." corect is".$correct_answers[$page-1];
$compare1 = $_POST['x'];
echo "page is".$page;
$compare2 = $correct_answers[($page-1)];
echo "compare1 is ".$compare1;
echo "";
echo "compare2 is ".$compare2;
if (strcmp($compare1, $compare2
strcmp returns 0 if the two strings are equal.
In any case, why not just do
if ($city == $city_new) $error = true;
> -Original Message-
> From: andy [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 11, 2002 9:10 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] compari
Hi there,
I would like to compare 2 strings.
I do always get a 0 return (not equal) but they are difinatelly equal, I
double checked it. They are just in two different vars.
Here is how I did it:
if (strcmp($city, $city_new) != 0) $error = true;
Does anybody see the error? Or am I going the
I feel fairly new to this as well but I think that, whilst your logic is
right, the syntax may be a little off.
if ($action == "textstring)
{
echo "true";
}
else
{
echo "false";
}
Above should show how the syntax will rok.
Good luck
Michael
phantom wrote:
>
> Bear with me, new to PHP and g
Bear with me, new to PHP and got a beginner's questions
How do I run an if statement and the if statement compares a String?
IN ASP (yes I Know, ASP is evil) I would have wrote
if (String(Request("Action"))=="Submit")
do this
In PHP I have tried
if ($Action == "Submit") but I get a par
24 matches
Mail list logo