Ошибка doctype html public

I get the following syntax error in Firebug and I don’t get what’s it:

> syntax error [Break on this error]
> <!DOCTYPE html PUBLIC "-//W3C//DTDXHT...org/TR/xhtml1/DTD/xhtml1-strict.dtd">n

Is it because of the final «n» at the end ?

thanks

ps. I’ve just realized if I remove all scripts, I don’t get that error. For example, if I remove these lines, I don’t get it. If I add another script I get it again, so it doesn’t depend on the script itself.

<script type="text/JavaScript" src="<?php echo $base_url; ?>sites/all/themes/bluemarine/js/main.js"></script>

CODE:

<?php
// $Id: page.tpl.php,v 1.28.2.1 2009/04/30 00:13:31 goba Exp $
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $language->language ?>" xml:lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
<head>
  <?php print $head ?>
  <title><?php print $head_title ?></title>
  <?php print $styles ?>
  <?php print $scripts ?>
  <script type="text/JavaScript" src="<?php echo $base_url; ?>sites/all/themes/bluemarine/js/main.js"></script>
  <!--<script type="text/JavaScript" src="<?php echo $base_url; ?>sites/all/themes/bluemarine/js/griddy-min.js"></script>
-->

</head>

<body>...

Тег DOCTYPE означает «объявление типа документа». Он сообщает веб-браузерам, какую версию HTML использует ваша страница. Прописывать DOCTYPE необходимо для переключения браузера в режим соответствия стандартам данной версии. DOCTYPE всегда должен быть самой первой строкой HTML-кода страницы.

Хотя современные браузеры не принимают во внимание незначительные ошибки в коде HTML, неправильный DOCTYPE является серьезной проблемой, которая может существенно повлиять на доступность вашего веб-контента. Отчет Labrika «Неверный HTML DOCTYPE» позволяет установить наличие таких ошибок.

Содержание отчета

Отчет показывает список URL-адресов страниц, в HTML-коде которых DOCTYPE прописан неверно.

список URL-адресов страниц, в HTML-коде которых DOCTYPE прописан неверно

Использование отчета

Найдите страницы с  некорректным DOCTYPE и пропишите его правильно.

Синтаксис:

<!DOCTYPE [Элемент верхнего уровня] [Публичность] "[Регистрация]//[Организация]//[Тип] [Имя]//[Язык]" "[URL]">

Параметры:

  • Элемент верхнего уровня — указывает элемент верхнего уровня в документе, для HTML это тег <html>.
  • Публичность — указывает, является объект публичным (значение PUBLIC) или системным (значение SYSTEM) ресурсом, например, таким как локальный файл. Для HTML/XHTML выбирается значение PUBLIC.
  • Регистрация — сообщает, зарегистрирован ли разработчик DTD (document type definition, описания типа документа) в международной организации по стандартизации (International Organization for Standardization, ISO). Принимает одно из двух значений: плюс (+) — разработчик зарегистрирован в ISO или минус (-) — разработчик не зарегистрирован. Для W3C указывается значение «-».
  • Организация — уникальное название организации, разработавшей DTD. Официально HTML/XHTML публикует W3C (англ. World Wide Web Consortium — Консорциум Всемирной паутины). Нназвание этой организации и пишется в теге DOCTYPE.
  • Тип описываемого документа. Для HTML/XHTML указывается значение DTD.
  • Имя — уникальное имя документа для описания DTD.
  • Язык — указывается язык, на котором написан текст для описания объекта. Содержит две буквы, пишется в верхнем регистре. Для документа HTML/XHTML нужно прописывать английский язык (EN).
  • URL — адрес документа с DTD.

Существует несколько видов DOCTYPE — они различаются в зависимости от используемой на странице версии языка разметки гипертекста.

Пример для версии HTML 4.01:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

Спецификация HTML5 предлагает следующий вариант написания DOCTYPE для всех документов:

<!DOCTYPE html>.

cooperOk, спасибо, что указали на ошибку — я просто вчера после часа борьбы и напившись от огорчения водкой скопировала все немного не оттуда. На самом деле код у файла, который вчера лежал на сервере и проверялся по линку, вот такой:

HTML5
1
2
3
4
5
6
7
8
9
10
11
12
13
# <!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>
# <meta http-equiv="content-type" content="text/html; charset=windows-1251" />
# <meta name="generator" content="Bluefish 2.0.0" />
#
# <title>Сайт</title>
# <link rel="stylesheet" href="css/stylekh.css" type="text/css" />
# <!--[if lte IE 7]><link rel="stylesheet" href="css/ie.css" type="text/css" media="screen,projection" /><![endif]-->
# </head>

Он и вчера был такой и сегодня остался… так вот сегодня после проверки я получаю сообщение «This document was successfully checked as XHTML 1.0 Transitional!»

Ничего не поняла, но проблема исчезла, поэтому всем спасибо за ответы

Добавлено через 1 минуту

Цитата
Сообщение от lesha_firs
Посмотреть сообщение

используй этот

HTML5
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Добавлено через 47 секунд
Ты проста для xml использовал!

В след.раз в случае возникновения проблемы попробую и такой поюзать, thx

Привет

Помогите плиз разобраться с вот этой строчкой
<!DOCTYPE HTML PUBLIC «-//W3C//DTD HTML 4.0 Transitional//RU»>

все что я про это знаю, это то что эта строчка указывает, про версию ХТМЛ которая используется,

а что значит слово Transitional, и какой вообще бывает синтаксис этой строчки я встречал ее довольно в разных интерпритациях.

проблема, в том что в зависимости от нее, браузера (ИЕ ФайерФокс) показывают по разному страницу.

Может кто расскажет в чем ее соль.

Или ссылкой поделиться где про это подробно написано, и желательно по русски

Спасибо

What is the reason of the below error in my log cat ?

06-28 21:05:55.850: I/System.out(19770): Thread-3337 calls detatch()
06-28 21:05:56.210: I/System.out(19770): Thread-3337 calls detatch()
06-28 21:05:56.600: I/System.out(19770): Thread-3337 calls detatch()
06-28 21:05:56.600: I/System.out(19770): Response : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
06-28 21:05:56.600: I/System.out(19770): <html xmlns="http://www.w3.org/1999/xhtml">
06-28 21:05:56.600: I/System.out(19770): <head>
06-28 21:05:56.600: I/System.out(19770): <title>Web hosting, domain names, VPS - 000webhost.com</title>
06-28 21:05:56.600: I/System.out(19770): <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
06-28 21:05:56.600: I/System.out(19770): <link href="/new_style.css" rel="stylesheet" type="text/css">
06-28 21:05:56.600: I/System.out(19770): </head>
06-28 21:05:56.600: I/System.out(19770): <script type="text/javascript">
06-28 21:05:56.600: I/System.out(19770): var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
06-28 21:05:56.600: I/System.out(19770): document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
06-28 21:05:56.600: I/System.out(19770): </script>
06-28 21:05:56.600: I/System.out(19770): <script type="text/javascript">
06-28 21:05:56.600: I/System.out(19770): try {
06-28 21:05:56.600: I/System.out(19770): var pageTracker = _gat._getTracker("UA-10701068-1");
06-28 21:05:56.600: I/System.out(19770): pageTracker._trackPageview();
06-28 21:05:56.600: I/System.out(19770): } catch(err) {}</script>
06-28 21:05:56.600: I/System.out(19770): <map name="map1">
06-28 21:05:56.600: I/System.out(19770): <area shape=rect coords="325,60,440,94" href="http://www.000webhost.com/features" target="_parent" alt="Features" title="Features">
06-28 21:05:56.600: I/System.out(19770): <area shape=rect coords="442,60,549,94" href="http://www.000webhost.com/order.php" target="_parent" alt="Order Now" title="Order Now">
06-28 21:05:56.600: I/System.out(19770): <area shape=rect coords="550,60,659,94" href="http://www.000webhost.com/affiliate-program" target="_parent" alt="Affiliate Program" title="Affiliate Program">
06-28 21:05:56.600: I/System.out(19770): <area shape=rect coords="660,60,770,94" href="http://www.000webhost.com/contact" target="_parent" alt="Contact Us" title="Contact Us">         
06-28 21:05:56.600: I/System.out(19770): </map>
06-28 21:05:56.600: I/System.out(19770): <body class="twoColFixRtHdr">
06-28 21:05:56.600: I/System.out(19770): <SCRIPT SRC="http://creative.xtendmedia.com/matomy/cf/ply/ply.js?pubid=50792397&mid=c51681034&wid=c51531274&popup=1&popunder=1&size=320x480&pop_times=2&pop_frequency=3600&mm_delay=0&mm_back_delay=300&numOfTimes=3&duration=1&period=24hour&close=1&openNewTab=true" TYPE="text/javascript"></SCRIPT>
06-28 21:05:56.600: I/System.out(19770): <script type="text/javascript" src="http://c.ctpsrv.com/ma.js?s=154926"></script>
06-28 21:05:56.600: I/System.out(19770): <div id="container">
06-28 21:05:56.600: I/System.out(19770):   <div id="header">
06-28 21:05:56.600: I/System.out(19770):    <img src="/images/locale/EN/header.gif" width="780" height="119" border="0" usemap="#map1" />
06-28 21:05:56.600: I/System.out(19770): </div>
06-28 21:05:56.600: I/System.out(19770):  
06-28 21:05:56.600: I/System.out(19770): <div id="sidebar1">
06-28 21:05:56.600: I/System.out(19770): <div align="center">
06-28 21:05:56.600: I/System.out(19770): </div>
06-28 21:05:56.605: I/System.out(19770):     <table width="200" border="0" cellspacing="5" cellpadding="0">
06-28 21:05:56.605: I/System.out(19770):       <tr>
06-28 21:05:56.605: I/System.out(19770):         <td width="20%"><div align="center"><img src="/images/icons/menu1.gif" alt="Ошибка doctype html public" width="16" height="16" /></div></td>
06-28 21:05:56.605: I/System.out(19770):         <td width="80%"><a class="rightmenu" href="http://www.000webhost.com/">Free Web Hosting</a></td>
06-28 21:05:56.605: I/System.out(19770):       </tr>
06-28 21:05:56.605: I/System.out(19770):       <tr>
06-28 21:05:56.605: I/System.out(19770):         <td><div align="center"><img src="/images/icons/main1.gif" alt="Ошибка doctype html public" width="16" height="16" /></div></td>
06-28 21:05:56.605: I/System.out(19770):         <td><a href="http://www.hosting24.com/" class="rightmenu">Premium Web Hosting</a></td>
06-28 21:05:56.605: I/System.out(19770):       </tr>
06-28 21:05:56.605: I/System.out(19770):       <tr>
06-28 21:05:56.605: I/System.out(19770):         <td><div align="center"><img src="/images/icons/main5.gif" alt="Ошибка doctype html public" width="16" height="16" /></div></td>
06-28 21:05:56.605: I/System.out(19770):         <td><a href="http://www.000webhost.com/website-builder" class="rightmenu">Website Builder</a></td>
06-28 21:05:56.605: I/System.out(19770):       </tr>
06-28 21:05:56.605: I/System.out(19770):       <tr>
06-28 21:05:56.605: I/System.out(19770):         <td><div align="center"><img src="/images/icons/templates_small.gif" alt="Ошибка doctype html public" width="16" height="16" /></div></td>
06-28 21:05:56.605: I/System.out(19770):         <td><a href="http://www.000webhost.com/templates/" class="rightmenu">Website Templates</a></td>
06-28 21:05:56.605: I/System.out(19770):       </tr>     
06-28 21:05:56.605: I/System.out(19770):       <tr>
06-28 21:05:56.605: I/System.out(19770):         <td><div align="center"><img src="/images/icons/directory_list_small.gif" alt="Ошибка doctype html public" width="16" height="16" /></div></td>
06-28 21:05:56.605: I/System.out(19770):         <td><a href="http://www.000webhost.com/directory/" class="rightmenu">Web Hosting Reviews</a></td>
06-28 21:05:56.605: I/System.out(19770):       </tr>             
06-28 21:05:56.605: I/System.out(19770):       <tr>
06-28 21:05:56.605: I/System.out(19770):         <td><div align="center"><img src="/images/icons/menu11.jpg" alt="Ошибка doctype html public" width="16" height="16" /></div></td>
06-28 21:05:56.605: I/System.out(19770):         <td><a href="http://www.000webhost.com/affiliate-program" class="rightmenu">Affiliate Program</a></td>
06-28 21:05:56.605: I/System.out(19770):       </tr>
06-28 21:05:56.605: I/System.out(19770):       <tr>
06-28 21:05:56.605: I/System.out(19770):         <td><div align="center"><img src="/images/icons/menu13.gif" width="16" height="16" /></div></td>
06-28 21:05:56.605: I/System.out(19770):         <td><a href="http://www.000webhost.com/forum/" class="rightmenu">Web Hosting Forum</a></td>
06-28 21:05:56.605: I/System.out(19770):       </tr>
06-28 21:05:56.605: I/System.out(19770):     </table>
06-28 21:05:56.605: I/System.out(19770):     <div align="center"><br />
06-28 21:05:56.605: I/System.out(19770):     <br />
06-28 21:05:56.605: I/System.out(19770):     <a href="http://www.000webhost.com/order.php"><img src="/images/locale/EN/signup.gif" width="183" height="75" border="0" /></a> 
06-28 21:05:56.605: I/System.out(19770):     <br />
06-28 21:05:56.605: I/System.out(19770):     <br />
06-28 21:05:56.610: I/System.out(19770):     </div>
06-28 21:05:56.610: I/System.out(19770): </div>
06-28 21:05:56.610: I/System.out(19770): <div id="mainContent">
06-28 21:05:56.610: I/System.out(19770):     <table width="500" border="0" cellspacing="0" cellpadding="0">
06-28 21:05:56.610: I/System.out(19770):       <tr>
06-28 21:05:56.610: I/System.out(19770):         <td width="12%"><img src="/images/icons/upgrade.gif" width="48" height="48" /></td>
06-28 21:05:56.610: I/System.out(19770):         <td width="88%"><h4>Free web hosting, no ads or banners!</h4></td>
06-28 21:05:56.610: I/System.out(19770):       </tr>
06-28 21:05:56.610: I/System.out(19770):     </table>
06-28 21:05:56.610: I/System.out(19770):    <p>Can you imagine <b>free web hosting</b> service that has 99.9% uptime? Too good to be true? No more! <a href='http://www.000webhost.com/'>000webhost.com</a> has made the revolution, forget the stereotype that free hosting is unreliable.. Here is the proof: <a href='http://www.serviceuptime.com/users/monitoring.php?S=6c8ef11fcca35bab3d971cdce3d7179b' target='_blank'>uptime stats of 20 servers</a>. We beat your paid hosting provider!</p>
06-28 21:05:56.610: I/System.out(19770): <!-- <p align="center"><img src="advertisement.gif"></p> -->
06-28 21:05:56.610: I/System.out(19770): <fieldset><legend>Advertisements</legend>
06-28 21:05:56.610: I/System.out(19770): <p align="center">
06-28 21:05:56.610: I/System.out(19770): <script type="text/javascript"><!--
06-28 21:05:56.610: I/System.out(19770): google_ad_client = "ca-pub-9043996592502243";
06-28 21:05:56.610: I/System.out(19770): /* 000webhost Error Big */
06-28 21:05:56.610: I/System.out(19770): google_ad_slot = "1420565520";
06-28 21:05:56.610: I/System.out(19770): google_ad_width = 336;
06-28 21:05:56.610: I/System.out(19770): google_ad_height = 280;
06-28 21:05:56.610: I/System.out(19770): //-->
06-28 21:05:56.610: I/System.out(19770): </script>
06-28 21:05:56.610: I/System.out(19770): <script type="text/javascript"
06-28 21:05:56.610: I/System.out(19770): src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
06-28 21:05:56.610: I/System.out(19770): </script>
06-28 21:05:56.610: I/System.out(19770): </p>
06-28 21:05:56.610: I/System.out(19770): </fieldset>
06-28 21:05:56.610: I/System.out(19770):     
06-28 21:05:56.610: I/System.out(19770):     <h3>1500 MB disk space, 100 GB data transfer! PHP, MySQL, FTP, cPanel..</h3>
06-28 21:05:56.610: I/System.out(19770):     <p>Our free hosting service is supercharged with over 60 features, just like paid hosting. Unrestricted access to PHP, MySQL, FTP, cPanel, Website Builder and many more features are waiting for you absolutely free!</p>
06-28 21:05:56.610: I/System.out(19770):     <h3>Need unlimited premium hosting that is really UNLIMITED?</h3>
06-28 21:05:56.610: I/System.out(19770):     <p>Signup with <a href='http://www.hosting24.com/'>www.hosting24.com</a> - <b>unlimited</b> disk space, <b>unlimited</b> data transfer, host <b>unlimited</b> domains for just $4.84</p>
06-28 21:05:56.610: I/System.out(19770):     <table width="500" border="0" cellpadding="2" cellspacing="2" bgcolor="#F2F2F2">
06-28 21:05:56.610: I/System.out(19770):       <tr class="dblue">
06-28 21:05:56.610: I/System.out(19770):         <td> </td>
06-28 21:05:56.610: I/System.out(19770):         <td><div align="center"><strong>&raquo; Free Hosting</strong></div></td>
06-28 21:05:56.610: I/System.out(19770):         <td><div align="center"><strong>&raquo; Premium Hosting</strong></div></td>
06-28 21:05:56.610: I/System.out(19770):       </tr>
06-28 21:05:56.610: I/System.out(19770):       <tr class="list_accounts">
06-28 21:05:56.610: I/System.out(19770):         <td width="40%">Price</td>
06-28 21:05:56.610: I/System.out(19770):         <td width="30%">$0.00</td>
06-28 21:05:56.610: I/System.out(19770):         <td width="30%">$4.84 / month</td>
06-28 21:05:56.610: I/System.out(19770):       </tr>
06-28 21:05:56.610: I/System.out(19770):       <tr class="list_accounts2">
06-28 21:05:56.610: I/System.out(19770):         <td width="40%">Disk Space</td>
06-28 21:05:56.610: I/System.out(19770):         <td width="30%">1500 MB</td>
06-28 21:05:56.610: I/System.out(19770):         <td width="30%">Unlimited Disk Space!</td>
06-28 21:05:56.610: I/System.out(19770):       </tr>
06-28 21:05:56.610: I/System.out(19770):       <tr class="list_accounts">
06-28 21:05:56.610: I/System.out(19770):         <td width="40%">Data Transfer</td>
06-28 21:05:56.610: I/System.out(19770):         <td width="30%">100 GB / month</td>
06-28 21:05:56.610: I/System.out(19770):         <td width="30%">Unlimited Data Transfer!</td>
06-28 21:05:56.610: I/System.out(19770):       </tr>
06-28 21:05:56.610: I/System.out(19770):       <tr class="list_accounts2">
06-28 21:05:56.610: I/System.out(19770):         <td>Add-on Domains</td>
06-28 21:05:56.610: I/System.out(19770):         <td>5</td>
06-28 21:05:56.610: I/System.out(19770):         <td>Unlimited</td>
06-28 21:05:56.610: I/System.out(19770):       </tr>
06-28 21:05:56.610: I/System.out(19770):       <tr class="list_accounts">
06-28 21:05:56.610: I/System.out(19770):         <td>Sub-domains</td>
06-28 21:05:56.610: I/System.out(19770):         <td>5</td>
06-28 21:05:56.610: I/System.out(19770):         <td>Unlimited</td>
06-28 21:05:56.610: I/System.out(19770):       </tr>
06-28 21:05:56.610: I/System.out(19770):       <tr class="list_accounts2">
06-28 21:05:56.610: I/System.out(19770):         <td>E-mail Addresses</td>
06-28 21:05:56.610: I/System.out(19770):         <td>5</td>
06-28 21:05:56.610: I/System.out(19770):         <td>Unlimited</td>
06-28 21:05:56.610: I/System.out(19770):       </tr>
06-28 21:05:56.615: I/System.out(19770):       <tr class="list_accounts">
06-28 21:05:56.615: I/System.out(19770):         <td>MySQL Databases</td>
06-28 21:05:56.615: I/System.out(19770):         <td>2</td>
06-28 21:05:56.615: I/System.out(19770):         <td>Unlimited</td>
06-28 21:05:56.615: I/System.out(19770):       </tr>
06-28 21:05:56.615: I/System.out(19770):       <tr class="list_accounts2">
06-28 21:05:56.615: I/System.out(19770):         <td>Free domain registration yourname.COM, .NET, .ORG, .INFO, .CO.UK</td>
06-28 21:05:56.615: I/System.out(19770):         <td><img src="images/uncheck.gif" width="15" height="15" /></td>
06-28 21:05:56.615: I/System.out(19770):         <td><img src="images/check.gif" width="15" height="15" /></td>
06-28 21:05:56.615: I/System.out(19770):       </tr>
06-28 21:05:56.615: I/System.out(19770):       <tr class="list_accounts">
06-28 21:05:56.615: I/System.out(19770):         <td>Control Panel</td>
06-28 21:05:56.615: I/System.out(19770):         <td>Custom Panel</td>
06-28 21:05:56.615: I/System.out(19770):         <td>cPanel Pro, <a href="http://x3demob.cpx3demo.com:2082/login/?user=x3demob&pass=x3demob" target="_blank">see demo</a></td>
06-28 21:05:56.615: I/System.out(19770):       </tr>
06-28 21:05:56.615: I/System.out(19770):       <tr class="list_accounts">
06-28 21:05:56.615: I/System.out(19770):         <td height="40"> </td>
06-28 21:05:56.615: I/System.out(19770):         <td><a href="http://www.000webhost.com/order.php"><img src="images/ordernow1.gif" width="89" height="25" border="0" /></a></td>
06-28 21:05:56.615: I/System.out(19770):         <td><a href="http://www.hosting24.com/" target="_blank"><img src="images/ordernow1.gif" alt="Web Hosting" width="89" height="25" border="0" /></a></td>
06-28 21:05:56.615: I/System.out(19770):       </tr>
06-28 21:05:56.615: I/System.out(19770):       <tr class="list_accounts2">
06-28 21:05:56.615: I/System.out(19770):         <td>Site Builder</td>
06-28 21:05:56.615: I/System.out(19770):         <td><img src="images/check.gif" width="15" height="15" /></td>
06-28 21:05:56.615: I/System.out(19770):         <td><img src="images/check.gif" width="15" height="15" /></td>
06-28 21:05:56.615: I/System.out(19770):       </tr>
06-28 21:05:56.615: I/System.out(19770):       <tr class="list_accounts2">
06-28 21:05:56.615: I/System.out(19770):         <td>Advanced Site Builder</td>
06-28 21:05:56.615: I/System.out(19770):         <td><img src="images/uncheck.gif" width="15" height="15" /></td>
06-28 21:05:56.615: I/System.out(19770):         <td><img src="images/check.gif" width="15" height="15" /></td>
06-28 21:05:56.615: I/System.out(19770):       </tr>      
06-28 21:05:56.615: I/System.out(19770):       <tr class="list_accounts">
06-28 21:05:56.615: I/System.out(19770):         <td>Assistance in  Installing Your Scripts</td>
06-28 21:05:56.615: I/System.out(19770):         <td><img src="images/uncheck.gif" width="15" height="15" /></td>
06-28 21:05:56.615: I/System.out(19770):         <td><img src="images/check.gif" width="15" height="15" /></td>
06-28 21:05:56.615: I/System.out(19770):       </tr>
06-28 21:05:56.615: I/System.out(19770):       <tr class="list_accounts2">
06-28 21:05:56.615: I/System.out(19770):         <td>Help in Developing Your Website</td>
06-28 21:05:56.615: I/System.out(19770):         <td><img src="images/uncheck.gif" width="15" height="15" /></td>
06-28 21:05:56.615: I/System.out(19770):         <td><img src="images/check.gif" width="15" height="15" /></td>
06-28 21:05:56.615: I/System.out(19770):       </tr>
06-28 21:05:56.615: I/System.out(19770):       <tr class="list_accounts">
06-28 21:05:56.615: I/System.out(19770):         <td>Backups</td>
06-28 21:05:56.615: I/System.out(19770):         <td><img src="images/check.gif" width="15" height="15" /></td>
06-28 21:05:56.615: I/System.out(19770):         <td><img src="images/check.gif" width="15" height="15" /></td>
06-28 21:05:56.615: I/System.out(19770):       </tr>
06-28 21:05:56.615: I/System.out(19770):       <tr class="list_accounts">
06-28 21:05:56.615: I/System.out(19770):         <td>Automated Weekly Backups</td>
06-28 21:05:56.615: I/System.out(19770):         <td>Limited</td>
06-28 21:05:56.615: I/System.out(19770):         <td><img src="images/check.gif" width="15" height="15" /></td>
06-28 21:05:56.620: I/System.out(19770):       </tr>      
06-28 21:05:56.620: I/System.out(19770):       <tr class="list_accounts2">
06-28 21:05:56.620: I/System.out(19770):         <td>Uptime</td>
06-28 21:05:56.620: I/System.out(19770):         <td>99%</td>
06-28 21:05:56.620: I/System.out(19770):         <td>99.9%</td>
06-28 21:05:56.620: I/System.out(19770):       </tr>
06-28 21:05:56.620: I/System.out(19770):       <tr class="list_accounts2">
06-28 21:05:56.620: I/System.out(19770):         <td>FTP Accounts</td>
06-28 21:05:56.620: I/System.out(19770):         <td>1</td>
06-28 21:05:56.620: I/System.out(19770):         <td>Unlimited</td>
06-28 21:05:56.620: I/System.out(19770):       </tr>
06-28 21:05:56.620: I/System.out(19770):       <tr class="list_accounts">
06-28 21:05:56.620: I/System.out(19770):         <td>Anonymous FTP Access</td>
06-28 21:05:56.620: I/System.out(19770):         <td><img src="images/uncheck.gif" width="15" height="15" /></td>
06-28 21:05:56.620: I/System.out(19770):         <td><img src="images/check.gif" width="15" height="15" /></td>
06-28 21:05:56.620: I/System.out(19770):       </tr>
06-28 21:05:56.620: I/System.out(19770):       <tr class="list_accounts2">
06-28 21:05:56.620: I/System.out(19770):         <td>CGI Scripts</td>
06-28 21:05:56.620: I/System.out(19770):         <td><img src="images/uncheck.gif" width="15" height="15" /></td>
06-28 21:05:56.620: I/System.out(19770):         <td><img src="images/check.gif" width="15" height="15" /></td>
06-28 21:05:56.620: I/System.out(19770):       </tr>
06-28 21:05:56.620: I/System.out(19770):       <tr class="list_accounts">
06-28 21:05:56.620: I/System.out(19770):         <td>PHP</td>
06-28 21:05:56.620: I/System.out(19770):         <td><img src="images/check.gif" width="15" height="15" /></td>
06-28 21:05:56.620: I/System.out(19770):         <td><img src="images/check.gif" width="15" height="15" /></td>
06-28 21:05:56.620: I/System.out(19770):       </tr>
06-28 21:05:56.625: I/System.out(19770):       <tr class="list_accounts2">
06-28 21:05:56.625: I/System.out(19770):         <td>Ruby On Rails</td>
06-28 21:05:56.625: I/System.out(19770):         <td><img src="images/uncheck.gif" width="15" height="15" /></td>
06-28 21:05:56.625: I/System.out(19770):         <td><img src="images/check.gif" width="15" height="15" /></td>
06-28 21:05:56.625: I/System.out(19770):       </tr>
06-28 21:05:56.625: I/System.out(19770):       <tr class="list_accounts">
06-28 21:05:56.625: I/System.out(19770):         <td>SSH Access</td>
06-28 21:05:56.625: I/System.out(19770):         <td><img src="images/uncheck.gif" width="15" height="15" /></td>
06-28 21:05:56.625: I/System.out(19770):         <td><img src="images/check.gif" width="15" height="15" /></td>
06-28 21:05:56.625: I/System.out(19770):       </tr>
06-28 21:05:56.625: I/System.out(19770):       <tr class="list_accounts2">
06-28 21:05:56.625: I/System.out(19770):         <td>Perl</td>
06-28 21:05:56.625: I/System.out(19770):         <td><img src="images/uncheck.gif" width="15" height="15" /></td>
06-28 21:05:56.625: I/System.out(19770):         <td><img src="images/check.gif" width="15" height="15" /></td>
06-28 21:05:56.625: I/System.out(19770):       </tr>
06-28 21:05:56.625: I/System.out(19770):       <tr class="list_accounts">
06-28 21:05:56.625: I/System.out(19770):         <td> ASP.NET</td>
06-28 21:05:56.625: I/System.out(19770):         <td><img src="images/uncheck.gif" width="15" height="15" /></td>
06-28 21:05:56.625: I/System.out(19770):         <td><img src="images/check.gif" width="15" height="15" /></td>
06-28 21:05:56.625: I/System.out(19770):       </tr>
06-28 21:05:56.625: I/System.out(19770):       <tr class="list_accounts2">
06-28 21:05:56.625: I/System.out(19770):         <td>Python</td>
06-28 21:05:56.625: I/System.out(19770):         <td><img src="images/uncheck.gif" width="15" height="15" /></td>
06-28 21:05:56.625: I/System.out(19770):         <td><img src="images/check.gif" width="15" height="15" /></td>
06-28 21:05:56.625: I/System.out(19770):       </tr>
06-28 21:05:56.630: I/System.out(19770): </div>
06-28 21:05:56.630: I/System.out(19770): </body>
06-28 21:05:56.630: I/System.out(19770): </html>



httppost= new HttpPost("http://31.170.160.102/public_html/check.php"); 

31.170.160.102 this is my ip I get from my free host.

/public_html/check.php in the file manager root there is public_html folder I added it check.php.

This is check.php:

<?php
$hostname_localhost ="mysql12.000webhost.com";
$database_localhost ="a6901827_justed";
$username_localhost ="a6901827_moudiz";
$password_localhost ="*****";
$localhost = mysql_connect($hostname_localhost,$username_localhost,$password_localhost)
or
trigger_error(mysql_error(),E_USER_ERROR);

mysql_select_db($database_localhost, $localhost);

$username = $_POST['username'];
$password = $_POST['password'];
$query_search = "select * from tbl_user where username = '".$username."' AND password = '".$password. "'";
$query_exec = mysql_query($query_search) or die(mysql_error());
$rows = mysql_num_rows($query_exec);
//echo $rows;
if($rows == 0) { 
    echo "No Such User Found"; 
}
else  {
    echo "User Found"; 
}
?>

This is my code:

void login(){
    try{            

        httpclient=new DefaultHttpClient();
        httppost= new HttpPost("http://31.170.160.102/public_html/check.php"); // make sure the url is correct.
        //add your data
        nameValuePairs = new ArrayList<NameValuePair>(2);
        // Always use the same variable name for posting i.e the android side variable name and php side variable name should be similar, 
        nameValuePairs.add(new BasicNameValuePair("username",et.getText().toString().trim()));  // $Edittext_value = $_POST['Edittext_value'];
        nameValuePairs.add(new BasicNameValuePair("password",pass.getText().toString().trim())); 
        httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
        //Execute HTTP Post Request
        response=httpclient.execute(httppost);
        int responseStatusCode = response.getStatusLine().getStatusCode();
        System.out.println("Response : " + responseStatusCode); 

        Log.d("Http response: ", "> " + response);
        // edited by James from coderzheaven.. from here....
        ResponseHandler<String> responseHandler = new BasicResponseHandler();
        final String response = httpclient.execute(httppost, responseHandler);
        System.out.println("Response : " + response); 
        runOnUiThread(new Runnable() {
            public void run() {
                tv.setText("Response from PHP : " + response);
                dialog.dismiss();
            }
        });

        if(response.equalsIgnoreCase("User Found")){
            runOnUiThread(new Runnable() {
                public void run() {
                    Toast.makeText(MainActivity.this,"Login Success", Toast.LENGTH_SHORT).show();
                }
            });

        //    startActivity(new Intent(MainActivity.this, UserPage.class));
        }else{
            showAlert();                
        }

    }catch(Exception e){
        dialog.dismiss();
        System.out.println("Exception : " + e.getMessage());
    }
}

Возможно, вам также будет интересно:

  • Ошибка docker build requires exactly 1 argument
  • Ошибка dnserror яндекс браузер как исправить
  • Ошибка dnserror что значит как исправить
  • Ошибка dns устройства ivms ошибка 119
  • Ошибка dns серверу не удается разрешить имена серверов службы xbox live

  • Понравилась статья? Поделить с друзьями:
    0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии