Whats wrong in this???
Moderator: General Moderators
Code: Select all
if(strlen($keimeno) == $_SESSION['i'])
header("Refresh: 1; URL=http://localhost/test.php");
else
session_destroy();Code: Select all
<html>
<head>
<script type="text/javascript">
var textToShow = "just a test";
var pos = 0;
var tm;
function init()
{
tm = setInterval("type()", 200);
}
function type()
{
if (textToShow.length != pos)
{
d = document.getElementById("divText");
d.appendChild(document.createTextNode(textToShow.charAt(pos++)));
}
else
clearInterval(tm);
}
</script>
</head>
<body onload="javascript:init();">
<div id="divText" style="border: 5px solid yellow; width: 200px; height: 50px;">
</div>
</body>
</html>Yes it wokrs great too and i think that u can se the spedd in this one!!!
cool!
But can u pls tell mw how can i insert thsi to the previous php code u gave me so that i can it all in one?? i dont knwo if iam sking this correctly but the reasone for all this is:
http://www.nikolas.tk
the text that u see in the table i want it to be display one by one character using the js script u gave me so pls tell me how to insert this code to read from my file!!
Thank u very much!! here is my inde.php that i want your js script to be inserted!!
<?php
error_reporting(E_ALL); $xronos=date("l dS of F h:i:s A"); $host=gethostbyaddr($_SERVER['REMOTE_ADDR']); $i=0;
if (@mysql_connect('localhost', 'nik', 'macgyver'));
else @mysql_connect('localhost', 'root');
mysql_select_db('db_nik');
if ($host=="komodino.itc.auth.gr") echo "ÂñÝ êáëþò ôïí ×ñÞóôï! ×áßñïìáé ðïõ óå âëÝðù ðÜëé! Óáí ôï óðßôé óïõ!<p>";
$file_data = file("data.txt");
$file_diary = file("diary.txt");
?>
<body bgproperties='fixed' background='pics/anemos.bmp'>
<form action="show.php" method="post">
<center><font size='5' color='LightGreen'>- Ðñïò íÝïí åñùôÞóáíôá ðåñß ðñïóåõ÷Þò -</font></center><br>
<center><table border='1' cellspacing='1' width='90%' id='AutoNumber1' bordercolor='Yellow' style='border-style: solid; border-width: 5' background='pics/brick.jpg'>
<tr>
<td align=center bordercolor='#ffcc00'> <font face='Com' size='4' color='LightBlue'><? while ($i < count($file_data)) echo $file_data[$i++]; ?></font></td>
</tr>
</table>
<p>
<center><font size='4' color='Cyan'>* Áí èÝëåéò íá êÜíåéò êáé óõ ìéá äùñåÜ ðñïò óõíáíèñþðïõò ðïõ Ý÷ïõí ôçí áíÜãêç óïõ, ôþñá ìðïñåßò ìÝóù ôçò óåëßäáò áõôÞò *</font>
<center><font size='4' color='Cyan'>* Ôá ÷ñÞìáôá ðïõ èá óõãêåíôñùèïýí óôïí ëïãáñéáóìü èá äéáôåèïýí ãéá öéëáíèñùðéêïýò óêïðïýò *</font>
<center><font size='4' color='Cyan'>* Alpha Bank: 704-00-2310016553 *</font>
<p>
<center><table border='1' cellspacing='1' width='90%' id='AutoNumber1' bordercolor='Yellow' style='border-style: solid; border-width: 5' background='pics/blue.jpg'>
<tr>
<td align=center bordercolor='#ffcc00'> <font face='Com' size='5' color='Lightgreen'>Ðþò óå ëÝíå?</font></td>
<td align=center bordercolor='#ffcc00'> <input type="text" name="onoma"></td>
</tr>
<tr>
<td align=center bordercolor='#ffcc00'> <font face='Com' size='5' color='Lightgreen'>Ðïéü åßíáé ôï ó÷üëéï óïõ åðß ôïõ èÝìáôïò?</font></td>
<td align=center bordercolor='#ffcc00'> <textarea name="sxolio" rows=4 cols=25 wrap="on"></textarea></td>
</tr>
<tr>
<td align=center bordercolor='#ffcc00'> <font face='Com' size='5' color='Lightgreen'>Ðïéü åßíáé ôï e-mail óïõ?</font></td>
<td align=center bordercolor='#ffcc00'> <input type="text" name="email"></td>
</tr>
<tr>
<td align=center bordercolor='#ffcc00'> <input type="submit" name="show" value="ÅìöÜíéóç"></td>
<td align=center bordercolor='#ffcc00'> <input type="submit" name="send" value="ÁðïóôïëÞ"></td>
</tr>
</table>
</form>
<br><center><font size='4' color='White'><? echo $file_diary[rand(0, count($file_diary)-1)]; ?></font></center><br><br>
<center><font size='4' color='Orange'><? echo $xronos; ?></font></center>
<center><font size='4' color='Pink'><? echo $host; ?></font></center>
<?
mysql_query("UPDATE visitor SET counter=counter+1");
$sql = mysql_query("SELECT counter FROM visitor");
$counter = mysql_fetch_array($sql);
echo "<center><font size='5' color='Yellow'>$counter[0]</font>";
echo "<center><a href='progs.php'><img src='pics/email.gif'></a>";
mail ("nik0s@mycosmos.gr", "Åðßóêåøç áðü $host! Óýíïëï: $counter[0]", "", "From: spy@web.gr");
?>
pls keep in mind the way i syntax it!
thank you very much!
u helpes a great deal!!
cool!
But can u pls tell mw how can i insert thsi to the previous php code u gave me so that i can it all in one?? i dont knwo if iam sking this correctly but the reasone for all this is:
http://www.nikolas.tk
the text that u see in the table i want it to be display one by one character using the js script u gave me so pls tell me how to insert this code to read from my file!!
Thank u very much!! here is my inde.php that i want your js script to be inserted!!
<?php
error_reporting(E_ALL); $xronos=date("l dS of F h:i:s A"); $host=gethostbyaddr($_SERVER['REMOTE_ADDR']); $i=0;
if (@mysql_connect('localhost', 'nik', 'macgyver'));
else @mysql_connect('localhost', 'root');
mysql_select_db('db_nik');
if ($host=="komodino.itc.auth.gr") echo "ÂñÝ êáëþò ôïí ×ñÞóôï! ×áßñïìáé ðïõ óå âëÝðù ðÜëé! Óáí ôï óðßôé óïõ!<p>";
$file_data = file("data.txt");
$file_diary = file("diary.txt");
?>
<body bgproperties='fixed' background='pics/anemos.bmp'>
<form action="show.php" method="post">
<center><font size='5' color='LightGreen'>- Ðñïò íÝïí åñùôÞóáíôá ðåñß ðñïóåõ÷Þò -</font></center><br>
<center><table border='1' cellspacing='1' width='90%' id='AutoNumber1' bordercolor='Yellow' style='border-style: solid; border-width: 5' background='pics/brick.jpg'>
<tr>
<td align=center bordercolor='#ffcc00'> <font face='Com' size='4' color='LightBlue'><? while ($i < count($file_data)) echo $file_data[$i++]; ?></font></td>
</tr>
</table>
<p>
<center><font size='4' color='Cyan'>* Áí èÝëåéò íá êÜíåéò êáé óõ ìéá äùñåÜ ðñïò óõíáíèñþðïõò ðïõ Ý÷ïõí ôçí áíÜãêç óïõ, ôþñá ìðïñåßò ìÝóù ôçò óåëßäáò áõôÞò *</font>
<center><font size='4' color='Cyan'>* Ôá ÷ñÞìáôá ðïõ èá óõãêåíôñùèïýí óôïí ëïãáñéáóìü èá äéáôåèïýí ãéá öéëáíèñùðéêïýò óêïðïýò *</font>
<center><font size='4' color='Cyan'>* Alpha Bank: 704-00-2310016553 *</font>
<p>
<center><table border='1' cellspacing='1' width='90%' id='AutoNumber1' bordercolor='Yellow' style='border-style: solid; border-width: 5' background='pics/blue.jpg'>
<tr>
<td align=center bordercolor='#ffcc00'> <font face='Com' size='5' color='Lightgreen'>Ðþò óå ëÝíå?</font></td>
<td align=center bordercolor='#ffcc00'> <input type="text" name="onoma"></td>
</tr>
<tr>
<td align=center bordercolor='#ffcc00'> <font face='Com' size='5' color='Lightgreen'>Ðïéü åßíáé ôï ó÷üëéï óïõ åðß ôïõ èÝìáôïò?</font></td>
<td align=center bordercolor='#ffcc00'> <textarea name="sxolio" rows=4 cols=25 wrap="on"></textarea></td>
</tr>
<tr>
<td align=center bordercolor='#ffcc00'> <font face='Com' size='5' color='Lightgreen'>Ðïéü åßíáé ôï e-mail óïõ?</font></td>
<td align=center bordercolor='#ffcc00'> <input type="text" name="email"></td>
</tr>
<tr>
<td align=center bordercolor='#ffcc00'> <input type="submit" name="show" value="ÅìöÜíéóç"></td>
<td align=center bordercolor='#ffcc00'> <input type="submit" name="send" value="ÁðïóôïëÞ"></td>
</tr>
</table>
</form>
<br><center><font size='4' color='White'><? echo $file_diary[rand(0, count($file_diary)-1)]; ?></font></center><br><br>
<center><font size='4' color='Orange'><? echo $xronos; ?></font></center>
<center><font size='4' color='Pink'><? echo $host; ?></font></center>
<?
mysql_query("UPDATE visitor SET counter=counter+1");
$sql = mysql_query("SELECT counter FROM visitor");
$counter = mysql_fetch_array($sql);
echo "<center><font size='5' color='Yellow'>$counter[0]</font>";
echo "<center><a href='progs.php'><img src='pics/email.gif'></a>";
mail ("nik0s@mycosmos.gr", "Åðßóêåøç áðü $host! Óýíïëï: $counter[0]", "", "From: spy@web.gr");
?>
pls keep in mind the way i syntax it!
thank you very much!
u helpes a great deal!!
Volka pls man dont leave me on this one! yous js is fine! but i have to re-arrange it a bit in order to llok like http://www.nikolas.tk but i dont know js, so pls do tour magic eith this, pls its an emergency!
you may trybut keep the old script, haven't tested this and no time right now 
Code: Select all
<?php
...
$file_data = file("data.txt");
$file_diary = file("diary.txt");
?>
<head>
<script type="text/javascript">
var textToShow = "<?php echo addslashes(join('', $file_data)); ?>";
var pos = 0;
var tm;
function init()
{ tm = setInterval("type()", 200); }
function type()
{
if (textToShow.length != pos)
{
d = document.getElementById("textbox");
d.appendChild(document.createTextNode(textToShow.charAt(pos++)));
}
else
clearInterval(tm);
}
</script>
</head>
<body bgproperties='fixed' background='pics/anemos.bmp' onLoad="init();">
...
<center>
<table border='1' cellspacing='1' width='90%' id='AutoNumber1' bordercolor='Yellow' style='border-style: solid; border-width: 5' background='pics/brick.jpg'>
<tr>
<td id="textbox" align="center"
style="color: lightblue; border-color: #ffcc00;
font-size: small; font-family: 'Com,Times New Roman',Times,serif';" >
</td>
</tr>
</table>
...<?php
error_reporting(E_ALL); $xronos=date("l dS of F h:i:s A"); $host=gethostbyaddr($_SERVER['REMOTE_ADDR']); $i=0;
if (@mysql_connect('localhost', 'nik', 'macgyver'));
else @mysql_connect('localhost', 'root');
mysql_select_db('db_nik');
if ($host=="komodino.itc.auth.gr") echo "ÂñÝ êáëþò ôïí ×ñÞóôï! ×áßñïìáé ðïõ óå âëÝðù ðÜëé! Óáí ôï óðßôé óïõ!<p>";
$file_data = file("data.txt");
$file_diary = file("diary.txt");
?>
<script type="text/javascript">
var textToShow = "<? echo addslashes(join('', $file_data)); ?>";
var pos = 0;
var tm;
function init()
{tm = setInterval("type()", 50);}
function type()
{
if (textToShow.length != pos)
{
d = document.getElementById("textbox");
d.appendChild(document.createTextNode(textToShow.charAt(pos++)));
}
else
clearInterval(tm);
}
</script>
<body bgproperties='fixed' background='pics/anemos.bmp' onLoad="init();">
<form action="show.php" method="post">
<center><font size='5' color='LightGreen'>- Ðñïò íÝïí åñùôÞóáíôá ðåñß ðñïóåõ÷Þò -</font></center><br>
<center><table border='1' cellspacing='1' width='90%' id='AutoNumber1' bordercolor='Yellow' style='border-style: solid; border-width: 5' background='pics/brick.jpg'>
<tr>
<td align=center bordercolor='#ffcc00'> <font face='Com' size='4' color='LightBlue'></font></td>
</tr>
</table>
<p>
<center><font size='4' color='Cyan'>* Áí èÝëåéò íá êÜíåéò êáé óõ ìéá äùñåÜ ðñïò óõíáíèñþðïõò ðïõ Ý÷ïõí ôçí áíÜãêç óïõ, ôþñá ìðïñåßò ìÝóù ôçò óåëßäáò áõôÞò *</font>
<center><font size='4' color='Cyan'>* Ôá ÷ñÞìáôá ðïõ èá óõãêåíôñùèïýí óôïí ëïãáñéáóìü èá äéáôåèïýí ãéá öéëáíèñùðéêïýò óêïðïýò *</font>
<center><font size='4' color='Cyan'>* Alpha Bank: 704-00-2310016553 *</font>
<p>
<center><table border='1' cellspacing='1' width='90%' id='AutoNumber1' bordercolor='Yellow' style='border-style: solid; border-width: 5' background='pics/blue.jpg'>
<tr>
<td align=center bordercolor='#ffcc00'> <font face='Com' size='5' color='Lightgreen'>Ðþò óå ëÝíå?</font></td>
<td align=center bordercolor='#ffcc00'> <input type="text" name="onoma"></td>
</tr>
<tr>
<td align=center bordercolor='#ffcc00'> <font face='Com' size='5' color='Lightgreen'>Ðïéü åßíáé ôï ó÷üëéï óïõ åðß ôïõ èÝìáôïò?</font></td>
<td align=center bordercolor='#ffcc00'> <textarea name="sxolio" rows=4 cols=25 wrap="on"></textarea></td>
</tr>
<tr>
<td align=center bordercolor='#ffcc00'> <font face='Com' size='5' color='Lightgreen'>Ðïéü åßíáé ôï e-mail óïõ?</font></td>
<td align=center bordercolor='#ffcc00'> <input type="text" name="email"></td>
</tr>
<tr>
<td align=center bordercolor='#ffcc00'> <input type="submit" name="show" value="ÅìöÜíéóç"></td>
<td align=center bordercolor='#ffcc00'> <input type="submit" name="send" value="ÁðïóôïëÞ"></td>
</tr>
</table>
</form>
<br><center><font size='4' color='White'><? echo $file_diary[rand(0, count($file_diary)-1)]; ?></font></center><br><br>
<center><font size='4' color='Orange'><? echo $xronos; ?></font></center>
<center><font size='4' color='Pink'><? echo $host; ?></font></center>
<?
mysql_query("UPDATE visitor SET counter=counter+1");
$sql = mysql_query("SELECT counter FROM visitor");
$counter = mysql_fetch_array($sql);
echo "<center><font size='5' color='Yellow'>$counter[0]</font>";
echo "<center><a href='progs.php'><img src='pics/email.gif'></a>";
mail ("nik0s@mycosmos.gr", "Åðßóêåøç áðü $host! Óýíïëï: $counter[0]", "", "From: spy@web.gr");
?>
I need to get this script working pls!
especially in the javascript part that i want it to diplay the text to data.txt char by char!! plsssss help!!
error_reporting(E_ALL); $xronos=date("l dS of F h:i:s A"); $host=gethostbyaddr($_SERVER['REMOTE_ADDR']); $i=0;
if (@mysql_connect('localhost', 'nik', 'macgyver'));
else @mysql_connect('localhost', 'root');
mysql_select_db('db_nik');
if ($host=="komodino.itc.auth.gr") echo "ÂñÝ êáëþò ôïí ×ñÞóôï! ×áßñïìáé ðïõ óå âëÝðù ðÜëé! Óáí ôï óðßôé óïõ!<p>";
$file_data = file("data.txt");
$file_diary = file("diary.txt");
?>
<script type="text/javascript">
var textToShow = "<? echo addslashes(join('', $file_data)); ?>";
var pos = 0;
var tm;
function init()
{tm = setInterval("type()", 50);}
function type()
{
if (textToShow.length != pos)
{
d = document.getElementById("textbox");
d.appendChild(document.createTextNode(textToShow.charAt(pos++)));
}
else
clearInterval(tm);
}
</script>
<body bgproperties='fixed' background='pics/anemos.bmp' onLoad="init();">
<form action="show.php" method="post">
<center><font size='5' color='LightGreen'>- Ðñïò íÝïí åñùôÞóáíôá ðåñß ðñïóåõ÷Þò -</font></center><br>
<center><table border='1' cellspacing='1' width='90%' id='AutoNumber1' bordercolor='Yellow' style='border-style: solid; border-width: 5' background='pics/brick.jpg'>
<tr>
<td align=center bordercolor='#ffcc00'> <font face='Com' size='4' color='LightBlue'></font></td>
</tr>
</table>
<p>
<center><font size='4' color='Cyan'>* Áí èÝëåéò íá êÜíåéò êáé óõ ìéá äùñåÜ ðñïò óõíáíèñþðïõò ðïõ Ý÷ïõí ôçí áíÜãêç óïõ, ôþñá ìðïñåßò ìÝóù ôçò óåëßäáò áõôÞò *</font>
<center><font size='4' color='Cyan'>* Ôá ÷ñÞìáôá ðïõ èá óõãêåíôñùèïýí óôïí ëïãáñéáóìü èá äéáôåèïýí ãéá öéëáíèñùðéêïýò óêïðïýò *</font>
<center><font size='4' color='Cyan'>* Alpha Bank: 704-00-2310016553 *</font>
<p>
<center><table border='1' cellspacing='1' width='90%' id='AutoNumber1' bordercolor='Yellow' style='border-style: solid; border-width: 5' background='pics/blue.jpg'>
<tr>
<td align=center bordercolor='#ffcc00'> <font face='Com' size='5' color='Lightgreen'>Ðþò óå ëÝíå?</font></td>
<td align=center bordercolor='#ffcc00'> <input type="text" name="onoma"></td>
</tr>
<tr>
<td align=center bordercolor='#ffcc00'> <font face='Com' size='5' color='Lightgreen'>Ðïéü åßíáé ôï ó÷üëéï óïõ åðß ôïõ èÝìáôïò?</font></td>
<td align=center bordercolor='#ffcc00'> <textarea name="sxolio" rows=4 cols=25 wrap="on"></textarea></td>
</tr>
<tr>
<td align=center bordercolor='#ffcc00'> <font face='Com' size='5' color='Lightgreen'>Ðïéü åßíáé ôï e-mail óïõ?</font></td>
<td align=center bordercolor='#ffcc00'> <input type="text" name="email"></td>
</tr>
<tr>
<td align=center bordercolor='#ffcc00'> <input type="submit" name="show" value="ÅìöÜíéóç"></td>
<td align=center bordercolor='#ffcc00'> <input type="submit" name="send" value="ÁðïóôïëÞ"></td>
</tr>
</table>
</form>
<br><center><font size='4' color='White'><? echo $file_diary[rand(0, count($file_diary)-1)]; ?></font></center><br><br>
<center><font size='4' color='Orange'><? echo $xronos; ?></font></center>
<center><font size='4' color='Pink'><? echo $host; ?></font></center>
<?
mysql_query("UPDATE visitor SET counter=counter+1");
$sql = mysql_query("SELECT counter FROM visitor");
$counter = mysql_fetch_array($sql);
echo "<center><font size='5' color='Yellow'>$counter[0]</font>";
echo "<center><a href='progs.php'><img src='pics/email.gif'></a>";
mail ("nik0s@mycosmos.gr", "Åðßóêåøç áðü $host! Óýíïëï: $counter[0]", "", "From: spy@web.gr");
?>
I need to get this script working pls!
especially in the javascript part that i want it to diplay the text to data.txt char by char!! plsssss help!!
Code: Select all
function init()
{ tm = setInterval("type()", 200); }Code: Select all
function type()
{
if (textToShow.length != pos) // if we're not already "behind" the end
{
d = document.getElementById("divText");
d.appendChild(document.createTextNode(textToShow.charAt(pos++)));
}
else
clearInterval(tm);
}Code: Select all
function type()
{
if (textToShow.length != pos)
{
// finding a reference to the element with the id divText
d = document.getElementById("divText");
// getting the char fromthe current position in the text
c = textToShow.charAt(pos);
// making a new text-node from this char
n = document.createTextNode(c);
// appending this new text to the currently displayed text
d.appendChild(n);
// moving to the next position
pos++;
}
else
clearInterval(tm); // no more text, so clear the interval
}- see also:
- getElementById: http://www.mozilla.org/docs/dom/domref/ ... ml#1025944
- String.charAt: http://www.devguru.com/Technologies/ecm ... harat.html
- createTextNode: http://www.mozilla.org/docs/dom/domref/ ... ref47.html
- appendChild: http://www.mozilla.org/docs/dom/domref/ ... ref32.html
Code: Select all
<html>
<head>
<script type="text/javascript">
// marking a new line with a single chr(13), so this will lead to 2 lines:
var textToShow = "just a test"+String.fromCharCode(13)+"and a second line";
var pos = 0;
var tm;
function init()
{
tm = setInterval("type()", 200);
}
function type()
{
if (textToShow.length != pos)
{
d = document.getElementById("divText");
c = textToShow.charAt(pos++);
// checking wether this marks a new line or not
if (c.charCodeAt(0) != 13)
// simple text, just append it as before
d.appendChild(document.createTextNode(c));
else
// a new line, so insert a linebreak-element
d.appendChild(document.createElement("br"));
}
else
clearInterval(tm);
}
</script>
</head>
<body onload="javascript:init();">
<div id="divText" style="border: 5px solid yellow; width: 200px; height: 50px;">
</div>
</body>- see also:
- fromCharCode: http://www.devguru.com/technologies/ecm ... rcode.html
- createElement: http://www.mozilla.org/docs/dom/domref/ ... ref46.html
Code: Select all
<?php $file_data = array_map('trim', $file_data); ?>- see also:
- array_map: http://www.php.net/manual/en/function.array-map.php
- trim: http://www.php.net/manual/en/function.trim.php
Code: Select all
<?php $file_data = array_map('addslashes', $file_data); ?>- addslashes: http://www.php.net/manual/en/function.addslashes.php
- should also apply htmlentites: http://www.php.net/manual/en/function.htmlentities.php
Code: Select all
<?php $file_data = join('', $file_data); ?>It's one string now, but there are no linebreaks anymore.
Code: Select all
<?php $file_data = join('"+String.fromCharCode(13)+"', $file_data); ?>- Say $file_data contains
- just a test
- and a second line
Code: Select all
var textToShow = "<?php $file_data ?>";Putting it all together (a bit compressed) the example now is
Code: Select all
<?php
$file_data = file("data.txt");
?>
<html><head>
<script type="text/javascript">
var textToShow = "<? echo join('"+String.fromCharCode(13)+"', array_map('addslashes', (array_map('trim', $file_data)))); ?>";
var pos = 0;
var tm;
function init()
{ tm = setInterval("type()", 50); }
function type()
{
if (textToShow.length != pos)
{
d = document.getElementById("divText");
c = textToShow.charAt(pos++);
if (c.charCodeAt(0) != 13)
d.appendChild(document.createTextNode(c));
else
d.appendChild(document.createElement("br"));
}
else
clearInterval(tm);
}
</script>
</head>
<body onload="javascript:init();">
<div id="divText" style="border: 5px solid yellow; width: 200px; height: 50px;">
</div>
</body>
</html>for ($i=0; $i<=10000000; $i++)
echo "Thank you very much Volka";

The script u gave me worked great! I just also wanted to ask what changes should i make in order for it to look like this:
http://tigani.coderz.gr/~nik/test.php
This is the same thing as js but in php running on my remote web server!
but i dont know how to produce it with js!
Slow isnt it?? even if i have it with refresh 0
Thanks again! i own you my friend!
echo "Thank you very much Volka";
The script u gave me worked great! I just also wanted to ask what changes should i make in order for it to look like this:
http://tigani.coderz.gr/~nik/test.php
This is the same thing as js but in php running on my remote web server!
but i dont know how to produce it with js!
Slow isnt it?? even if i have it with refresh 0
Thanks again! i own you my friend!
Javascipt inside php!
<script type="text/javascript">
var textToShow = "<? echo join('"+String.fromCharCode(13)+"', array_map('addslashes', (array_map('trim', $file_data)))); ?>";
var pos = 0;
var tm;
function init()
{ tm = setInterval("type()", 40); }
function type()
{
if (textToShow.length != pos)
{
d = document.getElementById("divText");
c = textToShow.charAt(pos++);
if (c.charCodeAt(0) != 13)
d.appendChild(document.createTextNode(c));
else
d.appendChild(document.createElement("br"));
}
else
clearInterval(tm);
}
</script>
<center><font size='5' color='LightGreen'>- Προς νέον ερωτήσαντα περί προσευχής -</font></center><br>
<body background='pics/anemos.bmp' onload='javascript:init()'>
<center>
<div id="divText" align="left" style="border: 5px solid yellow; width: 900px; height: 500px;">
<font face='Com' size='4' color='LightCyan'>
</div>
</body>
In this one why cant i replace div with <table> ??
and how am i gonan do this inside the outline to use an image?
div id="divText" background="pics/brick.jpg" align="left" style="border: 5px solid yellow
Why this wont work?
as far as this: http://tigani.coderz.gr/~nik/test.php
u changer it 1 min before your post damn!!
and i dont have the source no more!!
anyway http://www.nikolas.tk
llok at this volka pls and tell me how to bacground the table!!
and opther good stuff about div
is div a javascript commnad?
var textToShow = "<? echo join('"+String.fromCharCode(13)+"', array_map('addslashes', (array_map('trim', $file_data)))); ?>";
var pos = 0;
var tm;
function init()
{ tm = setInterval("type()", 40); }
function type()
{
if (textToShow.length != pos)
{
d = document.getElementById("divText");
c = textToShow.charAt(pos++);
if (c.charCodeAt(0) != 13)
d.appendChild(document.createTextNode(c));
else
d.appendChild(document.createElement("br"));
}
else
clearInterval(tm);
}
</script>
<center><font size='5' color='LightGreen'>- Προς νέον ερωτήσαντα περί προσευχής -</font></center><br>
<body background='pics/anemos.bmp' onload='javascript:init()'>
<center>
<div id="divText" align="left" style="border: 5px solid yellow; width: 900px; height: 500px;">
<font face='Com' size='4' color='LightCyan'>
</div>
</body>
In this one why cant i replace div with <table> ??
and how am i gonan do this inside the outline to use an image?
div id="divText" background="pics/brick.jpg" align="left" style="border: 5px solid yellow
Why this wont work?
as far as this: http://tigani.coderz.gr/~nik/test.php
u changer it 1 min before your post damn!!
and i dont have the source no more!!
anyway http://www.nikolas.tk
llok at this volka pls and tell me how to bacground the table!!
and opther good stuff about div
is div a javascript commnad?
you can use a table (almost any element that may contain content) and you can style font settings, colors, images, ...
But you should use css for thisif you do something like
But you should use css for this
Code: Select all
<html>
<head>
<script type="text/javascript">
// marking a new line with a single chr(13), so this will lead to 2 lines:
var textToShow = "just a test"+String.fromCharCode(13)+"and a second line";
var pos = 0;
var tm;
function init()
{
tm = setInterval("type()", 100);
}
function type()
{
if (textToShow.length != pos)
{
d = document.getElementById("divText");
c = textToShow.charAt(pos++);
// checking wether this marks a new line or not
if (c.charCodeAt(0) != 13)
// simple text, just append it as before
d.appendChild(document.createTextNode(c));
else
// a new line, so insert a linebreak-element
d.appendChild(document.createElement("br"));
}
else
clearInterval(tm);
}
</script>
</head>
<body onload="javascript:init();" style="background-color: darkblue">
<table border="1" style="background-image: url('test.png')">
<tr>
<td >1</td>
<td id="divText" style="border: 5px solid yellow; width: 400px; height: 400px; color: lightblue; font-size: small; font-family: 'Com,Times New Roman',Times,serif';">
</td>
</tr>
<tr><td>3</td><td>4</td></tr>
</table>
</body>
</html>Code: Select all
<div id="divText" align="left" style="border: 5px solid yellow; width: 900px; height: 500px;">
<font face='Com' size='4' color='LightCyan'>
</div>- it's
- not valid html anymore (structural error)
- useless if combined with appendChild. THe browser will treat it as
Code: Select all
<div ...> <font ...></font> <!-- append child will take place here, outside the font-tag --> </div>