HOME
TUTORIAL
∇
Applets
Comments
CSS
Document Tags
Embed
Fonts
Forms
Frames
Images
Lines & Paragraphs
Links
Lists
Logical Tags
Scripts
Sounds
Symbols
Tables
Weird Tags
FORUM
∇
HTML Help
Web Design
Programming Languages
Web Hosting
Domain Names
Marketing
Community
QUICK LIST
CSS
Forum Home
FAQ
Search
Memberlist
Register
Profile
Log in to check your private messages
Log in
Register
- Not registered yet? Got something to say?
Join HTML Code Tutorial
!
SSI not echoing to <li> element
HTML Help Forum Index
->
SSI
View previous topic
::
View next topic
Author
Message
verlager
Joined: 23 Jan 2009
Posts: 4
Posted: Fri Jan 23, 2009 1:41 pm
SSI not echoing to <li> element
I have a MOTD that I want to display as an alert. This works fine:
Code:
<li><a href="#" onClick="alert('test');return false;">quotes</a></li>
But this does nothing:
Code:
<li><a href="#" onClick="alert('<!--#include virtual="./quotes-3.php" -->');return false;">quotes</a></li>
and this is quotes-3.php which echos $comment and by itself, works just fine.
Code:
<?php session_start();
// Load the data file only if needed
if(!isset($_SESSION['array'])) {
// The name of your quote file
$quote_file = "chess.txt";
// Open the quote file
$fp = fopen($quote_file, "r");
// Read the contents and tokenize the file to individual quotes
$quotes = fread($fp, filesize($quote_file)-1);
fclose($fp);
// set the permanent session variable array
$_SESSION['array'] = explode("\n",$quotes);
}
srand((double)microtime()*1000000);
$array_index = (rand(1, sizeof($_SESSION['array'])) - 1);
$comment = strtolower($_SESSION['array'][$array_index]);
$len = (strlen($comment)/2);
if (strlen($comment)<311)
{echo ($comment);}
?>
sticks464
Joined: 31 Dec 2006
Posts: 2308
Posted: Fri Jan 23, 2009 2:29 pm
It won't work because server side script executes before client side script.
verlager
Joined: 23 Jan 2009
Posts: 4
Posted: Fri Jan 23, 2009 6:02 pm
Noted!
I guess that's it, then! Thank you!
Display posts from previous:
All Posts
1 Day
7 Days
2 Weeks
1 Month
3 Months
6 Months
1 Year
Oldest First
Newest First
HTML Help Forum Index
->
SSI
All times are GMT - 8 Hours
Page
1
of
1
Jump to:
Select a forum
Announcements
----------------
Announcements
HTML Help
----------------
Member Tutorials
General HTML
HTML Form
HTML Table
HTML Frame
CSS
DHTML
SSI
MySpace
HTML Tools
Web Design
----------------
Images & Graphics
Templates
Multimedia
Programming Languages
----------------
Javascript
PHP
Perl
ASP
Others
Web Hosting
----------------
Free Hosting
Shared Hosting
Dedicated, Managed, and Co-located Hosting
Hosting Business and Reseller Hosting
Domain Names
----------------
Registrars
Tools
For Sale, Wanted, & Appraisals
Expired Domains
Monetization
Legal Issues
Marketing
----------------
SEO
PPC
Affiliate Marketing
Other Internet Marketing
Community
----------------
Miscellaneous
Website Review
Introduce Yourself
Feedback
Praise
Errors
You
cannot
post new topics in this forum
You
cannot
reply to topics in this forum
You
cannot
edit your posts in this forum
You
cannot
delete your posts in this forum
You
cannot
vote in polls in this forum
Your Ad Here
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
DARFUR
Get a
Stop the Genocide
poster at
SaveDarfur.org
.
Also see
Eyes on Darfur
.
HOSTING / DESIGN
$1.99 Domain Registration
Cheap Web Hosting
Website Templates
MAKE MONEY
Sell Domain Names
Sell Website Templates
Home
|
Tutorials
|
Forum
|
Quick List
|
Link Directory
|
About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial