Jump to content

Search the Community

Showing results for tags 'cannot re-declare'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

Found 1 result

  1. Hey there guys ! so i have finally finished my register log-in page , and with that i have created a couple functions pages , as i am sure you can assume all the functions for logic will be called from these pages. now i have one called users , i.e for login , registration , check if active, etc.. and i have one for more general functions page called general , i.e for redirects, and input sanitation. anyway my register login page works flawless ( well i guess more 90 % done 90 % left to go ). and now when im on the index page or my main page essentially i now see a fatal error: now i see that it is telling me exactly where the error is , yet i dont understand as to why i am seeing this . im not quite sure as to how the function is being declared already , when the function is only being called once or twice on the register page. just to show you guys what im talking about my code: general.php ( FUNCTIONS ARE STORED) function email($to, $subject, $body){mail($to, $subject, $body, 'From: support@j.m.com'); } function email_to_activate($to, $subject, $body){ mail($to, $subject, $body, 'From: activate@j.m.com'); } function email_user_for_recovery($to, $subject, $body){ mail($to, $subject, $body, 'From: recovery@j.m.com'); } function logged_in_redirect(){ if (logged_in() === true ) header("Location: index.php"); } function protect_page() { // redirects if user is not logged in .. user gets no access page if (logged_in() === false ) { header('Location: no_permission.php'); exit(); } } function admin_access() { global $user_data; if (has_access($user_data['user_id'], 1) === false) { header('Location: index.php'); exit(); } } function page_redirect() { // if user not logged in redirect goes to index page if (logged_in() === false ) { header('Location: index.php'); exit(); } } function redirect(){ // redirects regardless of logged in or not header('Location: index.php'); exit(); } function array_sanitize(&$item){ $items = strip_tags(htmlentities(mysql_real_escape_string($item))); } function sanitize($data) { return strip_tags(htmlentities(mysql_real_escape_string($data))); } function output_errors($errors){ $output = array(); foreach($errors as $error){ $output[] = $error ; } return '<ul>' . implode($output) . '</ul>'; } and index.php // CORE FUNCTIONS - DATABASE CONNECT - SESSIONS & COOKIES include('include/init.php'); // HEADER INFO - META TAGS - LINKS - SCRIPTS include('include/header.php'); // LOG USER IN if (logged_in() === true){ include ('include/widgets/loggedin.php'); } else { include('include/widgets/login.php'); } // WEBSITE LOGO include('include/logo_head.php'); // NAVIGATION BAR include('include/navbar.php'); // MAIN PAGE include('include/topbanner.php'); include('include/topbanner2.php'); <----- Error shows up here and cuts off the rest of the page. include('include/mainbody.php'); // FOOTER include('include/footer.php'); as i mention in the code above, the page spits about half the output then cuts off and displays that error message. This confuses me a bit more actually. any suggestions as to why this is happening ? EDIT : to add init.php ( CORE FILE ) if(!isset($_SESSION)) { session_start(); } error_reporting(E_ALL| E_STRICT); ini_set('display_errors', 1); require ('core/database/dbconnect.php'); require ('core/functions/general.php'); require ('core/functions/users.php'); require 'core/queries/dbqueries.php'; $current_file = explode('/', $_SERVER['SCRIPT_NAME']); $current_file = end($current_file); if (logged_in() === true) { $session_user_id = $_SESSION['user_id']; $user_data = user_data($session_user_id, 'user_id', 'username', 'password', 'email', 'gender', 'country', 'month' ,'date' , 'year', 'pass_recover', 'type'); if (user_active($user_data['username']) === false){ session_destroy(); header('Location: index.php'); exit(); } if($current_file !== 'change_password.php' && $current_file !== 'logout.php' && $user_data['pass_recover'] == 1 ){ header('Location: change_password.php?force'); exit(); } } $errors = array();
  • 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.