หน้า 1 จากทั้งหมด 1

ช่วยแก้ code หน่อยครับ เอาเก็บค่ามาแทนที่ php arrary

โพสต์แล้ว: 04/05/2012 9:58 am
โดย hopehope
code นี้ จะแสดง เลข 2 ตัว ตัวบนและตัวล่าง เวลาผมกดnext อยากให้ข้อบนเปลี่ยน แล้ว ข้อล่าง จะเก็บค่าตัวเลขบนมาไว้ พอกดnext อีกรอบ ก้จะเปลีย่นข้อบนแล้วจะเก็บเลขตัวล่างเอาไว้

1 next /// 2 next//// 3 next
1 1
2

แบบนี้อ่ะครับ ช่วยทีครับ

โค้ด: เลือกทั้งหมด

<?php
$array_q = array (1 =>1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
$rand_keys = array_rand($array_q, 2);
echo $array_q[$rand_keys[0]];
echo $i;
?>

<?
if($_GET['_post']==2){?><font color="RED" class="font_tahoma"></font><?}
?>

<form method="post" action="" name="myform_login" id="myform_login">
<table width="80%" align="center" cellpadding="2" border="0">
<tr>

<td width="45%" rowspan="2" align="center" valign="middle">
<input type="submit" name="name" id="submit" value="next" class="field1" style="vertical-align:top;cursor:pointer"/>
</td>
</tr>
</table>

</form>

<form>
<? 
echo $i; 
echo $array_q[$rand_keys[0]];
?>
</form>
:-o