Jump to content

mahenda

Members
  • Content Count

    132
  • Joined

  • Last visited

Community Reputation

0 Neutral

About mahenda

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. How can i play with these role in my database table as you can see here //I have a database table CREATE TABLE users ( id int(10) NOT NULL PRIMARY KEY AUTO_INCREMENT, urole varchar(10) ); in the role column, I have 2 roles first role is only used once but the sound one can be assigned to more than one user, now I want to check my table if the first role is already registered, then we can't register user with that role, also the second role can exist two or more times //check role, a variable user role has been defined as $urole = $_POST['urole']; $check = $connect -> prepar
  2. AWESOME SOLUTION THANKS, SOLVED, IT WAS A SYNTAX IN MY PHP SCRIPT, I CHECKED IN ERROR LOG
  3. //please dont talk about sql injection, i'll work on it, the problem with this code, it count all entries in a database table but i wantto count only with nid = 1 $query = 'SELECT * FROM abc WHERE nid = if(!empty($_POST["search"]["value"])){ $query .= 'AND (a LIKE "%'.$_POST["search"]["value"].'%" OR b LIKE "%'.$_POST["search"]["value"].'%" OR c LIKE "%'.$_POST["search"]["value"].'%") '; } if(!empty($_POST["order"])){ $query .= 'ORDER BY '.$_POST['order']['0']['column'].' '.$_POST['order']['0']['dir'].' '; } else { $query .= 'ORDER BY id DESC ';
  4. is iy possible to auto dismiss the appended alert? this doesn't work $("#slide-up").fadeTo(2000, 500).slideUp(500, function(){ $("#slide-up").slideUp(500); }); after adding #slide-up id $('.card-header').append('<div class="alert alert-info alert-dismissible" role="alert" id="slide-up"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>'+data.errors.phonenoexist+'</div>');
  5. Thanks it works // i changed the columns in a table mydata create table mydata ( id int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, fname varchar(20) NOT NULL, phoneno varchar(12) NOT NULL UNIQUE /*......*/ ); //it works, but i validated the phoneno so the user can't enter invalid number
  6. //database create table mydata ( id int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, fname varchar(20), phoneno int(12) NOT NULL /*......*/ ); //class my data php <?php include('connect.php'); class InsertMydata { public function insertnow($fname, $phoneno) { $connect = new Connect; $insrt = $db -> prepare('INSERT INTO mydata (fname, phoneno) VALUES (?,?)'); $insrt -> execute(array($fname, $phoneno)); } } ?> //insernow validate form <?php include('../classs/mydata.php'); //Declare data and error arrays $errors = []; $mydara = []; if(!preg_mat
  7. As we know , A post_max_size used to limit the size of posted data via POST method while the upload_max_filesize used to limit the size of file to be uploaded I assume. post_max_size = 8m upload_max_filesize = 2m When i limit the user to only upload 100kb file, i say <pre> if (!empty($_FILES["myfile"]["tmp_name"]) && ($_FILES["myfile"]["size"] > 100000)) { echo "the file is too large"; } </pre> This message occur even when the file is greater than 8 m The problem com
  8. so this means ini_set('session.cache_limiter','public'); session_cache_limiter(false); session_start(); or session_start(); ini_set('session.cache_limiter','public'); session_cache_limiter(false); and what happen when am creating login session
  9. ini_set('session.cache_limiter','public'); session_cache_limiter(false); they give warning Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in C:\xampp\htdocs\aps\init.php on line 3 Warning: session_cache_limiter(): Cannot change cache limiter when session is active in C:\xampp\htdocs\aps\init.php on line 4
  10. //look my code CREATE TABLE IF NOT EXISTS first ( fid int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, p_name varchar(60) NOT NULL ); CREATE TABLE IF NOT EXISTS second ( sed int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, firstname varchar(20) NOT NULL, fid int(11) NOT NULL, FOREIGN KEY (fid) REFERENCES first(fid) ); CREATE TABLE IF NOT EXISTS third ( thid int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, start_date date NOT NULL, end_date date NOT NULL, sed int(11) NOT NULL, FOREIGN KEY (sed) REFERENCES second(sed), fid int(11) NOT NULL, FOREIGN KEY (fid) RE
  11. It give an the link like http://localhost/aps/undefined Object not found! The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error. If you think this is a server error, please contact the webmaster. Error 404 localhost Apache/2.4.35 (Win32) OpenSSL/1.1.0i PHP/7.2.11 //The php code to fetch data //The php code to fetch data <?php include('db.php'); $query = ''; $output = array(); $query .= "SELECT * FROM users "; if(isset($_POST["search"]["value"
  12. //The php code to fetch data <?php include('db.php'); $query = ''; $output = array(); $query .= "SELECT * FROM users "; if(isset($_POST["search"]["value"])) { $query .= 'WHERE first_name LIKE "%'.$_POST["search"]["value"].'%" '; $query .= 'OR last_name LIKE "%'.$_POST["search"]["value"].'%" '; } if(isset($_POST["order"])) { $query .= 'ORDER BY '.$_POST['order']['0']['column'].' '.$_POST['order']['0']['dir'].' '; } else { $query .= 'ORDER BY id DESC '; } if($_POST["length"] != -1) { $query .= 'LIMIT ' . $_POST['start'] . ', ' . $_POST['length']; } $statement = $connec
×
×
  • 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.