.


:




:

































 

 

 

 


, ,




. , , [1].

PHPMyAdmin 2.6.1. :

1) : http://localhost/Tools/phpMyAdmin/;

2) ( 3.3)

. 3.3

 

3) interteach . , SQL ( 3.4):

 

. 3.4

 

( 8):

 

8. SQL

CREATE TABLE `settings` (

`id` int(2) NOT NULL auto_increment,

`title` varchar(255) NOT NULL,

`text` text NOT NULL,

`parent` int(2) NOT NULL,

PRIMARY KEY (`id`)

) ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=cp1251 AUTO_INCREMENT=12;

 

INSERT INTO `settings` VALUES (2, ' ', ' " " . ', 0);

INSERT INTO `settings` VALUES (3, ' ', ' " " . .', 0);

INSERT INTO `settings` VALUES (4, ' ', ' " " . .', 0);

INSERT INTO `settings` VALUES (5, ' ', '<p> " " . .</p>', 0);

INSERT INTO `settings` VALUES (6, ' ', '<p> " " . .</p>', 0);

INSERT INTO `settings` VALUES (7, '', '<p> "" . .</p>', 0);

INSERT INTO `settings` VALUES (8, '', '<p> "" . .</p>', 0);

INSERT INTO `settings` VALUES (1, '', '<p><span class="style-main"> InterTeach </span> <strong> :</strong>\r\n<ul>\r\n<li> , ; </li>\r\n<li> , , ;</li>\r\n<li> , , ;</li>\r\n<li> ./ . ();</li>\r\n<li> <span class="style-main"> </span> 2 . </li>\r\n</ul>\r\n</p><p> .</p>\r\n', 0);

 

CREATE TABLE `userlist` (

`id` int(3) NOT NULL auto_increment,

`user` varchar(50) NOT NULL,

`pass` varchar(50) NOT NULL,

PRIMARY KEY (`id`)

) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=cp1251 AUTO_INCREMENT=2;

 

INSERT INTO `userlist` VALUES (1, 'eiti1994', 'kafedrais');

 

4) , , ( 3.5)

. 3.5

 

5) PHPMyADMIN . ( 3.6)

. 3.6

 

6) . index.php view.php. index.php , view.php . 2 .

7) blocks php bd.php. Interteach. ( 9):

9.

<?php $db = mysql_connect ("localhost","admin","819g12hiez");

mysql_select_db ("interteach",$db);?>

 

mysql_connect server MySQL , , , . username password . mysql_select_db USE SQL-, . . mysql_select_db , SQL- .

 

8) Dreamweaver index.php. . , , ( 10):

10.

<?php include ("blocks/bd.php");/* */

$result = mysql_query ("SELECT title, text FROM settings WHERE id='1'",$db);

 

if (!result){

echo "<p> . .<br>

<strong> :</strong>

</p>";

exit(mysql_error());}

if (mysql_num_rows($result)>0){

$myrow = mysql_fetch_array ($result);}

else{

echo "<p> . </p>";

exit();}

?>

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

<html>

<head>

<title> Interteach - <?php echo $myrow ['title'];?></title>

<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">

<link rel="stylesheet" type="text/css" href="cssverticalmenu.css" />

<script type="text/javascript" src="cssverticalmenu.js">

</script>

<link rel="stylesheet" type="text/css" href="style.css" />

</head>

<body>

<div id="container">

<!-- -->

<?php include ("blocks/header.php");?>

<div id="wrapper">

<div id="content">

<h2> !</h2>

<div id="topicwhite">

<?php echo $myrow ['text'];?>

</div>

</div>

</div>

<!-- -->

<?php include ("blocks/form.php");?>

<!-- -->

<?php include ("blocks/reklama.php");?>

<!-- "" -->

<?php include ("blocks/footer.php");?>

</div>

</body>

</html>

 

mysql_query SQL-. mysql_fetch_array , mysql_query.

9) , view.php, navigation.php, ( 11)

11.

<?php

include ("blocks/bd.php");/* */

$result2 = mysql_query ("SELECT * FROM settings WHERE parent='0' ORDER BY id",$db);

$myrow2 = mysql_fetch_array ($result2);

?>

<div id="navigation">

<ul id="verticalmenu" class="glossymenu">

<?php

do

{

printf ("<li><a href='view.php?id=%s'>%s</a>", $myrow2['id'],$myrow2['title']);

$d=$myrow2['id'];

$result3 = mysql_query ("SELECT * FROM settings WHERE parent=\"$d\"",$db);

$myrow3 = mysql_fetch_array ($result3);

$c=mysql_num_rows($result3);

if ($c!='0')

{

echo "<ul>";

do

{

printf ("<li><a href='view.php?id=%s'>%s</a></li>", $myrow3['id'],$myrow3['title']);

}

while ($myrow3 = mysql_fetch_array ($result3));

echo "</ul></li>";

}

else {echo "</li>";}

}

while ($myrow2 = mysql_fetch_array ($result2));

?>

</ul></div>

 

10) , id view.php $_GET['id']. view.php ( 12):

 

12. view.php

<?php include ("blocks/bd.php");/* */

if (isset($_GET['id'])) {$id=$_GET['id'];}

$result = mysql_query ("SELECT title, text FROM settings WHERE id='$id'",$db);

$myrow = mysql_fetch_array ($result);

?>

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

<html>

<head>

<title> Interteach - <?php echo $myrow ['title'];?></title>

<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">

<link rel="stylesheet" type="text/css" href="cssverticalmenu.css" />

<script type="text/javascript" src="cssverticalmenu.js">

</script>

<link rel="stylesheet" type="text/css" href="style.css" />

</head>

<body>

<div id="container">

<!-- -->

<?php include ("blocks/header.php");?>

<div id="wrapper">

<div id="content">

<h2><?php echo $myrow ['title'];?></h2>

<div id="topicwhite">

<?php echo $myrow ['text'];?>

</div>

</div>

</div>

<!-- -->

<?php include ("blocks/form.php");?>

<!-- -->

<?php include ("blocks/reklama.php");?>

<!-- "" -->

<?php include ("blocks/footer.php");?>

</div>

</body>

</html>

 

 





:


: 2017-02-28; !; : 344 |


:

:

,
==> ...

1589 - | 1353 -


© 2015-2024 lektsii.org - -

: 0.028 .