473,411 Members | 2,030 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

accessing value of a constant from another page

hi am going thru a joomla script and they are accessing a constant without re-defining it or including the file where it was originally define. the first line of codes on the script is
Expand|Select|Wrap|Line Numbers
  1. defined('_JEXEC') or die('restricted access');
  2.  
how is this possible
Sep 15 '11 #1
2 1841
Dormilich
8,658 Expert Mod 8TB
this line simply checks, whether the constant _JEXEC has been already defined or not. besides that, the line does not access the constant itself, only the name is passed.
Sep 15 '11 #2
Markus
6,050 Expert 4TB
The purpose of this is to prevent direct access to the file. If you access the file directly (e.g. http://your.tld/include/protected.php), the constant _JEXEC isn't defined. However, if this file is included via a PHP file where that constant has been defined, it will load appropriately.

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. define( '_JEXEC', 1 );
  3.  
  4. // access-protected file
  5. include 'included/protected.php';
  6.  
Sep 15 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Mike P | last post by:
When you are passing a value to another page, and will need access to it throughout the page and on any postbacks, what is the best way to store it? By making it a variable accessible to the whole...
3
abdoelmasry
by: abdoelmasry | last post by:
Hi Friends i need help in sessions im passing variables between pages using sessions this is the main page thats mean the home page the main page have table to show messages for users , it have...
11
by: dkate777 | last post by:
Hi, Is anybody know how to pass textbox input value to another page. I am using document.secondform.fieldname.value=document.firstformname.fieldname.value but it's not working Thanks
0
by: kareemelhosseny | last post by:
plz all i want your help urgently i have a form that include combo box for example which contain all axps pages in the project my case when i choose each page i can call each controle in it...
2
by: stephen | last post by:
Hi, I have a button on a webpage. Clicked event of this button opens another page for search and populates a datagrid or whatever and then I want to return value from this second page on to the...
3
by: jmash | last post by:
Hello, The requirement is to display rows of data on a classic ASP page for rows in a recordset. On each row we have a link at the end to show detailed information about the selected row. A...
1
by: mentor | last post by:
in first page, <form id="form1" runat="server" action="page2.aspx"> <TEXTAREA id="txt1" runat=server></TEXTAREA> <INPUT type=submit value=submit name=rev_submit> in second page(c#) string...
2
by: digituf | last post by:
i have 2 forms here. 1) DisplayDetails.php 2) RegistrationForm.php when user click to the link 'Next' at the DisplayDetails.php page it will bring all the session value to the...
1
by: sandhya karki | last post by:
I have three combobox for menu ,submenu and subsubmenu. When I click the first combox ,second combobox should be appeared displaying the value related to the first combox box and when i click the...
2
by: dougancil | last post by:
I have a page with a gridview and I want to pass the value when a user clicks on a hyperlinked field in the grid to another page. Here is the code for the gridview: <asp:GridView ID="GridView1"...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.