What exactly is causing an error in this PHP code? - php

So I'm not familiar with PHP and a friend of mine got this error message from their site:
Uncaught Error: Function name must be a string in
/var/www/wp-content/themes/framework/php/class-htmlhelper.php:222
Any help on what is needed would be greatly appreciated! I've tried to understand what component needs to become a string but I'm not sure...

In line number 218 you have to write $this->element to call a function.

I think $this->$element['type'] not string.
You try print $this->$element['type']

Related

I can't find the error in this line

I can't find the error in this line of php code.I tried checking it online and I get this is wrong. 'darth'(T_STRING), expecting ']' in your code on line 1
I am new and know very little about coding. Can someone please help! Thank you!
if(trim(strtolower($_POST['bonusq’]))!='darth vader’) {
You are using typographical single quotes after "bonusq" and "vader", which can't work - change them to regular quotes
Try with this:
$a = $_POST['bonusq'];
if(trim(strtolower($a))!='darth vader') {
Hope to help you.

How to Pass BackSlash at end of string?

I m trying to delete one image using unlink function.
But path creates error to pass. My syntax is as below.
unlink('customer\'.$user_id."\book\".$id);
But this will generate error here.
Please help me to solve this. Thanks in advance.
Try this:
unlink('customer\\'.$user_id."\\book\\".$id);
Use this (Use Backslash)
unlink("customer/".$user_id."/book/".$id)

Show line number of error in Yii 1.1.x

I have a self explanatory error in my Yii application - I know what the problem is, I would just like to know which line & file this is on.
htmlspecialchars() expects parameter 1 to be string, array given
Can anyone explain the best/easiest way to use the Yii framework to output the exact line number that this error is coming from? I already have some debugging on but it all looks confusing and nowhere does it say Line xxx in file somename.php
You can try this Tutorial :
As you expected, this tutorial showing only file name and line number only.
http://www.yiiframework.com/wiki/113/how-to-customize-error-handling-in-console-mode-applications/
what about using these 2 lines on your index.php??
error_reporting(E_ALL);
ini_set('display_errors', 'on');

Firebug: "invalid regular expression flag h" after running YUI Compressor

After I run YUI Compressor, I'm getting this error:
invalid regular expression flag h
[Break On This Error] ction(event){$(this).removeClass('lumi...cs_glb.php</b> on line <b>221</b><br/>
The part of the JS code in questions is:
//Form LUMI
$('input').focus(function(event){
$(this).addClass('lumi');
});
$('input').blur(function(event){
$(this).removeClass('lumi');
});
I validated the JS code with http://www.javascriptlint.com/online_lint.php and it points no error.
Does anybody knows what's wrong?
After trying one thousand ways to debug this, I found out that a php warning was causing the error. It is hard to find this kind of error because the Firebug debugger was pointing to a totally different direction. Thanks.

Javascript syntax for passing PHP variables

HELLO EVERYONE :D
I am having some diffculties passing php varaibles through javascript.
Basically this is the statement:
new Ajax.Updater( 'result', 'update_request.php?status='+status_change);
and I need to pass another variable after status_change, the variable I need to pass is the id of the ticket that is being updated.
So I tried this:
new Ajax.Updater( 'result', 'update_request.php?status='+status_change'&requestid='+request_id);
However this gives me an error stated below:
Webpage error details
Message: Expected ')' Line: 128 Char:
77 Code: 0 URI:
http://site_url/dev/time_off_new/main.php
I have tried double quotes, as well as a combination. I do not know why it is giving me such harrassment.
I ran the php script that it is attached to, and everything is working fine. After debugging I have narrowed it down to this statement, so everthing else is working fine.
Thank you ahead of time.
Peace and love!
You are missing a concatenation operator after the variable status_change
Try this
new Ajax.Updater( 'result', 'update_request.php?status='+status_change+'&requestid='+request_id);

Categories