×

php up to date

Remove Category from home page osclass

Remove Category from home page  osclass

 

Open theme folder and edit functions.php file,
 find out h1 tag with categories under div with class name row 
remove from there  to closing tab of row div...
that's all categories now removed from your home page completely. 
Eg:
   <h1 class="title"><?php _e('Categories', OSCLASSWIZARDS_THEME_FOLDER);?></h1>
<div class="row">
<?php

    $total_categories   = osc_count_categories();
    $col1_max_cat       = ceil($total_categories/1);
    osc_goto_first_category();
    $catcount    =    0;
    while ( osc_has_categories() ) {
?>
<ul class="col-sm-6 col-md-3 grid_list">
  <li>
   -----
   -----
</li></ul>
<?php } ?>
</div>
It will change based on your theme. Mostly common.some customized themes may different.

PHP Question And Answers

PHP Question And Answers



1. What is the importance of "action" attribute in a html form?
ANS: The action attribute determines where to send the form-data in the form submission.

2. Distinguish between urlencode and urldecode?
ANS: This method is best when encode a string to used in a query part of a url. it returns a string in which all non-alphanumeric characters except -_. have replece with a percentege(%) sign . the urldecode->Decodes url to encode string as any %and other symbole are decode by the use of the urldecode() function.

3. what is sql injection ?
ANS: SQL injection is a malicious code injection technique.It exploiting SQL vulnerabilities in Web applications

4. What is the difference between $var and $$var?
ANS: They are both variables. But $var is a variable with a fixed name. $$var is a variable who's name is stored in $var. For example, if $var contains "message", $$var is the same as $message.
EXPLAIN:
  $var is a variable and $$var is a variable of another variable. For example

$var = "YOU";
$you= "Me";

echo $var //Output:- you
echo $$var //output :-Me

$$var allows the developer to change the name of the variable dynamically.

5. Explain how to submit form without a submit button.
ANS: A form data can be posted or submitted without the button in the following ways:

1. On OnClick event of a label in the form, a JavaScript function can be called to submit the form e.g. document.form_name.submit()

2. Using a Hyperlink: On clicking the link, JavaScript function can be called e.g <a.href=” javascript:document.MyForm.submit();">

6. What is Joomla in PHP?
ANS: Joomla is an open source content management system. Joomla can be used in PHP as a framework to publish web contents. Joomla allows the user to manage the content of the web pages with ease.

7. What is difference between developing website using Java and PHP?
ANS: In order to make interactive pages, java uses JSP (Java Server pages). PHP is open source while JSP is not. Libraries are much stronger in Java as compared tp PHP. Huge codes can be managed with ease in Java by making classes.   

8. How can I embed a java programme in php file?
ANS: PHP can be integrated into the servlet environment of java or java support can be integrated with php.the java extension can be used to create and invoke methods on Java objects from PHP.

9. How to get jQuery nth Element?
ANS: //include jQuery file
<script type="text/javascript" src="jquery.js"></script>
<script>
function go_to(id_number){     
     var obj=jQuery('div.mydiv ul li:nth-child('+id_number+') a');      
     alert(obj.html()) 
}
go_to(3);
</script>

10.What is Invoking Client Programs?
ANS: MySQL client programs can be invoked from the command line. For example from a Windows console prompt OR a Unix shell prompt.
EX: shell> mysql -h localhost -p -u myname


11.What is needed to be able to use image function?
ANS: GD library is needed to be able execute image functions.
12. What is the use of the function ‘imagetypes()’?
ANS: imagetypes() gives the image format and types supported by the current version of GD-PHP.
13. What are the functions to be used to get the image’s properties (size, width and height)?
ANS: The functions are getimagesize() for size, imagesx() for width and imagesy() for height.
14. How failures in execution are handled with include() and require() functions?
ANS: If the function require() cannot access to the file then it ends with a fatal error. However, the include() function gives a warning and the PHP script continues to execute.
15. What is the main difference between require() and require_once()?
ANS: require() and require_once() perform the same task except that the second function checks if the PHP script is already included or not before executing it.
(same for include_once() and include())
16. How can we automatically escape incoming data? 
ANS: We have to enable the Magic quotes entry in the configuration file of PHP.
17. How can you pass a variable by reference?
To be able to pass a variable by reference, we use an ampersand in front of it, as follows $var1 = &$var2

Allow or Deny Website Access using IP Address

Allow  Website Access using One IP Address


Restrict website access using .httacess file

order deny,allow
deny from all
allow from 112.221.323.443

Allow  Website Access Except Few IP Address

order deny,allow
deny from 80.52.168.0/23
deny from 181.138.10.153/32
deny from 182.138.78.129/32 
allow from all



Order allow,deny
Allow from all
Deny from 58.14.0.0/15
Deny from 58.16.0.0/16


You can decide ips to add in the bloglist to provide restriction