rallokkcaz Posted September 2, 2006 Author Share Posted September 2, 2006 ok i will thanks for the poststhey are idusernamepasswordemailfullname Link to comment https://forums.phpfreaks.com/topic/19438-how-to-make-pages-like-blahuserusername/page/2/#findComment-84692 Share on other sites More sharing options...
w32 Posted September 2, 2006 Share Posted September 2, 2006 <?php//##your db script##include("config.php");if($_GET['uid']){$id = $_GET['uid'];$get['userdata'] = mysql_query("SELECT * FROM pokebash_users WHERE id='$id'");$get['userdata'] = mysql_fetch_array($get['userdata']);echo 'Username: ' .$get['userdata']['username'] .'<br />';echo 'E-mail: ' .$get['userdata']['email'] .'<br />';echo 'fullname: ' .$get['userdata']['fullname'];}else{//########REDIRECTS TO YOUR HOME PAGE IF UID IS NOT PRESENT IN THE URL#########echo '<meta http-equiv="refresh" content="0;URL=index.php" />';}?>That'd work I think :)you should now use something like user.php?id=1 or any id you want Link to comment https://forums.phpfreaks.com/topic/19438-how-to-make-pages-like-blahuserusername/page/2/#findComment-84708 Share on other sites More sharing options...
rallokkcaz Posted September 2, 2006 Author Share Posted September 2, 2006 when ever i lin..ohh i think i just thought of something! Link to comment https://forums.phpfreaks.com/topic/19438-how-to-make-pages-like-blahuserusername/page/2/#findComment-84728 Share on other sites More sharing options...
rallokkcaz Posted September 2, 2006 Author Share Posted September 2, 2006 ok here's the codewhen ever i click on the link to view the profileit sends me back to the same page with a different urlhere's the page [url=http://www.pokebash.com/user.php]http://www.pokebash.com/user.php[/url]heres the code[code]<? include ("header.php"); ?><?php //connect to and select db $conn = mysql_connect('localhost','//yes i left these blank for secrurity purposes','') or die(mysql_error()); $db = mysql_select_db('pokebash_users',$conn) or die(mysql_error()); //get a list of the info from the table to make the linkies $sql = "select * from maaking_users"; $result = mysql_query($sql, $conn) or die(mysql_error()); // for each row fetched from the results... while ($list = mysql_fetch_array($result)) { //make the custom linkie echo "<font color='black'><a href= 'http://www.pokebash.com/user.php?id={$list['userid']}'>{$list['username']}</a><br>"; } // end while // if the user clicked on a linkie and therefore an id exists (the is_numeric is a basic security precaution) ... if (is_numeric($_GET['username'])) { // for easier var syntax handling $id = $_GET['userid']; $sql = "select username from maaking_users where video_id = '$id'"; $result = mysql_query($sql, $conn) or die(mysql_error()); $videofound = mysql_num_rows($result); if ($videofound) { $user = mysql_fetch_array($result); include ("header.php");echo " "; } // end if found } // end if there was a linkie clicked?><?php//##your db script##if($_GET['userid']){$id = $_GET['userid'];$get['userdata'] = mysql_query("SELECT * FROM pokebash_users WHERE userid='$id'");$get['userdata'] = mysql_fetch_array($get['userdata']);echo 'Username: ' .$get['userdata']['username'] .'';echo 'E-mail: ' .$get['userdata']['email'] .'';echo 'fullname: ' .$get['userdata']['fullname'];}?>[/code] Link to comment https://forums.phpfreaks.com/topic/19438-how-to-make-pages-like-blahuserusername/page/2/#findComment-84734 Share on other sites More sharing options...
rallokkcaz Posted September 2, 2006 Author Share Posted September 2, 2006 people pleeze Link to comment https://forums.phpfreaks.com/topic/19438-how-to-make-pages-like-blahuserusername/page/2/#findComment-84846 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.