Hesk Rating not working throw a blank page after store rate

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
Monclee
Posts: 1
Joined: Sat Aug 24, 2013 10:18 pm

Hesk Rating not working throw a blank page after store rate

Post by Monclee »

Script URL: Not yet localhost
Version of script: 2.4.2
Hosting company: -NA-
URL of phpinfo.php: -NA-
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

hesk raiting blank page, hesk rating not working, rating php errors hesk,

Write your message below:

I just made a fresh install of hesk in my system the funny thing is rating is working, but the "location" in php is not working cause after you rank you stay on a blank page, you do not return no the previews page.. as it suppose..

I check the php code..

Code: Select all

/* Rating? */
if (isset($_GET['rating']) && !hesk_detect_bots())
{
	$rating = intval($_GET['rating']);

	/* Rating can only be 1 or 5 */
	if ($rating != 1 && $rating != 5)
	{
		hesk_error($hesklang['attempt']);
	}

    $artid = intval($_GET['id']) or hesk_error($hesklang['kb_art_id']);

    $_COOKIE['hesk_kb_rate'] = isset($_COOKIE['hesk_kb_rate']) ? $_COOKIE['hesk_kb_rate'] : '';

    if (strpos($_COOKIE['hesk_kb_rate'],'a'.$artid.'%')===false)
    {
		$sql = 'UPDATE `'.hesk_dbEscape($hesk_settings['db_pfix']).'kb_articles` SET `rating`=((`rating`*`votes`)+'.hesk_dbEscape($rating).')/(`votes`+1), `votes`=`votes`+1 WHERE `id`=\''.hesk_dbEscape($artid).'\' AND `type`=\'0\' LIMIT 1';
		hesk_dbQuery($sql);
    }
	echo "merin";
    setcookie('hesk_kb_rate', $_COOKIE['hesk_kb_rate'].'a'.$artid.'%', time()+2592000);
    header('Location: knowledgebase.php?article='.$artid.'&rated=1');
    exit();
}

As you can see i add a line (echo "merin";) just to test, and it actually echo this ok.. so the problem must be on setcookie or the header location , but i dont get any erros.

Any ideas?

I need to present this project to a client, if he aprobes i will buy license, but this must work to show everythings works, or he will not want to buy
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: Hesk Rating not working throw a blank page after store

Post by Klemen »

I am 99% sure this is a problem with broken headers.

Did you modify any of the files?

This usually happens when files are modified and saved as UTF with BOM, for example if a language file is modified and saved as UTF-8 with BOM (viewtopic.php?t=2713).

Can't say for sure without seeing it though.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: Hesk Rating not working throw a blank page after store

Post by Klemen »

Also, you should upgrade to version 2.5.1 and check if it works fine with default unmodified files (and English language pack).
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply