[UPHPU] Form Help

Tyler Gee geekout at gmail.com
Fri Jun 24 09:48:18 MDT 2005


What you want to do is set it up as a link (which you have already
done) and then append the member id into the URL.  Something like

<a href="editmember.php?memberID=<?php mysql_result ($result, $i,
"???");?>"><img src=greencheck.gif border=0></a>

Do you have a unique ID on these rows?  That is what you want to put
instead of the ??? above.

Then, on editmember.php you can use $_POST['memberID'] to pull out the
information from the database.

Let us know what questions you might have as that is probably
confusing if you have never done it before.

-wtgee


On 6/24/05, Jonathan Grotegut <jgrotegut at gmail.com> wrote:
> I'm not sure exactly how to do this so hopefully there is someone out
> there that can help me out.  I have the following page (will be adding
> security soon):
> 
> http://wow.rednight.us/manage/modmember.php
> 
> What I want to do is when someone clicks on the Edit button (green
> check mark) it takes them to a page that is prefilled with the
> information from the "member" that was selected.
> 
> I am guessing I would have to do some type of form to allow for the
> "member" info to be passed to the page to modify it but I am not sure
> how to best do this, or is there a better way?
> 
> Here is the code for the page with Database info removed:
> 
> <?php
> $connection = mysql_connect ("blah", "blah", "blah");
> if ($connection == false){
>   echo mysql_errno().": ".mysql_error()."<BR>";
>   exit;
> }
> 
> $query = "select * from name ORDER BY Name";
> $result = mysql_db_query ("lgzwywj_wowroster", $query);
> 
> if ($result){
>   echo "<table class=sortable width=100% cellpadding=0 cellspacing=0
> border=1px id=roster>";
>   echo "<tr><th width=15% align=center>Member Rank</th><th width=15%
> align=center>Member Name</th><th width=15% align=center>Member
> Class</th><th width=15% align=center>Member Race</th><th width=15%
> align=center>Member Level</th><th width=15% align=center>Edit</th><th
> width=15% align=center>Delete</th></tr>";
> 
>   $numOfRows = mysql_num_rows ($result);
>   for ($i = 0; $i < $numOfRows; $i++){
>     $memberrank = mysql_result ($result, $i, "Rank");
>     $membername = mysql_result ($result, $i, "Name");
>     $memberclass = mysql_result ($result, $i, "Class");
>         $memberrace = mysql_result ($result, $i, "Race");
>         $memberlevel = mysql_result ($result, $i, "Level");
>     echo "<tr><td align=center>$memberrank</td><td
> align=center>$membername</td><td align=center>$memberclass</td><td
> align=center>$memberrace</td><td align=center>$memberlevel</td><td
> align=center><a href=editmember.php><img src=greencheck.gif
> border=0></a></td><td align=center><a href=deletemember.php><img
> src=redx.gif  border=0></a></td></tr>";
>   }
> 
>   echo "</table>";
> }
> else{
>   echo mysql_errno().": ".mysql_error()."<BR>";
> }
> 
> mysql_close ();
> 
> ?>
> 
> Any help or suggestions are greatly appreciated, Thanks in advance.
> 
> Jonathan
> 
> 
> _______________________________________________
> 
> UPHPU mailing list
> UPHPU at uphpu.org
> http://uphpu.org/mailman/listinfo/uphpu
> IRC: #uphpu on irc.freenode.net
>




More information about the UPHPU mailing list