PhpSnip.com

User Stats

Space Eater

if u use any (text) variable for your ID you will have problem with browser compatibility,<br> how to get rid off from space? u can use this.

Info

 Download  View Source (print view)
 Rating : 4.7  Views : 428

Source Code ( 31 lines )

<?
/* if u use any variable for your ID you will have problem with browser compatibility,
how to get rid off from space? u can use this.
best regard, idban@satunet.com 
greeting to my wife dessy fatmawati and all of my friends

free for use, keep my name :)
*/

$username = "username"; 
$password = "password"; 
$usertable = "tabelname";
$dbName = "DBname"; 

MYSQL_CONNECT($hostname, $username, $password) OR DIE("Unable to connect to database");
@mysql_select_db( "$dbName") or die( "Unable to select database");
$news_query = mysql_query("select * from $usertable order by coloumname desc limit 0,5") or die(mysql_error());
while ($row  =  mysql_fetch_array($news_query))

   {    $var1=$row["colum_name"]; 

// change any space to + ( plus )
$var1_new = eregi_replace(" ","+",$var1); 

print (" the original text : <a href="http://domain.com/viewscript.php3?id=$var1">$var1</a>
 <br> <font color="red"> link will broken if use netscape!</font><br>");
print (" modified text : <a href="http://domain.com/viewscript.php3?id=$var1_new">$var1_new</a>
<br><font color="red"> link will NOT broken even use netscape!</font> <br><br>");
}
MYSQL_CLOSE();
?>

Search

Subscribe

  Rss Feeds

Sponsors

Advertise