Ok I have still have this problem, it is the register globals is off, tested it and that is the cause.
So within this script what causes them to be on and what must I change to turn them off? please!
include "header.php";
// This code will encode the page into Arabic windows. At this moment, it is not working. I don't know why. :(
// echo "<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1256">";
// Developer information
function developer() {
echo ("<br>");
echo ("<center><a href="javascript:void window.open('".XOOPS_URL."/modules/Quran/help.html', 'win2', 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no');" title=""._MD_INFO."">Quran 1.0</a></center>");
}
// If you are a good citizen, please do not remove this copyright information.
// Main Index
function index() {
global $xoopsConfig, $xoopsDB, $xoopsUser, $xoopsTheme, $xoopsLogger, $xoopsModule, $xoopsTpl, $surano;
include XOOPS_ROOT_PATH.'/header.php';
$myts =& MyTextSanitizer::getInstance();
searchform();
echo "<br>";
$result = mysql_query ("select sura, surano, ayatno, ayat from quran where ayatno=1 order by surano");
echo "<tr bgcolor="#D2F3CF">";
echo "<td align="center" width="25">"._MD_NO."</td><td align="left" width="175">"._MD_CHAPTERNAME."</td><td align="center" width="100">"._MD_VERSES."</td><td align="center" width="175">"._MD_LISTENDOWNLOAD."</td></tr>";
while (list ($sura,$surano,$ayat,$ayatno) = mysql_fetch_row ($result)) {
$result2 = mysql_query ("select count(ayatno) from quran where surano=$surano");
list ($ayatcount) = mysql_fetch_row ($result2);
mysql_free_result ($result2);
echo "<tr bgcolor="#ffffff">";
echo "<td align="center" width="25">$surano.</td><td align="left" width="175"><a href="index.php?op=viewayat&surano=$surano">$sura</a></td><td align="center" width="100">$ayatcount</td><td align="center" width="175"><a href="http://quran.al-islam.com/Recite/CRecite_g2.asp?s=$surano&f=$ayat&Reciter=1">$surano<a/></td>";
echo "</tr>";
}
echo "<tr valign="top"><td width="100%" colspan="4" align="center">";
developer();
echo "</td></tr></table>";
include '../../footer.php';
}
// Main Index Finished Here
// Search function
function search($query, $min, $show) {
global $xoopsConfig, $xoopsDB, $xoopsUser, $xoopsTheme, $xoopsLogger, $xoopsModule, $xoopsTpl;
if (!isset($min)) $min=0;
if (!isset($max)) $max=$min+$perpage;
$perpage=10;
$searchresults=10;
if ($show!="") {
$searchresults=$show;
} else {
$show=$searchresults;
}
$query = addslashes($query);
$result = mysql_query("select ayat, sura, surano from quran where ayat LIKE '%$query%' OR sura LIKE '%$query%' limit $min,$perpage");
$fullcountresult = mysql_query("select id, sura, surano from quran where ayat LIKE '%$query%' ");
$totalselecteddownloads = mysql_num_rows($fullcountresult);
$nrows = mysql_num_rows($fullcountresult);
$x=0;
$the_query = stripslashes($query);
$the_query = str_replace("'", "'", $the_query);
include XOOPS_ROOT_PATH.'/header.php';
$myts =& MyTextSanitizer::getInstance();
echo "<br>";
if ($query != "") {
if ($nrows>0) {
searchform();
echo "<tr valign="top"><td width="100%" colspan="4" align="center"><font class="option">"._MD_SEARCHRESULTS." : <b><i>$the_query</i></b> "._MD_FOUND." : $nrows "._MD_VERSES." </font><br><br>";
while(list($ayat,$ayatno,$sura,$surano) = mysql_fetch_row($result))
{
$ayat = stripslashes($ayat);
$sura = stripslashes($sura);
$ayat = eregi_replace($query, "<span style="background-color: #FFFF00"><b>$query</b></span>", $ayat);
echo "<p align="left">$sura.$ayat";
echo "<br>";
$sura = ereg_replace($query, "<span style="background-color: #FFFF00"><b>$query</b></span>", $sura);
echo "<br>";
$x++;
}
echo "</font>";
}
else {
searchform();
echo "<tr><td width="100%" colspan="4" align="center"><br><br><font class="option"><b>"._MD_NOMATCHESFOUND."</b></font><br><br>"._MD_SEARCHAGAIN."<br></td></tr>";
}
/* Calculates how many pages exist. Which page one should be on, etc... */
$quranpagesint = ($totalselecteddownloads / $searchresults);
$downloadpageremainder = ($totalselecteddownloads % $searchresults);
if ($downloadpageremainder != 0) {
$downloadpages = ceil($quranpagesint);
if ($totalselecteddownloads < $searchresults) {
$downloadpageremainder = 0;
}
} else {
$downloadpages = $quranpagesint;
}
/* Page Numbering */
if ($downloadpages!=1 && $downloadpages!=0) {
echo "<br><br>"
.""._MD_SELECTPAGES.": ";
$prev=$min-$searchresults;
if ($prev>=0) {
echo " <b>[ <a href="index.php?op=search&query=$the_query&min=$prev&show=$show">"
." << "._MD_PREVIOUS."</a> ]</b> ";
}
$counter = 1;
$currentpage = ($max / $searchresults);
while ($counter<=$downloadpages ) {
$cpage = $counter;
$mintemp = ($perpage * $counter) - $searchresults;
if ($counter == $currentpage) {
echo "<b>$counter</b> ";
} else {
echo "<a href="index.php?op=search&query=$the_query&min=$mintemp&show=$show">$counter</a> ";
}
$counter++;
}
$next=$min+$searchresults;
if ($x>=$perpage) {
echo " <b>[ <a href="index.php?op=search&query=$the_query&min=$next&show=$show">"
." "._MD_NEXT." >></a> ]</b></td></tr>";
}
}
}
else {
searchform();
echo "<tr><td colspan="4" width="100%" align="center"><font class="option"><b>"._MD_FORGOTKEYWORDS."</b></font><br><br></td></tr>";
}
echo "<tr valign="top"><td width="100%" colspan="4" align="center">";
developer();
echo "</td></tr></table>";
include '../../footer.php';
}
/********/
function choose() {
echo "<tr valign="top"><td width="100%" colspan="4" align="center"><b>"._MD_BROWSECHAPTER." </b> <select name="surano" onChange="top.location.href=this.options[this.selectedIndex].value"> ";
echo "<option value=>"._MD_SELECTCHAPTER."</option>";
$dropdown = mysql_query("select sura, surano from quran where ayatno=1 ORDER BY surano");
while (list($sura,$surano) = mysql_fetch_row($dropdown))
{
echo "<option value=index.php?op=viewayat&surano=$surano>$surano.$sura</option>";
}
echo "</select></td></tr>";
}
/********/
function searchform() {
echo "<table width="100%" cellspacing="0" cellpadding="10" border="0">";
echo "<tr valign="top"><td width="100%" colspan="4" align="center">n"
."<p><img src="images/quran.gif" border="0" alt=""._MD_NOBLEQURAN.""><br><h2><font face="palatino, georgia, verdana, arial">"._MD_NOBLEQURAN."</font></h2></p></td></tr>";
echo "<tr valign="top"><td width="100%" colspan="4" align="center">n"
."<p><form action="index.php?op=search" method="post">n"
.""._MD_SEARCHQURAN." <input name="query" type=text>n"
."<input type=submit value=""._MD_SEARCH."">n"
."<input type=hidden value=search name=search></form></p></td></tr>";
echo "<tr valign="top"><td width="100%" colspan="4" align="center">n"
."<p><form action="index.php?op=display" method="post">n"
.""._MD_CHAPTERNO." <input name="surano" type="text" maxLength="3" size="3">n"
." "._MD_VERSENO." <input name="ayatno" type="text" maxLength="4" size="3">n"
."<input type=submit value=""._MD_DISPLAY."">n"
."<input type=hidden value=display name=action></form></p></td></tr>";
echo "<tr valign="top"><td width="100%" colspan="4" align="center"><a href="".XOOPS_URL."/">"._MD_HOME."</a> | <a href="index.php">"._MD_QURANINDEX."</a><br></td></tr>";
choose();
echo"<br>";
}
// Search function finished
// Displaying ayat and surah
function display($surano,$ayatno) {
global $xoopsConfig, $xoopsDB, $xoopsUser, $xoopsTheme, $xoopsLogger, $xoopsModule, $xoopsTpl, $surano, $ayatno;
include XOOPS_ROOT_PATH.'/header.php';
$myts =& MyTextSanitizer::getInstance();
$result = mysql_query("select sura, surano, ayat from quran where surano=$surano AND ayatno=$ayatno");
$resultar = mysql_query("select ayat_ar from quran_ar where surano_ar=$surano AND ayatno_ar=$ayatno");
if($result!="") {
while(list($sura,$surano,$ayat) = mysql_fetch_row($result)) {
list($ayat_ar,$ayatno_ar,$id) = mysql_fetch_row($resultar) ;
searchform();
echo "<tr valign="top"><td width="100%" align="center"><strong>"._MD_DISPLAYING.":</strong> $sura ($surano) "._MD_VERSENO.": <b>$ayatno</b><br><br>";
echo "<p align="right"><font style="font-family:Simplified Arabic;font-size:20px" color=black>$ayat_ar</font> <a href="http://quran.al-islam.com/Recite/CRecite_g2.asp?s=$surano&f=$ayatno&Reciter=1"><img src="images/audio.gif" border="0" alt=""._MD_LISTENTOVERSE.""></a></p><p> $surano.$ayat</p></td></tr>";
}
}
else {
echo "<tr valign="top"><td width="100%" align="center"><font class="option"><b>"._MD_MENTIONNOCHAPTERORVERSE." </b></font><br><br>";
echo "<A HREF="javascript:history.go(-1)">"._MD_TRYAGAIN."</A></td></tr>";
}
echo "<tr valign="top"><td width="100%" align="center">";
developer();
echo "</td></tr></table>";
include '../../footer.php';
}
/********/
function viewayat($surano,$min,$show) {
$perpage=10;
global $xoopsConfig, $xoopsDB, $xoopsUser, $xoopsTheme, $xoopsLogger, $xoopsModule, $xoopsTpl;
include XOOPS_ROOT_PATH.'/header.php';
$myts =& MyTextSanitizer::getInstance();
if (!isset($min)) $min=0;
if (!isset($max)) $max=$min+$perpage;
if ($show!="") {
$perpage = $show;
} else {
$show=$perpage;
}
searchform();
$resultx = mysql_query("select id, sura, surano, ayatno, ayat from quran where surano=$surano limit $min,$perpage");
$fullcountresult = mysql_query("select surano from quran where surano=$surano ORDER BY surano");
$totalayat = mysql_num_rows($fullcountresult);
echo "<table width="100%" cellspacing="0" cellpadding="10" border="0"><tr><td><font class="content">";
$x=0;
list($id,$sura,$surano,$ayatno,$ayat) = mysql_fetch_row($resultx);
$result2 = mysql_query ("select count(ayatno) from quran where surano=$surano ");
list ($ayatcount) = mysql_fetch_row ($result2);
if ($ayatcount<10) {
$showstart=1;
$showend=$ayatcount;
}
else {
$showstart=$min+1;
$showend=$show+$min;
}
$x++;
echo "<center><p><b>"._MD_CHAPTERNAME.":</b> $sura <b>"._MD_TOTALVERSES."</b>: $totalayat <b>n"
.""._MD_DISPLAYING.":</b> $showstart-$showend <br>";
if ($ayatno<2) {
echo"<br><b>"._MD_BISMILLAH."</b></center>";
}
// Displaying Navbar at the top start
/* Calculates how many pages exist. Which page one should be on, etc... */
$audiopagesint = ($totalayat / $perpage);
#global $surano; // I dont know why it does not work without this.
$audiopageremainder = ($totalayat % $perpage);
if ($audiopageremainder != 0) {
$audiopages = ceil($audiopagesint);
if ($totalayat < $perpage) {
$audiopageremainder = 0;
}
} else {
$audiopages = $audiopagesint;
}
/* Page Numbering */
if ($audiopages!=1 && $audiopages!=0) {
echo "<br><center>";
echo "Select pages: ";
$prev=$min-$perpage;
if ($prev>=0) {
#echo " <b>[ <a href="index.php?op=viewayat&surano=$surano&min=$prev&show=$show">";
#echo " <<Previous</a> ]</b> ";
}
$counter = 1;
$currentpage = ($max / $perpage);
while ($counter<=$audiopages ) {
$cpage = $counter;
$mintemp = ($perpage * $counter) - $perpage;
if ($counter == $currentpage) {
echo "<b>$counter</b> ";
} else {
echo "<a href="index.php?op=viewayat&surano=$surano&min=$mintemp&show=$show">$counter</a> ";
}
$counter++;
}
$next=$min+$perpage;
if ($x>=$perpage) {
echo " <b>[ <a href="index.php?op=viewayat&surano=$surano&min=$next&show=$show">";
#echo ""._MD_Next." >></a> ]</b></center> ";
}
}
echo "</td></tr></table>";
// Displaying Navbar at the top finished
$result = mysql_query("select id, sura, surano, ayatno, ayat from quran where surano=$surano ORDER BY ayatno ASC limit $min,$perpage");
$resultar = mysql_query("select ayat_ar, surano_ar, ayatno_ar from quran_ar Where surano_ar=$surano ORDER BY ayatno_ar ASC limit $min,$perpage");
while(list($id,$sura,$surano,$ayatno,$ayat)= mysql_fetch_row($result)) {
list($ayat_ar,$ayatno_ar,$id) = mysql_fetch_row($resultar) ;
$sura=stripslashes($sura);
$ayat=stripslashes($ayat);
$ayat_ar=stripslashes($ayat_ar);
// $ayatno_ar=$ayatno;
// echo"sura: $sura Ayats: $ayatno<br>";
echo "<p align="right"><font style="font-family:Simplified Arabic;font-size:20px" color=black>$ayat_ar<a/></font> <a href="http://quran.al-islam.com/Recite/CRecite_g2.asp?s=$surano&f=$id&Reciter=1"><img src="images/audio.gif" border="0" alt=""._MD_LISTENTOVERSE.""></a></p><p align="left">$surano.$ayat<br><hr width="98%" noShade SIZE="1"></p>";
}
// added
developer();
include '../../footer.php';
}
$op = isset($HTTP_GET_VARS['op']) ? trim($HTTP_GET_VARS['op']) : '';
// Displaying ayat and surah finished here
switch($op) {
case "viewayat":
viewayat($surano,$min,$show);
break;
case "search";
search($query,$min,$show);
break;
case "display";
display($surano,$ayatno);
break;
case "choose":
choose();
break;
default:
index();
break;
}
This is the only section of code as the rest of the files are just name, ect
Can some one please help me and show me how to turn off register globals in this module??