Hy, can anyone help me, i have problem with my script..
if I input 4324 in input field nmber, i want the result like this :
4324
4342
4234
4243
4432
4423
3424
3442
3244
2434
2443
2344
this is my script :
<form name="a" method="POST" action="">
<table border="1" width="100%">
<tbody><tr>
<td height="38" align="center"><b>Number</b>
<input name="nmber" size="8.5" maxlength="4" type="text" value="<?php echo $_POST['nmber']; ?>"> <b>Buy</b>
<input name="buy" size="6" type="text" value="<?php echo $_POST['buy']; ?>"> <font color="#000000" size="2"><b>(x 1000)</b></font>
<input name="save" style="padding:7px;" value="Submit" type="submit">
</td>
</tr>
</tbody></table>
</form>
And this is my php script :
<?php
if(isset($_POST['save']))
{
$dataangka=$_POST['nmber'];
$databetnya=$_POST['buy'];
$rupiahkali=$databetnya*1000;
$dataangkasplit=str_split($dataangka);
$angka1=$dataangkasplit[0];
$angka2=$dataangkasplit[1];
$angka3=$dataangkasplit[2];
$angka4=$dataangkasplit[3];
$no=1;
$n=24;
for($i=1;$i<=$n;$i++)
{
?>
<tr align="center">
<td><?=$no?></td>
<td><input name="cek[<?=$i?>]" value="1" checked="checked" type="checkbox"></td>
<td><?php echo substr(str_shuffle("$dataangka"),0,$n); ?>
<input size="2" name="res[<?=$i?>]" value="<?php echo substr(str_shuffle("$dataangka"),0,$angka4); ?>" type="hidden">
</td>
<td><?=$rupiahkali?></b> <input size="2" name="bet[<?=$i?>]" value="<?=$rupiahkali?>" type="hidden"></td>
</tr>
<?php
$no++;
}
}
?>
I have already try with substr and str_shuffle but result not like what i want..
Please help me.. :(
Thank you so much..