This page was previously displaying properly. I don't see anything wrong with the specified line number in this error message. I just did a few edits on some code snippets based on what I saw in different tutorials online.
I went back through each revision I made but I still don't see anything that could have affected this function/part.
A PHP Error was encountered
Severity: Notice
Message: Uninitialized string offset: 0
Filename: client/view_job.php
Line Number: 75
Here's what I have on line 75:
Edit
This was perfectly displayed before. I don't know where the new issue came from.
#hsuk, I realized your point and I could actually solve it by changing
$row['job_id']
to simply
<?= $id?>
and it worked..
Related
Suddenly, my php log is getting flooded with this php warning:
Got error 'PHP message: PHP Warning: Invalid argument supplied for foreach() in /public_html/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-dashboard.php on line 543', referer:
The warning always keep the same but the referer could be literally any page of the site, including back and front end. I really don't have a clue whats going on.
Any ideas?
Using a solution found in Invalid argument supplied for foreach()
You can edit 'class-wc-admin-dashboard.php' and add this code in line 543 (just before the foreach):
if (is_array($data) || is_object($data))
Today, i was updating wordpress new version 5.6.2, after that, database update but i have some problem with this:
Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'WP_Block_Supports' not found in /home/------/public_html/wp-includes/class-wp-hook.php on line 287
im looking a solution for this Warning
how to fix this problem.
thank you
for anybody can help me to fix this problem
Originally I was trying to solve this issue:
403 Error Persists After Changing File Permissions & Editing Htaccess File
Before I make too many changes to my code I would like to understand the problem.
After the suggestion of #misorude I checked the PHP error logs for the directory that the code causing the error existed in. I found the following error.
[12-Jan-2019 15:23:49 America/Chicago] PHP Warning: Invalid argument supplied for foreach() in /home/bullbusterweb/public_html/community/profile.php on line 898
I have tried the following to understand this issue.
1) I googled what invalid argument supplied for foreach() could mean and found the following result.
Invalid argument supplied for foreach()
2) Then I looked at my code to see what could be causing this.
The foreach in question was here:
'''php
foreach($Articles as $Article){
'''
The first place 'Articles is defined is
$Articles = $Ambassador->getArticles();
A few lines above the foreach() I found the following code related to the articles variable.
// var_dump($Articles);
if(isset($Articles)){
According to the php manual:
var_dump : "Dumps information about a variable" .
isset: " Determines if a variable is set and is not NULL"
I tried uncommenting the var_dump but found that it messed up the formatting of the page. So now I know why it is commented out.
I am getting hundreds of from ANSI.php. Here is an example:
/usr/share/pear/File/ANSI.php on line 553 Notice: Undefined offset: 75 in
/usr/share/pear/File/ANSI.php on line 555 Notice: Undefined offset: 76 in
/usr/share/pear/File/ANSI.php on line 553 Notice: Undefined offset: 76 in
/usr/share/pear/File/ANSI.php on line 555 Notice: Undefined offset: 77 in
/usr/share/pear/File/ANSI.php on line 555 Notice: Trying to get property of non-object in
/usr/share/pear/File/ANSI.php on line 496 Notice: Trying to get property of non-object in
This is generating from:
$ansi->appendString($ssh->read());
Everything is working. I suspect the old machines I am working with are giving ANSI.php a hard time.
Is there a way i can disable just the error messages from ANSI.PHP and keep the others? Unless someone has a way of fixing the error.
Simplest Solution (Sub-Optimal)
I guess the simplest way to suppress the errors would be to use the error suppression operator #. eg.
#$ansi->appendString($str);
Optimal Solution (Possibly)
There have been two commits to phpseclib since the latest release (1.0.7 and 2.0.6, as of this post) that fixed issues with File/ANSI.php:
https://github.com/phpseclib/phpseclib/commit/5c792f6bc1fa8a5d26b43fb8200191c073637e15
https://github.com/phpseclib/phpseclib/commit/84d1628cb7734134b1ba80545b38985025942b79
More info:
https://github.com/phpseclib/phpseclib/issues/1161
https://github.com/phpseclib/phpseclib/issues/1150
Kinda makes me wonder if one of those might fix the issue for you.
Fallback to Optimal Solution
If the previously mentioned "optimal solution" doesn't fix the issue for you then it would be nice to fix the problem at the source. What'd help me do that would be a copy of the data you got before you passed it to $ansi->appendString(). To make it so the characters don't get garbled because they're extended ASCII maybe hex encode it. eg. echo bin2hex($ssh->read()); or something.
I've just got an error.
When I try to assign an object like this: am doing for SEO by google php seo scripts.
Deprecated: Assigning the return value of new by reference is deprecated in E:\wamp\www\subgoogle\nusoap.php on line 3703
Deprecated: Function ereg() is deprecated in E:\wamp\www\subgoogle\nusoap.php on line 3876
Deprecated: Function ereg() is deprecated in E:\wamp\www\subgoogle\nusoap.php on line 3896
Deprecated: Function ereg() is deprecated in E:\wamp\www\subgoogle\nusoap.php on line 1451
Notice: Uninitialized string offset: 0 in E:\wamp\www\subgoogle\searchgoosimple.php on line 89
Sorry, no search results found
The error I get is "Assigning the return value of new by reference is deprecated". Actually I've been looking for a solution but the only one I've seen is just turn down the politicy of nusoap.php (error_reporting). I've tried it too, but it didn't work.
It's so confusing..I hope you could help me. Thanks in advance.
Each of these error messages carries a line number and a filename:
Deprecated: Assigning the return value of new by reference is deprecated in E:\wamp\www\subgoogle\nusoap.php on line 3703
Go there, and remove the & before the new.
To get rid of the other warnings, use following setting in your main script to reduce the error reporting level:
error_reporting(E_ALL);
You'll have to find eventual other instances of error_reporting( and adapt them too.