• Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Alfraganus

  • Rank
  1. I was trying to make a blog with YII2, my framework is confusing to call data from database. For example when I call "username" from "user" table, <?= DetailView::widget([ 'model' => $model, 'attributes' => [ 'user.fullname', --->> Yii2 is thinking that this is a category and not a user table 'title', 'description', 'content:html', 'count_view', 'status', 'created_at', ], ]) ?> I am getting this error: -->> unknown property: app\models\Category::fullname please could you help me to solve this issue, where I did make a mistake?
  2. 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
  3. 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( at kitob.Java_Kitob.access$000( at kitob.Java_Kitob$1.actionPerformed( at javax.swing.AbstractButton.fireActionPerformed( at javax.swing.AbstractButton$Handler.actionPerformed( at javax.swing.DefaultButtonModel.fireActionPerformed( at javax.swing.DefaultButtonModel.setPressed( at javax.swing.plaf.basic.BasicButtonListener.mouseReleased( at java.awt.Component.processMouseEvent( at javax.swing.JComponent.processMouseEvent( at java.awt.Component.processEvent( at java.awt.Container.processEvent( at java.awt.Component.dispatchEventImpl( at java.awt.Container.dispatchEventImpl( at java.awt.Component.dispatchEvent( at java.awt.LightweightDispatcher.retargetMouseEvent( at java.awt.LightweightDispatcher.processMouseEvent( at java.awt.LightweightDispatcher.dispatchEvent( at java.awt.Container.dispatchEventImpl( at java.awt.Window.dispatchEventImpl( at java.awt.Component.dispatchEvent( at java.awt.EventQueue.dispatchEventImpl( at java.awt.EventQueue.access$500( at java.awt.EventQueue$ at java.awt.EventQueue$ at Method) at$JavaSecurityAccessImpl.doIntersectionPrivilege( at$JavaSecurityAccessImpl.doIntersectionPrivilege( at java.awt.EventQueue$ at java.awt.EventQueue$ at Method) at$JavaSecurityAccessImpl.doIntersectionPrivilege( at java.awt.EventQueue.dispatchEvent( at java.awt.EventDispatchThread.pumpOneEventForFilters( at java.awt.EventDispatchThread.pumpEventsForFilter( at java.awt.EventDispatchThread.pumpEventsForHierarchy( at java.awt.EventDispatchThread.pumpEvents( at java.awt.EventDispatchThread.pumpEvents( at
  4. any suggestions to re-order them correctly?
  5. 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); } ?>
  6. 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>"; } }
  7. 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, 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?
  8. I think I did not insert encoding to mysql query
  9. 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
  10. 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" ""> <html xmlns=""> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  11. 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?
  12. bro please can you type the correct code, can you correct it for me please, I've been trying a lot, but no works(
  13. 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
  14. 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> "; } } } } }
  15. it worked, thank you bro