ColdEdge Posted July 5, 2009 Share Posted July 5, 2009 Hello I have a simple PHP search script which runs by defult searching for requested titles, but it also comes with option of checking off tags and searching tags instead of the title of specific request.I dont want to add all stuff to MySQL Manually. So I made a PHP Search Add script, but when i try to test it i get and error. Can any one tell me whats wrong? <?php$con = mysql_connect("localhost","******_riot","********");if (!$con) { die('Could not connect: ' . mysql_error()); }$q = mysql_query("SELECT * FROM doSearch WHERE stitle = '$title'") or die (mysql_error());if(mysql_num_rows($q) > 0){ echo '<script>alert("The title you entered is already in use, please try again."</script>'; echo '<script>history.back(1);</script>'; exit;}mysql_query("INSERT INTO doSearch (slink, stitle, stags, splot, simg) VALUES ('$link','$title','$tags','$plot','$img')") or die(mysql_error());if(($query){echo'<html> <head> <title>Sucess</title> </head> <body> <p>Information was added to database successfully!</p> </body> </html> '; } else {echo'<html> <head> <title>Error</title> </head> <body> <p>An error occured, please try again. If this error keeps repeating please contact administrator.</p> </body> </html> ';}} else {?><html><head><title>Title Administration Module</title></head><body> <form action="<?= $_SERVER['PHP_SELF'] ?>" method="post"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="50%">Title: </td> <td width="50%"><input name="title" type="text" id="title"></td> </tr> <tr> <td>Search URL: </td> <td><input name="link" type="text" id="link" value="http://www.animefrost.com/series?vid="></td> </tr> <tr> <td>Title Tags: </td> <td><input name="tags" type="text" id="tags"></td> </tr> <tr> <td>Title Plot: </td> <td><input name="plot" type="text" id="plot"></td> </tr> <tr> <td>Image URL: </td> <td><input name="img" type="text" id="img"></td> </tr> <tr> <td>Complete Process:</td> <td><input name="submit" type="submit" value="Submit!"></td> </tr> </table> </form> </body> </html> <? } mysql_close($l); ?> -Thanks ColdEdge Link to comment Share on other sites More sharing options...
Ingolme Posted July 5, 2009 Share Posted July 5, 2009 If you told us what the error message says we could have a better idea of where the problem is. Link to comment Share on other sites More sharing options...
ColdEdge Posted July 5, 2009 Author Share Posted July 5, 2009 Here is the error when i run it. [05-Jul-2009 09:09:04] PHP Parse error: syntax error, unexpected '{' in /home/riot/public_html/sAdd.php on line 20 By the way Inglome can you tell me how to make a wrapper with background? When I try to add background to repeat down it dose not repeat down why is that?Here is the code for the components of the warpper div#container { width:878px; padding-bottom: 10px;margin:0 auto 0 auto; background:url(images/nav-content_.png);} .wrap {height:inherit;} Link to comment Share on other sites More sharing options...
Ingolme Posted July 5, 2009 Share Posted July 5, 2009 You forgot a closing parenthesis on this line: if(($query) If you're calling an external stylesheet, make sure that the background image URL is relative to the stylesheet and not the HTML document. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.