Xtremer360 Posted December 8, 2009 Share Posted December 8, 2009 After I submit the form it doesn't place it in the database. Don't know why. print '<h1 class="backstage">Match Type Management</h1><br />'; print '<h2 class="backstage">Add New Match Type</h2><br />'; print '<form name="matchtype" method="post">'; print '<table width="100%" class="table2">'; print '<tr>'; print '<td width="120" class="rowheading" valign="center">Match Type:</td><td class="row3"><input type="text" name="matchtype" class="fieldtext490"></td>'; print '</tr>'; print '</table><br />'; print '<input type="hidden" name="newadded"><input type="submit" value="Save Match Type" class="button" name="addmatchtype"></form><br />'; print '<form method="POST"><input type="submit" value="Return to Match Type List" class="button200" name="return"></form><br />'; <?php function matchtypes() { if(isset($_POST['addmatchtype'])) { $matchtype = $_POST['matchtype']; $query = "INSERT INTO `efed_list_matchtypes` (`matchtype`) VALUES ('$matchtype')"; if (@mysql_query ($query)) { print '<p>The match type has been added.</p>'; } else { print '<p>Could not add the entry because: <b>" . mysql_error() . "</b>. The query was $query.</p>'; } } } ?> Link to comment https://forums.phpfreaks.com/topic/184348-form-action-problems/ Share on other sites More sharing options...
Deoctor Posted December 8, 2009 Share Posted December 8, 2009 where are u using the connection string to the database and how can it add to database if not connected to any one of the dataservers... Link to comment https://forums.phpfreaks.com/topic/184348-form-action-problems/#findComment-973233 Share on other sites More sharing options...
Xtremer360 Posted December 8, 2009 Author Share Posted December 8, 2009 Where at do I put the include of that file in the coding? And it's not even giving me an error message or anything should I be worried? Link to comment https://forums.phpfreaks.com/topic/184348-form-action-problems/#findComment-973236 Share on other sites More sharing options...
Deoctor Posted December 8, 2009 Share Posted December 8, 2009 u should include a file right at the top of the php file u can use it under the <?php tag like this <?php include "inc.php"; print '<h1 class="backstage">Match Type Management</h1><br />'; print '<h2 class="backstage">Add New Match Type</h2><br />'; print '<form name="matchtype" method="post">'; print '<table width="100%" class="table2">'; print '<tr>'; print '<td width="120" class="rowheading" valign="center">Match Type:</td><td class="row3"><input type="text" name="matchtype" class="fieldtext490"></td>'; print '</tr>'; print '</table><br />'; print '<input type="hidden" name="newadded"><input type="submit" value="Save Match Type" class="button" name="addmatchtype"></form><br />'; print '<form method="POST"><input type="submit" value="Return to Match Type List" class="button200" name="return"></form><br />'; function matchtypes() { if(isset($_POST['addmatchtype'])) { $matchtype = $_POST['matchtype']; $query = "INSERT INTO `efed_list_matchtypes` (`matchtype`) VALUES ('$matchtype')"; if (@mysql_query ($query)) { print '<p>The match type has been added.</p>'; } else { print '<p>Could not add the entry because: <b>" . mysql_error() . "</b>. The query was $query.</p>'; } } } ?> i dont know y it didnt showed u any error.. it should have obviusly given u one.. just try this code and see.. also one more thing change the file name from inc.php to something relevant Link to comment https://forums.phpfreaks.com/topic/184348-form-action-problems/#findComment-973243 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.