Jump to content

msz

New Members
  • Posts

    4
  • Joined

  • Last visited

msz's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. i am unable to select total_comment from mysql table related to each post.. For detail information check http://stackoverflow.com/questions/27406086/select-query-in-mysql
  2. Dear user I write a file upload code in php, the code work's fine but it will upload the file up to 60 KB, when i try to upload more then 60 KB file then the page stuck on loading. The problem is why it is not uploading more then 60kb file? is there any fault in my code please check it out.. My form.php code is... <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <link rel="stylesheet" href="css/bootstrap.css"/> <link rel="stylesheet" href="css/bootstrap.min.css"/> </head> <body> <div class="col-md-6"> <form action="upload.php" method="post" enctype="multipart/form-data"> <label for="">Item</label><br/> <input type="file" name="picture" class="form-control"><br/> <label for="">Description</label><br/> <textarea name="description" id="" placeholder="Enter Item Description" class="form-control" cols="50" rows="20"></textarea><br/> <input type="submit" name="submit" value="Upload" class="btn btn-success"> </form> </div> <script src="js/bootstrap.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/jquery-2.1.1.min.js"></script> <body> </html> my upload.php code is <?php include 'conn.php'; $desc=$_POST['description']; $image=$_FILES['picture']; $image_name=$_FILES['picture']['name']; $placed='uploads/'; if(move_uploaded_file($_FILES['picture']['tmp_name'],$placed.$image_name)) { $smt=$conn->prepare("INSERT INTO images(Image_Name,Description,Placed_On)VALUES('".$image_name."','".$desc."','".$placed."')"); $smt->execute(); header('location:form.php'); } else { echo 'error on uploading file'; } ?>
  3. msz

    user login

    Dear Friend's! i have a problem in my user login page. the problem is that when user login and i click the next page or link, then it will disappear, and when i back to the perivous page then it will not show the user? what can i do,,,, my login code is .. <?php include './header.php'; include 'connection.php'; if(isset($_POST) && count($_POST)>0) { $user = $_POST['username']; $pass = $_POST['password']; $sSQL = "SELECT * FROM ulog WHERE User_Name ='$user' AND Password = '$pass'"; $result = mysql_query($sSQL) or die(mysql_error()); if(mysql_affected_rows() > 0) { $row = mysql_fetch_object($result); $_SESSION['username'] = $row->User_Name; $_SESSION['password'] = $row->id; echo "<h4 id='welcome'>welcome &nbsp<a href='#'> $user</a></h4>"; } else { header("location:signup.html"); } } ?>
  4. hy to every one.. iam going to filter user input data using if(!filter_input(INPUT_POST,'$username')||!filter_input(INPUT_POST,'$password')) { echo "username or password already exists...."; } else { $sql = "INSERT INTO users (Username,Password) VALUES (:username,:password)"; $q=$dbh->prepare($sql); $q->execute(array(':username'=>$username,':password'=>$password)); $count=$q->rowCount(); echo "inserted $count rows.\n"; but it show an error... the error is that it simply show the message username or password already exists if the username or password is not exists it show the same message? if there is another metod in pdo to filter user data then plz proived the idea.
×
×
  • 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.