473,387 Members | 1,440 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

display php output in javascript?

77
Im trying to display output from a php file in javascript by using an iframe,
its displaying the raw code instead. I just want the output text, how can I do it please?

the code

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <title>Who is chatting</title>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5. </head>
  6. <body bgcolor="#e4eaf2" topmargin="0" marginheight="0">
  7. <font size='1' face="Verdana, Arial, Helvetica, sans-serif"> 
  8. <?php
  9.  
  10.  
  11.  
  12.  
  13. $chatnames = file('http://client11.addonchat.com/scwho.pl?id=292747&plain=1');
  14.  
  15.  
  16. $indx = count($chatnames);
  17. $indxcom = $indx - 1;
  18.  
  19. if ($indx == 0){
  20. echo "No one is in the chat room at the moment. <br /> Why not log in and see if you entice others to join you. ";
  21. }
  22.  
  23. else{
  24. echo "<b>People Chatting:</b>&nbsp;&nbsp;";
  25.  
  26.   for($i = 0; $i < $indx; $i++) {
  27.  
  28.     $name = explode('TAB', $chatnames[$i], 2);
  29.  
  30.     echo " $name[0]";
  31.  
  32.     if ($i < $indxcom) {
  33.  
  34.    echo ", ";
  35. }  
  36.  
  37.   }
  38. }
  39.  
  40. ?>
  41. </font> 
  42. </body>
  43.  
  44. </html>
Expand|Select|Wrap|Line Numbers
  1. <IFRAME SRC="http://inny.ipbfree.com/index.php?act=Attach&type=post&id=1353" WIDTH=50% marginwidth="0" height=35 marginheight="10" align="middle" scrolling="no" frameborder=0 ></IFRAME> 
Mar 13 '08 #1
2 1924
Markus
6,050 Expert 4TB
I dont understand.
You're trying to "output a php file in javascript"?
Explain more please :)
Mar 13 '08 #2
Inny
77
The php file above is to show users chatting in my chatroom., Im using an iframe to display its output

aka 'people chatting: x' where x is the names of people chating.

or 'No people chatting' if there are none.

I cannot use php code directly on my board therefore Im hosting it as a file

and displaying in javascript in an iframe.....or trying to.

Maybe theres a way to use javascript or ajax to do this instead?
Mar 13 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: google | last post by:
<html> <head> <title>JavaScript Replace</title> <script language="JavaScript1.1" type="text/javascript"> function phils_image_price(input) { //declare variables var output="" var position=0
5
by: GB | last post by:
Okay, here is what I am trying to do We have a dialog of windows that collects information for generation of a dynamic HTML report. The last page in the wizard dialog accepts all report options...
7
by: TLM | last post by:
I am trying to build a web application that will contain links to files on a users local computer. I am assuming that the files will be in a known location and can display in a browser window. ...
2
by: David Cho | last post by:
I hope I can describe the dilemma precisely. I have code to render PDF output in a browser window (using a third party control that merges PDF files and renders the PDF output in the browser...
3
by: Rich | last post by:
Hi, I'm very, very new to javascript, so please bear with me if this is a silly question. My problem is this. I would like to some javascript connect to a URL on the same webserver and...
18
by: Terry Holland | last post by:
I have an asp.net (1.1) application that connects to a SQL server 2000 db. I have a stored procedure in my db that out puts data in xml format. What I need to be able to do is display that xml...
4
by: dgiff33 | last post by:
Hello I am trying to display the characters |, /, - and \ one after the other in the same spot, disappearing and being replaced by the next character so that it looks like a spinning prompt. ...
5
by: austincollins | last post by:
I have been searching for hours to find a solution to display text rotated at 90 degrees in firefox, and could not find one. css3 and IE has the css command "writing-mode: tb-rl;" but this does not...
2
by: H. Rodriguez | last post by:
Hello, I would like to be able to open a new IE window on the client side and display a PDF document in the new window. Many tutorial sites that I have checked suggest opening a new IE window...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.