PDA

View Full Version : Java Alerts



Drompo
10-01-2007, 05:18 PM
On DJ Panels you have Alert.php with the following code

<form method='post' action='alert.php?act=create'>

<table>

<tr>

<td>Message:</td>

<td><textarea name='message' cols='30' rows='6'></textarea></td>

</tr>

<tr>

<td></td>

<td><input type='submit' value='Create'></td>

</form>";

break;



case"create":

$message = $_POST['message'];

if(empty($message)){

Echo"<b>Error:</b> Please fill out the message.";

exit;

}

mysql_query("UPDATE alert SET active ='N'");

mysql_query("INSERT INTO alert (message,name,active) VALUES ('$message', '$_SESSION[session_username]', 'Y')");



Echo"<b>Alert Added Sucessfully</b><br>

All other alerts have been deactivated. All users will recieve this alert

once, until you deactivate it.";

break;



case"deactivate":

mysql_query("UPDATE alert SET active ='N'");

Echo"<b>Alerts Deactivated</b><br>

All previous alerts have been deactivated.";

break;



}

?>

How do you make these alerts appear on the site?
+Rep for answer

Lysine
10-01-2007, 05:28 PM
<iframe name="I2" src="ALERTFILE" width="3%" height="1" frameborder="0" align="center"></iframe>

Add that at the bottom of your index page and it should work.

Dentafrice1
13-01-2007, 02:25 AM
Well you need a file to pull it out of the DB then display it. Or more advanced set a cookie which means it only shows up once

Want to hide these adverts? Register an account for free!