Error parse page

Подробная инструкция, как исправить ошибку парсинга страницы в Forkplayer. Восстановление работы Forkplayer и парсинга страниц.

Программное обеспечение Forkplayer продолжает набирать популярность среди пользователей со всего мира. Это отличное решение для просмотра FXML, которое удобно в использовании при изучении страниц в интернете. Данное ПО используется исключительно для запроса и обработки материалов fxml-сайтов, а также для непосредственного просмотра их содержимого. Можно открывать отдельные файлы, а можно заранее подготовленные плей-листы. Программное обеспечение идеально подходит и для просмотра потокового видео, а именно так его и используют в подавляющем большинстве случаев.

Forkplayer

Например, наличие Forkplayer дает возможность просматривать на телевизоре практически все имеющиеся в интернете телевизионные передачи, сериалы и фильмы. По сути, в данном случае речь идет про некий аналог классического браузера в формате приложения, имеющим возможность автоматического обновления плейлистов. Это дает возможность пользователям прослушивать любимые треки, слушать радио, смотреть фильмы, программы и другой контент в формате видео и аудио. Учитывая то, что данное ПО крайне удобно в использовании, до настоящего времени наблюдается рост его популярности.

Даже столь качественный продукт порой может работать некорректно. Например, сегодня мы поговорим о достаточно распространенной проблеме – это ошибка парсинга страницы. Практика показывает, что время от времени с ней сталкиваются многие пользователи, однако существует несколько способов решения этой проблемы. Для этого не нужно вызывать компьютерного мастера или обладать какими-то специальными знаниями. Рассмотрим эту тему максимально подробно и простым языком, чтобы каждый читатель мог вникнуть в суть.

Важно понимать, что все последующие рекомендации будут ориентированы на людей, которых можно позиционировать в качестве уверенных пользователей ПК. Например, они должны уметь устанавливать официальное приложение Forkplayer, а также изменять ДНС и уметь его настраивать. Впрочем, в этом таже нет ничего сложного, поэтому разобраться сможет каждый.

Чаще всего люди сталкиваются с данной проблемой, когда пытаются зайти на какой-то кино-портал в интернете или же запустить плейлист. В результате они видят распространенную ошибку, связанную с парсингом внутри приложения Forkplayer.

Способы решения ошибки

Чтобы избавиться от этой проблемы, потребуется зайти в меню, а после этого нажать на «Выйти из Forkplayer». Эту манипуляцию обязательно стоит сделать первым делом.
Что делать при ошибке парсинга в Forkplayer

Следующий шаг – повторный запуск программного обеспечения на вашем устройстве. Велика вероятность того, что банальный перезапуск приложения исправит появившуюся ошибку, а после этого вы сможете им пользоваться в штатном режиме. Важно предварительно выйти из программы, используя для этого соответствующий пункт меню. Бывает так, что решить проблему не получается с первого раза. В таком случае стоит произвести манипуляцию повторно.

Существует и еще один способ решения проблемы с парсингом страницы в Forkplayer. Например, в таком случае нужно перейти в адресную строку и прописать там ссылку http://fork-portal.ru. После этого появится возможность изучить всю информацию относительно использования данного приложения.

Обратите внимание что адрес должен начинаться именно с «http», а не «https». Скорее всего ошибка парсинга случается при работе по защищенному протоколу, разработчики уже занимаются решением этой проблемы.

Заключение

Как видите, избавиться от ошибки парсинга страницы в Forkplayer – это дело нескольких минут. Каждый из описанных вариантов будет одинаково действенным. Практика показывает, что банальной перезагрузки приложения на устройстве будет вполне достаточно. Также важно проверить правильность настроек, наличие доступа к сети Интернет. В остальном нет никаких проблем с тем, чтобы восстановить работоспособность этого программного обеспечения и продолжить просмотр контента FXML на просторах интернета. Надеемся, материал этой публикации был для вас действительно полезен и помог решить ошибку в Forkplayer за пару минут!

Forklayer программное обеспечение, которое становиться популярнее с каждым днём, во всём мире. С его помощью легко просматривать FXML, а также с ним удобно изучать интернет аккаунты. ПО нацелено на запросы и обработку FXML-сайтов, и изучение их наполнения. Есть возможность открытия индивидуальных файлов либо подготовленные плей — листы. ПО будет прекрасным решением, для просмотра потокового видео, чаще всего именно для этих целей устанавливают данное программное обеспечение.

Forklayer позволяет смотреть на экране ТВ любые видео, находящиеся на интернет ресурсах. Это своего рода, замена традиционного браузера, в виде программы, позволяющей автоматически обновлять плейлисты. Просмотр фильмов, прослушивание аудио и радио являются преимуществом программы. За счёт удобства приложения спрос на него увеличен.

Редко, но бывают замечены сбои программы. Одна из самых частых проблем – ошибка парсинга страницы. Есть несколько вариантов для разрешения ситуации. Они просты и понятны простым пользователям. Ниже подробно рассказано всё, что связано с этой проблемой.

forkplayer

forkplayer

Как поступить если показывает ошибку парсинга в программе

Наши рекомендации довольно просты, поэтому понять и использовать их сможет даже новичок. Указанная ошибка, возникает при посещении киносайтов либо при прослушивании треков. Итогом таких интернет сеансов становиться ошибка парсинга в программе.

Варианты решения проблемы

Для того чтобы решить проблему и устранить ошибку, необходимо выполнить следующие действия:

  1. Зайти в меню программы и клацнуть по кнопке «Выйти из Forklayer».

    выход

    выход

  2. Перезапустить приложение.

Эти несложные действия могут решить проблему, после чего можно пользоваться им как обычно. Обязательно нужно выйти из программы.  В случае если этот метод не помог можно попробовать перезапустить ещё раз.

Если решить проблему так и не получилось, то можно набрать в адресной строке http://fork-portal.ru. На сайте можно получить всю информацию, касающеюся программы.

Стоит учесть, что адрес должен начинаться с «http», без символа «S». Это может стать одной из причин неполадок в работе.

Может быть интересно: Как отключить голосовое сопровождение на телевизоре Самсунг

Заключение

Решить проблему парсинга можно, буквально, за пару минут. Помимо перезагрузки рекомендуется проверить настройки и уровень сигнала интернета. Эти методы помогут продолжить просмотр и прослушивание любимого контента.

Оценка статьи:

Загрузка…

Содержание

  • 1 Возможные неполадки и методы их устранения
    • 1.1 По каким причинам не работает forkplayer
    • 1.2 Что делать если Forkplayer не воспроизводит видео
    • 1.3 Что делать, если не работает поиск
    • 1.4 Как исправить плохую работу Forkplayer на LG, Samsung и Philips

Пользователи Смарт ТВ, оценившие работу Форкплеер не представляют жизни без него. Удобный доступ к базе бесплатных видео предоставляет приложение. Иногда возникают сбои, и Forkplayer не работает. В 2019 году была выпущена усовершенствованная версия с исправленными ошибками. Зачастую проблемы связаны не с приложением. Следует разобраться в распространенных причинах неполадок, вариантах устранения. Парсинг страницы, ошибка соединения, черный экран – распространенные неполадки, наряду с незагружаемыми плейлистами, соцсетями, Youtube.

Forkplayer меню

Пользователи Смарт ТВ, оценившие работу Форкплеер не представляют жизни без него.

Возможные неполадки и методы их устранения

На функциональность Форкплеера влияют многие факторы: скорость интернет-соединения, правильность установки, настройки. Если процедуры проведены правильно, качество подключения в норме, а приложение функционирует с ошибками или не отвечает вовсе, следует определить правильную предпосылку сбоя.

По каким причинам не работает forkplayer

Зачастую причина того, что не работает Forkplayer скрывается в:

Forkplayer настройки

  1. Блокировке плейлиста, адреса ДНС. К пиратскому контенту перекрывают доступ, поэтому требуется проверить остальные плейлисты. Если они рабочие, проблема действительно в этом. Адрес DNS блокирует роутер или провайдер. Потребуется сменить адрес.
  2. IPTV заблокирован. Необходимо поискать другой, рабочий IPTV.
  3. Выставлен несоответствующий формат плеера. Следует войти в настройки и изменить параметры.
  4. Системные сбои. Иногда помогает перезагрузка. В отдельных случаях приложение запускается спустя определенное время.

Существуют специфические ошибки, свойственные отдельным моделям Смарт ТВ. В таком случае важно изучить, почему не функционирует Форкплеер и устранить причину.

Что делать если Forkplayer не воспроизводит видео

Forkplayer плейлист

Пользователи при запуске виджета могут увидеть черный экран. Зачастую случается это по причине блокировки отдельного IPTV или всего плейлиста. Следует испробовать другие IPTV, чтобы определить работоспособность. В сети имеется множество самообновляемых плейлистов, которые регулярно удаляют нерабочие адреса, добавляют рабочие ссылки.

Вторая распространенная причина появления черного экрана вместо видео – неправильный формат плеера. Если все плейлисты не работают, для проверки нужно открыть настройки.

В параметрах требуется указать формат html5 или медиа.

Что делать, если не работает поиск

Если поиск не функционирует, зачастую это связано с блокированием ресурсов из-за пиратского контента. Проблема не решается. Владельцы Смарт ТВ утверждают, что поиск в Форкплеер начинает работать самостоятельно по прошествии определенного времени.

Читайте также:

  • Почему пропал звук на телевизоре – технология обнаружения и устранения неисправности;
  • Как скачать и установить форк плеер для андроид.
  • Почему ютуб не работает на телевизоре и как это исправить.
  • Как скачать билайн тв?

Как исправить плохую работу Forkplayer на LG, Samsung и Philips

Разъем интернет-кабеляЕсли плеер перестал функционировать на устройствах LG, Samsung, Philips, нужно проверить состояние Интернет-соединения. Если все в порядке, проблема заключается в заблокированном адресе DNS. Потребуется заменить нерабочий адрес рабочим. Воспользуйтесь следующими ДНС:

  • для Samsung36.222.114 или 17.30.89;
  • для LG79.190.156 или 85.17.30.89;
  • другие универсальные адреса, которые могут подойти: 36.218.194, 101.118.43 или 36.220.208.

Важно! При возникновении большинства проблем нет необходимости спешить переустанавливать приложение. Виджет не заработает. Следует выявить причину проблемы и устранить ее.

Со сбоями в работе Forkplayer tv может столкнуться каждый. Работоспособность не зависит от модели Смарт ТВ. Дело в настройках, контенте, который могут заблокировать. Не следует спешить отказываться от использования виджета, поскольку большинство проблем с легкостью решаются без посторонней помощи.

Tips, tricks
and all of the stuff you should
know about BeTheme

How to Fix the “Currently Unable To Handle This Request” Error

February 12, 2021

How To Remove the Category From the WordPress URL

February 15, 2021

A WordPress parse error is serious. It will block access to the website and readers won’t be able to view the content.

Some common syntax errors are:

  • «parse error: syntax error, unexpected t_string wordpress»
  • «syntax error unexpected end of file»
  • «syntax error, unexpected t_function»
  • «syntax error unexpected text t_string»
  • «parse error syntax error unexpected if t_if wordpress»

Fortunately, they are not difficult to fix. It’s usually possible to see from the error log what caused the malfunction.

The key is to identify the corrupted file and change it.

Before restoring the site, site owners need to understand what a WordPress parse error is and what may have caused it.

Outlined below are some useful tips for fixing the error.

Types of WordPress Parse Error

First of all, what is parsing? Parsing is a process of interpreting a string of data and converting it into a different format.

It means that the code which holds the website data is converted into the content displayed on the page.

A parse or syntax error occurs during this process of data transformation. It indicates that there is a mistake in the PHP script.

This may be due to a faulty coding structure, punctuation, incorrect function names, or invalid variables.

WordPress parse errors usually occur after making changes to the website. It could be a problem in a plugin, theme, or core file.

A recent modification of any of the WordPress files, especially core files, is the likely source of this error.

Take care when inserting the code characters. Even a small typo or a missing part of the code will cause a syntax error and make the script impossible to process.

When there’s an error in the code, the PHP parser cannot interpret the code and stops working. Consequently, the data will not display on the page.

It’s usually easy to trace the cause of the issue. Generally, there are three types of parse error:

Syntax error

syntax-error1

This error indicates that there is a mistake in the code. The error log will pinpoint the exact line of code where the error occurs.

It’s often caused by a missing PHP tag at the beginning or the end of a block of code. Another source of the problem could be the semicolons, curly brackets, or quotations.

Unexpected error

unexpected-error1

The ‘unexpected error’ points to something that has failed to close. Somewhere in the code, there might be a missing opening or closing bracket, or another character.

The PHP parser reached the end of the script without finding the information it was looking for. This triggered the error message.

Undefined constant error

constant1

A constant is a simple value that can’t change later. Whenever PHP has detected that an undefined constant has been used, it will send this error.

It can be due to a missing character.

Tracing the Source of the WordPress Parse Error

In most cases, fixing a syntax error isn’t complicated. Unlike other malfunctions that are hard to diagnose, this should be straightforward.

To trace the cause of the error, determine what changes have recently been made to the site. This will help to pinpoint the root cause of the issue.

If the error occurred after activating a new plugin or theme, trace that modification first. Try to disable the new feature and check if the page is back on.

If there are no recently added plugins or themes, the error log should state where the problem is. It will lead you to the corrupted file and even the line.

The next step is to follow the path and correct the mistake in the code.

The error message will vary depending on the type of the parse error.

1. A typical Syntax error message:

“Parse error: syntax error, unexpected character in path/to/php-file.php on line number“

2. A typical Unexpected error message:

“Parse error: unexpected character in path/to/php-file.php on line number“

Instead of a character, it may trace a string.

3. A typical Undefined constant error message:

“Notice: Use of undefined constant constant string – assumed ‘constant string‘ in path/to/php-file.php on line number“

Instead of a constant string, the message may refer to unidentified tokens.

The error message itself leads to the corrupted file and part of the code. To fix it, connect to your WordPress site via an FTP (File Transfer Protocol) program.

Modifying the Corrupted File Using FTP

Modifying-the-Corrupted-File-Using-FTP

The first step is to connect to your WordPress site via FTP. After that, locate the file that contains the error.

Right-click on the file and choose View/Edit.

Next, find the part of the code that was recently added or modified. Determine if it is missing a closing bracket, a semi-colon, or another character, and make the needed change.

If it’s not possible to identify the incorrect code, then delete the latest modification.

Save the changes, close the file and reload your WordPress site. It should be running again.

However, think twice before deciding to delete the corrupted line instead of fixing it. In some cases, it will resolve the problem, but it can also lead to more issues.

File Restore

restore

If efforts to fix the issue have been unsuccessful, try to restore the original file from the backup. This should remove all the modifications that caused the parse error.

It’s possible to find the corrupted file by following the error log path. The actual process of restoring it will depend on the tools used.

The restored file should get the site running in its original format.

Backing up all the files related to the look and function of the page is very important. Although the site host usually backs up data, it’s good to have a copy downloaded to the computer.

Tracing the Error Through Debugging

Another method for fixing the syntax error is to enable debugging. This process can identify what causes performance issues on a website.

Activating WP-DEBUG is one of the simplest ways to log errors on a WordPress site.

To enable it, go to the wp-config.php file in the WordPress installation. Next, look for the following line:

define(‘WP_DEBUG’, false);

Once located, replace ‘false’ with ‘true’. If there is no such line in the file, add it at the top.

Now, refresh your site. Instead of the previously displayed blank white page, there should be a list of errors.

This way it’s possible to trace the cause of the problem.

If there are no errors listed, it may be due to a wrong debugging configuration on the server. In such a case, talk to the web host.

The error messages displayed as a result of the debugging may show that the issue is caused by a plugin. The message will be similar to the following notification:

Cannot redeclare get_posts()in/var/www/html/wordpress/wp-content/plugins/my-test-plug my-test-plugin.php on line 39

Now, navigate to the corrupted plugin and deactivate it.

Plugin Deactivation

Plugin-Deactivation

Plugins/themes are a common cause of a parse error. Problems often occur after activating a new plugin or after updating it.

To fix a plugin error, it’s necessary to disable it. Most of the time access is only possible by using FTP.

Go to admin, select ‘Plugins’ and ‘Deactivate’. This disables all plugins.

The next step is to activate them again one by one and refresh your site each time. Repeat the process until you find the corrupted plugin.

Ending thoughts on WordPress parse error

A parse/syntax error will disable access to your site and the content won’t display. But generally, fixing this type of error is not a difficult task.

It is usually caused by a recent modification on the site. Often it’s due to a plugin or a theme.

By deactivating the plugin/theme, you should be able to resolve the issue.

The error message could also indicate a mistake in the code. Most of the time, it’s necessary to track the faulty line and modify it.

However, in some cases, it’s necessary to perform backup file restoration or replace WordPress core files. It’s also possible to use the debugging tool to view the log of all the errors.

In order to prevent syntax errors, always take care when working with the code. Try to avoid typos or missing characters.

If you enjoyed reading this article on how to fix the WordPress parse error, you should check out this one about how to fix the currently unable to handle this request error.

We also wrote about a few related subjects like
WordPress failed to import media,
how to fix the parse error syntax error unexpected,
WordPress missed schedule,
fixing sorry, this file type is not permitted for security reasons,
how to fix the link you followed has expired and
how to fix an error occurred while processing this directive.

Albert Ślusarczyk

Albert Ślusarczyk

As the co-creator of Be Theme, I am a strong believer in designing with care and patience. I pour my energy, time & knowledge into perfecting the theme for our 260,000+ customers.

За последние 24 часа нас посетили 11517 программистов и 1155 роботов. Сейчас ищут 360 программистов …


  1. Iveria

    С нами с:
    16 июн 2017
    Сообщения:
    5
    Симпатии:
    2

    Добрый день!
    Не могу найти ошибку в коде

    1.        return new EspoCoreFileStorageManager(
    2.                    $this->get(‘metadata’)->get([‘app’, ‘fileStorage’, ‘implementationClassNameMap’]),

    Пишет Parse error: syntax error, unexpected ‘[‘, expecting ‘)’

    Спасибо!


  2. Deonis

    С нами с:
    15 фев 2013
    Сообщения:
    1.523
    Симпатии:
    504

    @Iveria, у вас версия PHP ниже 5.4, а короткий синтаксис объявления массивов [ ] поддерживается, начиная именно с этой версии. Или же обновите версию PHP, что крайне желательно или же используйте обычный синтаксис — array()

    1. $this->get(‘metadata’)->get(array(‘app’, ‘fileStorage’, ‘implementationClassNameMap’))


  3. Iveria

    С нами с:
    16 июн 2017
    Сообщения:
    5
    Симпатии:
    2

    Ага, он самый. Стоит ли вообще с ним возиться, или есть хостинг попроще для новичка?


  4. mkramer

    Команда форума
    Модератор

    С нами с:
    20 июн 2012
    Сообщения:
    8.493
    Симпатии:
    1.732

    Не стоит. Основные варианты:

    • Если хочется локалку и просто, то современную сборку (XAMPP, Open Server и др.). PHP должен быть минимум 7.1 (в крайнем случае 7.0)
    • Если хочется локалку чуть более интересно, то можно самому поднять стек на windows (я, кстати, по началу, так и делал). PHP 7.1, mysql 5.7, apache 2.4 или ngnix (не знаю, какая последняя версия)
    • Если хочется локалку, но чтоб как на хостинге — поднять Linux в виртуальной машине, настроить стек там.
    • Ну или взять хостинг. Я, к примеру, купил на ihor.ru за 250 рублей в месяц VPS специально для разработки, и поиграться. Но на локалке у меня тоже есть, XAMPP


  5. Алекс8

    Алекс8
    Активный пользователь

    С нами с:
    18 май 2017
    Сообщения:
    1.730
    Симпатии:
    359

    у меня на сервере до сих пор стоит 5.4.)) на нем несколько форумов)) уже даже и обновления для форума вышло что бы он поддерживал mysqli и php7))) я уже и многим клиентам своим обновил движок и пофиксил проблемы с пхп7)) а сам никак не переведу свои проекты)


  6. Fell-x27

    Команда форума
    Модератор

    С нами с:
    25 июл 2013
    Сообщения:
    12.162
    Симпатии:
    1.770
    Адрес:
    :сердА

    Имхо, для разработки хостинг не нужен, когда можно намутить локальный сервер. С локальным удобнее же в разы.
    — Добавлено —

    Hostens! Дешевле и сочнее.


  7. Iveria

    С нами с:
    16 июн 2017
    Сообщения:
    5
    Симпатии:
    2

    @Fell-x27, спасибо за подробный ответ! Установила XAMPP — все работает, вроде.


  8. Iveria

    С нами с:
    16 июн 2017
    Сообщения:
    5
    Симпатии:
    2

Member Avatar

17 Years Ago

Maybe you can help us by showing the code that you are getting the error with?

Member Avatar

12 Years Ago

hi guys,
Im having the same problem but im using dreamweaver8 instead. bear with me I’m very new at php.
Im trying to insert multiple rows into the same table so I mixed some code I saw online with the code generated in dreamweaver and then when I tried running the page I got the error

Parse error: parse error in C:wampwwwstudent information systemstudent_list_attendance.php on line 292

line 292 is the last line

here is my code//////////

<?php require_once('Connections/dbconnect.php'); ?>
<?php
//initialize the session
if (!isset($_SESSION)) {
  session_start();
}

// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
  $logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
  //to fully log out a visitor we need to clear the session varialbles
  $_SESSION['MM_Username'] = NULL;
  $_SESSION['MM_UserGroup'] = NULL;
  $_SESSION['PrevUrl'] = NULL;
  unset($_SESSION['MM_Username']);
  unset($_SESSION['MM_UserGroup']);
  unset($_SESSION['PrevUrl']);
	
  $logoutGoTo = "home.php";
  if ($logoutGoTo) {
    header("Location: $logoutGoTo");
    exit;
  }
}
?>
<?php
if (!isset($_SESSION)) {
  session_start();
}
$MM_authorizedUsers = "admin";
$MM_donotCheckaccess = "false";

// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) { 
  // For security, start by assuming the visitor is NOT authorized. 
  $isValid = False; 

  // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. 
  // Therefore, we know that a user is NOT logged in if that Session variable is blank. 
  if (!empty($UserName)) { 
    // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. 
    // Parse the strings into arrays. 
    $arrUsers = Explode(",", $strUsers); 
    $arrGroups = Explode(",", $strGroups); 
    if (in_array($UserName, $arrUsers)) { 
      $isValid = true; 
    } 
    // Or, you may restrict access to only certain users based on their username. 
    if (in_array($UserGroup, $arrGroups)) { 
      $isValid = true; 
    } 
    if (($strUsers == "") && false) { 
      $isValid = true; 
    } 
  } 
  return $isValid; 
}

$MM_restrictGoTo = "admin_login.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {   
  $MM_qsChar = "?";
  $MM_referrer = $_SERVER['PHP_SELF'];
  if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
  if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0) 
  $MM_referrer .= "?" . $QUERY_STRING;
  $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
  header("Location: ". $MM_restrictGoTo); 
  exit;
}
?>
<?php
$currentPage = $_SERVER["PHP_SELF"];

function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "student_details")) {

FOREACH($_POST['class_id'] as $row=>$therows)
{
$therows=count($_POST['class_id']);
$student_id=mysql_real_escape_string($_POST['student_id'][$row]);
$class_id=mysql_real_escape_string($_POST['class_id'][$row]);

if (empty($student_id)){} else {

  $insertSQL = sprintf("INSERT INTO attendance (class_id, student_id) VALUES ('".$class_id."','".$student_id."')");
  
   mysql_select_db($database_dbconnect, $dbconnect);
  $Result1 = mysql_query($insertSQL, $dbconnect) or die(mysql_error());
 }}
 
  $insertGoTo = "student_list_attendance.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));

$maxRows_student_list = 5;
$pageNum_student_list = 0;
if (isset($_GET['pageNum_student_list'])) {
  $pageNum_student_list = $_GET['pageNum_student_list'];
}
$startRow_student_list = $pageNum_student_list * $maxRows_student_list;

mysql_select_db($database_dbconnect, $dbconnect);
$query_student_list = "SELECT student_id, First_name, Last_name FROM student ORDER BY student.student_id";
$query_limit_student_list = sprintf("%s LIMIT %d, %d", $query_student_list, $startRow_student_list, $maxRows_student_list);
$student_list = mysql_query($query_limit_student_list, $dbconnect) or die(mysql_error());
$row_student_list = mysql_fetch_assoc($student_list);

if (isset($_GET['totalRows_student_list'])) {
  $totalRows_student_list = $_GET['totalRows_student_list'];
} else {
  $all_student_list = mysql_query($query_student_list);
  $totalRows_student_list = mysql_num_rows($all_student_list);
}
$totalPages_student_list = ceil($totalRows_student_list/$maxRows_student_list)-1;

$colname_admin = "-1";
if (isset($_SESSION['MM_Username'])) {
  $colname_admin = (get_magic_quotes_gpc()) ? $_SESSION['MM_Username'] : addslashes($_SESSION['MM_Username']);
}
mysql_select_db($database_dbconnect, $dbconnect);
$query_admin = sprintf("SELECT admin_Id, first_name FROM `admin` WHERE admin_Id = %s", $colname_admin);
$admin = mysql_query($query_admin, $dbconnect) or die(mysql_error());
$row_admin = mysql_fetch_assoc($admin);
$totalRows_admin = mysql_num_rows($admin);

mysql_select_db($database_dbconnect, $dbconnect);
$query_attendance = "SELECT * FROM attendance";
$attendance = mysql_query($query_attendance, $dbconnect) or die(mysql_error());
$row_attendance = mysql_fetch_assoc($attendance);
$totalRows_attendance = mysql_num_rows($attendance);

$queryString_student_list = "";
if (!empty($_SERVER['QUERY_STRING'])) {
  $params = explode("&", $_SERVER['QUERY_STRING']);
  $newParams = array();
  foreach ($params as $param) {
    if (stristr($param, "pageNum_student_list") == false && 
        stristr($param, "totalRows_student_list") == false) {
      array_push($newParams, $param);
    }
  }
  if (count($newParams) != 0) {
    $queryString_student_list = "&" . htmlentities(implode("&", $newParams));
  }
}
$queryString_student_list = sprintf("&totalRows_student_list=%d%s", $totalRows_student_list, $queryString_student_list);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Student Attendace </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style2 {color: #614654}
.style3 {color: #FFFFFF}
-->
</style>
</head>
<body>
<div id="container">
  
  <div id="banner"><img src="img/banner.jpg" alt="banner" title="banner" /> </div>
  <div id="bannerb">
  
    <h1>The London College of Business and Information Technology  </h1>
    <h1>&nbsp;</h1>
    <h1><span class="orange">Student Information Site </span></h1>
    <div id="scrolldiv" class="scrolldiv">
	<img src="img/New Picture.jpg" width="210" height="57" /> 
    </div>
  </div>
  <div class="topnav">
    <div id="navcontainer">
      <ul id="navlist">
        <li><a href="home.php">Home</a></li>
<li><a href="student_section.php">Students</a></li>
<li id="active"><a href="admin_section.php">Admin</a></li>
<li><a href="About.html">News/Events</a></li>
<li><a href="http://www.free-css.com/">FAQs</a><a href="http://www.free-css.com/">Contact </a></li>
</ul>
    </div>
    <div class="clear">&nbsp;</div>
  </div>
  
  <div id="sidebar">
    <h1>Student Attendace </h1>
    <div id="menu">
      <ul>
        <li id="active"><a href="manage_students.php">Up to Manage Students </a></li>
        <li><a href="<?php echo $logoutAction ?>">Logout</a></li>
      </ul>
    </div>
	 <div class="clear">&nbsp; </div>
     <div id="scrolldiv">
	  <img src="img/Scrolls.jpg" />
	 </div>
  </div>
  <div id="student_info">
    <h1>Logged in as   <span class="orange"><?php echo $row_admin['first_name']; ?></span></h1>
    <div id="div" class="stpersonal">
	<form action="student_list_attendance.php" method="post" name="class_id_value">
	<input name="class_id" type="text" size="5" maxlength="2" />
	<input name="submit_class_id" type="button" value="GO" />
	</form>
	
	<form action="<?php echo $editFormAction; ?>" id="student_details" name="student_details" method="POST">
     
	  <fieldset>
      <table width="100%" border="0">
        <tr bgcolor="#FF6600">
          <td><span class="style3"> ID No. </span></td>
          <td><span class="style3">First Name </span></td>
          <td colspan="4"><span class="style3">Last Name </span><span class="style3"></span><span class="style3"></span></td>
          </tr>
        <?php do { ?>
          <tr>
            <td><input name="student_id" type="text"  value="<?php echo $row_student_list['student_id']; ?>"/></td>
            <td><?php echo $row_student_list['First_name']; ?></td>
            <td><?php echo $row_student_list['Last_name']; ?></td>
            <td><a href="update_ attendance.php?studentid=<?php echo $row_student_list['student_id' ] ;?>">update</a></td>
            <td><a href="View_attendace_admin.php?studentid=<?php echo $row_student_list['student_id' ] ;?>">View</a></td>
            <td><input name="class_id" type="hidden" id="class_id" value="<?php echo $POST['class_id'];?>" /></td>
          </tr>
          <?php } while ($row_student_list = mysql_fetch_assoc($student_list)); ?>
      </table>
      </fieldset>
      
      <input type="hidden" name="MM_insert" value="student_details">
	  <input type="submit" name="Submit" value="Update" />
	</form>
	<p>&nbsp;</p>
	<hr width="100%" />

    <table width="100%" border="0" cellspacing="1px" cellpadding="1px">
      <tr>
        <th width="25" scope="row"><div align="left" class="style2"><a href="<?php printf("%s?pageNum_student_list=%d%s", $currentPage, min($totalPages_student_list, $pageNum_student_list + 1), $queryString_student_list); ?>">Next</a></div></th>
        <td width="25"><div align="left" class="style2"><a href="<?php printf("%s?pageNum_student_list=%d%s", $currentPage, max(0, $pageNum_student_list - 1), $queryString_student_list); ?>">Previous</a></div></td>
        <td width="25"><div align="left" class="style2"><a href="<?php printf("%s?pageNum_student_list=%d%s", $currentPage, 0, $queryString_student_list); ?>">First</a></div></td>
        <td width="25"><div align="left" class="style2">
          <a href="<?php printf("%s?pageNum_student_list=%d%s", $currentPage, $totalPages_student_list, $queryString_student_list); ?>">Last</a></div></td>
      </tr>
    </table>
    </div>
  </div>
  <div id="footer"> <a href="http://www.free-css.com/">disclaimer</a> | <a href="mailto:denise@mitchinson.net">terms of use </a> | <a href="http://validator.w3.org/check?uri=referer">privacy notice </a> | <a href="http://jigsaw.w3.org/css-validator">Phone: +44 (0) 7533856123 </a> | &copy; 2010 The College| Design by <a href="http://www.mitchinson.net">Jere M F Limited </a></div>
</div>
</body>
</html>
<?php
mysql_free_result($student_list);

mysql_free_result($admin);

mysql_free_result($attendance);
?>

Member Avatar


MVied

11



Junior Poster


12 Years Ago

Hi there, this error usually means you’re missing a closing curly brace in your code somewhere.

Php-coder, your unclosed curly brace is on line 108. Just glancing at your code, it looks like you’d want to put the closing brace around line 130, under this line.

header(sprintf("Location: %s", $insertGoTo));

May I also suggest you add an exit; after that line. This stops any more code from being processed when you’re doing a redirect.

Edited

12 Years Ago
by MVied because:

n/a

Member Avatar

12 Years Ago

Hi
Mvied, Thanx a lot. I followed your advice and now the error’s gone. The page is diplaying but I havn’t been able to make the multiple insert work, do you (or any one) think you could help with that too

Edited

12 Years Ago
by php-coder because:

wanted to extend the question to everyone else

Понравилась статья? Поделить с друзьями:
  • Error parse error trailing garbage
  • Error parse error octave
  • Error parse error nodejs
  • Error parse error node
  • Error parse error in pattern