Код за новини

C++ JAVA
Post Reply
RaDo0o_16
Нов
Нов
Posts: 141
Joined: Mon May 18, 2009 4:08 pm
Location: Белослав
Contact:

Код за новини

Post by RaDo0o_16 » Thu Sep 24, 2009 7:55 pm

Значи искам да си добавя в сайта новини. Намерих си една системка за новини Обаче в админ панела ми дава крешка... Пиши че има грешка в файла admin.php на 12 ред.Как да си го оправя?

SveXteZ
Гуру
Гуру
Posts: 2426
Joined: Thu Jul 24, 2008 12:42 pm
Answers: 68

Post by SveXteZ » Thu Sep 24, 2009 7:59 pm

Като напишеш каква е грешката като за начало ... и дадеш кода около ред 12

RaDo0o_16
Нов
Нов
Posts: 141
Joined: Mon May 18, 2009 4:08 pm
Location: Белослав
Contact:

Post by RaDo0o_16 » Thu Sep 24, 2009 8:09 pm

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at F:\xampp\htdocs\popfolk\admin\admin.php:7) in F:\xampp\htdocs\popfolk\admin\admin.php on line 12

st3akOO7
Нов
Нов
Posts: 4
Joined: Wed Aug 05, 2009 8:31 am
Contact:

..

Post by st3akOO7 » Thu Sep 24, 2009 8:48 pm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>Администраторски панел</title>
<link rel="stylesheet" href="../files/font.css" type="text/css">
<script LANGUAGE="JavaScript" src="../files/script.js" type="text/JavaScript"></script>
</head>
<body>
<?php
.....
значи преди <?php напиши </html>. трябва да стане ето така
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>Администраторски панел</title>
<link rel="stylesheet" href="../files/font.css" type="text/css">
<script LANGUAGE="JavaScript" src="../files/script.js" type="text/JavaScript"></script>
</head>
<body>
</html>
<?php
....

User avatar
Kirev
Нов
Нов
Posts: 180
Joined: Wed Sep 02, 2009 8:29 pm

Post by Kirev » Thu Sep 24, 2009 9:11 pm

И да го напише няма да си реши проблема.
PHP кодът трябва да се намира в body частта на HTML-a.

oniq
Потребител
Потребител
Posts: 625
Joined: Tue Mar 24, 2009 3:17 pm

Post by oniq » Thu Sep 24, 2009 10:23 pm

Kirev wrote:И да го напише няма да си реши проблема.
PHP кодът трябва да се намира в body частта на HTML-a.
Ми грешката ти идва нещо от вида заради тва:

header();

Я бухни най-отгоре над всеки HTML или кфот имаш...

<?
ob_start();
?>

nikitybe
Нов
Нов
Posts: 48
Joined: Sat Jun 21, 2008 8:53 pm

Post by nikitybe » Thu Sep 24, 2009 10:23 pm

Я сложи това в началото на документа. и го махни от 13 ред на admin.php

Code: Select all

<?php
 session_start&#40;&#41;;
?> 
а също така сложи и

Code: Select all

<?
ob_start&#40;&#41;;
?>

User avatar
crazy_pi4
Шаман
Шаман
Posts: 3052
Joined: Sun Jun 17, 2007 4:56 am
Answers: 174

Post by crazy_pi4 » Fri Sep 25, 2009 5:44 am

Code: Select all

<?php
session_start&#40;&#41;;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251"> 
<title>Администраторски панел</title> 
<link rel="stylesheet" href="../files/font.css" type="text/css"> 
<script LANGUAGE="JavaScript" src="../files/script.js" type="text/JavaScript"></script> 
</head> 
<body> 
<?php 
include "../db.php";
$potrebitel= $HTTP_POST_VARS&#91;'potrebitel'&#93;; 
$pas= $HTTP_POST_VARS&#91;'pas'&#93;; 
if &#40;$potrebitel!='admin' || $pas!='admin'&#41; 
&#123;echo " 

"; 
exit;&#125; 
else 
&#123; 
$HTTP_SESSION_VARS&#91;'potrebitel'&#93;= $potrebitel; 

&#125; 
?> 
<table align="center" class="d" cellspacing="0" cellpadding="10"> 
<tr> 
<td> 
<br /> 
<form action="../save.php" method="post" name="form1"> 
<table border="0" cellspacing="2" cellpadding="0" class="e"> 
<tr> 
<td align="right"> 
<b>Име на новината&#58;</b> 
</td> 
<td> 
<input name="ime" size="68"> 
</td> 
</tr> 
<tr> 
<td align="right"> 
<b>Картинка&#58;</b> 
</td> 
<td> 
<input name="kartinka" size="68"> 
</td> 
</tr> 
<tr> 
<td align="right"> 
<b>Пояснение&#58;</b> 
</td> 
<td> 
<textarea name="poqsnenie" cols="65" rows="5"></textarea> 
</td> 
</tr> 
<tr> 
<td width="100"><br> 
<table align="center" class="e"> 
<tr> 
<td colspan="4"> 
<b>Emoticons</b> 
</td> 
</tr> 
<tr> 
<td> 
<a href="javascript&#58;emoticon&#40;'&#58;biggrin&#58;'&#41;;"><img src="smilies/biggrin.gif" border="0" alt="img" ></a> 
</td> 
<td> 
<a href="javascript&#58;emoticon&#40;'&#58;cool&#58;'&#41;;"><img src="smilies/cool.gif" border="0" alt="img"></a> 
</td> 
<td> 
<a href="javascript&#58;emoticon&#40;'&#58;cry&#58;'&#41;;"><img src="smilies/cry.gif" border="0" alt="img"></a> 
</td> 
<td> 
<a href="javascript&#58;emoticon&#40;'&#58;dead&#58;'&#41;;"><img src="smilies/dead.gif" border="0" alt="img"></a> 
</td> 
</tr> 
<tr> 
<td> 
<a href="javascript&#58;emoticon&#40;'&#58;eek&#58;'&#41;;"><img src="smilies/eek.gif" border="0" alt="img"></a> 
</td> 
<td> 
<a href="javascript&#58;emoticon&#40;'&#58;embarrassed&#58;'&#41;;"><img src="smilies/embarrassed.gif" border="0" alt="img"></a> 
</td> 
<td> 
<a href="javascript&#58;emoticon&#40;'&#58;laugh&#58;'&#41;;"><img src="smilies/laugh.gif" border="0" alt="img"></a> 
</td> 
<td> 
<a href="javascript&#58;emoticon&#40;'&#58;love&#58;'&#41;;"><img src="smilies/love.gif" border="0" alt="img"></a> 
</td> 
</tr> 
<tr> 
<td> 
<a href="javascript&#58;emoticon&#40;'&#58;mad&#58;'&#41;;"><img src="smilies/mad.gif" border="0" alt="img"></a> 
</td> 
<td> 
<a href="javascript&#58;emoticon&#40;'&#58;no&#58;'&#41;;"><img src="smilies/no.gif" border="0" alt="img"></a> 
</td> 
<td> 
<a href="javascript&#58;emoticon&#40;'&#58;none&#58;'&#41;;"><img src="smilies/none.gif" border="0" alt="img"></a> 
</td> 
<td> 
<a href="javascript&#58;emoticon&#40;'&#58;rolleyes&#58;'&#41;;"><img src="smilies/rolleyes.gif" border="0" alt="img"></a> 
</td> 
</tr> 
<tr> 
<td> 
<a href="javascript&#58;emoticon&#40;'&#58;sad&#58;'&#41;;"><img src="smilies/sad.gif" border="0" alt="img"></a> 
</td> 
<td> 
<a href="javascript&#58;emoticon&#40;'&#58;smile&#58;'&#41;;"><img src="smilies/smile.gif" border="0" alt="img"></a> 
</td> 
<td> 
<a href="javascript&#58;emoticon&#40;'&#58;smilewinkgrin&#58;'&#41;;"><img src="smilies/smilewinkgrin.gif" border="0" alt="img"></a> 
</td> 
<td> 
<a href="javascript&#58;emoticon&#40;'&#58;wink&#58;'&#41;;"><img src="smilies/wink.gif" border="0" alt="img"></a> 
</td> 
</tr> 
</table> 
</td> 
<td> 
<br /> 
<INPUT onclick="b&#40;&#41;" type="button" value="B" class="button"> 
<INPUT onclick="i&#40;&#41;" type="button" value="I" class="button"> 
<INPUT onclick="u&#40;&#41;" type="button" value="U" class="button"> 
<INPUT onclick="url&#40;&#41;" type="button" value="Url" class="button"> 
<INPUT onclick="email&#40;&#41;" type="button" value="Email" class="button"> 
<br /> 
<textarea name="text" cols="65" rows="9"></textarea> 
</td> 
</tr> 
<tr> 
<td> 
</td> 
<td> 
<center> 
<input name="Submit" type="submit" class="button" value="Изпрати"> 
</center> 
</td> 
</tr> 
</table> 
</form> 
</td> 
</tr> 
</table> 
<br /> 
<table width="65%" align="center"> 
<tr> 
<td><? 

for &#40;$i=$broi; $i>0; $i--&#41; &#123; 
if &#40;is_file&#40;"../posts/".$i.".html"&#41;&#41; &#123; 
include "../posts/".$i.".html"; 

echo"<font size=1>Файл $i.html</font> "; 
echo "<a href='del.php?file=".$i."' class='BlockTextSmall'>Изтриване</a>"; 
echo "<br /><hr />"; 
&#125; 
&#125; 
?> 
</td> 
</tr> 
</table> 
</body> 
</html>

RaDo0o_16
Нов
Нов
Posts: 141
Joined: Mon May 18, 2009 4:08 pm
Location: Белослав
Contact:

Post by RaDo0o_16 » Fri Sep 25, 2009 6:51 am

като сложих този код изобщо неми излиза нищо само син екран и толкова.

RaDo0o_16
Нов
Нов
Posts: 141
Joined: Mon May 18, 2009 4:08 pm
Location: Белослав
Contact:

Post by RaDo0o_16 » Fri Sep 25, 2009 8:10 am

Ако може и някоя подобна система за новини да си сложа в сайта...

Post Reply