|
|
#1 |
|
New Member
![]() Join Date: Feb 2010
Posts: 3
|
I have created admin page where admin see all the users username and i have made the username list as link to process the details of the user but when i click it should pass the username to the processing page. the code -
members list- members_detail.php <?php if(!mysql_connect("localhost","root","admin")) { echo "<h2>".$TEXT['product-error to connect']."</h2>"; die(); } echo "<h5>Users:-</h5><br>"; $link = mysql_connect("localhost", "root", "admin"); mysql_select_db("jc214330", $link); $i=0; $sql = mysql_query("SELECT * FROM users"); while($members = mysql_fetch_array($sql)) { echo "<p><a href=\"members_process.php\">".$members[username] ."</a></p>"; echo "<p>Name - ".$members[first_name] ." ".$members[last_name] ."<br><br><br></p>"; } ?> members process to get full details, edit and delete users - members_process.php <?php $username[i] = $_REQUEST['$username[i]']; if(!mysql_connect("localhost","root","admin")) { echo "<h2>".$TEXT['product-error to connect']."</h2>"; die(); } echo "<h5>Users:-</h5><br>"; $link = mysql_connect("localhost", "root", "admin"); mysql_select_db("jc214330", $link); $sql = mysql_query("SELECT * FROM users where username = 'username[i]'"); while($membersdtl = mysql_fetch_array($sql)) { echo "<p>Name - ".$membersdtl[first_name] ." ".$membersdtl[last_name] ."<br><br><br></p>"; } ?> how do i pass $username[i] from members_detail.php to members_process.php |
|
|
|
|
|
#2 |
|
New Member
![]() Join Date: Feb 2010
Posts: 2
|
hiiiii
In PHP u can pass value in two ways or we can say 2 methods POST and GET 1)POST method is simply declare post method in form tag <form method="post"> <input value=""> through this u can pass 2) by passing query string ex-> <a href="pagename.php?userid=".<?=$usernameid?>><?=$u sername?></a> through u can pass the id i hope this 2 method help u thanks |
|
|
|
|
|
#3 |
|
New Member
![]() Join Date: Apr 2009
Location: Romania
Posts: 18
|
one link should be
echo "members_process.php?username=$members[username]"; and in members_process.php tou should get the username like this $username=$_GET['username'];
__________________
Code Generators |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|