Here is an example of a problem i have:
I have index.php which calls a function which needs a variable from en.php.
en.php contains text strings for the site. In index.php we have a function that when the amount of content is limited per page, produces links to the previous and next pages. The text for these links will change languages, and i need to call the proper text from the language file, in this example, en.php. But my synthax is wrong, can somebody tell what’s off?
This is en.php
[CODE]<?php
// Declare all text strings that we need,
// in English.
$GLOBALS[‘text’] = array (
‘prevpage’ => ‘Previous page’,
‘nextpage’ => ‘Next page’,
);
?>
This is index.php
[CODE]<?php
require_once ‘language/en.php’;
function getPagingLink($totalResults, $pageNumber, $itemPerPage = 3, $strGet = ”)
{
… …
if ($totalPages > 1) {
$self = ‘http://’ . $_SERVER[‘HTTP_HOST’] . $_SERVER[‘PHP_SELF’] ;
// print ‘previous’ link only if we’re not
// on page one
if ($pageNumber > 1) {
$page = $pageNumber – 1;
if ($page > 1) {
$prev = ” <a href=”$self?pageNum=$page”>$text[‘prevpage’]</a> “;
… …