0

I am a beginner php and joomla user. I have installed jumi component in joomla 2.5. I want to collaborate between pages but I don't know how to link between them. Can anyone please help me by explaining briefly.

Such as I have created a new file in jumi named "linked to another article" and the codes are explained below:

I have defined them:

defined("_JEXEC") OR die ("Restricted access");

I have created a link:

$linktext = "<Click> & you'll see";

After that I put the href:

<a href="FILE PATH"><?php echo htmlspecialchars($linktext);?>

After that I have created another file in jumi named "ABC" where I put <?php echo"Hello World"?>, how can I include the path of ABC file in the "FILE PATH" of my first file so that if I click on the first files link then it will redirect me to my ABC file and show "Hello World"?

I will be grateful for your kind reply. Thanks.

user1946440
  • 349
  • 1
  • 5
  • 13

1 Answers1

0

Let's suppose you have 2 files in the jumi directory (components/com_jumi/files). A.php and B.php.

We don't want people to be able to access those files directly, so we place inside them the snippet

defined("_JEXEC") OR die ("Restricted access");

So far so good. Assuming that your website's URL is h**p://www.example.com, you'll get a

restricted access if you try any of the bellow:

h**p://www.example.com/components/com_jumi/files/A.php or

h**p://www.example.com/components/com_jumi/files/B.php.

This means that you cannot use those URLs to access for example B.php from A.php.

So here is a workaround:

  1. Create 2 jumi applications from your administration panel, one for A.php (let's call it Application_A) and one for B.php (let's call it Application_B). I supose you have already done that.

  2. Create a menu item of type Jumi application, point it to Application_A and use as its alias the application_a. From this point A.php its accesible as h**t://www.example.com/application_a

  3. Create a new Joomla menu (you can call it hidden for clarity), and in that menu create a menu item of type Jumi application, point it to Application B and use as its alias the application_b. From this point B.php its accesible as h**t://www.example.com/application_b

  4. So. whenever you want to access B.php from A.php you can do it simply as

    <a href="application_b">Go to B</a>

Community
  • 1
  • 1
tliokos
  • 3,606
  • 3
  • 28
  • 28