marcus Posted November 14, 2006 Share Posted November 14, 2006 [code]<?phpinclude("mysql.php");include("header.php");$by = $_POST[by];if(!$by){$by = id;};echo "<table border=0 cellspacing=1 cellpadding=0><tr><td>Username<td>Email<td>Website<td>Mail";$q = "SELECT * FROM `users` ORDER BY $by";$query = mysql_query($q);while($user = mysql_fetch_assoc($query)){str_replace("http://","",$user[website]);echo "<tr><td>$user[username]<td><a href='mailto:".$user[email]."'>$user[email]</a><td><a href='http://".$user[website]."' target='_blank'>Site</a><td><a href='mailbox.php?action=write&id=".$user[id]."'>Mail</a>";};mysql_free_result($query);echo "</table>";include("footer.php");?>[/code]i'm trying to replace http:// in user's defined website address Link to comment https://forums.phpfreaks.com/topic/27256-solved-str_replace-help-needed/ Share on other sites More sharing options...
Psycho Posted November 14, 2006 Share Posted November 14, 2006 You are not assigning the str_replace value to anything! Try reassigning the new value back to itself.$user[website] = str_replace("http://","",$user[website]); Link to comment https://forums.phpfreaks.com/topic/27256-solved-str_replace-help-needed/#findComment-124629 Share on other sites More sharing options...
marcus Posted November 14, 2006 Author Share Posted November 14, 2006 Alright, works, thanks! Link to comment https://forums.phpfreaks.com/topic/27256-solved-str_replace-help-needed/#findComment-124633 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.