PDA

View Full Version : Function isset() undefined?


Francky683
08-01-2006, 10:23 PM
Hi all,
I've been workin with PHP for some time and I must say I just had the weirdest error ever this afternoon. Here are the code lines :

<?
$cartSql = mysql_query("SELECT * FROM ".$table_suffixe."shop_carts WHERE cart_id = ".str_replace("cart","",$_GET['id'])." AND user_id = ".$_SESSION['session_user_id']);
if(isset($_GET['id']) && isset($_GET['uid']) && isset($_GET['value']) && (mysql_num_rows($cartSql) == 0) && (md5($_SESSION['session_unique_id']) == $_GET['uid']))
{
$cartRow = mysql_fetch_array($cartSql);
$priceShipping = ($cartRow['price']*$shoppingCart->shippingFees/100);
$priceShopping = ($cartRow['price']*$shoppingCart->shoppingTaxes/100);
if(md5(str_replace($notGoodChars,"",round($cartRow['price']+$priceShipping,$priceShopping,2))) !== $_GET['value'])
{

}
}
else{
echo "
<div style=\"padding:5px;\">
You didn't follow the good link, please follow the one in the email that contains your order's informations.
</div>
";
}
?>

Error message :

Fatal error: Call to undefined function: isset() in /mounted-storage/home19a/sub001/sc19472-DQUQ/www/acidreign/shop/completed.php on line 9

Can anyone help me with this?

Best regards,

Francis B.

boeing747fp
08-01-2006, 10:39 PM
did you try

if(!empty())

GJay
08-01-2006, 11:19 PM
PHP Version?
has someone been messing with runkit?

(suggesting to use empty is rather silly, standard functions shouldn't be undefined...)

boeing747fp
08-01-2006, 11:28 PM
i know... but if it's that odd that isset() wont work, maybe it's odd that empty() would :p

Francky683
08-02-2006, 12:33 AM
doesn't work as well ... anyone?

and it won't work only on this page

GJay
08-02-2006, 08:10 AM
Only on one page?
What's the rest of the code on the page? (the line number doesn't match the error message otherwise...)
PHP version? (again...)
does looking at phpinfo() output look sensible?

_Aerospace_Eng_
08-02-2006, 08:14 AM
I wonder if it matters if the php was opened using short open tags
<?
rather than
<?php

marek_mar
08-02-2006, 01:16 PM
isset() is not a function.
To get that error you would have to call isset() via variable functions.

Vin0rz
08-02-2006, 01:51 PM
isset() is not a function.

Hold on a minute. What's this then? (http://nl2.php.net/manual/en/function.isset.php)

fci
08-02-2006, 02:05 PM
vin0rz, what he means is:
Note: Because this is a language construct and not a function, it cannot be called using variable functions

Vin0rz
08-02-2006, 02:07 PM
vin0rz, what he means is:

So that means he would have to have done:

$function = 'isset';
if($function(true){
//blabla

Which he didn't, right?

_Aerospace_Eng_
08-04-2006, 03:34 AM
isset() returns true or false.
$var = 'test';
if(isset($var)) // returns true
{
// do something
}

This is all the OP is doing so it should work.