Jump to content

how to clear the screen?


zgkhoo

Recommended Posts

<?php
ob_start(); //output buffering begin
session_start();
include 'config.php';
include 'opendb.php';

echo "<h1>Place Bet3</h1>";
echo "</br>Mode: ".$_SESSION['mode'];
echo "</br>Category: ".$_SESSION['category'];
echo "</br>Date:".$_SESSION['date'];

//echo "<table border=1>";

//display all the data inside result table

//$result=mysql_query("SELECT DrawDate,DrawNumber,Category  FROM result") or die('Query failed: ' . mysql_error());
//while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {

//echo "<tr><td>$row[DrawDate]</td><td>$row[DrawNumber]</td><td>$row[Category]</td></tr>";	
//}

//echo "</table>";

//finding the drawnumber..
$result=mysql_query("SELECT DrawDate,DrawNumber,Category  FROM result") or die('Query failed: ' . mysql_error());
while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {

if(($row[DrawDate]==$_SESSION['date'])&&($row[Category]==$_SESSION[category])){
	$_SESSION[drawnumber]=$row[DrawNumber];
	echo "</br>DrawNumber=".$_SESSION[drawnumber];

}

}



?>



<html>

<table>

<form action=placebet3.php method='post'>
</br>
Betting Number
<input type=text name=betnumber>
</br>
Amount (RM)
<input type=text name=amount>
</br>
<input type=submit name=bet value=Bet>

</form>
</table>
</html>


<?php
if(isset($_POST[bet])){
$_SESSION['betnumber']=$_POST[betnumber];
$_SESSION['amount']=$_POST[amount];

echo "bet";
[color=red]	header
   ('Refresh:2;url=placebet4.php');
   echo "<center><table><tr><td bgcolor=#FFCC00><font color=#CC0000>you will be redirected into Confirm page in 2 seconds</font></td></tr></table></center>";[/color]
   
     ob_flush();
//$sql="INSERT INTO transaction (DrawNumber,Amount,PurchaseNo,BetMode)
	//VALUES ('$drawnumber','$_POST[amount]','$_POST[betnumber]','$_SESSION[mode]')";

//mysql_query($sql, $con);
}

?>


 

 

how to clear the screen when the user clicked the button?while currently when the user click the button the system show the message "you will be redirected into Confirm page in 2 seconds" but those element, form/button still appear in there, how can disappear those element when user clicked the button?

thanks..

 

 

Link to comment
Share on other sites

Try

 

<?php
ob_start(); //output buffering begin
session_start();
include 'config.php';
include 'opendb.php';

echo "<h1>Place Bet3</h1>";
echo "</br>Mode: ".$_SESSION['mode'];
echo "</br>Category: ".$_SESSION['category'];
echo "</br>Date:".$_SESSION['date'];

//echo "<table border=1>";

//display all the data inside result table

//$result=mysql_query("SELECT DrawDate,DrawNumber,Category  FROM result") or die('Query failed: ' . mysql_error());
//while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {

//echo "<tr><td>$row[DrawDate]</td><td>$row[DrawNumber]</td><td>$row[Category]</td></tr>";	
//}

//echo "</table>";

//finding the drawnumber..
$result=mysql_query("SELECT DrawDate,DrawNumber,Category  FROM result") or die('Query failed: ' . mysql_error());
while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {

if(($row[DrawDate]==$_SESSION['date'])&&($row[Category]==$_SESSION[category])){
	$_SESSION[drawnumber]=$row[DrawNumber];
	echo "</br>DrawNumber=".$_SESSION[drawnumber];

}

}


if(isset($_POST['bet'])){
$_SESSION['betnumber']=$_POST[betnumber];
$_SESSION['amount']=$_POST[amount];

echo "bet";
[color=red]	header
   ('Refresh:2;url=placebet4.php');
   echo "<center><table><tr><td bgcolor=#FFCC00><font color=#CC0000>you will be redirected into Confirm page in 2 seconds</font></td></tr></table></center>";[/color]
   
     ob_flush();
//$sql="INSERT INTO transaction (DrawNumber,Amount,PurchaseNo,BetMode)
	//VALUES ('$drawnumber','$_POST[amount]','$_POST[betnumber]','$_SESSION[mode]')";

//mysql_query($sql, $con);

exit;
}


?>



<html>

<table>

<form action=placebet3.php method='post'>
</br>
Betting Number
<input type=text name=betnumber>
</br>
Amount (RM)
<input type=text name=amount>
</br>
<input type=submit name=bet value=Bet>

</form>
</table>
</html>

Link to comment
Share on other sites

Try this out:

 

<script type="text/javascript">
function show_div(div_name) {
  var my_div;
  my_div = document.getElementById ? document.getElementById(div_name) : null;
  if (my_div) {
    if (my_div.style) my_div.style.display = '';
    else if (my_div.display) my_div.display = '';
  } else {
    //alert('Cant find ' + div_name);
  }
}

function hide_div(div_name) {
  var my_div;
  my_div = document.getElementById ? document.getElementById(div_name) : null;
  if (my_div) {
    if (my_div.style) {
      my_div.style.display = 'none';
    } else if (my_div.display) {
      alert(div_name);
    }
  }
}
</script><div id="foo">Hide me</div>
<input type="button" name="Show" value="Show" onClick="show_div('foo')">
<input type="button" name="Hide" value="Hide" onClick="hide_div('foo')">

Link to comment
Share on other sites

<?php
ob_start(); //output buffering begin
session_start();
include 'config.php';
include 'opendb.php';

echo "<h1>Place Bet3</h1>";
echo "</br>Mode: ".$_SESSION['mode'];
echo "</br>Category: ".$_SESSION['category'];
echo "</br>Date:".$_SESSION['date'];

//echo "<table border=1>";

//display all the data inside result table

//$result=mysql_query("SELECT DrawDate,DrawNumber,Category  FROM result") or die('Query failed: ' . mysql_error());
//while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {

//echo "<tr><td>$row[DrawDate]</td><td>$row[DrawNumber]</td><td>$row[Category]</td></tr>";	
//}

//echo "</table>";

//finding the drawnumber..
$result=mysql_query("SELECT DrawDate,DrawNumber,Category  FROM result") or die('Query failed: ' . mysql_error());
while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {

if(($row[DrawDate]==$_SESSION['date'])&&($row[Category]==$_SESSION[category])){
	$_SESSION[drawnumber]=$row[DrawNumber];
	echo "</br>DrawNumber=".$_SESSION[drawnumber];

}

}


if(isset($_POST['bet'])){
$_SESSION['betnumber']=$_POST[betnumber];
$_SESSION['amount']=$_POST[amount];

echo "bet";
//[color=red]	header
   ('Refresh:2;url=placebet4.php');
   echo "<center><table><tr><td bgcolor=#FFCC00><font color=#CC0000>you will be redirected into Confirm page in 2 seconds</font></td></tr></table></center>";
   
    ob_flush();
//$sql="INSERT INTO transaction (DrawNumber,Amount,PurchaseNo,BetMode)
	//VALUES ('$drawnumber','$_POST[amount]','$_POST[betnumber]','$_SESSION[mode]')";

//mysql_query($sql, $con);

exit;
}


?>



<html>

<table>

<form action=placebet3.php method='post'>
</br>
Betting Number
<input type=text name=betnumber>
</br>
Amount (RM)
<input type=text name=amount>
</br>
<input type=submit name=bet value=Bet>

</form>
</table>
</html>

 

i changed to above, still the same..the form still wont disappear when the user click the button

Link to comment
Share on other sites

To hide an element with javascript is fairly simple....

 

I'm not going to integrate this into your script mainly because I'm feeling lazy, and it'll give you something to do ;p.

 

<script language="javascript">
function Hide(elem) {
e = document.getElementById(elem);
e.style.display = "none";
}
</script>

<div id="hideThis">
now you see it!
</div>

<a href="#" onclick="Hide('hideThis');">Hide It</a>

 

You would want to mod that though since that'll have problems in some browsers....

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.