Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error config.php #5

Open
ghost opened this issue Dec 14, 2021 · 1 comment
Open

error config.php #5

ghost opened this issue Dec 14, 2021 · 1 comment

Comments

@ghost
Copy link

ghost commented Dec 14, 2021

Fatal error: Uncaught Error: Undefined constant "html" in C:\xampp\htdocs\config.php:798 Stack trace: #0 C:\xampp\htdocs\home\rss.php(54): rss('http://1337day....') #1 {main} thrown in C:\xampp\htdocs\config.php on line 798

function rss($feed) {
$rss = new DOMDocument(html);
$dom->DOMDocument ();
$rss->load($feed);
//@$rss->loadHTML($feed);
//@$rss->loadHTML($html);
$feed = array();
foreach ($rss->getElementsByTagName('item') as $node) {
$item = array (
'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,
'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue,
);
array_push($feed, $item);
}

@ghost
Copy link
Author

ghost commented Dec 14, 2021

I made the correction but it didn't work very well
Warning: DOMDocument::load(): EntityRef: expecting ';' in http://1337day.com/rss, line: 1 in C:\xampp\htdocs\config.php on line 800

|$dom->@loadHTML($html); |

This is incorrect, use this instead:

|@$dom->loadHTML($html);|

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants