Jump to content

abubaker0000

Members
  • Posts

    22
  • Joined

  • Last visited

abubaker0000's Achievements

Member

Member (2/5)

0

Reputation

  1. I make this function but not work function work_image_multipages($num_of_itmes,$sended_page) { global $con; if(!isset($_GET['page'])) { $page=1; } else { $page=(int)$_GET['page']; } $records_at_page=$num_of_itmes; $q=mysqli_query($con,'select * from images'); $records_count=mysqli_num_rows($q); mysqli_free_result($q); $page_count=(int)ceil($records_count/$records_at_page); if(($page>$page_count)||($page<=0)) { mysqli_close($con); die('no pages'); } $start=($page-1)*$records_at_page; $end=$records_at_page; if($records_count!=0) { $query=mysqli_query($con,'select * from images LIMIT $start,$end'); $icount=mysqli_num_rows($query); $items=array(); for($i=0; $i<$icount; $i++) { $items[count($items)]=mysqli_fetch_object($query); } } mysqli_free_result($query); return($items); //print the numbers of pages for($i=0; $i<=$page_count; $i++) { if($page==$i) { echo $page; } else { echo '<a href="$sended_page?page'.$i.'">'.$i.'</a>'; } } }
  2. hi how can I make a function for multi pages , the function accept two arguments (page name, number of records which showed in one page). and returns the data from the table , also returns the number of pages
  3. there are many files ... so that may get same name?
  4. I used the move_uploaded_file function to upload files to my server ,but the function changes the Arabic names of files because most of my files are Arabic named how can I fix that ?
  5. I do it but in mouse click(focus) the border shadow is visible
  6. how can make the text box like line as in the photo
  7. it's by default but cant upload 12MB size image also when I upload a large size image the not give me "DONE" or "ERROR" in the browser
  8. <!doctype html> <html> <head> <meta content="text/html; charset=utf-8" http-equiv="content-type"> <title>Untitled Document</title> </head> <body> <form action="upload_image.php" method="post" enctype="multipart/form-data"> <label>select page<input type="file" name="image"> <input type="submit" name="upload"> </label> </form> <?php if(isset($_POST['upload'])) { $image_name=$_FILES['image']['name']; //return the name ot image $image_type=$_FILES['image']['type']; //return the value of image $image_size=$_FILES['image']['size']; //return the size of image $image_tmp_name=$_FILES['image']['tmp_name'];//return the value if($image_name=='') { echo '<script type="text/javascript">alert("please select image")</script>'; exit(); } else { $ex=move_uploaded_file($image_tmp_name,"image/".$image_name); if($ex) { echo 'image upload done "<br>"'; echo $image_name.'<br>'; echo $image_size.'<br>'; echo $image_type.'<br>'; echo $image_tmp_name.'<br>'; } else { echo 'error'; } } } ?> </body> </html> I make this simple script for upload files like photo , It's work correctly ,but not upload the large files ex 8MB images 12MB images
  9. thanks a lot .... I found the mistake ..... in the query ..... the values word is wrong
  10. because it's no syntax error
  11. there are no data inserted in the table
  12. function abuf_user_add($name,$password,$email,$isadmin) { global $af_con; if((empty($name)) || (empty($password)) || (empty($email)) || empty($isadmin)) { return false; // for check that is not empty } $n_email =mysqli_real_escape_string($af_con,strip_tags($email)); if(!filter_var($n_email,FILTER_VALIDATE_EMAIL))//for make sure that is email { return false; } $n_name =mysqli_real_escape_string($af_con,strip_tags($name));// $n_pass =md5(mysqli_real_escape_string($af_con,strip_tags($password)));// for encrypting password $n_isadmin=(int)$isadmin; $query=sprintf("insert into `user` valuse (NULL,'%s','%s','%s','%d')",$n_name,$n_pass,$email,$n_isadmin); echo $query; $qresult=mysqli_query($af_con,$query); if(!$qresult) { return false; } return true; } in this insert function there is a logic error ... how I can fix it ?
×
×
  • 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.