PDA

View Full Version : can someone make this please!!!!!!!!!!!



Bonxy
02-06-2008, 07:11 PM
Can anyone make this for me...


i want just a list on 10 on/off buttons with the php to show them...in a mysql database aswell

here is a crappy example:

http://www.bonxy.co.uk/habbo/options.php

Reply below or PM me!

kreechin
02-06-2008, 08:43 PM
so you want a panel to turn on/off the message, and to show a message in an alert box?
I'll get to work on it, should take me like 5 mins.

kreechin
02-06-2008, 09:22 PM
can't edit my post so;
something like this?
http://free-host.ath.cx/alert/form.php - the form
http://free-host.ath.cx/alert/alert.php - the alert

Bonxy
02-06-2008, 09:41 PM
ye... is tht a mysql version tho ?

kreechin
02-06-2008, 09:42 PM
It is yeah :)
I can't work with flat file xD

You know how to make a config file I assume?
alert.php or w.e


<?php
Include ("config.php");
$query = ("SELECT * FROM alert");
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
if ($row[status] == 1) {
echo ("<SCRIPT language='JavaScript'>
alert('Message From Your Site Here Staff: $row[message]');
</SCRIPT>");
} else {
echo ("no alert to show, alerts disabled");
}
}
?>


form.php or w.e


<?
include "config.php";
if (isset($_POST[submit])) {
$status = $_POST[status];
$message = $_POST[message];
$update = mysql_query("UPDATE alert SET status = '".$status."', message = '".$message."' WHERE id = '1'")
or die(mysql_error());
echo ("Alert Preferences Updated!");
} else {
echo ("
<form method='POST' style='text-align: center'>
<p><select size='1' name='status'>
<option value='1' selected>On</option>
<option value='0'>Off</option>
</select></p>
<p><textarea rows='2' name='message' cols='20'></textarea></p>
<p><input type='submit' value='Update Status' name='submit'></p>
</form>");
}
?>


mysql table shizz


CREATE TABLE `alert` (
`id` int(33) NOT NULL default '1',
`status` int(33) NOT NULL default '0',
`message` varchar(255) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `alert`
--

INSERT INTO `alert` VALUES (1, 1, 'Hmm. :)');

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