Now I have fixed the problem the T_ELSE parse error is not displaying anymore, But then how can I direct the code to display the if or the else?
Well users are going to come from either page1.php or page2.php
url coming from page1.php
cart.php?ids=1
url coming from page2.php
cart.php?idc=1
for instance if the url is coming from page1.php then cart is going to receive it like
$ids= isset($_GET[‘ids’])?(int) $_GET[‘ids’]:null;
$idc= isset($_GET[‘idc’])?(int) $_GET[‘idc’]:null;
if ($ids) {
display something
}
elseif($idc) {
display something different
}
else
{
display nothing has passed
}
Those are the conditions I have right but it is not working properly since it will display the else message “display nothing has passed”. Again it will display the else statement even if I come from page1.php or page2.php. I guess the conditions are not well set up or it is passing empty. How can I set up the conditions so it can display either $ids statement or the elseif $idc.
I assume that ‘blabla’ isn’t actually in your code but there is, in fact, something meaningful there.
Remember to test for something with your if statement.