50787

Создание динамических страниц

Лабораторная работа

Информатика, кибернетика и программирование

Цель:Научиться создавать динамические страницы Задание1. Создать форму с 2-мя полями и кнопкой и настроить отправку данных на другой файл.

Русский

2014-01-30

25.5 KB

3 чел.

Лабораторная работа 75

Тема: Создание динамических страниц

Цель:Научиться создавать динамические страницы

Задание1. Создать форму с 2-мя полями и кнопкой и настроить отправку данных на другой файл.
<?php

echo"<html>";

echo"<head><title>форма</title></head>";

echo "<body><form  action='vvivd.php' method='get'>";

echo" Login:<input type=text name='login'><br>";

echo" Пароль:<input type=password name='pas'><br>";

echo" <input type=submit value='Отправить'>";

?>

Задание 2 Настроить запись информации из 2-го файла в БД.

<?php

$one=mysql_real_escape_string($_GET['login']);

$two=mysql_real_escape_string($_GET['pas']);

mysql_connect("localhost","lion","8");

mysql_select_db("lion");

mysql_query("CREATE TABLE ST(number INT,Name TEXT)");

mysql_query("INSERT INTO st(number,Name) VALUES('$one','$two')")

or die(mysql_error());

mysql_close();

?>

<?php

mysql_connect("localhost","lion","8");

//$s='CREATE  SD';

mysql_select_db("lion");

$q = mysql_query("SELECT * FROM st");

echo "В таблице mytable ".mysql_num_fields($q)." полей ";

//

$rows=mysql_num_rows($q);

for ($i=0;$i<$rows;$i++)

{

   $no=mysql_result($q,$i,'number');

   $name=mysql_result($q,$i,'Name');

   print "<br>

   Номер: $no

   Название: $name    

";

}?>


 

А также другие работы, которые могут Вас заинтересовать

13713. Do you agree or disagree with the following statement? Advertising can tell you a lot about a country. Use specific reasons and examples to support your answer 1.84 KB
  Do you agree or disagree with the following statement Advertising can tell you a lot about a country. Use specific reasons and examples to support your answer. Every country has its own culture and traditions. There is no doubt that an advertising campaign conducted in Russia will not have the same affect here in the United States. Let us take for example advertisement of food and restaurants. A huge amount of fast food stands suggest their services for breakfast lunch di...
13714. A gift (such as a camera, a soccer ball, or an animal) can contribute to a child’s development. What gift would you give to help a child develop? Why? Use reasons and specific examples to support your choice 2.45 KB
  A gift such as a camera a soccer ball or an animal can contribute to a childs development. What gift would you give to help a child develop Why Use reasons and specific examples to support your choice. People learn and develop throughout their entire lives. I think that in our modern world it is very essential to be familiar with computer technology. So if I had a chance to give a child a gift it would be a computer. I think that computers play an essential role in our lives and ...
13715. Would you prefer to live in a traditional house or in a modern apartment building? Use specific reasons and details to support your choice 2.25 KB
  Would you prefer to live in a traditional house or in a modern apartment building Use specific reasons and details to support your choice. If I was asked where I would I prefer to live in a traditional house or in a modern apartment building I think I would hesitate to answer. This question from my point of view is a controversial one. In the following paragraphs I will analyze both these options and present my view. From the one side living in a modern apartment building bri...
13716. If you could study a subject that you have never had the opportunity to study, what would you choose? Explain your choice, using specific reasons and details 1.8 KB
  If you could study a subject that you have never had the opportunity to study what would you choose Explain your choice using specific reasons and details. If I would have the opportunity to study a subject I do not know yet I would choose to study the outer space. I have a Bachelor degree in Management and I like to have the possibilities to work in this field. However I was always interested in the space exploration. I think it is a very interesting and challenging job to w...
13717. Do you agree or disagree with the following statement? Attending a live performance (for example, a play, concert, or sporting event) is more enjoyable than watching the same event on television. Use specific reasons and examples to support your opinion 1.89 KB
  Do you agree or disagree with the following statement Attending a live performance for example a play concert or sporting event is more enjoyable than watching the same event on television. Use specific reasons and examples to support your opinion. The issue whether to attend a live performance or enjoy watching the same event on TV is a controversial one. However in my opinion an intermediate position can be taken. I base my suggestion on the following points. But before I begin I...
13718. Do you agree or disagree with the following statement? People should read only those books that are about real events, real people, and established facts. Use specific reasons and details to support your opinion 5.36 KB
  Do you agree or disagree with the following statement People should read only those books that are about real events real people and established facts. Use specific reasons and details to support your opinion. Some people think that fiction books have no use at all. They claim that people should read about real events that took place real people and established facts. I have to totally disagree with this statement. From my everyday experience and observation I can stand that fiction...
13719. It has been said, “Not everything that is learned is contained in books.” Compare and contrast knowledge gained from experience with knowledge gained from books. In your opinion, which source is more important? Why? 2.02 KB
  It has been said Not everything that is learned is contained in books. Compare and contrast knowledge gained from experience with knowledge gained from books. In your opinion which source is more important Why People are learning and practicing through their entire life. I believe that life experience and practice are the basic reasons of the humankind's evolution. However in my opinion knowledge gained from books plays a very important role in the modern life. The mo...
13720. It is sometimes said that borrowing money from a friend can harm or damage the friendship. Do you agree? Why or why not? Use reasons and specific examples to explain your answer 2.35 KB
  It is sometimes said that borrowing money from a friend can harm or damage the friendship. Do you agree Why or why not Use reasons and specific examples to explain your answer. I think that borrowing money from a friend has some negative aspects and can harm or damage the friendship in some cases. For example a person borrowed some money from his or her friend and did not return it. However I believe that borrowing money from a friend and returning it on time can not harm friendship...
13721. What are some important qualities of a good supervisor (boss)? Use specific details and examples to explain why these qualities are important 1.82 KB
  What are some important qualities of a good supervisor boss Use specific details and examples to explain why these qualities are important. Many people have to work under somebody's supervision. In most cases an employee does not choose his or her boss unless a supervisor is elected. In the following paragraphs I will list the most important qualities of my ideal boss. First of all he must be impartial. I believe that it is very important to make a technical decision think ...