I have great fath in you when it comes to db.s and some other php coding however.. in this.. case i dont think that will work. (* but i will give it a try .. and get back )
EDIT : sorry didnt work..
funcition openWindow() has..
theURL, "indexsecure.php", but something goes wrong there i think.
Well, looking at it again, function abrirVentana(theURL) does require a url to be passed in, but it's being called from function CargaString() like this,
abrirVentana('indexsecure.php') .. so it does pass in a url
So i'm not sure you should be calling both
abrirVentana();
CargaString();
but maybe just CargaString();
Not sure what function openWindow() is that you mention above as you don't mention it in your original post
function openWindow(theURL)
{
var cadena;
var ancho, alto;
ancho = screen.availWidth - 10;
alto = screen.availHeight - 50;
cadena = 'left=0,top=0,border=0,status=yes,scrollbars=no,toolbar=no,menubar=no,location=no,resizable=yes,' + 'width=' + ancho + ',height=' + alto;
window.open(theURL, "for title bar ... ", cadena);
}
function CargaString()
{
window.status = "Welcome to ..........;
var yourname = getCookie("USERNAME");
if (yourname != null)
{
//Ha cargado el sitio previamente
// meaning cookie did got set..
Tiempo = setTimeout("openWindow('indexsecure.php')", 500);
}
else
{
//No ha cargado el sitio previamente
// meaning cookie didnt got set "GO BACK TO START "
register("USERNAME");
Tiempo = setTimeout("openWindow('indexsecure0.php')", 500);
}
}
//-->
</script>
</head>
<? echo $_COOKIE['USERNAME']; ?> // does echo back the cookie
// /here it stops doing its job.
<body onload="CargaString();" bgcolor="#5d5d60" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
Nice noticing that .. however it does still produce this error
The requested URL /user/undefined was not found on this server.
=====================================================
Apache/1.3.29 Server at localhost.localhost Port 443
function getCookie(Name)
{
var search = Name + "="
if (document.cookie.length > 0)
{ // if there are any cookies
offset = document.cookie.indexOf(search)
if (offset != -1)
{ // if cookie exists
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset)
// set index of end of cookie value
if (end == -1)
end = document.cookie.length
return unescape(document.cookie.substring(offset, end))
}
}
}