44justin Posted January 23, 2009 Share Posted January 23, 2009 Hello everybody i have a question about my php script. i Got the same error after i add some text but i now cannot find the answer. here is the script <?php session_start(); require("includes/vars.inc.php"); require("includes/functions.inc.php"); require("includes/templates.inc.php"); require("includes/apt_functions.inc.php"); $access_level=$access_matrix['battle_stats'][0]; db_connect(); check_login_member(); if(isset($_SESSION['user_id'])){ $myuser_id = $_SESSION['user_id'];} else {$myuser_id = "";} global $relative_path; $tpl = new phemplate(_TPLPATH_,'remove_nonjs'); if (isset($_SESSION['topass']) && is_array($_SESSION['topass']) && !empty($_SESSION['topass'])) { $topass=$_SESSION['topass']; $_SESSION['topass']=''; unset($_SESSION['topass']); $comment=$topass['comment']; } $message=((isset($topass['message'])) ? ($topass['message']) : ("")); $limitzoid= "10"; // -> change this $table_cols= "5"; // -> change this $offset = "0"; $set = "10"; if(isset($_GET['offset']) == ""){ $offset = "0"; } if(isset($_GET['offset'])){ $offset = $_GET['offset']; $offset2 = $offset; } $select = "SELECT * FROM partners ORDER by inhits DESC"; $query = mysql_query($select) or die (mysql_error()); $tippytop="<table width=\"100%\" cellpadding=\"0\" cellspacing=\"1\" align=\"center\" valign=\"top\">"; $tippytop.="\t<td class=align=\"center\" valign=\"top\">\n"; $tippytop.="<td><b>Naam:</b></td> <td><b>Inhits:</b></td> <td><b>Uithits:</b></td>"; while ($list = mysql_fetch_object($query)) { $sitenaam = $list->sitenaam; $siteurl = $list->siteurl; $sitenaam = htmlspecialchars("$sitenaam"); $siteurl = htmlspecialchars("$siteurl") $tippytop.="<td><a href=\"uithits.php?action=tel&id=$list->id\" target=\"_blank\">$list->sitenaam</a><br>"; $tippytop.= "<td>$list->inhits</td> <td>$list->uithits</td>"; } </table> $tippytop.="\t</td>\n"; $tippytop.="</table><center><p><table border=0><tr><td align=left valign=middle><font color=\"#000066\" face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\"></b></td></tr></table></center>\n"; unset($x, $WinPercent); $tpl->set_var('tippytopz',$tippytop); $tpl->set_file('middlecontent','battletop.html'); $tpl->set_var('message',$message); $tpl->set_var('sitename',_SITENAME_); $middle_content=$tpl->process('out','middlecontent',0,1); $title = "Top Photo Battle"; $tpl->set_file('frame','frame.html'); $tpl->set_var('baseurl',_BASEURL_); $tpl->set_var('sitename',_SITENAME_); $tpl->set_var('relative_path', $relative_path); $tpl->set_var('middle_content',$middle_content); include('block_main_frame.php'); ?> here my script online so you can see the error. http://www.iboobs.nl/linkpartner.php greets justin Link to comment https://forums.phpfreaks.com/topic/142096-solved-question-about-php-script/ Share on other sites More sharing options...
gevans Posted January 23, 2009 Share Posted January 23, 2009 change if(isset($_GET['offset']) == ""){ $offset = "0"; } if(isset($_GET['offset'])){ $offset = $_GET['offset']; $offset2 = $offset; } to this if(isset($_GET['offset']) && $_GET['offset'] == ""){ $offset = "0"; } else { $offset = $_GET['offset']; $offset2 = $offset; } Link to comment https://forums.phpfreaks.com/topic/142096-solved-question-about-php-script/#findComment-744178 Share on other sites More sharing options...
44justin Posted January 23, 2009 Author Share Posted January 23, 2009 dear gevans i changed that code but i still have the same error. http://www.iboobs.nl/linkpartner.php greets Link to comment https://forums.phpfreaks.com/topic/142096-solved-question-about-php-script/#findComment-744182 Share on other sites More sharing options...
gevans Posted January 23, 2009 Share Posted January 23, 2009 try this... if you get any errors let me know; <?php session_start(); require("includes/vars.inc.php"); require("includes/functions.inc.php"); require("includes/templates.inc.php"); require("includes/apt_functions.inc.php"); $access_level = $access_matrix['battle_stats'][0]; db_connect(); check_login_member(); if(isset($_SESSION['user_id'])){ $myuser_id = $_SESSION['user_id'];} else $myuser_id = ""; #global $relative_path;//is this needed? $tpl = new phemplate(_TPLPATH_,'remove_nonjs'); if(isset($_SESSION['topass']) && is_array($_SESSION['topass']) && !empty($_SESSION['topass'])) { $topass = $_SESSION['topass']; $_SESSION['topass'] = NULL; unset($_SESSION['topass']); $comment = $topass['comment']; } $message = (isset($topass['message'])) ? ($topass['message']) : ""; $limitzoid= "10"; // -> change this $table_cols= 5; // -> change this $offset = 0; $set = 10; if(isset($_GET['offset']) && $_GET['offset'] == "") { $offset = "0"; } elseif(isset($_GET['offset']) && $_GET['offset'] != "") { $offset = $_GET['offset']; $offset2 = $offset; } $select = "SELECT * FROM partners ORDER by inhits DESC"; $query = mysql_query($select) or die (mysql_error()); $tippytop = "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"1\" align=\"center\" valign=\"top\">"; $tippytop .= "\t<td class=align=\"center\" valign=\"top\">\n"; $tippytop .= "<td><b>Naam:</b></td> <td><b>Inhits:</b></td> <td><b>Uithits:</b></td>"; while($list = mysql_fetch_object($query)) { $sitenaam = $list->sitenaam; $siteurl = $list->siteurl; $sitenaam = htmlspecialchars($sitenaam); $siteurl = htmlspecialchars($siteurl); $tippytop .= "<td><a href=\"uithits.php?action=tel&id={$list->id}\" target=\"_blank\">{$list->sitenaam}</a><br>"; $tippytop .= "<td>{$list->inhits}</td> <td>{$list->uithits}</td>"; } $tippytop .= "\t</td>\n"; $tippytop .= "</table><center><p><table border=0><tr><td align=left valign=middle><font color=\"#000066\" face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\"></b></td></tr></table></center>\n"; unset($x, $WinPercent); $tpl->set_var('tippytopz',$tippytop); $tpl->set_file('middlecontent','battletop.html'); $tpl->set_var('message',$message); $tpl->set_var('sitename',_SITENAME_); $middle_content = $tpl->process('out','middlecontent',0,1); $title = "Top Photo Battle"; $tpl->set_file('frame','frame.html'); $tpl->set_var('baseurl',_BASEURL_); $tpl->set_var('sitename',_SITENAME_); $tpl->set_var('relative_path', $relative_path); $tpl->set_var('middle_content',$middle_content); include('block_main_frame.php'); ?> Link to comment https://forums.phpfreaks.com/topic/142096-solved-question-about-php-script/#findComment-744187 Share on other sites More sharing options...
44justin Posted January 23, 2009 Author Share Posted January 23, 2009 heey great it works thank you very much for your help result http://www.iboobs.nl/linkpartner.php greets justin Link to comment https://forums.phpfreaks.com/topic/142096-solved-question-about-php-script/#findComment-744188 Share on other sites More sharing options...
gevans Posted January 23, 2009 Share Posted January 23, 2009 Good to hear, hit solved Link to comment https://forums.phpfreaks.com/topic/142096-solved-question-about-php-script/#findComment-744191 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.