| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| New Member | Adding chatbox Hi, I want to add a chatbox to my site: http://www.cbox.ws/ ------> basically just generates a html code for you to put on your site. Is this AJAX? Cuz I tried making a chat_box.php file and it turned out with all these weird symbols. If it's AJAX, can someone kinda point me in the direction of what I would have to do? (I've never done ajax..) Thanks in advance
__________________ PM me for a banner. Last edited by twizzlers; 07-21-2008 at 01:56 PM. |
| |
| | #2 (permalink) |
| Your face is regfee! | It's using Ajax for those other things, so if you want to keep it like that, I guess you'll need Ajax. You could mimic what it's doing in php or javascript, but it wouldn't work exactly the same way. I can't help with ajax, though, I've never worked with it before. |
| |
| | #4 (permalink) |
| Senior Member | Daniel's method is probably the best way to do it without actually messing with AJAX, but it might be helpful to use javascript here. try doing something like: Code: <html>
<head>
<script>
function show(x) {
document.getElementById('divelementname').style.visibility=visible;
}
</script>
</head>
<body>
<div id="chatbox" style="visibility:hidden;">
<?php include("chatbox.php"); ?>
</div>
<input type="button" value="Chat!" onSubmit="show('chatbox')">
</body>
</html>
__________________ Hacksar.com - Your source for random computer tips and tricks! MySiteMemberships.com - Keep track of your site registration information! Like my post? Rep is appreciated! |
| |
| | #5 (permalink) |
| New Member | So I put that in my layout.php file, but where do I put the code for the chatbox? In the layout place or do I make a separate chatbox.php file? This is the chatbox code - it's just html right? Do I have to put these php things around it (<?php and ?>) Code: <!-- BEGIN CBOX - www.cbox.ws --> <div align="center" id="cboxdiv"> <iframe frameborder="0" width="300" height="100" src="http://www4.cbox.ws/box/?boxid=3522815&boxtag=zacwjc&sec=main" marginheight="2" marginwidth="2" scrolling="auto" allowtransparency="yes" name="cboxmain" style="border:#DBE2ED 1px solid;" id="cboxmain"></iframe><br/> <iframe frameborder="0" width="300" height="75" src="http://www4.cbox.ws/box/?boxid=3522815&boxtag=zacwjc&sec=form" marginheight="2" marginwidth="2" scrolling="no" allowtransparency="yes" name="cboxform" style="border:#DBE2ED 1px solid;border-top:0px" id="cboxform"></iframe> </div> <!-- END CBOX -->
__________________ PM me for a banner. |
| |
| | #6 (permalink) | |
| Your face is regfee! | Quote:
Yes, it's just an html code. You don't have to put the <?php and ?> around it. My homepage does that same thing using javascript. I did it a while back just to see if I could. | |
| |
| | #7 (permalink) |
| New Member | why isn't this working?? I put this in my layout.php Code: <script>
function show(x) {
document.getElementById('divelementname').style.vi sibility=visible;
}
</script>
</head>
<body>
<?php include('includes/chat-box.html'); ?>
</div>
<input type="button" value="Chat!" onSubmit="show('chatbox')">
Code: <!-- BEGIN CBOX - www.cbox.ws --> <div align="center" id="cboxdiv"><div class="chat-box"> <iframe frameborder="0" width="300" height="100" src="http://www4.cbox.ws/box/?boxid=3522815&boxtag=zacwjc&sec=main" marginheight="2" marginwidth="2" scrolling="auto" allowtransparency="yes" name="cboxmain" style="border:#DBE2ED 1px solid;" id="cboxmain"></iframe><br/> <iframe frameborder="0" width="300" height="75" src="http://www4.cbox.ws/box/?boxid=3522815&boxtag=zacwjc&sec=form" marginheight="2" marginwidth="2" scrolling="no" allowtransparency="yes" name="cboxform" style="border:#DBE2ED 1px solid;border-top:0px" id="cboxform"></iframe> </div> <!-- END CBOX --> Code: ÿþ� �� �� �<�!�-�-� �B�E�G�I�N� �C�B�O�X� �-� �w�w�w�.�c�b�o�x�.�w�s� �-�-�>�� �<�d�i�v� �a�l�i�g�n�=�"�c�e�n�t�e�r�"� So confused!!!
__________________ PM me for a banner. |
| |
| | #8 (permalink) |
| NamePros Member | Code:
<script type='text/javascript'>
function show(x) {
var el = document.getElementById(x);
if (!el) return;
el.style.display='';
}
</script>
</head>
<body>
<?php include('includes/chat-box.html'); ?>
<input type="button" value="Chat!" onclick="show('cboxdiv')">
</body>
</html>
Code: <div align="center" id="cboxdiv" style='display: none;'> <div class="chat-box"> <iframe frameborder="0" width="300" height="100" src="http://www4.cbox.ws/box/?boxid=3522815&boxtag=zacwjc&sec=main" marginheight="2" marginwidth="2" scrolling="auto" allowtransparency="yes" name="cboxmain" style="border:#DBE2ED 1px solid;" id="cboxmain"></iframe><br/> <iframe frameborder="0" width="300" height="75" src="http://www4.cbox.ws/box/?boxid=3522815&boxtag=zacwjc&sec=form" marginheight="2" marginwidth="2" scrolling="no" allowtransparency="yes" name="cboxform" style="border:#DBE2ED 1px solid;border-top:0px" id="cboxform"></iframe> </div> </div> Bruce Last edited by Bruce_KD; 07-07-2008 at 03:53 PM. |
| |
| | #9 (permalink) |
| New Member | Still just has a bunch of this Code: þ� �� �� �<�!�-�-� �B�E�G�I�N� �C�B�O�X� �-� �w�w�w�.�c�b�o�x�.�w�s� �-�-�>�� �<�d�i�v� �a�l�i�g�n�=�"�c�e�n�t�e�r�"�!�-�-� �B�E�G�I�N� �C�B�O�X� �-� �w�w�w�.�c�b�o�x�.�w�s� �-�-�>�� �<�d�i�v� �a�l�i�g�n�=�"�c�e�n�t�e�r�"�
__________________ PM me for a banner. |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |