Greaser9780 Posted February 14, 2007 Author Share Posted February 14, 2007 Nope, it just turns my screen all white again. Link to comment https://forums.phpfreaks.com/topic/38416-solved-prob-compairing-mysql-result-with-_post-result/page/2/#findComment-184436 Share on other sites More sharing options...
redarrow Posted February 14, 2007 Share Posted February 14, 2007 post your form please cheers. Link to comment https://forums.phpfreaks.com/topic/38416-solved-prob-compairing-mysql-result-with-_post-result/page/2/#findComment-184438 Share on other sites More sharing options...
Greaser9780 Posted February 14, 2007 Author Share Posted February 14, 2007 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Untitled</title> </head> <body> <form action="bhdsingle_create.php" method="post"> Clan Name:<input type="text" name="clan_name"> Logo:<input type="text" name="logo"> Message:<input type="text" name="message"> Email:<input tupe="text" name="email"> AIM Handle:<input type="text" name="aim"> Yahoo Handle:<input type="text" name="yahoo"> MSN Handle:<input type="text" name="msn"> <button type="submit">Submit</button> </form> </body> </html> Link to comment https://forums.phpfreaks.com/topic/38416-solved-prob-compairing-mysql-result-with-_post-result/page/2/#findComment-184440 Share on other sites More sharing options...
Greaser9780 Posted February 14, 2007 Author Share Posted February 14, 2007 If anyone cares I finally figured it out.The following is what actually worked: $sql_select = "SELECT `clan_name` FROM `bhdsingle` WHERE `clan_name`='$clan_name' "; $result= mysql_query($sql_select) or die(mysql_error()); if (mysql_num_rows($result) == 1 ) { echo "Sorry, that clan name is already registered here at PST. Please choose another clan name."; include("bhdsingle_join_form.html"); } else { $sql = "INSERT INTO `bhdsingle` (clan_name, logo, message, email, aim, yahoo, msn, signup_date) VALUES('$clan_name', '$logo', '$message', '$email', '$aim', '$yahoo', '$msn', now() )" or die (mysql_error()); $sql_result=mysql_query($sql)or die(mysql_error()); echo "Congratulations on registering your new clan for the BHD Singles Ladder!"; } :) :) Link to comment https://forums.phpfreaks.com/topic/38416-solved-prob-compairing-mysql-result-with-_post-result/page/2/#findComment-184455 Share on other sites More sharing options...
redarrow Posted February 14, 2007 Share Posted February 14, 2007 please try this as your way is not safe try ok. use the page as it is ok. <?php $database=mysql_connect("localhost","username","password"); $mysql_select_db( "database_name" , $database); $clan_name=addslashes($_POST['clan_name']); $logo=addslashes($_POST['logo']); $message=addslashes($_POST['message']); $email=addslashes($_POST['email']); $aim=addslashes($_POST['aim']); $yahoo=addslashes($_POST['yahoo']); $msn=addslashes($_POST['msn']); $sql_select = "SELECT * FROM `bhdsingle` WHERE `clan_name`='$clan_name' "; $result= mysql_query($sql_select) or die(mysql_error()); if (mysql_num_rows($result) == 1 ) { echo "Sorry, that clan name is already registered here at PST. Please choose another clan name."; include("bhdsingle_join_form.html"); } else { if($_POST['submit']){ $sql = "INSERT INTO `bhdsingle` (clan_name, logo, message, email, aim, yahoo, msn, signup_date VALUES('$clan_name', '$logo', '$message', '$email', '$aim', '$yahoo', '$msn', 'now() )" or die (mysql_error()); $sql_result=mysql_query($sql)or die(mysql_error()); echo "Congratulations on registering your new clan for the BHD Singles Ladder!"; } } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Untitled</title> </head> <body> <form action=" " method="post"> Clan Name:<input type="text" name="clan_name"> Logo:<input type="text" name="logo"> Message:<input type="text" name="message"> Email:<input tupe="text" name="email"> AIM Handle:<input type="text" name="aim"> Yahoo Handle:<input type="text" name="yahoo"> MSN Handle:<input type="text" name="msn"> <input type="submit" name="submit" value="submit"> </form> </body> </html> Link to comment https://forums.phpfreaks.com/topic/38416-solved-prob-compairing-mysql-result-with-_post-result/page/2/#findComment-184466 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.