Jump to content

Undefined Function?


monkeypaw201

Recommended Posts

<?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

<?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

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.