I try to get a value from a textbox in to a variable and show the value in the same page?
The Objective Is wen the user insert they BTC wallet in to the textbox, and i need to assign the value from the textbox in to a variable in the same page and then echo the value.
I have try this code but i get an error This is my error
O ficheiro não foi encontrado Pode ter sido movido ou eliminado. ERR_FILE_NOT_FOUND
This is my code
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<meta name="Author" content="Helder Ventura">
<title>Roll the dice</title>
<body bgcolor="orange">
<h1 align="center">Welcome To Dice Game</h1>
<center>
<form action= $Wallet method="post">
<input type="text" size="15" name="var1" />
<input type="submit" value="assign" />
</form>
</center>
<?php
$var =$_POST["var1"];
// now you can do wtf you want with the variable.
echo $var;
?>
<style type="text/css">
body{
background-color:white;
font-size:10pt;
font-family:sans-serif;
color:#00436e;
}
</style>
<script language="javascript">
var d1, d2;
var ctr=0;
var images=new Array();
for(i=0;i<=6;i++){
images[i]=new Image(); images[i].src='dice'+i+'.gif';
}
function rolldice(){
document.f.t.value='';
document.f.b.value=' Rolling..... ';
if(ctr<6){
showdice();
ctr++;
setTimeout('rolldice()',150);
}else{
ctr=0;
showdice();
document.f.t.value=d1+d2;
document.f.b.value='Roll the dice...';
}}
function showdice(){
d1=Math.floor(Math.random()*6+1);
d2=Math.floor(Math.random()*6+1);
document.images['d1'].src='dice'+d1+'.gif';
document.images['d2'].src='dice'+d2+'.gif';
}
</script>
</head>
<body>
<center>
<form name="f">
<table>
<tr height="60">
<td align="center">
<img src="dice1.gif" name="d1">
</td>
<td width="50"> </td>
<td align="center">
<img src="dice1.gif" name="d2">
</td>
</tr>
</table>
<br><br>
<b>Roll Total</b> <input type="text" size="2" value="" name="t" readonly
onClick="document.f.b.focus()" onSelect="document.f.b.focus()">
<br><br>
<input type="button" name="b" value="Roll the dice..." onClick="rolldice()">
</form>
</center>
<br><br><hr><br><br>
<h2>Instructions:</h2>
<form name="SAf">
<br><br><br>
1: Copy and paste the following script in the HEAD section of your page:
<br>
<a href="javascript:document.forms['SAf'].scripttxt.focus();document.forms['SAf'].scripttxt.select();">Select all...</a>
<br><br>
<textarea cols="80" rows="8" wrap="off" name="scripttxt">
<script language="javascript">
var d1, d2;
var ctr=0;
var images=new Array();
for(i=0;i<=6;i++){
images[i]=new Image(); images[i].src='dice'+i+'.gif';
}
function rolldice(){
document.f.t.value='';
document.f.b.value=' Rolling..... ';
if(ctr<6){
showdice();
ctr++;
setTimeout('rolldice()',150);
}else{
ctr=0;
showdice();
document.f.t.value=d1+d2;
document.f.b.value='Roll the dice...';
}}
function showdice(){
d1=Math.floor(Math.random()*6+1);
d2=Math.floor(Math.random()*6+1);
document.images['d1'].src='dice'+d1+'.gif';
document.images['d2'].src='dice'+d2+'.gif';
}
</script>
</textarea>
<br><br><br>
2: Copy and paste the following HTML in the BODY section of your page:
<br>
<a href="javascript:document.forms['SAf'].bodytxt.focus();document.forms['SAf'].bodytxt.select();">Select all...</a>
<br><br>
<textarea cols="80" rows="8" wrap="off" name="bodytxt">
<form name="f">
<table>
<tr height="60">
<td align="center">
<img src="dice1.gif" name="d1">
</td>
<td width="50"> </td>
<td align="center">
<img src="dice1.gif" name="d2">
</td>
</tr>
</table>
<br><br>
<b>Roll Total</b> <input type="text" size="2" value="" name="t" readonly
onClick="document.f.b.focus()" onSelect="document.f.b.focus()">
<br><br>
<input type="button" name="b" value="Roll the dice..." onClick="rolldice()">
</form>
</textarea>
</form>
</body>
</html>