supanoob Posted April 21, 2006 Share Posted April 21, 2006 well, i have tried various codes and this is the one i have got now:My Form (search.php):[code]<HTML><HEAD></HEAD><BODY><FORM NAME="searchphone" METHOD="post" ACTION="searchres.php">Enter Last Name: <input name="Array[user]" type="text" id="Array[user]"><BR><input type="submit" name="Submit" value="Submit"></FORM></BODY></HTML>[/code]and this is the php (searchres.php):[code]<HTML><HEAD></HEAD><BODY><FORM NAME="searchphone" METHOD="post" ACTION="searchres.php">Enter Last Name: <input name="Array[user]" type="text" id="Array[user]"><BR><input type="submit" name="Submit" value="Submit"></FORM></BODY></HTML><HTML><HEAD></HEAD><BODY><?php$Array["user"] =trim ($Array["user"]);$Host="i dunt believe it";$Username="damn";$Password="hahaha";$DBName="meh";$TableName="yeah"; $Link = mysql_connect($Host, $Username, $Password);$Query="SELECT * from $TableName Where user = $Array[user]";$Result= mysql_db_query ($DBName, $Query, $Link);echo "Results: <br>$Row[user] ($Row[playerid]) <BR> ";mysql_close ($Link); ?></BODY></HTML>[/code]now i get no errors when searching it just doesnt bring any results up :Sgo here to see what i mean:[a href=\"http://twottk.com/game\" target=\"_blank\"]HERE[/a]and login using the following:Username: testaccpassword: test123 Quote Link to comment Share on other sites More sharing options...
supanoob Posted April 23, 2006 Author Share Posted April 23, 2006 can anyone help? Quote Link to comment Share on other sites More sharing options...
wisewood Posted April 23, 2006 Share Posted April 23, 2006 firstly, search.php needs to be modified so that session_start() is the first thing in the page.PS. you might wanna remove your username & password details from your code that you're sharing with the world. Quote Link to comment Share on other sites More sharing options...
supanoob Posted April 23, 2006 Author Share Posted April 23, 2006 thanks for the heads up Quote Link to comment Share on other sites More sharing options...
supanoob Posted April 25, 2006 Author Share Posted April 25, 2006 bump Quote Link to comment Share on other sites More sharing options...
sanfly Posted April 25, 2006 Share Posted April 25, 2006 Try this[code]<HTML><HEAD></HEAD><BODY><FORM NAME="searchphone" METHOD="post" ACTION="searchres.php">Enter Last Name: <input name="search_query" type="text"><BR><input type="submit" name="Submit" value="Submit"></FORM></BODY></HTML><HTML><HEAD></HEAD><BODY><?php$search_query = trim($_POST['search_query']);$Host="i dunt believe it";$Username="damn";$Password="hahaha";$DBName="meh";$TableName="yeah"; $Link = mysql_connect($Host, $Username, $Password);$Query="SELECT * from $TableName Where user = '$search_query'";$Result= mysql_db_query ($DBName, $Query, $Link) or die(mysql_error());$Row = mysql_fetch_array($Result);$num = mysql_num_rows($Result);$user = $Row['user'];$playerid = $Row['playerid'];if($num == "0"){echo "Search for $search_query returned no results";}else{echo "Results: <br>$user ($playerid) <BR> ";}mysql_close ($Link);?></BODY></HTML>[/code] Quote Link to comment Share on other sites More sharing options...
supanoob Posted April 28, 2006 Author Share Posted April 28, 2006 that didnt work either :( Quote Link to comment Share on other sites More sharing options...
sanfly Posted April 28, 2006 Share Posted April 28, 2006 So lets say youre searching for "bob". Then is this what you are getting when you search?[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]The search for bob returned no results[/quote] Quote Link to comment Share on other sites More sharing options...
supanoob Posted April 29, 2006 Author Share Posted April 29, 2006 no it wasnt echoeing correctly, well still isnt but now i have loads of errors Quote Link to comment Share on other sites More sharing options...
sanfly Posted April 30, 2006 Share Posted April 30, 2006 What kind of errors? you need to be more specific Quote Link to comment Share on other sites More sharing options...
supanoob Posted April 30, 2006 Author Share Posted April 30, 2006 oh i have fixed that now, thanks i might add a tut on it :D show people how i did it etc Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.