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

ตอบกระทู้

รูปแสดงอารมณ์
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
รูปแสดงอารมณ์อื่นๆ

BBCode เปิด
[img] เปิด
[url] เปิด
[Smile icon] เปิด

กระทู้แนะนำ
   

มุมมองที่ขยายได้ กระทู้แนะนำ: ช่วยแก้ code หน่อยครับ เอาเก็บค่ามาแทนที่ php arrary

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

โดย hopehope » 04/05/2012 9:58 am

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

ข้างบน