PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
wait, I think I know how I'll go about it using your suggestion, let me know your thoughts on this.
I'll use <img src="myJavaScript.js" height=1 width=1 />
and in the script, I'll set a cookie and use php to check and make sure that cookie exists. That'd bring both cookie testing, javascript testing, and image testing that could filter out most bots. Good idea to do it this way or not?
Having trouble grabbing the cookie my javascript is setting in php. php doesn't seem to be recognizing the cookie that the javascript is setting. is this right?
setCookie("imgchk", imgchk, 0);
function SetCookie(cookieName,cookieValue,nDays) {
var today = new Date();
var expire = new Date();
if (nDays==null || nDays==0) nDays=1;
expire.setTime(today.getTime() + 3600000*24*nDays);
document.cookie = cookieName+"="+escape(cookieValue)
+ ";expires="+expire.toGMTString();
}
looks like the javascript isn't even creating the cookie. Obviously, it's either not getting called, or somethings wrong with the imgchk.js code, Any ideas anyone? please helpe!
EDIT: Yeah, tested it. It's the javascript not getting called. Can I not call a script this way? Everything I've read says yes, but I've never done it.