cloudy243 Posted April 10, 2009 Share Posted April 10, 2009 I have a file (index.php) containing the following code. <script type="text/javascript" language="javascript"> function img() { var post=prompt("Please enter the image link","http://"); var MyElement = document.getElementById("post_box"); MyElement.value = MyElement.value + "[img=" + post + "]"; } function code() { var code=prompt("Paste the code here.",""); var MyElement = document.getElementById("post_box"); MyElement.value = MyElement.value + "[code]" + code + " "; } function link() { var url=prompt("Please enter the url link.","http://"); var urlpage=prompt("Please enter the text to be shown.",""); var MyElement = document.getElementById("post_box"); MyElement.value = MyElement.value + "http://" + url + "" + "[urlpage]" + urlpage + "[/urlpage]"; } function center() { var cen=prompt("Please enter the centered text.",""); var MyElement = document.getElementById("post_box"); MyElement.value = MyElement.value + "[cen]" + cen + "[/cen]"; } function bold() { var b=prompt("Please enter the bold text.",""); var MyElement = document.getElementById("post_box"); MyElement.value = MyElement.value + "" + b + ""; } function italic() { var i=prompt("Please enter the italic text.",""); var MyElement = document.getElementById("post_box"); MyElement.value = MyElement.value + "" + i + ""; } function underline() { var u=prompt("Please enter the underlined text.",""); var MyElement = document.getElementById("post_box"); MyElement.value = MyElement.value + "" + u + ""; } function omg() { var MyElement = document.getElementById("post_box"); MyElement.value = MyElement.value + "[omg]"; } function show_buttons(show) { if (show == smilies) { document.getElementById('smile_1').style.visibility='visible'; document.getElementById('smile_2').style.visibility='visible'; document.getElementById('smile_3').style.visibility='visible'; document.getElementById('smile_4').style.visibility='visible'; document.getElementById('smile_5').style.visibility='visible'; document.getElementById('smile_6').style.visibility='visible'; document.getElementById('smile_7').style.visibility='visible'; document.getElementById('smile_8').style.visibility='visible'; document.getElementById('smile_9').style.visibility='visible'; document.getElementById('smile_10').style.visibility='visible'; document.getElementById('smile_11').style.visibility='visible'; document.getElementById('smile_12').style.visibility='visible'; document.getElementById('smile_13').style.visibility='visible'; document.getElementById('smile_14').style.visibility='visible'; document.getElementById('smile_15').style.visibility='visible'; document.getElementById('smile_16').style.visibility='visible'; document.getElementById('smile_17').style.visibility='visible'; document.getElementById('smile_18').style.visibility='visible'; document.getElementById('smile_19').style.visibility='visible'; document.getElementById('smile_20').style.visibility='visible'; document.getElementById('smile_21').style.visibility='visible'; document.getElementById('smile_22').style.visibility='visible'; document.getElementById('smile_23').style.visibility='visible'; document.getElementById('smile_24').style.visibility='visible'; document.getElementById('smile_25').style.visibility='visible'; document.getElementById('smile_26').style.visibility='visible'; document.getElementById('smile_27').style.visibility='visible'; document.getElementById('smile_28').style.visibility='visible'; document.getElementById('smile_29').style.visibility='visible'; document.getElementById('smile_30').style.visibility='visible'; document.getElementById('smile_31').style.visibility='visible'; document.getElementById('smile_32').style.visibility='visible'; document.getElementById('smile_33').style.visibility='visible'; document.getElementById('smile_34').style.visibility='visible'; document.getElementById('smile_35').style.visibility='visible'; document.getElementById('smile_36').style.visibility='visible'; document.getElementById('smile_37').style.visibility='visible'; document.getElementById('smile_38').style.visibility='visible'; document.getElementById('smile_39').style.visibility='visible'; document.getElementById('smile_40').style.visibility='visible'; document.getElementById('smile_41').style.visibility='visible'; } else { document.getElementById('smile_1').style.visibility='hidden'; document.getElementById('smile_2').style.visibility='hidden'; document.getElementById('smile_3').style.visibility='hidden'; document.getElementById('smile_4').style.visibility='hidden'; document.getElementById('smile_5').style.visibility='hidden'; document.getElementById('smile_6').style.visibility='hidden'; document.getElementById('smile_7').style.visibility='hidden'; document.getElementById('smile_8').style.visibility='hidden'; document.getElementById('smile_9').style.visibility='hidden'; document.getElementById('smile_10').style.visibility='hidden'; document.getElementById('smile_11').style.visibility='hidden'; document.getElementById('smile_12').style.visibility='hidden'; document.getElementById('smile_13').style.visibility='hidden'; document.getElementById('smile_14').style.visibility='hidden'; document.getElementById('smile_15').style.visibility='hidden'; document.getElementById('smile_16').style.visibility='hidden'; document.getElementById('smile_17').style.visibility='hidden'; document.getElementById('smile_18').style.visibility='hidden'; document.getElementById('smile_19').style.visibility='hidden'; document.getElementById('smile_20').style.visibility='hidden'; document.getElementById('smile_21').style.visibility='hidden'; document.getElementById('smile_22').style.visibility='hidden'; document.getElementById('smile_23').style.visibility='hidden'; document.getElementById('smile_24').style.visibility='hidden'; document.getElementById('smile_25').style.visibility='hidden'; document.getElementById('smile_26').style.visibility='hidden'; document.getElementById('smile_27').style.visibility='hidden'; document.getElementById('smile_28').style.visibility='hidden'; document.getElementById('smile_29').style.visibility='hidden'; document.getElementById('smile_30').style.visibility='hidden'; document.getElementById('smile_31').style.visibility='hidden'; document.getElementById('smile_32').style.visibility='hidden'; document.getElementById('smile_33').style.visibility='hidden'; document.getElementById('smile_34').style.visibility='hidden'; document.getElementById('smile_35').style.visibility='hidden'; document.getElementById('smile_36').style.visibility='hidden'; document.getElementById('smile_37').style.visibility='hidden'; document.getElementById('smile_38').style.visibility='hidden'; document.getElementById('smile_39').style.visibility='hidden'; document.getElementById('smile_40').style.visibility='hidden'; document.getElementById('smile_41').style.visibility='hidden'; } } </script> <img src="/forumz/pictures/buttons/smiley.png" name="smilies_show" id="smilies_show" onclick="show_buttons(smilies);"> <table id="Table_02" width="100%" height="65" border="0" cellpadding="0" cellspacing="0"> <tr> <td> <img src="pictures/smilies/omg.png" name="smile_1" id="smile_1" width="30" heigh="30" onclick="omg()" style="visibility: hidden"> </td> <td> <img src="pictures/smilies/omg.png" name="smile_2" id="smile_2" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_3" id="smile_3" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_4" id="smile_4" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_5" id="smile_5" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_6" id="smile_6" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_7" id="smile_7" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_8" id="smile_8" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_9" id="smile_9" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_10" id="smile_10" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_11" id="smile_11" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_12" id="smile_12" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_13" id="smile_13" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_14" id="smile_14" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_15" id="smile_15" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_16" id="smile_16" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_17" id="smile_17" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_18" id="smile_18" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_19" id="smile_19" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_20" id="smile_20" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_21" id="smile_21" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_22" id="smile_22" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_23" id="smile_23" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_24" id="smile_24" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_25" id="smile_25" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_26" id="smile_26" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_27" id="smile_27" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_28" id="smile_28" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_29" id="smile_29" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_30" id="smile_30" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_31" id="smile_31" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_32" id="smile_32" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_33" id="smile_33" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_34" id="smile_34" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_35" id="smile_35" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_36" id="smile_36" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_37" id="smile_37" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_28" id="smile_28" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_39" id="smile_39" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_40" id="smile_40" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_41" id="smile_41" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> </tr> </table>[/code] When you visit the site and click the picture, it does not change visibility so the smilies remain hidden. If i try this though with only one smile it works. What is wrong, can anyone help. Quote Link to comment https://forums.phpfreaks.com/topic/153433-solved-htmljavascript-in-a-php-file-what-am-i-doing-wrong/ Share on other sites More sharing options...
cloudy243 Posted April 10, 2009 Author Share Posted April 10, 2009 oops code left the box because there was a end code in my script. here i am just gona change it, just know that it still exists <script type="text/javascript" language="javascript"> function img() { var post=prompt("Please enter the image link","http://"); var MyElement = document.getElementById("post_box"); MyElement.value = MyElement.value + "[img=" + post + "]"; } function code() { var code=prompt("Paste the code here.",""); var MyElement = document.getElementById("post_box"); MyElement.value = MyElement.value + "[code]" + code + "[/ccooddee]" "; } function link() { var url=prompt("Please enter the url link.","http://"); var urlpage=prompt("Please enter the text to be shown.",""); var MyElement = document.getElementById("post_box"); MyElement.value = MyElement.value + "" + url + "" + "[urlpage]" + urlpage + "[/urlpage]"; } function center() { var cen=prompt("Please enter the centered text.",""); var MyElement = document.getElementById("post_box"); MyElement.value = MyElement.value + "[cen]" + cen + "[/cen]"; } function bold() { var b=prompt("Please enter the bold text.",""); var MyElement = document.getElementById("post_box"); MyElement.value = MyElement.value + "" + b + ""; } function italic() { var i=prompt("Please enter the italic text.",""); var MyElement = document.getElementById("post_box"); MyElement.value = MyElement.value + "" + i + ""; } function underline() { var u=prompt("Please enter the underlined text.",""); var MyElement = document.getElementById("post_box"); MyElement.value = MyElement.value + "" + u + ""; } function omg() { var MyElement = document.getElementById("post_box"); MyElement.value = MyElement.value + "[omg]"; } function show_buttons(show) { if (show == smilies) { document.getElementById('smile_1').style.visibility='visible'; document.getElementById('smile_2').style.visibility='visible'; document.getElementById('smile_3').style.visibility='visible'; document.getElementById('smile_4').style.visibility='visible'; document.getElementById('smile_5').style.visibility='visible'; document.getElementById('smile_6').style.visibility='visible'; document.getElementById('smile_7').style.visibility='visible'; document.getElementById('smile_8').style.visibility='visible'; document.getElementById('smile_9').style.visibility='visible'; document.getElementById('smile_10').style.visibility='visible'; document.getElementById('smile_11').style.visibility='visible'; document.getElementById('smile_12').style.visibility='visible'; document.getElementById('smile_13').style.visibility='visible'; document.getElementById('smile_14').style.visibility='visible'; document.getElementById('smile_15').style.visibility='visible'; document.getElementById('smile_16').style.visibility='visible'; document.getElementById('smile_17').style.visibility='visible'; document.getElementById('smile_18').style.visibility='visible'; document.getElementById('smile_19').style.visibility='visible'; document.getElementById('smile_20').style.visibility='visible'; document.getElementById('smile_21').style.visibility='visible'; document.getElementById('smile_22').style.visibility='visible'; document.getElementById('smile_23').style.visibility='visible'; document.getElementById('smile_24').style.visibility='visible'; document.getElementById('smile_25').style.visibility='visible'; document.getElementById('smile_26').style.visibility='visible'; document.getElementById('smile_27').style.visibility='visible'; document.getElementById('smile_28').style.visibility='visible'; document.getElementById('smile_29').style.visibility='visible'; document.getElementById('smile_30').style.visibility='visible'; document.getElementById('smile_31').style.visibility='visible'; document.getElementById('smile_32').style.visibility='visible'; document.getElementById('smile_33').style.visibility='visible'; document.getElementById('smile_34').style.visibility='visible'; document.getElementById('smile_35').style.visibility='visible'; document.getElementById('smile_36').style.visibility='visible'; document.getElementById('smile_37').style.visibility='visible'; document.getElementById('smile_38').style.visibility='visible'; document.getElementById('smile_39').style.visibility='visible'; document.getElementById('smile_40').style.visibility='visible'; document.getElementById('smile_41').style.visibility='visible'; } else { document.getElementById('smile_1').style.visibility='hidden'; document.getElementById('smile_2').style.visibility='hidden'; document.getElementById('smile_3').style.visibility='hidden'; document.getElementById('smile_4').style.visibility='hidden'; document.getElementById('smile_5').style.visibility='hidden'; document.getElementById('smile_6').style.visibility='hidden'; document.getElementById('smile_7').style.visibility='hidden'; document.getElementById('smile_8').style.visibility='hidden'; document.getElementById('smile_9').style.visibility='hidden'; document.getElementById('smile_10').style.visibility='hidden'; document.getElementById('smile_11').style.visibility='hidden'; document.getElementById('smile_12').style.visibility='hidden'; document.getElementById('smile_13').style.visibility='hidden'; document.getElementById('smile_14').style.visibility='hidden'; document.getElementById('smile_15').style.visibility='hidden'; document.getElementById('smile_16').style.visibility='hidden'; document.getElementById('smile_17').style.visibility='hidden'; document.getElementById('smile_18').style.visibility='hidden'; document.getElementById('smile_19').style.visibility='hidden'; document.getElementById('smile_20').style.visibility='hidden'; document.getElementById('smile_21').style.visibility='hidden'; document.getElementById('smile_22').style.visibility='hidden'; document.getElementById('smile_23').style.visibility='hidden'; document.getElementById('smile_24').style.visibility='hidden'; document.getElementById('smile_25').style.visibility='hidden'; document.getElementById('smile_26').style.visibility='hidden'; document.getElementById('smile_27').style.visibility='hidden'; document.getElementById('smile_28').style.visibility='hidden'; document.getElementById('smile_29').style.visibility='hidden'; document.getElementById('smile_30').style.visibility='hidden'; document.getElementById('smile_31').style.visibility='hidden'; document.getElementById('smile_32').style.visibility='hidden'; document.getElementById('smile_33').style.visibility='hidden'; document.getElementById('smile_34').style.visibility='hidden'; document.getElementById('smile_35').style.visibility='hidden'; document.getElementById('smile_36').style.visibility='hidden'; document.getElementById('smile_37').style.visibility='hidden'; document.getElementById('smile_38').style.visibility='hidden'; document.getElementById('smile_39').style.visibility='hidden'; document.getElementById('smile_40').style.visibility='hidden'; document.getElementById('smile_41').style.visibility='hidden'; } } </script> <img src="/forumz/pictures/buttons/smiley.png" name="smilies_show" id="smilies_show" onclick="show_buttons(smilies);"> <table id="Table_02" width="100%" height="65" border="0" cellpadding="0" cellspacing="0"> <tr> <td> <img src="pictures/smilies/omg.png" name="smile_1" id="smile_1" width="30" heigh="30" onclick="omg()" style="visibility: hidden"> </td> <td> <img src="pictures/smilies/omg.png" name="smile_2" id="smile_2" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_3" id="smile_3" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_4" id="smile_4" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_5" id="smile_5" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_6" id="smile_6" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_7" id="smile_7" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_8" id="smile_8" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_9" id="smile_9" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_10" id="smile_10" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_11" id="smile_11" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_12" id="smile_12" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_13" id="smile_13" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_14" id="smile_14" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_15" id="smile_15" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_16" id="smile_16" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_17" id="smile_17" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_18" id="smile_18" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_19" id="smile_19" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_20" id="smile_20" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_21" id="smile_21" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_22" id="smile_22" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_23" id="smile_23" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_24" id="smile_24" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_25" id="smile_25" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_26" id="smile_26" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_27" id="smile_27" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_28" id="smile_28" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_29" id="smile_29" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_30" id="smile_30" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_31" id="smile_31" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_32" id="smile_32" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_33" id="smile_33" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_34" id="smile_34" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_35" id="smile_35" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_36" id="smile_36" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_37" id="smile_37" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_28" id="smile_28" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_39" id="smile_39" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_40" id="smile_40" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_41" id="smile_41" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> </tr> </table> Quote Link to comment https://forums.phpfreaks.com/topic/153433-solved-htmljavascript-in-a-php-file-what-am-i-doing-wrong/#findComment-806150 Share on other sites More sharing options...
cloudy243 Posted April 10, 2009 Author Share Posted April 10, 2009 btw what this code is doing is having hidden images (smilies) that will show up after you click a button. Quote Link to comment https://forums.phpfreaks.com/topic/153433-solved-htmljavascript-in-a-php-file-what-am-i-doing-wrong/#findComment-806155 Share on other sites More sharing options...
briant Posted April 10, 2009 Share Posted April 10, 2009 I don't know javascript but it looks like your problem lies in the javascript. Javascript works fine in php documents. It doesn't seem you are including it inside the php body so if the javascript is right, it should work. Quote Link to comment https://forums.phpfreaks.com/topic/153433-solved-htmljavascript-in-a-php-file-what-am-i-doing-wrong/#findComment-806158 Share on other sites More sharing options...
cloudy243 Posted April 10, 2009 Author Share Posted April 10, 2009 ok thanks does anyone know where i could post this in a place that knows more about javascript? Quote Link to comment https://forums.phpfreaks.com/topic/153433-solved-htmljavascript-in-a-php-file-what-am-i-doing-wrong/#findComment-806159 Share on other sites More sharing options...
briant Posted April 10, 2009 Share Posted April 10, 2009 What you can do is remove all functions but just the first. And test it out one by one. If it works, go on to the next til you find the function with the problem. Just a suggestion, I'm no pro. Quote Link to comment https://forums.phpfreaks.com/topic/153433-solved-htmljavascript-in-a-php-file-what-am-i-doing-wrong/#findComment-806161 Share on other sites More sharing options...
cloudy243 Posted April 10, 2009 Author Share Posted April 10, 2009 ok thanks i will start testing now, hopefully i can find the problem, but i have been trying to make this work all day lol. Quote Link to comment https://forums.phpfreaks.com/topic/153433-solved-htmljavascript-in-a-php-file-what-am-i-doing-wrong/#findComment-806164 Share on other sites More sharing options...
cloudy243 Posted April 10, 2009 Author Share Posted April 10, 2009 ok i found problem and have fixed the new code is (this time i am giving my whole php document) <? include_once("global/css.php"); ?> <script type="text/javascript" language="javascript"> function img() { var post=prompt("Please enter the image link","http://"); var MyElement = document.getElementById("post_box"); MyElement.value = MyElement.value + "[img=" + post + "]"; } function code() { var code=prompt("Paste the code here.",""); var MyElement = document.getElementById("post_box"); MyElement.value = MyElement.value + "[code]" + code + "[/ccooddee]"; } function link() { var url=prompt("Please enter the url link.","http://"); var urlpage=prompt("Please enter the text to be shown.",""); var MyElement = document.getElementById("post_box"); MyElement.value = MyElement.value + "[url=http://" + url + "]" + url + "[/url]" + "[urlpage]" + urlpage + "[/urlpage]"; } function center() { var cen=prompt("Please enter the centered text.",""); var MyElement = document.getElementById("post_box"); MyElement.value = MyElement.value + "[cen]" + cen + "[/cen]"; } function bold() { var b=prompt("Please enter the bold text.",""); var MyElement = document.getElementById("post_box"); MyElement.value = MyElement.value + "[b]" + b + "[/b]"; } function italic() { var i=prompt("Please enter the italic text.",""); var MyElement = document.getElementById("post_box"); MyElement.value = MyElement.value + "[i]" + i + "[/i]"; } function underline() { var u=prompt("Please enter the underlined text.",""); var MyElement = document.getElementById("post_box"); MyElement.value = MyElement.value + "[u]" + u + "[/u]"; } function omg() { var MyElement = document.getElementById("post_box"); MyElement.value = MyElement.value + "[omg]"; } function show_buttons(show) { if (show == 'smilies') { document.getElementById('smile_1').style.visibility='visible'; document.getElementById('smile_2').style.visibility='visible'; document.getElementById('smile_3').style.visibility='visible'; document.getElementById('smile_4').style.visibility='visible'; document.getElementById('smile_5').style.visibility='visible'; document.getElementById('smile_6').style.visibility='visible'; document.getElementById('smile_7').style.visibility='visible'; document.getElementById('smile_8').style.visibility='visible'; document.getElementById('smile_9').style.visibility='visible'; document.getElementById('smile_10').style.visibility='visible'; document.getElementById('smile_11').style.visibility='visible'; document.getElementById('smile_12').style.visibility='visible'; document.getElementById('smile_13').style.visibility='visible'; document.getElementById('smile_14').style.visibility='visible'; document.getElementById('smile_15').style.visibility='visible'; document.getElementById('smile_16').style.visibility='visible'; document.getElementById('smile_17').style.visibility='visible'; document.getElementById('smile_18').style.visibility='visible'; document.getElementById('smile_19').style.visibility='visible'; document.getElementById('smile_20').style.visibility='visible'; document.getElementById('smile_21').style.visibility='visible'; document.getElementById('smile_22').style.visibility='visible'; document.getElementById('smile_23').style.visibility='visible'; document.getElementById('smile_24').style.visibility='visible'; document.getElementById('smile_25').style.visibility='visible'; document.getElementById('smile_26').style.visibility='visible'; document.getElementById('smile_27').style.visibility='visible'; document.getElementById('smile_28').style.visibility='visible'; document.getElementById('smile_29').style.visibility='visible'; document.getElementById('smile_30').style.visibility='visible'; document.getElementById('smile_31').style.visibility='visible'; document.getElementById('smile_32').style.visibility='visible'; document.getElementById('smile_33').style.visibility='visible'; document.getElementById('smile_34').style.visibility='visible'; document.getElementById('smile_35').style.visibility='visible'; document.getElementById('smile_36').style.visibility='visible'; document.getElementById('smile_37').style.visibility='visible'; document.getElementById('smile_38').style.visibility='visible'; document.getElementById('smile_39').style.visibility='visible'; document.getElementById('smile_40').style.visibility='visible'; document.getElementById('smile_41').style.visibility='visible'; } else { document.getElementById('smile_1').style.visibility='hidden'; document.getElementById('smile_2').style.visibility='hidden'; document.getElementById('smile_3').style.visibility='hidden'; document.getElementById('smile_4').style.visibility='hidden'; document.getElementById('smile_5').style.visibility='hidden'; document.getElementById('smile_6').style.visibility='hidden'; document.getElementById('smile_7').style.visibility='hidden'; document.getElementById('smile_8').style.visibility='hidden'; document.getElementById('smile_9').style.visibility='hidden'; document.getElementById('smile_10').style.visibility='hidden'; document.getElementById('smile_11').style.visibility='hidden'; document.getElementById('smile_12').style.visibility='hidden'; document.getElementById('smile_13').style.visibility='hidden'; document.getElementById('smile_14').style.visibility='hidden'; document.getElementById('smile_15').style.visibility='hidden'; document.getElementById('smile_16').style.visibility='hidden'; document.getElementById('smile_17').style.visibility='hidden'; document.getElementById('smile_18').style.visibility='hidden'; document.getElementById('smile_19').style.visibility='hidden'; document.getElementById('smile_20').style.visibility='hidden'; document.getElementById('smile_21').style.visibility='hidden'; document.getElementById('smile_22').style.visibility='hidden'; document.getElementById('smile_23').style.visibility='hidden'; document.getElementById('smile_24').style.visibility='hidden'; document.getElementById('smile_25').style.visibility='hidden'; document.getElementById('smile_26').style.visibility='hidden'; document.getElementById('smile_27').style.visibility='hidden'; document.getElementById('smile_28').style.visibility='hidden'; document.getElementById('smile_29').style.visibility='hidden'; document.getElementById('smile_30').style.visibility='hidden'; document.getElementById('smile_31').style.visibility='hidden'; document.getElementById('smile_32').style.visibility='hidden'; document.getElementById('smile_33').style.visibility='hidden'; document.getElementById('smile_34').style.visibility='hidden'; document.getElementById('smile_35').style.visibility='hidden'; document.getElementById('smile_36').style.visibility='hidden'; document.getElementById('smile_37').style.visibility='hidden'; document.getElementById('smile_38').style.visibility='hidden'; document.getElementById('smile_39').style.visibility='hidden'; document.getElementById('smile_40').style.visibility='hidden'; document.getElementById('smile_41').style.visibility='hidden'; } } </script> <?php if (@$_SESSION['auth'] != "yes") { echo "Please Login."; } else { $security_code = rand(); $name = @$_SESSION['logname']; $_SESSION['security']=$security_code; $_SESSION['post_check']=rand(); $host = "localhost"; $user = "BLOCKED"; $pass = "BLOCKED"; $base = "wizll_forumzmembers"; $cxn = mysqli_connect($host,$user,$pass,$base) or die ("Connection failed"); $sql = "SELECT * FROM posts ORDER BY position"; $result = mysqli_query($cxn,$sql) or die ("Query failed"); while($row = mysqli_fetch_array($result)) { echo '<table width="100%" border="1">'; echo '<tr><td width="20%">'; echo "<center>"; echo $row['user']; echo "</center>"; echo '</td><td width="80%">'; echo "Subject: "; echo $row['subject']; echo '</td></tr><tr><td>'; echo "<center>"; if ($row['rank'] == 10) { echo '<img src="pictures/buttons/admin.png" alt="">'; } if ($row['rank'] == 9) { echo '<img src="pictures/buttons/admin.png" alt="">'; } if ($row['rank'] == { echo '<img src="pictures/buttons/mod.png" alt="">'; } $num_posts = $row['posts']; echo "<br>Posts:$num_posts"; echo "</center>"; echo "</td><td>"; $post_put = nl2br($row['post']); echo '<div id="post">'; echo $post_put; echo '</div>'; echo "</td></tr><tr><td>"; echo "Posted: "; echo $row['post_time']; echo "</td><td>"; // make is so when you click edit/quote it will edit/quote that post, not the last post on that page // ask how on php freaks echo '<script type="text/javascript" language="javascript">'; echo 'function quote() { var old_post = "[quote]" + "'; echo $row['user']; echo '[br]" + "'; echo $row['post']; echo '" + "[/quote]"; var MyElement = document.getElementById("post"); MyElement.value = old_post; } </script>'; echo '<img src="pictures/buttons/quote.png" alt="" onclick="quote()"><img src="pictures/buttons/PM.png" alt="">'; $name_3 = @$_SESSION['logname']; if ($row['user'] == $name_3) { //make it so it deletes the old post you are editing echo '<script type="text/javascript" language="javascript">'; echo 'function edit() { var old_post = "'; echo $row['post']; echo '"; var MyElement = document.getElementById("post"); MyElement.value = old_post; var override = "'; $override = "true"; $position_override = $row['position']; echo $override; echo '"; var position_override = "'; echo $position_override; echo '"; var MyElement = document.getElementById("override"); MyElement.value = override; var MyElement = document.getElementById("position_override"); MyElement.value = position_override; } </script>'; echo '<img src="pictures/buttons/edit.png" alt="" onclick="edit()">'; } echo "</td></tr>"; echo "</table>"; echo "<br>"; } ?> <br /> <form action="posted.php" method="post"> Quick Post: <br> Subject: <input type="textbox" name="post_subject" value=""><br> <img src="pictures/buttons/img.png" alt="" onclick="img()"> <img src="/forumz/pictures/buttons/smiley.png" name="smilies_show" id="smilies_show" onclick="show_buttons('smilies');"> <img src="pictures/buttons/code.png" alt="" onclick="code()"> <img src="pictures/buttons/url.png" alt="" onclick="link()"><br /> <textarea rows="9" name="post_box" id="post_box" cols="90"></textarea> <br /> <input type="hidden" name="security_code" value=" <?php $security_code = @$_SESSION['security']; echo $security_code; echo '" /> <input type="hidden" name="override" id="override" value=""><input type="hidden" name="position_override" id="position_override" value=""><input type="submit" value="Post" /> </form> <form action="post.php" method="post"> <input type="submit" value="Go Advanced" /> } <table id="Table_02" width="100%" height="65" border="0" cellpadding="0" cellspacing="0"> <tr> <td> <img src="pictures/smilies/omg.png" name="smile_1" id="smile_1" width="30" heigh="30" onclick="omg()" style="visibility: hidden"> </td> <td> <img src="pictures/smilies/omg.png" name="smile_2" id="smile_2" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_3" id="smile_3" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_4" id="smile_4" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_5" id="smile_5" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_6" id="smile_6" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_7" id="smile_7" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_8" id="smile_8" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_9" id="smile_9" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_10" id="smile_10" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_11" id="smile_11" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_12" id="smile_12" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_13" id="smile_13" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_14" id="smile_14" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_15" id="smile_15" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_16" id="smile_16" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_17" id="smile_17" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_18" id="smile_18" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_19" id="smile_19" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_20" id="smile_20" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_21" id="smile_21" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_22" id="smile_22" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_23" id="smile_23" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_24" id="smile_24" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_25" id="smile_25" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_26" id="smile_26" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_27" id="smile_27" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_28" id="smile_28" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_29" id="smile_29" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_30" id="smile_30" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_31" id="smile_31" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_32" id="smile_32" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_33" id="smile_33" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_34" id="smile_34" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_35" id="smile_35" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_36" id="smile_36" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_37" id="smile_37" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_28" id="smile_28" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_39" id="smile_39" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_40" id="smile_40" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> <td> <img src="pictures/smilies/omg.png" name="smile_41" id="smile_41" width="30" heigh="30" onclick="omg()" style="visibility: hidden"></td> </tr> </table>'; ?> But when i visit the site i get this error Parse error: syntax error, unexpected $end in /home/wizll/public_html/forumzbb.com/forumz/index.php on line 359 Why is the ?> being unexpected i have the ; and everything else. Quote Link to comment https://forums.phpfreaks.com/topic/153433-solved-htmljavascript-in-a-php-file-what-am-i-doing-wrong/#findComment-806170 Share on other sites More sharing options...
cloudy243 Posted April 10, 2009 Author Share Posted April 10, 2009 please i think it will have a simple answer it will just take some time to read the script, but please read it. After i get rid of this error i think it will be 100% working except for my other problem (on another topic) Quote Link to comment https://forums.phpfreaks.com/topic/153433-solved-htmljavascript-in-a-php-file-what-am-i-doing-wrong/#findComment-806179 Share on other sites More sharing options...
briant Posted April 10, 2009 Share Posted April 10, 2009 Please be patient. There's so much going on. After the Go Advanced button, what is that bracket for? Also, with the bottom blotch. You don't need to make all that inside an echo. You should just end the php code and then start on with the html code. I am off to bed now. Quote Link to comment https://forums.phpfreaks.com/topic/153433-solved-htmljavascript-in-a-php-file-what-am-i-doing-wrong/#findComment-806183 Share on other sites More sharing options...
cloudy243 Posted April 10, 2009 Author Share Posted April 10, 2009 Thanks briant i followed what you said and fixed it up. The file now works and my site is back online. Just took a little time of messing around with the script. Quote Link to comment https://forums.phpfreaks.com/topic/153433-solved-htmljavascript-in-a-php-file-what-am-i-doing-wrong/#findComment-806191 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.