Okay,
here's the deal. I am designing a "Craigslist" type deal using php/MySql.
I have everything down pat, EXCEPT I cannot figure out how to enter a simple search field (in HTML) where people can browse by city.
I have a little, no, very little experience with PhP. So, when I add the code, please know that everything I have is in BETA form, and is far from validation standards. So far, it all woks, except, I cannot figure out how to link a simple page that allows you to browse by cit.
Okay, here is the page that I am trying to get to:
<?php
require("header.php");
echo"<font size='5'>";
echo"General Header";
echo"</font>";
// Make a MySQL Connection
mysql_connect("fakeserver", "model_login", "fakepassword") or die(mysql_error());
mysql_select_db("model_login") or die(mysql_error());
// Get all the data from the "myfiles" table
$result = mysql_query("SELECT * FROM myfiles ORDER BY 1 DESC")
or die(mysql_error());
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table
echo"<center>";
echo"<table width='800' height='500' bgcolor='CCCCCC' cellpadding='2' cellspacing='10'>";
echo"<tr><td>";
echo"<b>";
echo $row['username'];
echo"<br>";
echo"From: ";
echo $row['city'];
echo"</td></tr>";
echo"<br>";
echo"<tr align='center' bgcolor='CCCCFF' border='10'><td align='center'>";
echo"<font size='2'>";
echo $row['description'];
echo"</font>";
echo"</td>";
echo"<br>";
echo"<td align='center'>";
echo "<img width='330' height='300' src=\"junk/".$row['file']."\" >";
echo"<br>";
echo"<table width='250'>";
echo"Ad Number-><font size='4' color='red'>";
echo $row['RecordID'];
echo"<br>";
echo"<font size='2' color='000000'><B>";
echo"To flag this ad, enter the AdNumber (in red), and a description as to why, then<br> hit the flag button";
echo"</table>";
echo"</td></tr></table>";
echo"<br>";
echo"<br>";
echo"<FORM METHOD='POST' ACTION='flag.php'>AdNumber<INPUT TYPE='text' NAME='ID' SIZE=3>
Brief FLAG reason:<INPUT TYPE='text' Name='reason' Size='30'><INPUT TYPE='SUBMIT' Name='Flag' value='FLAG'></form>";
echo"<br>";
echo"_________________________________________________________________________________________";
}
?>
I am just looking for a simple, one box form that will let you (again), put in a city, and browse people who submitted an ad, depending on the city their ad was posted with. Also, I was looking for a way to change this "flag" system that I have concocted, because it is kinda lame. I would rather try to find a way to have a simple one-button way. ACtually, If there was a way to propogate the AdNumber $variable in a hidden HTML text feild , I would do that. I'm sure there is, but, again, I am less than a novice PhP writer. My main concern is the search. I just want to get it right, and done.
ANY HELP is greatly appriciated -(besides being told to go back to school)-
Thank You Ω