Search the Community
Showing results for tags 'phphelp'.
-
here is a code of sign in page I want to add a role access for the student, teacher, and admin I have table name student in the database and a column role see image attached for database include("dbconfig.php"); session_start(); if($_SERVER["REQUEST_METHOD"] == "POST") { // username and password sent from form $name = mysqli_real_escape_string($con,$_POST['name']); $password = mysqli_real_escape_string($con,$_POST['password']); $sql = "SELECT user_id FROM student WHERE name = '$name' and password = '$password'"; $result = mysqli_query($con,$sql); $row = mysqli_fetch_array($result,MYSQLI_ASSOC); // $active = $row['active']; $count = mysqli_num_rows($result); if($count == 1) { //session_register("name"); $_SESSION['login_user'] = $name; header("location: allstudents1.php"); }else { $error = "Your Login Name or Password is invalid"; } } ?>
-
Hey I'm new to php and I have a bit of a problem. I haven't edited anything on this page, but keep getting a Parse error: syntax error, unexpected T_LNUMBER on line 64. Does anyone see the mistake or could help me in any way? Thank you. <?php // Set Content Width if ( ! isset( $content_width ) ) $content_width = 480; /*==================================== THEME SETUP ====================================*/ // Load default style.css and Javascripts add_action('wp_enqueue_scripts', 'themezee_enqueue_scripts'); if ( ! function_exists( 'themezee_enqueue_scripts' ) ): function themezee_enqueue_scripts() { // Register and Enqueue Stylesheet wp_register_style('zeeBusiness_stylesheet', get_stylesheet_uri()); wp_enqueue_style('zeeBusiness_stylesheet'); // Enqueue jQuery Framework wp_enqueue_script('jquery'); // Register and enqueue the Malsup Cycle Plugin wp_register_script('zee_jquery-cycle', get_template_directory_uri() .'/includes/js/jquery.cycle.all.min.js', array('jquery')); wp_enqueue_script('zee_jquery-cycle'); } endif; // Load comment-reply.js if comment form is loaded and threaded comments activated add_action( 'comment_form_before', 'themezee_enqueue_comment_reply' ); function themezee_enqueue_comment_reply() { if( get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } // Setup Function: Registers support for various WordPress features add_action( 'after_setup_theme', 'themezee_setup' ); if ( ! function_exists( 'themezee_setup' ) ): function themezee_setup() { // init Localization load_theme_textdomain('themezee_lang', get_template_directory() . '/includes/lang' ); // Add Theme Support add_theme_support('post-thumbnails'); add_theme_support('automatic-feed-links'); add_editor_style(); // Add Custom Background add_theme_support('custom-background', array('default-color' => 'eee')); // Add Custom Header add_theme_support('custom-header', array( 'default-image' => get_template_directory_uri() . '/images/default_header.jpg', 'header-text' => false, 'width' => 1100, 'height' => 140, 'flex-height' => true)); // Register Navigation Menus register_nav_menu( 'top_navi', __('Top Navigation', 'themezee_lang') ); register_nav_menu( 'main_navi', __('Main Navigation', 'themezee_lang') ); register_nav_menu( 'foot_navi', __('Footer Navigation', 'themezee_lang') );