Greetings all,
I have a noob php question i need answering if possible..
I simply want to save what ever is typed into the form field for when the page is reloaded to show again.
I know it needs a new session started but im confused alot about what needs changing.
Here is my php of code:
<?php
include("config.php");
if(isset($_POST['submit'])) {
$word=$_POST['q'];
if($word=="") { $error="<font color='red'>Please enter a keyword</font>"; }
if($error=="") {
$sql=mysql_query("SELECT * FROM slogans ORDER BY RAND() LIMIT 1");
$r=mysql_fetch_array($sql);
echo '<font size="6">';
$slogan=$r['slogan'];
$slogan=str_replace("[keyword]",$word,$slogan);
echo $slogan;
echo '</font>';
}
}
echo $error; ?>
And my Form:
<form method="post">
<input type="text" name="q" VALUE="Slogan Maker" size="35" maxlength="255" style="height:38px;font-size:18px;" onFocus="this.value=''"/>
<input type="submit" name="submit" value="Make Slogan!">
</form>
Thanks alot! plz help