pHp Fatal error: function name must be a string on line 23. Can't figure out why -


i have seen question asked before here, not within same context. have re-written on , on , continually same error. can see have done wrong?

<?php   include './connect.php';      if(array_key_exists("submit", $_post)) {          print_r($_post);          $error= "";          if(!$_post["email"]) {             $error .= "an email address required!<br>";         }          if(!$_post["password"]) {             $error .= "a password required!<br>";         }          if($error != "") {             $error = "<p>there error(s) in form: </p>".$error."<br>";         } else {              $query = "select id `users` email = '".$db_real_escape_string($link, $_post['email'])."' limit 1";              $result = $db_query($link, $query);              if($db_num_rows($result) > 0) {                 $error = "that email address exists!";             } else {                 $query = "insert `users` (`email`, `password`) values                 ('".$db_real_escape_string($link, $_post['email'])."',                 '".$db_real_escape_string($link, $_post['password'])."')";                  if ($db_query($link, $query)) {                     $error = "<p>could not sign up, please try again later</p>";                 } else {                     echo "sign successful!";                 }             }         }     }  ?>  <div id="error"><?php echo $error; ?></div>  <form method="post">     <input type="email" name="email" placeholder="your email" />     <input type="password" name="password" placeholder="password" />     <input type="checkbox" name="stayloggedin" value=1 />     <input type="submit" name="submit" value="sign up!" /> </form> 

included file:

<?php      $servername = getenv('ip');     $username = getenv('c9_user');     $password = '';     $database = 'c9';     $dbport = 3306;      $db = new mysqli($servername, $username, $password, $database, $dbport);      if($db->connect_error) {         die("connection failed: ".$db->connect_error);     } else {         echo "connected (".db_host_info.")";     } ?> 

i can print out contents of $db index.php file know include working correctly.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -