I have modified this block and reworked it but I am having no luck, getting it to function any help would be wonderful. Below are the two code snippets Block is disfunctional and the html version works perfectly. Thanks any assistance anyone is willing to give me on this one.
I have tracked down several errors in the form section and finally got the thing to quit making the pages go blank. Now if I can just get it to calculate I would happy. The script is designed to calculate the amount of clean time that a recovering drug addict has been away from drugs. Thanks again for your help. I had to use txt files because it wont let me use any html even in the code brackets.
That is after all existing code. (I have added a space into the opening and closing script tags to allow it to display here so remove that.) This places your javascript between the head tags of your site, just as you have it on your html page.
Code:
<?php
if (eregi("block-lifetimer.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
}
$content = "";
$stuff = <<< End_Stuff
<form name="live" method="post">
Your Clean Date Please:<br>
<INPUT TYPE="text" NAME="age" VALUE="" SIZE=20><br>
Example: (November 1, 1966)<br>
<INPUT TYPE="button" NAME="start" VALUE="Calculate" ONCLICK="lifetimer(this.form)">
<INPUT TYPE="reset" NAME="resetb" VALUE="Clear">
<p> <br>
You've been clean:
<INPUT TYPE="text" NAME="time4" VALUE="" size=8>years<br>
You are <INPUT TYPE="text" NAME="time1" VALUE="" size=5>
hours and <INPUT TYPE="text" NAME="time3" VALUE="" size=3>minutes
clean.</p>
</form>
End_Stuff;
$content .= $stuff;
?>
Save the above as block-lifetimer.php and upload to the blocks directory of your server. WARNING..... the copy/paste process sometimes adds invisible blank characters to the ends of code lines. These must be removed using a decent text editor before uploading to your site I use Crimson Editor
Next go to admin.php ..... Blocks and create your block by scrolling down and giving it a title. Next select lifetimer from the dropdown Filename select box and click create.
Tested and working on a Nuke 8.0 site.
_________________
chadrt Nuke Soldier
Joined: Oct 03, 2005
Posts: 21
Posted:
Sat Feb 10, 2007 3:30 pm
Thank you so much, I have fought with that thing for a couple of days now. I really appreciate you!! This site is not quite off the ground yet but I am hoping that it will become popular and things like that are just really nice for others to tell their friends about. Thanks again.
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