Quoting [EMAIL PROTECTED]:
3. if ($cardID = '' || is_int($cardID))
As someone mentioned, $cardID = '' makes an assignment, doesn't
test for true/false. Change to $cardID == ''. And this statement
SHOULD come up "true" as a whole because $cardID = '' should always
be true (unless th
Ok, some good points where made already, but let's pull it all together:
1. You should get in the habit of using $_GET[] instead of $HTTP_GET_VARS..
minor thing but worth noting (info at http://us2.php.net/reserved.variables)
2. case reserve:
This, I believe, will treate "reserve" as a consta
Am Freitag, den 20.01.2006, 18:28 -0500 schrieb comex:
> > if ($cardID=''||is_int($cardID))
>
> Two problems with that statement:
> First of all, this statement _sets_ cardID to '', and then (I think)
> returns a false value since '' doesn't evaluate to true. You probably
> wanted ==.
hO
well I don't well understand the problem hope these two snippets can solve
your problem: i tested them seems fine
file 1 form.php
enter tour code
enter tour code
user
code
file 2
--
get_card.php
Nuova pagina 1
> if ($cardID=''||is_int($cardID))
Two problems with that statement:
First of all, this statement _sets_ cardID to '', and then (I think)
returns a false value since '' doesn't evaluate to true. You probably
wanted ==.
Second of all, now that $cardID is '', it certainly isn't an int. It
isn't an
Am Freitag, den 20.01.2006, 16:08 -0700 schrieb Gerry Danen:
> You probably want to do an is_int() first...
>
> After that, you know it's an int and treat it that way. Why do you
> need to typecast it?
>
> BTW, change $cardID = $HTTP_GET_VARS[cardID]; to $cardID =
> $_GET['cardID']; for PHP5 comp
You probably want to do an is_int() first...
After that, you know it's an int and treat it that way. Why do you need to
typecast it?
BTW, change $cardID = $HTTP_GET_VARS[cardID]; to $cardID = $_GET['cardID'];
for PHP5 compatibility... ;-)
Gerry
On 1/20/06, Ron Eggler (Paykiosks) <[EMAIL PROTECT
You should be able to typecast the variable like so:
$cardID = (int)$cardID;
You can also check which type it is showing up as with the function gettype():
http://www.php.net/manual/en/function.gettype.php
Optionally you could use settype() to change the type of the variable:
http://www.php.ne
Hi,
I need to do a type cast from string to int in folllowing code:
[php]
[/php]
I need $cardID have converted to int. I thought it should work that way
but it does not!
But it's working if I'm putting
[php]
[/php]
in there. I got card ID as a var that is passed as get like:
[php]
$cardID = $HTT
9 matches
Mail list logo