<html>
<?php ... phpcode here... ?>
</html>
<?php
echo " simply type html here ";
?>
/* PAGE OUTPUT */ - NEWPAGE
<?php
// Prevent Cross Site XSS Scripting input
function sanitize($string) {
return mysql_real_escape_string($string);
}
// Prevent Cross Site XSS scripting output
function clean($output) {
return htmlspecialchars($output);
}
IF ($_POST['earth']) {
$mars = sanitize($_POST['mars']);
$venus = sanitize($_POST['venus']);
$uranus = sanitize($_POST['uranus']);
$jupiter = sanitize($_POST['jupiter']);
$sun = sanitize($_POST['sun']);
$moon = sanitize($_POST['moon']);
$full_sentence = "$mars $venus $uranus $jupiter $sun $moon";
$result = dbquery("SELECT * FROM ".DB_ARTICLES." WHERE articles_snippet LIKE '%".$full_sentence."' ORDER BY article_datestamp ASC");
$rows = dbrows($result);
opentable("Your page search results yield: $rows number of results..");
echo "<ul>\n";
while ($data = dbarray($result)) {
// CHECK FROM YOUR _articles table what you need..
$article_subject = clean($data['article_subject']);
$article_article= clean($data['article_subject']);
$article_datestamp= clean($data['article_subject']);
$article_reads= clean($data['article_subject']);
echo "<li> $article_subject, $article_article, $article_datestamp, $article_reads</li>\n";
}
echo "</ul>\n";
closetable();
}
?>
/* PAGE INPUT */ -- NEW PAGE
<?php
// remember to use ' instead of " because we open echo with ", inside must be ' if you open echo with ' then inside is "
// search internet to differentiate between ' and " in php. It's simple.
echo "
<form name='inputform' method='post' action='page2.php'>
<table width='100%'>
<tr><td>I want to : </td><td> <select name='mars'><option>rent</option></select> </td></tr>
<tr><td><input type='button' name='earth' value='Search My Home'></td></tr>
</table>
</form>
";
?>
// remember to use ' instead of " because we open echo with ", inside must be ' if you open echo with ' then inside is "
// search internet to differentiate between ' and " in php. It's simple.
echo "
<form name='inputform' method='post' action='page2.php'>
<table width='50%'>
<tr><td>Tip Tranzactie : </td><td> <select name='mars'><option> </option><option>de vanzare</option><option>de inchiriat</option></select> </td></tr>
<tr><td>Tip Imobil: </td><td> <select name='venus'><option> </option><option>garsoniera</option><option>apartament 1 camera</option><option>apartament 2 camere</option><option>apartament 3 camere</option><option>apartament 4 camere</option><option>apartament 5 camere</option><option>casa</option><option>teren</option><option>spatiu comercial</option></select> </td></tr>
<tr><td>Cartier: </td><td> <select name='uranus'><option> </option><option>Andrei Muresanu</option><option>Borhanci</option><option>Bulgaria</option><option>Buna Ziua</option><option>Central</option><option>Dambu Rotund</option><option>Europa</option><option>Faget</option><option>Gara</option><option>Gheorgheni</option><option>Grigorescu</option><option>Gruia</option><option>Intre Lacuri</option><option>Iris</option><option>Manastur</option><option>Marasti</option><option>Plopilor</option><option>Someseni</option><option>Zorilor</option></select> </td></tr>
<tr><td><input type='button' name='earth' value='Cauta'></td></tr>
</table>
</form>
";
?>
<?php
// Prevent Cross Site XSS Scripting input
function sanitize($string) {
return mysql_real_escape_string($string);
}
// Prevent Cross Site XSS scripting output
function clean($output) {
return htmlspecialchars($output);
}
IF ($_POST['earth']) {
$mars = sanitize($_POST['mars']);
$venus = sanitize($_POST['venus']);
$uranus = sanitize($_POST['uranus']);
$full_sentence = "$mars $venus $uranus";
$result = dbquery("SELECT * FROM ".DB_ARTICLES." WHERE articles_snippet LIKE '%".$full_sentence."' ORDER BY article_datestamp ASC");
$rows = dbrows($result);
opentable("Your page search results yield: $rows number of results..");
echo "<ul>\n";
while ($data = dbarray($result)) {
// CHECK FROM YOUR _articles table what you need..
$article_subject = clean($data['article_subject']);
$article_article= clean($data['article_subject']);
$article_datestamp= clean($data['article_subject']);
$article_reads= clean($data['article_subject']);
echo "<li> $article_subject, $article_article, $article_datestamp, $article_reads</li>\n";
}
echo "</ul>\n";
closetable();
}
?>
while ($data = dbarray($result)) {
// CHECK FROM YOUR _articles table what you need..
$article_subject = clean($data['article_subject']);
$article_article= clean($data['article_subject']);
$article_datestamp= clean($data['article_subject']);
$article_reads= clean($data['article_subject']);
echo "<li> $article_subject, $article_article, $article_datestamp, $article_reads</li>\n";
openside("This is where your title goes");
echo "
<form name='inputform' method='post' action='"BASEDIR."search_home.php'>
<table width='50%'>
<tr><td>Tip Tranzactie : </td><td> <select name='mars'><option> </option><option>de vanzare</option><option>de inchiriat</option></select> </td></tr>
<tr><td>Tip Imobil: </td><td> <select name='venus'><option> </option><option>garsoniera</option><option>apartament 1 camera</option><option>apartament 2 camere</option><option>apartament 3 camere</option><option>apartament 4 camere</option><option>apartament 5 camere</option><option>casa</option><option>teren</option><option>spatiu comercial</option></select> </td></tr>
<tr><td>Cartier: </td><td> <select name='uranus'><option> </option><option>Andrei Muresanu</option><option>Borhanci</option><option>Bulgaria</option><option>Buna Ziua</option><option>Central</option><option>Dambu Rotund</option><option>Europa</option><option>Faget</option><option>Gara</option><option>Gheorgheni</option><option>Grigorescu</option><option>Gruia</option><option>Intre Lacuri</option><option>Iris</option><option>Manastur</option><option>Marasti</option><option>Plopilor</option><option>Someseni</option><option>Zorilor</option></select> </td></tr>
<tr><td><input type='button' name='earth' value='Cauta'></td></tr>
</table>
</form>
";
closeside();
<?php
require_once "maincore.php";
require_once THEMES."templates/header.php";
// Prevent Cross Site XSS Scripting input
function sanitize($string) {
return mysql_real_escape_string($string);
}
// Prevent Cross Site XSS scripting output
function clean($output) {
return htmlspecialchars($output);
}
IF ($_POST['earth']) {
$mars = sanitize($_POST['mars']);
$venus = sanitize($_POST['venus']);
$uranus = sanitize($_POST['uranus']);
$jupiter = sanitize($_POST['jupiter']);
$sun = sanitize($_POST['sun']);
$moon = sanitize($_POST['moon']);
$full_sentence = "$mars $venus $uranus $jupiter $sun $moon";
$result = dbquery("SELECT * FROM ".DB_ARTICLES." WHERE articles_snippet LIKE '%".$full_sentence."' ORDER BY article_datestamp ASC");
$rows = dbrows($result);
if (dbrows($result) >= "1") {
opentable("Your page search results yield: $rows number of results..");
echo "<table width='100%'>\n";
while ($data = dbarray($result)) {
// CHECK FROM YOUR _articles table what you need..
$article_subject = clean($data['article_subject']);
$article_article= clean($data['article_subject']);
$article_datestamp= clean($data['article_subject']);
$article_reads= clean($data['article_subject']);
// Format your output beautifully in css here.
echo "<tr><td>
This is the subject= $article_subject
<br>
This is the article= $article_article </td></tr>\n";
}
echo "</table>\n";
closetable();
} else {
opentable("No Result");
echo "Sorry there is no result from your search.";
closetable();
}
}
require_once THEMES."templates/footer.php";
?>
opentable("title goes here");
closetable();
<form name='inputform' method='post' action='".BASEDIR."search_home.php'>
while ($data = dbarray($result)) {
// CHECK FROM YOUR _articles table what you need..
$article_subject = clean($data['article_subject']);
$article_article= clean($data['article_subject']);
$article_datestamp= clean($data['article_subject']);
$article_reads= clean($data['article_subject']);
<input type='button' name='earth' value='Cauta'>
<input type='submit' name='earth' value='Cauta'>
Quote
Should work. and will get no result. If you're working on photogallery album, which field are you searching? the title? the description?
Category Forum
Modifications and Requests - 8Labels
None yet
Statistics
2 participants
Notifications
You are not receiving notifications from this thread.
Related Questions