| | |
Help No output??? php noob
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
What on earth is wrong with it?
PHP Syntax (Toggle Plain Text)
<span class="ad_notxt"><code class="inlinecode"> <? Header("content-type: application/x-javascript"); $chatnames = file('http://client11.addonchat.com/scwho.pl?id=292747&plain=1'); $indx = count($chatnames); $indxcom = $indx - 1; if ($indx == 0){ echo "document.write(\"No one is in the chat room at the moment"\)"; } else{ echo "document.write(\"<b>Members Chatting:</b>"\)"; for($i = 0; $i < $indx; $i++) { $name = explode(' ', $chatnames[$i], 2); echo "document.write(\"$name[0]"\)"; if ($i < $indxcom) { echo "document.write(\","\)"; } } } ?> </code></span>
PHP Syntax (Toggle Plain Text)
<script type="text/javascript" src="http://h1.ripway.com/Inny/chat.php"></script>
Last edited by Inny; Mar 13th, 2008 at 3:39 pm.
Always carry a flagon of whiskey in case of snakebite and furthermore always carry a small snake.
W. C. Fields
W. C. Fields
Hi Inny, read the whole reply to find the error at its end. I'll keep the rest of my original post to show you my track of thoughts which could be helpful for you some other time.
Maybe fopen wrappers aren't enabled. (file('http://...)
Or maybe short_open_tag is off. (<?php versus <?)
Try placing this at the top and call it not with the <script> tag but directly:
Well, I just called it directly and there are run-time errors that tells you what's wrong:
http://h1.ripway.com/Inny/chat.php
It's difficult to count for me which line is the 13th but I guess you placed a backslash before parenthesis and not before quotation marks:
You should use a text editor with syntax highlighting (e.g. http://www.pspad.com/). Even DaniWeb syntax highlighter would have pointed out the error for you.
Happy coding.
Maybe fopen wrappers aren't enabled. (file('http://...)
Or maybe short_open_tag is off. (<?php versus <?)
Try placing this at the top and call it not with the <script> tag but directly:
php Syntax (Toggle Plain Text)
error_reporting(255); ini_set('display_errors','On');
Well, I just called it directly and there are run-time errors that tells you what's wrong:
http://h1.ripway.com/Inny/chat.php
It's difficult to count for me which line is the 13th but I guess you placed a backslash before parenthesis and not before quotation marks:
php Syntax (Toggle Plain Text)
echo "document.write(\","\)";
You should use a text editor with syntax highlighting (e.g. http://www.pspad.com/). Even DaniWeb syntax highlighter would have pointed out the error for you.
Happy coding.
Petr 'PePa' Pavel
The more information you give the more relevant answer you get.
Please consider using "Add to ... Reputation" and mark your thread as Solved if you found what you were looking for. By giving feedback you help others.
The more information you give the more relevant answer you get.
Please consider using "Add to ... Reputation" and mark your thread as Solved if you found what you were looking for. By giving feedback you help others.
![]() |
Similar Threads
Other Threads in the PHP Forum
- Previous Thread: Loading PHP into flash?
- Next Thread: open_basedir restriction in effect error in PHP
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email encode error fcc file files folder form forms function functions google howtowriteathesis href htaccess html image include insert integration ip java javascript joomla limit link login loop mail menu methods mlm mod_rewrite multiple multipletables mysql oop open parse paypal pdf php problem provider query radio random recursion regex remote script search select server sessions sms soap source space speed sql structure syntax system table template tutorial update upload url validation validator variable video web xml youtube






lol