×

php up to date

Showing posts with label question. Show all posts
Showing posts with label question. Show all posts

Osclass Mail Server Problems and solutions

1. User activation Mail Not send?


  In OSClass you need to configure mail server in osclass admin panel.

you can configure either your own localhost server or gmail server.

I) First locahost server?

   Server   :  Localhost   Email From : info@yourdomain.com   Port              : 25 for SMTP   user name  :yyyyy   password : your email id password

II) Gmail server configuration?

   Server  smtp.gmail.com
   Email From : info@gmail.com   Port              : 25 for SMTP   user name  :yyyyy   password : your email id password

Note :  If you use subdomain make sure your email id should be main domain  

Custom robots header tags settings in blogger

Custom robots header tags settings in blogger

It is very easy to handle these settings, you just need to follow these steps:
  • Login to blogger.com
  • Select your required blog from the list
  • Click on the Settings button and select Search preferences from the list.
  • Click on the Edit link next to the Custom Robots Header Tags section.
  • Select Yes to enable this option.
  • And follow the image below to solve this multiple choice options.


  

If you have any queries leave here feedback i will touch you soon

Check IP Under spam listed or not using php

Check IP Under spam listed or not using php

 

$host = "156.200.53.65";

$rbl  = 'sbl-xbl.spamhaus.org';
// valid query format is: 156.200.53.65.sbl-xbl.spamhaus.org
$rev = array_reverse(explode('.', $host));

$lookup = implode('.', $rev) . '.' . $rbl;

if ($lookup != gethostbyname($lookup)) {
   ?>
   <span style="color:red;"><?php echo "IP: $host is listed in $rbl\n"; ?></span>
<?php    echo "<br/>";
} else {
    echo "IP: $host NOT listed in $rbl\n";
    echo "<br/>";

 Just pass your ip address and find whether it comes unders spam list or not using spamhaus. If you need to fine bulk ip just post ip in the loop and get bulk result.

Find whois domain

Find whois domain 

 

<?
require("whoisClass.php");
$whois=new Whois;
$domain=$_POST['domain'];
?>

<form class="form-inline" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
                    <button type="submit" class="btn btn-primary rounded">Find</button>
                    <div class="form-group">
                        <input type="text" name="domain" class="form-control rounded" id="exampleInputEmail2" placeholder="Domain Name">
                    </div>
                </form>
<?php if(isset($domain)){echo nl2br($whois->whoislookup($domain));} ?>
Here nl2br   Inserts HTML line breaks before all newlines in a string.

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