
Mistral 🤖
Members-
Posts
22 -
Joined
-
Last visited
Everything posted by Mistral 🤖
-
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>'; } } }
- 5 replies
-
- php multi page
- functions
-
(and 1 more)
Tagged with:
-
where excatly ?
- 5 replies
-
- php multi page
- functions
-
(and 1 more)
Tagged with:
-
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
- 5 replies
-
- php multi page
- functions
-
(and 1 more)
Tagged with:
-
move_uploaded_file function change the file name
abubaker0000 replied to abubaker0000's topic in PHP Coding Help
there are many files ... so that may get same name?- 3 replies
-
- php
- upload file
-
(and 1 more)
Tagged with:
-
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 ?
- 3 replies
-
- php
- upload file
-
(and 1 more)
Tagged with:
-
I do it but in mouse click(focus) the border shadow is visible
-
how I can hide it ?
-
how can make the text box like line as in the photo
-
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
-
<!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
-
thanks a lot .... I found the mistake ..... in the query ..... the values word is wrong
-
because it's no syntax error
-
there are no data inserted in the table
-
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 ?
-
yes , but how that
- 3 replies
-
- commit script
- php
-
(and 2 more)
Tagged with:
-
haw can I make a commit script , when I click on button the commit inserted in the table and browsed immediately without refresh the page , like Facebook commits ?
- 3 replies
-
- commit script
- php
-
(and 2 more)
Tagged with:
-
thanks friend regards
-
I have this first example for ajax but it dosent work is there importance for import jquery librery? <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <div id="commit"> </div> <script type="text/javascript"> function getinfo () { var xmlhttp; if(window.XMLHttpRequest) xmlhttp = new XMLHttpRequest(); else xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); xmlhttp.onreadystatechange = function () { if(xmlhttp.readyState ==4 & xmlhttp.status == 200) document.getElementById("commit").innerHTML =xmlhttp.responeText; } xmlhttp.open("GET","info.php",true); xmlhttp.send(); } </script> <button type="button" onClick="getinfo()">send</button> </body> </html>
-
hi I'm create a form and I connect it by database and when I submit the data the data is inserted correctly in the table ,but it's show me some wrings this is HTML code <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <legend> <form action="cccccccccc.php" method="post"> <label>user name <input type="text" name="uname"> </label> <label>pasword <input type="password"name="pass"> </label> <input type="submit"> </form> </legend> </body> </html> and this is php code <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <?php mysql_connect("localhost","root","")or die (mysql_error()); mysql_select_db("abubakerdb") or die (mysql_error()); $user=$_POST['uname']; $pass=$_POST['pass']; $query = mysql_query("insert into user_name (name , password)values('$user','$pass')")or die (mysql_error()); if($query) { echo $user ."is added"; } ?> </body> </html>
-
hi I use dreamweaver cc and I make a recordset ,so I need to create a dynamic table but the data panel and data object panel not appear can any one help me please
-
database conncetion
abubaker0000 replied to abubaker0000's topic in Editor Help (PhpStorm, VS Code, etc)
please can you explane more because my english not well but I create the database with one table -
hi friends I have a dream weaver CC and wamp server ,so I have some problem when I need to access to my data bases server like this