c0d3r Posted February 8, 2011 Report Share Posted February 8, 2011 Есть поле ввода текста input, нужно чтобы когда пользователь что то ввёл и нажал enter осуществлялся переход по ссылке.Как такое сделать? Никак не пойму. Quote Link to comment Share on other sites More sharing options...
0 rus Posted February 8, 2011 Report Share Posted February 8, 2011 что значит переход по ссылке?в теге <form> есть путь до обработчика формы (action="..."), написанном на серверном языке сценариев php и выглядет так: <form method="..." action="mail.php"> - где mail.php и есть обработчик. Quote Link to comment Share on other sites More sharing options...
0 c0d3r Posted February 8, 2011 Author Report Share Posted February 8, 2011 Самой формы нет, есть одно поле ввода input.И когда пользователь введёт в неё текст и нажмёт enter, надо чтобы он перешёл на другую страницу.Не могли бы вы показать на примере, что то вообще не пойму как сделать? Quote Link to comment Share on other sites More sharing options...
0 Vlad Posted February 8, 2011 Report Share Posted February 8, 2011 <form action="ссылка"><input></form> Quote Link to comment Share on other sites More sharing options...
0 rus Posted February 8, 2011 Report Share Posted February 8, 2011 index.php<form method="POST" action="tvoya_stranica.php"><input type="text" name="test"><input type="submit" value="Отправить"></form>tvoya_stranica.php<?php$test = $_POST['test'];echo "вы ввели на предыдущей странице следующий текст: $test";?>можно в принципе и без:<input type="submit" value="Отправить"> Quote Link to comment Share on other sites More sharing options...
0 c0d3r Posted February 8, 2011 Author Report Share Posted February 8, 2011 Спасибо большое! то что надо Quote Link to comment Share on other sites More sharing options...
0 Int Posted February 8, 2011 Report Share Posted February 8, 2011 написанном на серверном языке сценариев phpК чему эта дезинформация новичков? Quote Link to comment Share on other sites More sharing options...
Question
c0d3r
Есть поле ввода текста input, нужно чтобы когда пользователь что то ввёл и нажал enter осуществлялся переход по ссылке.
Как такое сделать? Никак не пойму.
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.