Alfraganus

Members
  • Content count

    56
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Alfraganus

  • Rank
    Newbie
  1. yes, resizeImage() is a class, and I found my error, I was trying to reveal the image by jPanel, ans instead, I should have tried it by jLabel, therefore, that was was causing an error
  2. please could anybody explain me what type of error is it and where I should fix it? image.setIcon(ResizeImage(path, null)); ---> This line is causing the error. Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type: javax.swing.JPanel.setIcon at kitob.Java_Kitob.Btn_Choose_ImageActionPerformed(Java_Kitob.java:323) at kitob.Java_Kitob.access$000(Java_Kitob.java:29) at kitob.Java_Kitob$1.actionPerformed(Java_Kitob.java:152) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) at java.awt.Component.processMouseEvent(Component.java:6533) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at java.awt.Component.processEvent(Component.java:6298) at java.awt.Container.processEvent(Container.java:2236) at java.awt.Component.dispatchEventImpl(Component.java:4889) at java.awt.Container.dispatchEventImpl(Container.java:2294) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466) at java.awt.Container.dispatchEventImpl(Container.java:2280) at java.awt.Window.dispatchEventImpl(Window.java:2746) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.awt.EventQueue$4.run(EventQueue.java:729) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
  3. any suggestions to re-order them correctly?
  4. dear all, I am trying to make dynamic drop down menu but something is wront that I am geting following errors, can you have a look please: Warning: mysqli_query() expects parameter 1 to be mysqli, string given in C:\xampp\htdocs\as\inc\functions.php on line 14 Warning: mysqli_error() expects exactly 1 parameter, 0 given in C:\xampp\htdocs\as\inc\functions.php on line 14 <?php $condb=mysqli_connect("localhost","root","","books") or trigger_error(mysqli_error()); function getLanguage() { global $database; global $condb; $sql="SELECT * FROM LANGUAGES ORDER BY NAME asc"; $rs=mysqli_query($sql,$condb) or die (mysqli_error()); ERROR LINE 14 $rows=mysqli_fetch_assoc($rs); $total_rows=mysqli_num_rows($rs); if ($total_rows>0) { echo "<select name =\"srch_language\" id=\"srch_language\"><br>"; echo "<option value =\"\">any languageā€¦</option>"; do { echo "<option value=\"".$rows['id']."\"> ".$rows['name']."</option><br>"; }while ($rows=mysqli_fetch_assoc($rs)); echo "</select>"; } mysqli_free_result($rs); } ?>
  5. I've been trying to insert my data to database, i've checked db connection, it is ok, but my data is not being inserted to database, it is not even showing error message, can you have a look to my codes if I have written something wrong. <!DOCTYPE html> <html> <head> <title>inserting data</title> </head> <body> <form action="insert_post.php" method="post" enctype="multipart/form-data"> <table width="800" align="center" border="10"> <tr> <td align="center" bgcolor="green" colspan="2"><h1> Insert new post</h1></td></tr> <tr> <td>Post title</td> <td><input type="text" name="title"></td> </tr> <td>Post author</td> <td><input type="text" name="author"></td> </tr> <td>Post image</td> <td><input type="file" name="image"></td> </tr> <td>Post content</td> <td><textarea name="content" cols="60" rows="20 "></textarea>></td> </tr> <td align="center">submit</td> <td><input type="submit" align="center" name="submit" value="upload"></td> </tr> </body> </html> <?php include ('db.php'); if (isset($_POST['submit'])) { $title=$_POST['title']; $date=date('d-m-y'); $author=$_POST['author']; $content=$_POST['content']; $image=$_FILES['image']['name']; $image_tmp=$_FILES ['image'] ['tmp_name']; move_uploaded_file($image_tmp, "images/$image"); $query="INSERT INTO project (post_title, post_date,post_author,post_image,post_content) VALUES ('$title','$date','$author','$image','$content')"; if (mysql_query($query)) { echo "<script>alert('success')</script>"; } else { echo "<script>alert('oxshamadi')</script>"; } }
  6. Dear developers, I've been trying something that I dont know, I would like to place my 5 posts in special pattern, the example of pattern can be in this site https://kun.uz/, let's say, I want my first post to be on the left with larger size while other 4 posts to be on the right with the same size all, however all posts are from the same table in database, I don't know even its defenition to search it on google, please could you kindly help me to find it, isn't it called something "front end"? if so, where to find it?
  7. I think I did not insert encoding to mysql query
  8. I did, I saved with utf-8 encoding in sublime text 3, and I wrote charset-utf8 in html and php header function, i dont know what wrong with it, it is not working yet
  9. I have written charset utf8 in many ways, however, yet my browser are reading my data with many mistakes, how to enable utf-8 in php files? here is my small part of souce code: <?phpinclude_once("dbconfig.php"); ?> <?php header('Content-Type: text/html; charset=utf-8'); $con=mysqli_connect("localhost","root","","Alfy"); mysqli_set_charset($con,"utf8"); mb_internal_encoding("UTF-8"); ?> <?php include_once('functions.php'); ?> <?php include_once('class.paging.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  10. I am trying to configure "read more" function in wordpress for a long time, yet no results, I googled it a lot and I always read to change "the_content" function in wp-includes/post-template.php. I a trying but i dont know something wrong with my modifications, anyone has expreince in changing "read more" function? if yes, could you share your exprience please?
  11. bro please can you type the correct code, can you correct it for me please, I've been trying a lot, but no works(
  12. bro those anchors are working at least, my biggest issue is opening the page where its id equal to page id, my requested page in not coming from database, instead, i am having a blank page, can you check my sql query to select data from database please, I believe there is my mistake
  13. I was creating small CMS website, I have posted all the posts succesfully, but when I am clicking to any post's title or read more, it is not opening it:, web page just opening blank page, however, localhost is not alerning any error, public function fullpost() { if(isset($_GET['id'])) { $post_id=$_GET['id']; $q="SELECT * FROM tables where body_id=$post_id"; (I think here is my mistake, but I dont know what is it exactly) $r=mysql_query ($q); if ($r !==false &&mysql_num_rows($r)>0) { while ($a=mysql_fetch_assoc($r)) { $body_id=($a['id']); $title=stripcslashes($a['title']); $body=($a['body']); $image=($a['image']); echo " <h1><a href='pages.php?id=<?php echo $body_id';?> $title </h1></a> <img src='images1/$image' /> <p>$body</p><br><br><br> "; } } } } }
  14. it worked, thank you bro
  15. I did what u told me, now image is being uploaded, however, my image is not going to image folder, it is not moving anywhere, what should I do right now?