monkeypaw201 Posted June 16, 2008 Share Posted June 16, 2008 <?php $updateSQL = sprintf("INSERT INTO vamsys_users (username, password, admin) VALUES (%s, %s, %s)", GetSQLValueString($_POST['username'], "text"), GetSQLValueString(sha1($_POST['password']), "text"), GetSQLValueString($_POST['admin'], "text")); mysql_select_db($database_vamsys, $vamsys); $Result1 = mysql_query($updateSQL, $vamsys) or die(mysql_error()); ?> error: Fatal error: Call to undefined function GetSQLValueString() in install.php on line 58 any ideas? Link to comment https://forums.phpfreaks.com/topic/110371-undefined-function/ Share on other sites More sharing options...
bluejay002 Posted June 16, 2008 Share Posted June 16, 2008 <?php $updateSQL = sprintf("INSERT INTO vamsys_users (username, password, admin) VALUES (%s, %s, %s)", GetSQLValueString($_POST['username'], "text"), GetSQLValueString(sha1($_POST['password']), "text"), GetSQLValueString($_POST['admin'], "text")); mysql_select_db($database_vamsys, $vamsys); $Result1 = mysql_query($updateSQL, $vamsys) or die(mysql_error()); ?> error: Fatal error: Call to undefined function GetSQLValueString() in install.php on line 58 any ideas? GetSQLValueString() does not exist in install.php... check install.php if it really has a function named that way. and that includes the casing. Link to comment https://forums.phpfreaks.com/topic/110371-undefined-function/#findComment-566275 Share on other sites More sharing options...
GingerRobot Posted June 16, 2008 Share Posted June 16, 2008 Isn't it some sort of Dreamweaver muck? You'll no doubt need to include some other file. Link to comment https://forums.phpfreaks.com/topic/110371-undefined-function/#findComment-566276 Share on other sites More sharing options...
monkeypaw201 Posted June 16, 2008 Author Share Posted June 16, 2008 ok, well.. i removed that function and am using this now $pass=sha1($_POST['password']); $updateSQL = sprintf("INSERT INTO vamsys_users (username, password, admin) VALUES ('$_POST[username]','$pass','$_POST[admin]')"); mysql_select_db($database_vamsys, $vamsys); $Result1 = mysql_query($updateSQL, $vamsys) or die(mysql_error()); $updateSQL = sprintf("INSERT INTO `vamsys_settings` VALUES (1, 'Your New Website!', '$_POST[domain]', 'Default', 'default', 'Copyright 2008 VAMSys - All Rights Reserved', '[email protected]', 'home', 'VAM', '', 'No', '80', '80'"); mysql_select_db($database_vamsys, $vamsys); $Result1 = mysql_query($updateSQL, $vamsys) or die(mysql_error()); and now i'm getting this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Link to comment https://forums.phpfreaks.com/topic/110371-undefined-function/#findComment-566532 Share on other sites More sharing options...
trq Posted June 16, 2008 Share Posted June 16, 2008 Its likely that your $_POST variables aren't defined or are empty. You need to check this prior to attempting to use them. Link to comment https://forums.phpfreaks.com/topic/110371-undefined-function/#findComment-566540 Share on other sites More sharing options...
monkeypaw201 Posted June 16, 2008 Author Share Posted June 16, 2008 i have a form to submit them and i've triple check the names.. here is then rest of the relavent code: <?php if($_GET['step'] == "3"){ ?> <form name="form1" method="post" action="install.php?step=4"> <table width="100%" border="0"> <tr> <td>Username</td> <td><label> <input type="text" name="username" id="username"> </label></td> </tr> <tr> <td>Password</td> <td><label> <input type="password" name="password" id="password"> </label></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td>Domain (ie http://google.com/)</td> <td><label> <input type="text" name="domain" id="domain"> </label></td> </tr><input type="hidden" name="admin" id="admin" value="yes" /> <tr> <td> </td> <td><label> <input type="submit" name="button" id="button" value="Continue"> </label></td> </tr> </table> </form> ** Your Domain MUST have a trailing slash and any sub-directory <?php } if($_GET['step'] == "4"){ require_once("Connections/vamsys.php"); $pass=sha1($_POST['password']); $updateSQL = sprintf("INSERT INTO vamsys_users (username, password, admin) VALUES ('$_POST[username]','$pass','$_POST[admin]')"); mysql_select_db($database_vamsys, $vamsys); $Result1 = mysql_query($updateSQL, $vamsys) or die(mysql_error()); $updateSQL = sprintf("INSERT INTO `vamsys_settings` VALUES (1, 'Your New Website!', '$_POST[domain]', 'Default', 'default', 'Copyright 2008 VAMSys - All Rights Reserved', '[email protected]', 'home', 'VAM', '', 'No', '80', '80'"); mysql_select_db($database_vamsys, $vamsys); $Result1 = mysql_query($updateSQL, $vamsys) or die(mysql_error()); echo "Administrator Account Added and Domain configured... <br><br><a href='install.php?step=5'>Continue...</a>"; } ?> Link to comment https://forums.phpfreaks.com/topic/110371-undefined-function/#findComment-566546 Share on other sites More sharing options...
monkeypaw201 Posted June 16, 2008 Author Share Posted June 16, 2008 bump Link to comment https://forums.phpfreaks.com/topic/110371-undefined-function/#findComment-566664 Share on other sites More sharing options...
GingerRobot Posted June 16, 2008 Share Posted June 16, 2008 Change both of your queries to this: $Result1 = mysql_query($updateSQL, $vamsys) or die(mysql_error().'<br />Query was:'.$updateSQL); Link to comment https://forums.phpfreaks.com/topic/110371-undefined-function/#findComment-566676 Share on other sites More sharing options...
monkeypaw201 Posted June 16, 2008 Author Share Posted June 16, 2008 new output: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Query was:INSERT INTO `vamsys_settings` VALUES (1, 'Your New Website!', 'http://www.vamsys.org/demo/', 'Default', 'default', 'Copyright 2008 VAMSys - All Rights Reserved', '[email protected]', 'home', 'VAM', '', 'No', '80', '80' Link to comment https://forums.phpfreaks.com/topic/110371-undefined-function/#findComment-566679 Share on other sites More sharing options...
monkeypaw201 Posted June 16, 2008 Author Share Posted June 16, 2008 if it helps any i checked the database and it has been inserting correctly... just its still giving errors... is there any way to hide the errors and just continue running the script? Link to comment https://forums.phpfreaks.com/topic/110371-undefined-function/#findComment-566699 Share on other sites More sharing options...
GingerRobot Posted June 16, 2008 Share Posted June 16, 2008 new output: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Query was:INSERT INTO `vamsys_settings` VALUES (1, 'Your New Website!', 'http://www.vamsys.org/demo/', 'Default', 'default', 'Copyright 2008 VAMSys - All Rights Reserved', '[email protected]', 'home', 'VAM', '', 'No', '80', '80' There you are then. You're missing the the closing bracket in your list of fields to insert. Try: $updateSQL = sprintf("INSERT INTO `vamsys_settings` VALUES (1, 'Your New Website!', '$_POST[domain]', 'Default', 'default', 'Copyright 2008 VAMSys - All Rights Reserved', '[email protected]', 'home', 'VAM', '', 'No', '80', '80')"); Link to comment https://forums.phpfreaks.com/topic/110371-undefined-function/#findComment-566725 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.