Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- require 'database.php';
- if( isset($_SESSION['user_id']) ){
- $records = $conn->prepare('SELECT id,email,password,curvouch,fname FROM users WHERE id = :id');
- $records->bindParam(':id', $_SESSION['user_id']);
- $records->execute();
- $results = $records->fetch(PDO::FETCH_ASSOC);
- $user = NULL;
- if( count($results) > 0){
- $user = $results;
- }
- }
- ?>
- <?php
- <div class="form-group" action="profile.php" method="POST">
- <label for="exampleInputEmail1">Email address</label>
- <input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email" name="email">
- <small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
- </div>
- <button type="submit" class="btn btn-primary">Submit</button>
- </form>
- <?php
- $server = 'localhost';
- $username = 'HIDDEN';
- $password = 'HIDDEN';
- $database = 'HIDDEN';
- try{
- $conn = new PDO("mysql:host=$server;dbname=$database;", $username, $password);
- } catch(PDOException $e){
- die( "Connection failed: " . $e->getMessage());
- }
- Fatal error: Uncaught Error: Call to a member function execute() on null in /
Add Comment
Please, Sign In to add comment