Jump to content

_jexec OR DIE (I'm Dying

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
26 replies to this topic

#1
bradley7

bradley7

    Newbie

  • Members
  • PipPip
  • 15 posts
Hi guys, I'm new and frustratred

Basically i'm trying to learn JoomlA template which i copy from a book and trying to get running
All the reading i have done has told me ids is security ok, when I run it I get "Access Denined'
When I take the PHP stuvff out, which i don't want to do, it come up with errors

HELP please
<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >

<head>

<jdoc:include type="head" />

<link rel="stylesheet" href="templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="templates/system/css/general.css" type="text/css" />

</head>

<body> 
The name of this site is <?php echo $mainframe->getCfg('sitename');?><br />
The administrator email is <?php echo $mainframe->getCfg('mailfrom');?><br />
This template is in the <?php echo $this->template?> directory<br />
The URL is <?php echo JURI::base();;?>
<jdoc:include type="module" name="breadcrumbs" />
<jdoc:include type="modules" name="top" />
<jdoc:include type="modules" name="left" />
<jdoc:include type="component" />
<jdoc:include type="modules" name="right" />
</body>
</html>

Brad

Edited by Jaan, 20 April 2010 - 02:57 AM.
Please use code tags when you are posting your codes!


#2
CommittedC0der

CommittedC0der

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,565 posts
First, please wrap your code in
 
tags and if you post this the in PHP section you might get more help.
A man can be defined by what he does when no one is looking.
Science is only an educated theory, which we cannot disprove.

#3
macneato

macneato

    Newbie

  • Members
  • PipPip
  • 10 posts
Hi Bradley,

This could be a legacy issue. Try turning it on.

Nevertheless, I've updated your code a bit

<?php
// no direct access
defined('_JEXEC') or die('Restricted access');
?>
<?php echo '<?xml version="1.0" encoding="utf-8"?' .'>'; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" >

<head>
    <jdoc:include type="head" />
    <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/system.css" type="text/css" />
    <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/general.css" type="text/css" />
</head>

    <body>
        The name of this site is <?php echo $mainframe->getCfg('sitename');?><br />
        The administrator email is <?php echo $mainframe->getCfg('mailfrom');?><br />
        This template is in the <?php echo $this->template?> directory<br />
        The URL is <?php echo JURI::base();;?>
        <jdoc:include type="module" name="breadcrumbs" />
        <jdoc:include type="modules" name="top" />
        <jdoc:include type="modules" name="left" />
        <jdoc:include type="component" />
        <jdoc:include type="modules" name="right" />
    </body>
</html>


#4
bradley7

bradley7

    Newbie

  • Members
  • PipPip
  • 15 posts
hi macneato
i'm lost I copied you code and ran it on my localhost, still getting Restricted access
what do you mean a legary issue.

I'm trying hard to learn Joomla template
Brad,

#5
macneato

macneato

    Newbie

  • Members
  • PipPip
  • 10 posts
What version of joomla are you using?
Does this error occur only when you select your own custom template?

Legacy is for older versions of joomla and it uses '_VALID_MOS' instead of '_JEXEC'

#6
bradley7

bradley7

    Newbie

  • Members
  • PipPip
  • 15 posts
joomla 1.5
i working on another template which i have downloaded and installl, work find.
as i said i copyied two member from a book, one xml. the other, whick you have look at html/php
if i remove the php from the top of the html, i get html

i'm using the jomla 1.5 a user guide by barrie north pg 239-242 if that help

brad

#7
macneato

macneato

    Newbie

  • Members
  • PipPip
  • 10 posts
If im correct, this is your issue. You adding your template code to the joomla system template or root index which is a big NO NO. Ensure the index.php file you are editing is located within:

templates > yourtemplate >

If that is not the problem, please zip your template and upload it (filesend) and send me a link

#8
bradley7

bradley7

    Newbie

  • Members
  • PipPip
  • 15 posts
hope i did it right and thank you :)

Attached Files



#9
macneato

macneato

    Newbie

  • Members
  • PipPip
  • 10 posts
Hi Bradley,

I have taken a look at your template and everything thing seems fine from my side, think just download the latest version of joomla and see if it makes a difference

#10
bradley7

bradley7

    Newbie

  • Members
  • PipPip
  • 15 posts
no, not working
but you said update joomla, i use 1.5.15 but that make me think, i been running the index.php by it self, do i need to put in into a joomla module o something.
can you explain how you run it on localhost.
i now using php6

#11
macneato

macneato

    Newbie

  • Members
  • PipPip
  • 10 posts
Na don't need to add it as a module, should work within the templates folder. To run it locally i use wamp. Then you just add joomla into the webroot folder.

Not too sure about php6, I find that php 5.2.9-2 does the trick as you would have to edit some modules to avoid using depreciated code. Plus, how many hosting companies have switched over?

#12
bradley7

bradley7

    Newbie

  • Members
  • PipPip
  • 15 posts
this part i understand 'Then you just add joomla into the webroot folder. '. don't you instale a new copy of joomla for each web site? i will try php 5.2.9-2.
just want to understand