Hello all,
Since I have only been use PHP for several months, I consider my self a
difinte beginner. I have been helped many times by this group. Special
thanks to Adam Lang and my buddy Joel Wickard. I thought I would post
some of the code in the hope it can help some others.
Here is a java script to run a message in the bottom bar of the
browser. The problem I have was inserting the php code. It seemed easy
at first, but as always, it's the little things that cause the most
problems. Note the quotes around the php code inside the java script.
Thease are required.
mysql_select_db($database) or die("Unable to select $datbase");
$queryA = "SELECT * FROM webadmin WHERE login != '$null'";
$linkA = mysql_query($queryA) or die("<font color=red>could not find
Account! error-"
. mysql_error() . "<br>\nquery - $queryA</font>");
if ($myadmin = mysql_fetch_array($linkA))
{
$javamsg = $myadmin["default_msg"];
}
if ($javamsg == $null){
$javamsg = "This could be a standard message, if none is found in the
webadmin table.";
}
?>
<script language="JavaScript">
function scroll_status (seed)
{
var msg = "<?php echo ("$javamsg"); ?>"
var out = " ";
var c = 1;
if (150 < seed) {
seed--;
var cmd="scroll_status(" + seed + ")";
timerTwo = window.setTimeout(cmd, 100);
}
else if (seed <= 150 && 0 < seed) {
for (c=0 ; c < seed ; c++) {
out+=" ";
}
out+=msg;
seed--;
var cmd="scroll_status(" + seed + ")";
window.status=out;
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 0) {
if (-seed < msg.length) {
out+=msg.substring(-seed,msg.length);
seed--;
var cmd="scroll_status(" + seed + ")";
window.status=out;
timerTwo=window.setTimeout(cmd,100);
}
else {
window.status=" ";
timerTwo=window.setTimeout("scroll_status(150)",100);
}
}
}
// -- End of JavaScript code -------------- -->
</script>
Again, thanks to all in this group.
Richard D. Williams