I know it's probably easy but I just can't solve it. Please help. This is a little SUBMIT submit.php form that i wrote
<form method="POST" action="x.php" name="XForm">
<p>
<select name="Rubrika">
<option value="A">Alien</option>
<option value="B">Buffalo</option>
</select></p>
<textarea name="Oglasi" rows="4" cols="60"></textarea>
<br>
<br>
<input type="submit" name="submit" value="submit">
<br>
<input type="hidden" name="MM_insert" value="true">
</form>
Now this is how x.php looks like:
<?php
if (isset($_POST['MM_insert'])) {
mysql_query("INSERT INTO oglasi (Oglas, Rubrika, Datum) VALUES ('".$POST['Oglas']."', '".$POST['Rubrika']."', '".date("Y-m-d H:i_s")."')");
}
?>
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<?php
$datum=time();
$datum=$datum-186400;
$datum=getdate($datum);
$datum=$datum['year']."-".$datum['mon']."-".$datum['mday'];
//$datum = date("Y-m-").(date("d")-10).date(" H:i:s");
$strSQL = mysql_query("SELECT FROM oglasi WHERE Rubrika = '".$_GET['Rubrika']."' AND Datum >= '$datum' ORDER BY id DESC");
while ($r = mysql_fetch_array($strSQL)) {
?>
<tr>
<td><?php print datum_iz_mysql($r['Datum']); ?><?php print r['Oglas'];?></td>
</tr>
<?php } ?>
PROBLEM IS:
Let's say A stands for Alien and B for Buffalo. Now, x.php works fine as long as I click either link Alien or Buffalo on my left menu bar, because both links have this statements
<a href="malioglasi_arhiv.php?column=Alien"> or
<a href="malioglasi_arhiv.php?column=Buffalo">
But when I submit a new entry, a new Alien, x.php will not show any record. And that is because there is no parameter in this statement
<form method="POST" action="x.php" name="OglasiForm">
When I experiment and write this:
<form method="POST" action="x.php?column=A" name="OglasiForm">
x.php will show all records with Aliens in that particular column
but since in my submit form (look the code from submit.php) I choose either Alien or Buffalo option value I need some sort of parameter to tell x.php document which entry was made and wich records it has to show. For ex if I choose Alien and submit new entry I would like that x.php page to show all Alien records and vice versa. As I say right now it shows no record when I submit a new one
I hope this makes it clear what my problem is and I am really looking forward to hearing from someone who can help me solve this.
Thanks