How to show/Hide html element on cpecific URL

Hello experts,

I have a website that contains schedule system. There is two schedules for two offices
Schedule one:
http://corpus.pickup.org.il/index.php?option=com_shedule&filial_id=1&Itemid=226
Schedule 2
http://corpus.pickup.org.il/index.php?option=com_shedule&filial_id=2&Itemid=221

The only difference in url is "filial_id" it can be 1 or 2

Now my question:
I need to show div with different image for each one of schedules.
On  schedule one "img one" on schedule two "image two"
How can i show div with image only if url is valid for relevant element
example:

http://corpus.pickup.org.il/index.php?option=com_shedule&filial_id=1&Itemid=226
show image one
http://corpus.pickup.org.il/index.php?option=com_shedule&filial_id=2&Itemid=221
show image two.

Thank you,
Dan
DanSmirAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ray PaseurCommented:
There will be a variable in the PHP global scope called $_GET.  It is an array.  Test $_GET["filial_id"] with an if() statement and use the result to choose which image to produce.
0
DanSmirAuthor Commented:
Dear ray,
Can you please provide full code?

Thank you
0
Ray PaseurCommented:
No, but I can show you an example.  Back in a moment
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

DanSmirAuthor Commented:
Ok, show me
0
Ray PaseurCommented:
See these two links:
http://www.laprbass.com/RAY_temp_dansmir.php?option=com_shedule&filial_id=1&Itemid=226
http://www.laprbass.com/RAY_temp_dansmir.php?option=com_shedule&filial_id=2&Itemid=221

HTH, ~Ray
<?php // RAY_temp_dansmir.php
error_reporting(E_ALL);

/* FROM THE POST AT EE
http://corpus.pickup.org.il/index.php?option=com_shedule&filial_id=1&Itemid=226
show image one
http://corpus.pickup.org.il/index.php?option=com_shedule&filial_id=2&Itemid=221
show image two.
*/

// GET THE INFORMATION FROM THE URL ARGUMENT USING THE TERNARY OPERATOR
// MAN PAGE http://php.net/manual/en/language.operators.comparison.php
$filial_id = isset($_GET["filial_id"]) ? $_GET["filial_id"] : 0;

// USE SWITCH-CASE NOTATION TO CHOOSE INFORMATION
// MAN PAGE http://php.net/manual/en/control-structures.switch.php
switch ($filial_id)
{
    case 1:
        echo "<br/>filial_id = 1";
        echo "<br/>Itemid = {$_GET["Itemid"]}";
        break;

    case 2:
        echo "<br/>filial_id = 2";
        echo "<br/>Itemid = {$_GET["Itemid"]}";
        break;

    default:
        echo "<br/>filial_id IS NOT UNDERSTOOD";
        break;
}

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DanSmirAuthor Commented:
Genius!!
Thank you very much:)))
0
Ray PaseurCommented:
Thanks for the points! ~Ray
0
DanSmirAuthor Commented:
BTW Ray,

What for this "error_reporting(E_ALL);"?
0
DanSmirAuthor Commented:
To Ray, i got it.

Thanks again
0
Ray PaseurCommented:
10-4.  All the best, ~Ray
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Joomla

From novice to tech pro — start learning today.