HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
SSI not echoing to <li> element
Post new topic   Reply to topic    HTML Help Forum Index -> SSI
View previous topic :: View next topic  
Author Message
verlager



Joined: 23 Jan 2009
Posts: 4

PostPosted: Fri Jan 23, 2009 1:41 pm     SSI not echoing to <li> element Reply with quote

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: 2311

PostPosted: Fri Jan 23, 2009 2:29 pm     Reply with quote

It won't work because server side script executes before client side script.
verlager



Joined: 23 Jan 2009
Posts: 4

PostPosted: Fri Jan 23, 2009 6:02 pm     Noted! Reply with quote

I guess that's it, then! Thank you!
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> SSI All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
DARFUR
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial