PHP was upgraded on my server to PHP 5 and now a script that I had running and working is not doing as it is told. I can't seem to see what the problem is. Can anyone help? [code]<?php require_once('../Connections/grey.php'); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . $_SERVER['QUERY_STRING']; } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO users (username, password, realname, email, currency) VALUES (%s, %s, %s, %s, %s)", GetSQLValueString($_POST['username'], "text"), GetSQLValueString($_POST['password'], "text"), GetSQLValueString($_POST['realname'], "text"), GetSQLValueString($_POST['email'], "text"), GetSQLValueString($_POST['currency'], "text")); mysql_select_db($database_grey, $grey); $Result1 = mysql_query($insertSQL, $grey) or die(mysql_error()); $insertGoTo = "adduser.php?msg=ok"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } echo "<b><font size=2 face=Verdana>User Added Successfully</font></b>"; //header(sprintf("Location: %s", $insertGoTo)); } mysql_select_db($database_grey, $grey); $query_user = "SELECT * FROM users"; $user = mysql_query($query_user, $grey) or die(mysql_error()); $row_user = mysql_fetch_assoc($user); $totalRows_user = mysql_num_rows($user); ?> <html> <head> <title>Add User</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <p><font face="Arial, Helvetica, sans-serif" size="2" color="#999999"> </font></p> <table width="95%" border="0" align="center" cellpadding="2" cellspacing="0" bgcolor="#999999"> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td bgcolor="#EEEEEE"> <p><font face="Arial, Helvetica, sans-serif" size="2" color="#999999"> <?php if ($msg == "ok"){ ?> </font></p> <p></p> <table width="90%" border="0" cellspacing="0" cellpadding="4" align="center" height="14"> <tr bgcolor="#003399"> <td width="660" height="11" bgcolor="#CCCCCC"><font face="Arial, Helvetica, sans-serif" color="#FFFFFF" size="2"><strong>Status Message</strong></font></td> </tr> <tr> <td width="660" height="20" bgcolor="#DDDDDD" class="table_outline"> <div align="center"><font face="Arial, Helvetica, sans-serif" size="2"><strong>OPERATION SUCCESSFUL </strong><br> <br> </font></div></td> </tr> </table> <?php } ?> <form method="post" name="form1" action="<?php echo $editFormAction; ?>"> <table align="center"> <tr valign="baseline"> <td nowrap align="right"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Username:</strong></font></td> <td><input type="text" name="username" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right"><strong><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Password:</font></strong></td> <td><input type="text" name="password" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right"><strong><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Real Name:</font></strong></td> <td><input type="text" name="realname" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right"><strong><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Email:</font></strong></td> <td><input type="text" name="email" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Region:</strong></font></td> <td><select name="currency" id="currency"> <option value="1">US Dollar</option> <option value="2">Euro</option> <option value="3">UK Sterling</option> <option value="0">Scottish Water</option> <option value="3"><< Select >></option> </select></td> </tr> <tr valign="baseline"> <td nowrap align="right"> </td> <td><input type="submit" value="Add User"></td> </tr> </table> <input type="hidden" name="MM_insert" value="form1"> </form> <p> </p> <p> </p> </td> </tr> </table></td> </tr> </table> <FORM> <p align="right"> <INPUT name="Button" Type="Button" onclick="window.close()" Value="Close Window"> </p> </FORM> <p> </p> </body> </html> <?php mysql_free_result($user); ?>[/code]