Jump to content

sitesme

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

sitesme's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi to all, I have a recent script that I asked. The programmer is gone (no reply) and since I need to move the script from the root of one hosting to another one inside a folder, it is giving always pointing all items such as images, CSS, etc. to the root and not to my 'inter' folder. I have the file definitions.php where I believe there is something I need to change here to make this work: <?php error_reporting(E_ALL); define('DB_USERNAME','xxx'); define('DB_PASSWORD','xxx'); define('DB_NAME','xxx'); ///// // Connect to DB ///// $db=mysql_connect('localhost',DB_USERNAME, DB_PASSWORD); mysql_select_db(DB_NAME, $db); while (list($glob) = each($GLOBALS)){ if (!preg_match('/^(_POST|_GET|_COOKIE|_SERVER|_FILES|GLOBALS|HTTP.*|_REQUEST)$/', $glob)){ unset($$glob); } } unset($glob); if(@get_magic_quotes_gpc()) unfck_gpc(); function unfck($v) { return is_array($v) ? array_map('unfck', $v) : stripslashes($v); } function unfck_gpc() { foreach (array('POST', 'GET', 'REQUEST', 'COOKIE') as $gpc){ $GLOBALS['_' . $gpc] = array_map('unfck', $GLOBALS['_' . $gpc]); } } if(empty($_SERVER['REQUEST_URI'])) $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME']; if(empty($_SERVER['REMOTE_ADDR'])) $_SERVER['REMOTE_ADDR'] = '0.0.0.0'; if(!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR']; if(empty($_SERVER['REMOTE_HOST'])) $_SERVER['REMOTE_HOST'] = $_SERVER['REMOTE_ADDR']; if(empty($_SERVER['HTTP_REFERER'])) $_SERVER['HTTP_REFERER'] = ''; if(empty($_SERVER['HTTP_USER_AGENT'])) $_SERVER['HTTP_USER_AGENT'] = ''; ///// // User log in/out check ///// require_once('modules/system.php'); global $user, $errors, $content, $logger, $session; $serv_name = $_SERVER['SERVER_NAME'];; $serv_name=preg_replace('/^www\./si','',$serv_name); if(!empty($_COOKIE['cook']['session'])){ $session=$_COOKIE['cook']['session'];} else{ $session=md5(microtime()); setcookie('cook[session]',$session,0,'/',$serv_name); } $_POST['user_remember']=(empty($_POST['user_remember'])) ? 'false' : $_POST['user_remember']; if(!empty($_COOKIE['cook']['user_username'])&&!empty($_COOKIE['cook']['user_pass'])){ $user=check_user_login($_COOKIE['cook']['user_username'],$_COOKIE['cook']['user_pass'],'true','cook'); }elseif(!empty($_POST['user_username'])&&!empty($_POST['user_pass'])&&!$user['logged_in']){ $user=check_user_login($_POST['user_username'],md5($_POST['user_pass']),$_POST['user_remember'],'post'); } if((!empty($_POST['user_logout']) && ($_POST['user_logout']=='true'))||((!empty($_GET['act']))&&($_GET['act']=='logout')&&(empty($_POST['user_username'])))){ $user=user_logout(); header("Location: /"); exit(); } ?> Please let me know if you have a clue where do I need to add the 'inter' folder as I couldn't. Thanks
  2. Thanks to everyone. MadTechie, that fixed my problem. Many thanks for the great help of all
  3. I've changed from: $SelectqryComm="select * from ". COMMENT . " where commentid='$Menu' and varStatus='Active' order by intid limit $offset, $limit"; to: $SelectqryComm="select * from ". COMMENT . " where commentid='$Menu' and varStatus='Active' order by intid limit '$offset', '$limit'"; but the result is the same. I removed the "limit $offset, $limit" part and the error is gone but then... I do not get pagination in the page... The full page code is here: // Display Event Details $Q_Check = "select * from ". COMMENT . " where commentid='$Menu' and varStatus='Active' order by CommDate"; $R_Check = mysql_query($Q_Check) or die(mysql_error()); $C_Check = mysql_num_rows($R_Check); $total = mysql_num_rows($R_Check); $page = $_GET['page']; $limit = $Fetch['intRows']; //$limit = 10; $pager = getPagerData($total, $limit, $page); $offset = $pager->offset; $limit = $pager->limit; $page = $pager->page; $SelectqryComm="select * from ". COMMENT . " where commentid='$Menu' and varStatus='Active' order by CommDate limit $offset, $limit"; $ExeqryComm=mysql_query($SelectqryComm); $BlogCommentsdis.='<table cellpadding="0" cellspacing="0" border="0">'; $i =0; $BlogCommentsdis.=' <tr> <td> <form action="" method="post" name="commentfrm" onSubmit="return fn_comments();"><table width="79%" border="0" align="left" cellpadding="3" cellspacing="3" height="80px">'; if($statusemail=="suc") { $BlogCommentsdis.='<tr> <td colspan="2" align="center" class="informationbox" style="text-align:center">'.$varConfirmationOpiniao.'</td> </tr>'; } $BlogCommentsdis.='<tr> <td width="51%" align="right" style="text-align:right;" class="smalltxt">Nome <span class="error">*</span> </td> <td width="49%" align="left"><input type="text" name="varName" class="txt" size="50"/></td> </tr> <tr> <td align="right" style="text-align:right;" class="smalltxt">Email <span class="error">*</span></td> <td align="left"><input type="text" name="varEmail" class="txt" size="50"/></td></tr> <!-- <tr> <td align="right" style="text-align:right;" class="smalltxt">Data <span class="error">*</span></td> <td align="left"><input name="varData" type="text" class="txt"/></td> </tr>--> <tr> <td align="right" style="text-align:right;" class="smalltxt">Localidade <span class="error">*</span></td> <td align="left"><input name="varLocalidade" type="text" class="txt"/></td> </tr> <tr valign="top"> <td height="27" align="right" class="smalltxt">Comentário <span class="error">*</span></td> <td height="27" class="leftcontent"><textarea name="shortnews" cols="50" rows="6" class="inputbox1"></textarea></td> </tr> <tr valign="top"><td height="27" colspan="3" align="center"><input type="submit" name="post" id="post" value="Submeter" class="buttonsub"><input type="hidden" name="task" id="task" value="'.base64_encode($Menu).'"></td></tr> </table> </form> </td> </tr> <tr> <td> <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">'; if(mysql_num_rows($ExeqryComm)!=0){ $BlogCommentsdis.='<tr> <td width="76%" class="pickheadcss">As opiniões</td> </tr>'; while($FetchqryComm=mysql_fetch_array($ExeqryComm)) { $i++; $CommDate_blog = dateformat($FetchqryComm['CommDate']); $Description_blog = $FetchqryComm['Description']; $bid = $FetchqryBlog['intblogid']; $varName_blog = $FetchqryComm['varName']; $varEmail_blog = $FetchqryComm['varEmail']; $BlogCommentsdis.='<tr> <td width="76%" class="picktext14">'.$varName_blog.'</td> </tr><tr> <td width="76%" class="new">'.$CommDate_blog.'</td> </tr> <tr> <td width="76%" class="new"> </td> </tr> <tr> <td>'.$Description_blog.'</td> </tr> <tr> <td style="border-bottom:1px solid #ffa2b5;"> </td> </tr>'; } $BlogCommentsdis.='<tr> <td><table width="65%" border="0" align="center" cellpadding="3" cellspacing="3"> <tr> <td width="97%" align="right">'; if($limit < $total) { if ($page == 1) { echo ""; } else { $BlogCommentsdis.="<a href=\"".$_SERVER['PHP_SELF']."?task=MTQ=view&sortby=".$SortList."&page=" . ($page - 1) . "\" class='linksnew'>Prev</a>"; } for ($i = 1; $i <= $pager->numPages; $i++) { $BlogCommentsdis.=" | "; if ($i == $pager->page) { $BlogCommentsdis.="<span class='Hint1'>"."$i"."</span>"; } else { $BlogCommentsdis.="<a href=\"".$_SERVER['PHP_SELF']."?task=MTQ=view&sortby=".$SortList."&page=$i\" class='linksnew'> $i</a>"."</font>"; } } if ($i > 1) { $BlogCommentsdis.=" | "; } if ($page == $pager->numPages) { $BlogCommentsdis.=""; } else { $BlogCommentsdis.="<a href=\"".$_SERVER['PHP_SELF']."?task=MTQ=view&sortby=".$SortList."&page=" . ($page + 1) . "\" class='linksnew'>Next</a>"; } } $BlogCommentsdis.='</td> <td width="3%" align="right"> </td> </tr> </table></td> </tr>'; } $BlogCommentsdis.='</table> </td> </tr> <tr> <td> </td> </tr>'; $BlogCommentsdis.='</table>'; ?> Any help is appreciated. Thanks again.
  4. Hi PFMaBiSmAd, Your help is highly appreciated but I have no clue how to proceed and fix this. I don't understand the -20 error you mentioned. Is this in the PHP or can it be in the MySQL? Thanks.
  5. Just to make sure... I replaced $ExeqryComm=mysql_query($SelectqryComm); to $ExeqryComm=mysql_query($SelectqryComm) or die (mysql_error()); Am I supposed to try something else?
  6. I found in the database two entries with Friday and Wednesday maybe from the beginning when the code was being developed. Deleting these entries, the problem seems fixed. Thanks to all for your help.
  7. As I don't want to damage the code, can you please tell me the exact line where I should add "echo mysql_error()"? Thank you
  8. I understand the matter, and thanks to all for letting me understand the problem better. Obviously I would like to fix the code, how can I do this? Is it in the code or in the database? I'm not a programmer, I'm simply trying to fix the code with my low knowledge. Any help is appreciated. Thanks.
  9. Fixing the problem is my first option as well... Any help please? Thanks to all.
  10. Hum... I'm not really a programmer with that knowledge I'm afraid... What I know is that it was working fine on another server so it might be a configuration in PHP or MySQL Any help is appreciated.
  11. The transfer was made between servers and it shouldn't be any problem on both versions. I believe it is a matter of configuration in PHP or MySQL. I remember a similar problem that was fixed with some sort of "hide errors" on PHP configuration or somewhat?
  12. Sure, here it is: $SelectqryComm="select * from ". COMMENT . " where commentid='$Menu' and varStatus='Active' order by CommDate limit $offset, $limit"; $ExeqryComm=mysql_query($SelectqryComm); $BlogCommentsdis.='<table cellpadding="0" cellspacing="0" border="0">'; $i =0; $BlogCommentsdis.=' <tr> <td> <form action="" method="post" name="commentfrm" onSubmit="return fn_comments();"><table width="79%" border="0" align="left" cellpadding="3" cellspacing="3" height="80px">'; if($statusemail=="suc") { $BlogCommentsdis.='<tr> <td colspan="2" align="center" class="informationbox" style="text-align:center">'.$varConfirmationOpiniao.'</td> </tr>'; } $BlogCommentsdis.='<tr> <td width="51%" align="right" style="text-align:right;" class="smalltxt">Nome <span class="error">*</span> </td> <td width="49%" align="left"><input type="text" name="varName" class="txt" size="50"/></td> </tr> <tr> <td align="right" style="text-align:right;" class="smalltxt">Email <span class="error">*</span></td> <td align="left"><input type="text" name="varEmail" class="txt" size="50"/></td></tr> <!-- <tr> <td align="right" style="text-align:right;" class="smalltxt">Data <span class="error">*</span></td> <td align="left"><input name="varData" type="text" class="txt"/></td> </tr>--> <tr> <td align="right" style="text-align:right;" class="smalltxt">Localidade <span class="error">*</span></td> <td align="left"><input name="varLocalidade" type="text" class="txt"/></td> </tr> <tr valign="top"> <td height="27" align="right" class="smalltxt">Comentário <span class="error">*</span></td> <td height="27" class="leftcontent"><textarea name="shortnews" cols="50" rows="6" class="inputbox1"></textarea></td> </tr> <tr valign="top"><td height="27" colspan="3" align="center"><input type="submit" name="post" id="post" value="Submeter" class="buttonsub"><input type="hidden" name="task" id="task" value="'.base64_encode($Menu).'"></td></tr> </table> </form> </td> </tr> <tr> <td> <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">'; if(mysql_num_rows($ExeqryComm)!=0){ $BlogCommentsdis.='<tr> <td width="76%" class="pickheadcss">As opiniões</td> </tr>'; while($FetchqryComm=mysql_fetch_array($ExeqryComm)) { $i++; $CommDate_blog = dateformat($FetchqryComm['CommDate']); $Description_blog = $FetchqryComm['Description']; $bid = $FetchqryBlog['intblogid']; $varName_blog = $FetchqryComm['varName']; $varEmail_blog = $FetchqryComm['varEmail']; $BlogCommentsdis.='<tr> <td width="76%" class="picktext14">'.$varName_blog.'</td> </tr><tr> <td width="76%" class="new">'.$CommDate_blog.'</td> </tr> <tr> <td width="76%" class="new"> </td> </tr> <tr> <td>'.$Description_blog.'</td> </tr> <tr> <td style="border-bottom:1px solid #ffa2b5;"> </td> </tr>'; } $BlogCommentsdis.='<tr> <td><table width="65%" border="0" align="center" cellpadding="3" cellspacing="3"> <tr> <td width="97%" align="right">'; if($limit < $total) { if ($page == 1) { echo ""; } else { $BlogCommentsdis.="<a href=\"".$_SERVER['PHP_SELF']."?task=MTQ=view&sortby=".$SortList."&page=" . ($page - 1) . "\" class='linksnew'>Prev</a>"; } for ($i = 1; $i <= $pager->numPages; $i++) { $BlogCommentsdis.=" | "; if ($i == $pager->page) { $BlogCommentsdis.="<span class='Hint1'>"."$i"."</span>"; } else { $BlogCommentsdis.="<a href=\"".$_SERVER['PHP_SELF']."?task=MTQ=view&sortby=".$SortList."&page=$i\" class='linksnew'> $i</a>"."</font>"; } } if ($i > 1) { $BlogCommentsdis.=" | "; } if ($page == $pager->numPages) { $BlogCommentsdis.=""; } else { $BlogCommentsdis.="<a href=\"".$_SERVER['PHP_SELF']."?task=MTQ=view&sortby=".$SortList."&page=" . ($page + 1) . "\" class='linksnew'>Next</a>"; } } $BlogCommentsdis.='</td> <td width="3%" align="right"> </td> </tr> </table></td> Thanks
  13. Hi, After moving server my script started showing this error: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/user/public_html/blog.php on line 107 Here is the code on line 107: if(mysql_num_rows($ExeqryComm)!=0){ Any help please? Thank you all
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.