I can't get my Add new Division form to submit to the database. Anyone see my issue?
Code: <?php
$e = <<<here
<script src="./jscripts/scriptaculous/prototype.js" type="text/javascript"></script>
<script src="./jscripts/scriptaculous/scriptaculous.js" type="text/javascript"></script>
<script type="text/javascript" src="./jscripts/ajax.js"></script>
here;
switch ($_REQUEST['option']) {
case 0:
echo $e;
?>
<h1 class="backstage">Division Management</h1><br />
<h2 class=backstage>Divisions :: <a href="#" onclick="ajaxpage('backstage_libs/division.php?option=1', 'content'); return false;">Add New</a></h2><br />
<table width="100%" class="table1">
<tr class="rowheading">
<td> </td>
<td>Name</td>
</tr>
<?php
$query = "SELECT * FROM efed_list_divisions";
$result = mysql_query ( $query );
$rows = mysql_num_rows($result);
if ($result) {
$i = 0;
while ( $row = mysql_fetch_array ( $result, MYSQL_ASSOC ) ) {
$sClass = 'row2';
if ($i++ % 2) $sClass = 'row1';
printf ( "<tr class="%s">", $sClass );
print "<td valign="top" align=center width=35><a href="#" onclick="ajaxpage('backstage_libs/division.php?option=2', 'content'); return false;">Edit</a></td>";
printf ( "<td valign="top">%s</td>", $row [name] );
echo '</tr>';
}
echo '</table>';
} else {
echo '<span>There are no divisions.</span><br />';
}
returnmain();
break;
case 1:
echo $e;
require_once('../backstagefunctions.php');
?>
<h1 class="backstage">Division Management</h1><br />
<h2 class="backstage">Add New Division</h2><br />
<form name="divisions" method="post">
<input type="hidden" name="action" value="division" />
<table width="100%" class="table2">
<tr>
<td width="120" class="rowheading" valign="center">Division Name:</td><td class="row3"><input type="text" name="name" class="fieldtext490"></td>
</tr>
</table><br />
<input type="hidden" name="newadded" value="true">
<input type="submit" value="Save Division" class="button"></form><br />
<form method="post"><input type="submit" value="Return to Division List" class="button200" name="return">
</form><br />
<?php
returnmain();
break;
case 2:
echo $e;
require_once('../backstagefunctions.php');
?>
<h1 class="backstage">Division Management</h1><br />
<h2 class="backstage">Edit Division</h2><br />
<form name="editdivision" method="post">
<table width="100%" class="table2">
<tr>
<td width="120" class="rowheading" valign="center">Division:</td><td class="row3"><input type="text" name="division" class="fieldtext490" value=""></td>
</tr>
</table><br />
<center>
<input type="checkbox" name="deletedivision"><span class="table1heading">Delete Division?</span><br /><br />
<input type="submit" value="Edit Division" class=button name="editdivision"><br /><br />
<input type="button" value="Return to Divisions List" class="button200"><br /><br />
</form>
<?php
returnmain();
break;
}
function division() {
if ((!empty($_POST['newadded'])) && (!empty($_POST['divisions']))) {
$name = mysql_real_escape_string($_POST['name']);
$query = "INSERT INTO `efed_list_divisions` (name) VALUES ('".$name."')";
if (mysql_query($query)) {
//success
} else {
//fail
}
}
}
?>
http to https
Hi,Is there any specific method/condition to move an http:// page to https:// ?
Change Web page language
i doing this thing first time but i dont find any suitable solution for it. On the demand of user. I want to change my web site pages in user's language without without google translater. Can
Login Functionality Working Different on IE
This is an odd one, I have a site which has an admin section. The admin pages unsurprisingly require you to be logged in to access them. Each admin page has the following at the top to check that the
Passing JS to PHP
So I have the followingCode: <?phpgetdetails(?><script type="text/javascript">document.write(jsvariable)</script><?php );?>The idea is
Limiting uploaded file type
Hi. First post here I am working on a simple upload script, and I need it to limit the allowed file type that is uploaded to only .mpr files. .mpr files are not a MIME file type so I do not know how
PHP - MySQL Fail
My PHP code will only execute the first part of my code... Code: <?php session_start(); ?> <html> <head> <title> Create a
Not Loading Function Into Div
I'm not sure whether to put this under the php forum or ajax forum but because I tink it's more of an issue wit the php code itself I decided to put it here. I came across this file from a friend that
Polymorphism
Was wondering if someone could explain this a little better to me. I had always assumed that it had to do with method overloading or overriding(through inheritence). The following wikipedia entry
rookie looking for help coding a CSS form with PHP
I'm trying to figure out how to add PHP code to my xhtml form so that it is a working form embedded in the contact us page of a website that is still on my pc only. The end goal is to place the PHP
exclude characters from counting?
Hello, I wanted to ask if you have a string like:Code: $my_s='ASRGREGTGTR----REGREGRE+++RRRRRR....';is there a way to count the length of the string, excluding non-word characters (+,- or .)?thank you