из файла find.php
CODE (text):
скопировать код в буфер обмена
скопировать код в буфер обмена
- <?php
- include 'c.php';
- echo head("Ïîèñê");
- echo lpanel();
- $findit=$_POST['find'];
- $in=$_POST['in'];
- if($find) {
- if($in=='catalog') {
- $q="select id, name, text, pic from catalog";
- $q=mysql_query($q) or die(me(mysql_error()));
- while($r=mysql_fetch_assoc($q)) if(stristr($r['name'], $find) or stristr($r['title'], $find)) catalog($r['id'], $r['name'], $r['text'], $r['pic'], $find);
- } elseif($in=='site') {
- $q="select id, title, text from content";
- $q=mysql_query($q) or die(me(mysql_error()));
- while($r=mysql_fetch_assoc($q)) if(stristr($r['text'], $find)) echo "<a href='pages.php?page={$r['id']}'>{$r['title']}</a>
- ";
- }
- } else {
- echo "
- <form action='find.php' method='post'>
- Ïîèñê ïî:
- <input type='radio' name='in' value='site' /> ñàéò
- <input type='radio' name='in' value='catalog' /> êàòàëîã
- <input style='width: 100%;' type='text' name='find' value='' />
- <input type='submit' name='find' value='Èñêàòü' />
- </form>
- ";
- }
- echo fin();
- ?>