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
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
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', 'admin@yourdomain.com', '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
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', 'admin@yourdomain.com', '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
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', 'admin@yourdomain.com', 'home', 'VAM', '', 'No', '80', '80'

Link to comment
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', 'admin@yourdomain.com', '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', 'admin@yourdomain.com', 'home', 'VAM', '', 'No', '80', '80')");

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.