สอบถามเรื่อง Link หน่อยครับ
ถาม-ตอบ แนะนำไอเดียว โค้ดตัวอย่าง แนวทาง วิธีแก้ปัญหา สอบถามเรื่อง Link หน่อยครับ
สอบถามเรื่อง Link หน่อยครับ
Copy
พอดีติดปัญหาต้องแก้ code ของคนเก่า
index.php
แต่พอค่ามันออกมาจะ Error ดังนี้คับ
Url: จะขึ้นแบบนี้ http://localhost/xxxxx/?page=myprofile?uid=2
และจะมี Error กลางหน้า แบบนี้ครับ
index.php
<?php
error_reporting(E_ALL & ~E_NOTICE);
require_once('header.php');
require_once(basename(($_GET['page']!='' ? $_GET['page'] : 'home') . '.php'));
require_once('footer.php');
?>
ตัวนี้คือตัว Link<a href="?page=myprofile?uid=<?=$_SESSION['member_id'];?>" style="color: #ABABAB">ข้อมูลส่วนตัว</a>
myprofile.php
<?php
include("administrator/connectdb.php");
include ("administrator/function.php");
if(isset($_GET['uid']) && (!isset($_POST['username']))){
$id = $_GET['uid'];
$SQL = "select * from member where id = '$id' ";
$RS = mysql_query($SQL);
$arr = mysql_fetch_array($RS);
$username = $arr['username'];
$password = $arr['password'];
$firstname = $arr['firstname'];
$lastname = $arr['lastname'];
$mail = $arr['mail'];
$gender = $arr['gender'];
$birth_day = $arr['birth_day'];
$tel = $arr['tel'];
$fax = $arr['fax'];
$img = $arr['img'];
$btn ="Update";
//...
}else if(isset($_GET['uid']) && (isset($_POST['username']))){
if($op=='update'){
$SQL ="UPDATE member SET
username = '$_POST[username]',
password = '$_REQUEST[password]',
firstname = '$_REQUEST[firstname]',
lastname = '$_REQUEST[lastname]',
mail = '$_REQUEST[mail]',
gender = '$_REQUEST[gender]',
birth_day = '$_REQUEST[birth_day]',
tel = '$_REQUEST[tel]',
fax = '$_REQUEST[fax]',
img = '$_REQUEST[img]',
fax = '$_REQUEST[fax]'
where id ='$_REQUEST[id]'";
if ((isset($_POST["ok"])) && ($_POST["ok"] == "ok_pass") && ($img != "") ){
$upload_image = new upload($_FILES['img'] ) ;
if ( $upload_image->uploaded ) {
$upload_image->process( "administrator/member" );
if ( $upload_image->processed ) {
$img = $upload_image->file_dst_name ;
$upload_image->clean();
}
} $sql = "update member set img='$img' where id = '$_REQUEST[id]' ";
$result = mysql_query($sql) or die("Err img") ;
}
mysql_query($SQL);
}///end op=update
msgbox("ข้อมูลของคุณได้ถูกบันทึกใหม่แล้วครับ");
redirect("manage-annual.php");
}
?>
<div class="page">
<div class="page_header clearfix page_margin_top">
<div class="page_header_left">
<h1 class="page_title">ข้อมูลส่วนตัว</h1>
</div>
</div>
<div class="page_layout clearfix">
<div class="divider_block clearfix">
<hr class="divider first">
<hr class="divider subheader_arrow">
<hr class="divider last">
</div>
<div class="row page_margin_top_section">
<div class="column column_1_3">
<h4 class="box_header">สมาชิกล่าสุด</h4>
<ul class="authors rating clearfix">
<?php
$sql = "select * from member order by id desc limit 0,4";
$result = mysql_query($sql) or die("เอ็กซีคิวต์คำสั่ง ไม่ได้");
$row = mysql_num_rows($result);
while ($dbarr = mysql_fetch_assoc($result)) {
?>
<li class="author">
<a class="thumb" href="?page=author" title="Debora Hilton">
<img src='administrator/member/<?php echo $dbarr['img'] ;?>' width="100px" height="100px" alt='img'>
<span class="number animated_element" data-value="<?php echo $dbarr['id'] ;?>"></span>
</a>
<div class="details">
<h5><a href="?page=author" title=""><?php echo $dbarr['username'] ;?></a></h5>
</div>
</li>
<?php } ?>
</ul>
</div>
<div class="column column_1_3">
<h4 class="box_header">ข้อมูลส่วนตัว</h4>
<form role="form" class="margin_top_15" name="form1" method="post" action="#" enctype="multipart/form-data" OnSubmit="return fncSubmit();">
<fieldset class="box_input">
<div class="block">
<input class="text_input" name="gender" type="text" value="<?php echo $gender;?>" placeholder="เพศ" required>
</div>
</fieldset>
<fieldset class="box_input margin_top_10">
<div class="block">
<input class="text_input" name="birth_day" type="text" value="<?php echo $birth_day;?>" placeholder="วัน/เดือน/ปีเกิด" required>
</div>
</fieldset>
<fieldset class="box_input margin_top_10">
<div class="block">
<input class="text_input" name="tel" type="text" value="<?php echo $tel;?>" placeholder="โทรศัพท์" required>
</div>
</fieldset>
<fieldset class="box_input margin_top_10">
<div class="block">
<input class="text_input" name="fax" type="text" value="<?php echo $fax;?>" placeholder="แฟกซ์" required>
</div>
</fieldset>
<fieldset class="box_input margin_top_10">
<div class="block">
<input class="text_input" name="img" type="text" value="<?php echo $img;?>" placeholder="รูปภาพ" required>
</div>
</fieldset>
<fieldset class="box_input margin_top_10">
<div class="block">
<input class="text_input" name="status" type="text" value="<?php echo $status;?>" placeholder="สถานะ" disabled>
</div>
</fieldset>
</div>
<div class="column column_1_3">
<h4 class="box_header">ข้อมูลส่วนตัว</h4>
<fieldset class="box_input margin_top_15">
<div class="block">
<input class="text_input" name="firstname" type="text" value="<?php echo $firstname;?>" placeholder="ชื่อ" disabled>
</div>
</fieldset>
<fieldset class="box_input margin_top_10">
<div class="block">
<input class="text_input" name="lastname" type="text" value="<?php echo $lastname;?>" placeholder="นามสกุล" disabled>
</div>
</fieldset>
<fieldset class="box_input margin_top_10">
<div class="block">
<input class="text_input" name="mail" type="email" value="<?php echo $mail;?>" placeholder="อีเมล์" disabled>
</div>
</fieldset>
<fieldset class="box_input margin_top_10">
<div class="block">
<input class="text_input" name="username" type="text" value="<?php echo $username;?>" placeholder="ชื่อผู้ใช้" disabled>
</div>
</fieldset>
<fieldset class="box_input margin_top_10">
<div class="block">
<input class="text_input" name="password" type="password" value="<?php echo $password;?>" placeholder="รหัสผ่าน" required>
</div>
</fieldset>
<fieldset class="box_input margin_top_10">
<div class="block">
<input class="text_input" name="conpassword" type="password" value="<?php echo $conpassword;?>" placeholder="ยืนยันรหัสผ่านใหม่" required>
</div>
</fieldset>
<fieldset class="margin_top_10">
<input name="id" type="hidden" id="id" value="<?=$_REQUEST[uid]?>" />
<input name="op" type="hidden" id="op" value="update" />
</fieldset>
</form>
</div>
</div>
</div>
</div>
แต่พอค่ามันออกมาจะ Error ดังนี้คับ
Url: จะขึ้นแบบนี้ http://localhost/xxxxx/?page=myprofile?uid=2
และจะมี Error กลางหน้า แบบนี้ครับ
Warning: require_once(myprofile?uid=2.php) [function.require-once]: failed to open stream: No error in D:AppServwwwxxxxxindex.php on line 4
Fatal error: require_once() [function.require]: Failed opening required 'myprofile?uid=2.php' (include_path='.;C:php5pear') in D:AppServwwwxxxxxindex.php on line 4
รบกวนด้วยนะครับ
รบกวนด้วยนะครับ
คำแนะนำ และการใช้งาน
สมาชิก กรุณา ล็อกอินเข้าระบบ เพื่อตั้งคำถามใหม่ หรือ ตอบคำถาม สมาชิกใหม่ สมัครสมาชิกได้ที่ สมัครสมาชิก
- ถาม-ตอบ กรุณา ล็อกอินเข้าระบบ
เว็บไซต์ของเราให้บริการเนื้อหาบทความสำหรับนักพัฒนา โดยพึ่งพารายได้เล็กน้อยจากการแสดงโฆษณา
โปรดสนับสนุนเว็บไซต์ของเราด้วยการปิดการใช้งานตัวปิดกั้นโฆษณา (Disable Ads Blocker) ขอบคุณครับ