wattsup88 Posted January 12, 2007 Share Posted January 12, 2007 I was just wondering if you can make cool interactive features with PHP? What i mean by that is like drop down interactive menus and cool looking stuff like that... Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted January 12, 2007 Share Posted January 12, 2007 No. PHP is nothing like javascript. PHP allows you to create a dynamic sites, such as a blog, forum or whatever. It cannot be used for rich media content like drag and drop, pull down menu's etc. Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 12, 2007 Share Posted January 12, 2007 If you mean on a web site in your browser, that's Javascript, not Java. If you mean a program you run on your computer, yes, PHP can make those too, but it's meant for dynamic web sites, not applications. Quote Link to comment Share on other sites More sharing options...
taith Posted January 12, 2007 Share Posted January 12, 2007 not by the way that your probably thinking... php is finished processing by the time it hits the browser... however... php can echo out javascript... so you can automate many javascript functions through php... for example...[code]<?function status_decrypt($text, $link, $status){ global $statusdecrypt, $head; if(!isset($statusdecrypt)){ $statusdecrypt=1; $head .='<SCRIPT LANGUAGE="JavaScript"><!--'; $head .='var data="0123456789";'; $head .='var done=1;'; $head .='function statusIn(text){'; $head .=' decrypt(text,2,1);'; $head .='}'; $head .='function statusOut(){'; $head .=' self.status = \'\';'; $head .=' done=1;'; $head .='}'; $head .='function decrypt(text, max, delay){'; $head .=' if(done){'; $head .=' done=0;'; $head .=' decrypt_helper(text, max, delay, 0, max);'; $head .=' }'; $head .='}'; $head .='function decrypt_helper(text, runs_left, delay, charvar, max){'; $head .=' if(!done){'; $head .=' runs_left = runs_left - 1;'; $head .=' var status = text.substring(0, charvar);'; $head .=' for(var current_char = charvar; current_char < text.length; current_char++){'; $head .=' status += data.charAt(Math.round(Math.random()*data.length));'; $head .=' }'; $head .=' window.status=status;'; $head .=' var rerun = "decrypt_helper(\'" + text + "\'," + runs_left + "," + delay + "," + charvar + "," + max + ");"'; $head .=' var new_char = charvar + 1;'; $head .=' var next_char="decrypt_helper(\'" + text + "\'," + max + "," + delay + "," + new_char + "," + max + ");"'; $head .=' if(runs_left > 0){'; $head .=' setTimeout(rerun, delay);'; $head .=' }else{'; $head .=' if(charvar < text.length){'; $head .=' setTimeout(next_char, Math.round(delay*(charvar+3)/(charvar+1)));'; $head .=' }else{'; $head .=' done=1;'; $head .=' }'; $head .=' }'; $head .=' }'; $head .='}'; $head .='--></script>'; } return '<a href="'.$link.'" onMouseOver="statusIn("'.$status.'");return true;" onMouseOut="statusOut();">'.$text.'</a>';}?>[/code]or to that effect :-) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.