Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jan 2013
    Location
    Australia
    Posts
    120
    Thanks
    22
    Thanked 0 Times in 0 Posts

    Smile PHP Echo Not Working

    Hello on my server I have few file but not pick up my <p><?php echo $powered; ?></p>

    index.php which has these to links in it so far

    Code:
    <?php include("catalog/view/theme/realestate/template/common/header.php"); ?>
    <?php include("catalog/view/theme/realestate/template/common/footer.php"); ?>
    I have created a controller file which is in my catalog folder in the in the controller file is footer.php

    Code:
    <?php  
    class ControllerCommonFooter extends Controller {
    	protected function index() {
    		$this->language->load('common/footer');
    		
    
    		$this->data['text_contact'] = $this->language->get('text_contact');
    
    		
    
    		$this->data['contact'] = $this->url->link('information/contact');
    	
    
    		$this->data['powered'] = sprintf($this->language->get('text_powered');
    
    
    
    		$filename = '/catalog/view/theme/realestate/template/common/footer.php';
    
    		if (file_exists($filename)) {
    		    echo "catalog/view/theme/realestate/template/common/footer.php";
    		} else {
    		    echo "catalog/view/theme/realestate/template/common/footer.php";
    		}
    	}
    }
    ?>
    also in the catalog file is a language folder english/common footer.php

    Code:
    $_['text_powered']      = 'Powered By <a href="http://www.teststore.com">Test Computers</a><br /> &copy;';
    on my footer.php that is in my catalog/view/theme/realestate/template/common

    Code:
    <p><?php echo $powered; ?></p>

  • #2
    Regular Coder Redcoder's Avatar
    Join Date
    May 2012
    Location
    /dev/null
    Posts
    335
    Thanks
    2
    Thanked 49 Times in 48 Posts
    If you follow and echo out earlier, you'll find that the variable $powered i empty and therefore the problem i not the PHP interpreter but rather the fact that $powered is not propagated probably due to a flaw in your code.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •