There is no SQL needed with it.
is the code.PHP Code:<head>
<script language="javascript" type="text/javascript"> alert('
<? echo(file_get_contents("alert.txt"); ?>
'); </script>
Printable View
There is no SQL needed with it.
is the code.PHP Code:<head>
<script language="javascript" type="text/javascript"> alert('
<? echo(file_get_contents("alert.txt"); ?>
'); </script>
Have you created alert.txt and CHMOD'd it?
- Dan
Not sure then.
- Dan
That should work.PHP Code:<?
echo "<script language='javascript' type='text/javascript'> alert('";
include "alert.txt";
echo "'); </script>";
?>
w00t it worked thanks <3
Now, this will probably be simple, but I need a simple php script or whatever that will write a new message to the alert.txt file by typing it in a text box or something.
Rob
I won't do the HTML because its to easy, but heres the php
Create a form with a text box called alertPHP Code:<?
if ($_SERVER['REQUEST_METHOD'] != 'GET'){
$alert= $_POST['alert'];
$file = fopen("alert.txt", "w+");
fputs($file, $alert);
fclose($file);
echo "'$alert' has been broadcasted!";
?>
Hope this helped ;)
Or you could do it that way *sigh*Quote:
Originally Posted by Tomdarkness2
Will that also only send the alert once?
Its better because it dosent keep showing the alert to the vister everytime the alert.php refreshes lol xDQuote:
Originally Posted by Luckyrare
Thanks.
But it aint working.
http://www.wackyhabbo.co.uk/hab-tastic/alerts/alert.php is just blank and shows no alert
and http://www.wackyhabbo.co.uk/hab-tast...rts/script.php becomes blank when you have typed a message.
Any suggestions anyone? <3