Jump to content

php code help


yazah

Recommended Posts

here is the code.It is suppose to get stored in the data.txt file.

Thanks

 

<html>

<head>

<title>Register Yourself</title>

</head>

<script type="text/javascript">

function test()

{

var donation=document.getElementById("test").value;

if (donation == null)

{

donation=0.0000;

}

var newdonation=donation+0.0001;

document.getElementById("test").value=newdonation;

document.getElementById("test").innerHTML="$"+newdonation.toFixed(4);

}

</script>

<body>

<input type="button" value="Search" onClick="test()"/>

<div id="test" value=0>$0.0</div>

<div id="result">

</div>

<!-- end #mainContent -->

</div><!-- end #container -->

</div><script type="text/javascript">var obj = "search";

//Id name to call upData function when clickedvar target = "result";

//Id name of element to display resultvar url = "data.php";

//Url to server processing file data.php$(document).ready(function() { upData(0.000); $("#"+obj).click(function() { upData(0.001); });});function upData(data) { $.ajax({   type: "GET",   url: url,   data: "action=do&data="+data,   success: function(msg) {   $("#"+target).html('$'+msg);   } });}   </script></body></html>

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/226843-php-code-help/#findComment-1170491
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.