Jump to content

[SOLVED] Question about php script


44justin

Recommended Posts

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

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;


        }

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');
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.