Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the astra domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/sqrtyhjzaqx471/public_html/wp-includes/functions.php on line 6121

Warning: Cannot modify header information - headers already sent by (output started at /home/sqrtyhjzaqx471/public_html/wp-includes/functions.php:6121) in /home/sqrtyhjzaqx471/public_html/wp-content/plugins/bbpress/includes/replies/functions.php on line 2160

Warning: Cannot modify header information - headers already sent by (output started at /home/sqrtyhjzaqx471/public_html/wp-includes/functions.php:6121) in /home/sqrtyhjzaqx471/public_html/wp-content/plugins/bbpress/includes/replies/functions.php on line 2161
» All Posts https://softechquery.com/categories/php/feed Tue, 01 Jul 2025 05:21:07 +0000 https://bbpress.org/?v=2.6.11 en-US https://softechquery.com/discussion/static-variable/#post-163 <![CDATA[Reply To: Static variable]]> https://softechquery.com/discussion/static-variable/#post-163 Tue, 08 Oct 2024 10:34:17 +0000 softechquery There really is no difference between a global variable and a public static variable. The class variable is namespaced a tiny bit better, but that hardly makes any difference. Both are accessible anywhere at any time and both are global state.

As it happens, I just wrote an exhaustive article on the subject:
How Not To Kill Your Testability Using Statics

]]>
https://softechquery.com/discussion/static-variable/#post-162 <![CDATA[Reply To: Static variable]]> https://softechquery.com/discussion/static-variable/#post-162 Tue, 08 Oct 2024 10:33:55 +0000 softechquery There really is no difference between a global variable and a public static variable. The class variable is namespaced a tiny bit better, but that hardly makes any difference. Both are accessible anywhere at any time and both are global state.

As it happens, I just wrote an exhaustive article on the subject:
How Not To Kill Your Testability Using Statics

]]>
https://softechquery.com/discussion/static-variable/#post-134 <![CDATA[Reply To: Static variable]]> https://softechquery.com/discussion/static-variable/#post-134 Thu, 03 Oct 2024 11:34:07 +0000 vikas mishra There really is no difference between a global variable and a public static variable. The class variable is namespaced a tiny bit better, but that hardly makes any difference. Both are accessible anywhere at any time and both are global state.

As it happens, I just wrote an exhaustive article on the subject:
How Not To Kill Your Testability Using Statics

]]>
https://softechquery.com/discussion/static-variable/#post-133 <![CDATA[Static variable]]> https://softechquery.com/discussion/static-variable/#post-133 Thu, 03 Oct 2024 11:32:31 +0000 krishna krishna Can we make global static variable if yes then how?

]]>
https://softechquery.com/discussion/how-to-create-form-captcha-validation-using-php-and-java-script/#post-132 <![CDATA[Reply To: How to create form captcha validation using PHP and Java Script ?]]> https://softechquery.com/discussion/how-to-create-form-captcha-validation-using-php-and-java-script/#post-132 Thu, 03 Oct 2024 11:24:56 +0000 softechquery Use this code

<?php
$code=rand(1000,9999);
?>

<script>
    function myfun(){ 
        var x = document.getElementById('captcha1').value;
        var y = <?php echo $code  ?>;

        if (x == y) {
            return true;
        }
        else{
            return false;
        }
    }
<script>
<form>
<span-><?php echo $code;?></span>
<input id="captcha1" name="captcha" type="text">
<input id="button" type='submit'  onclick=" return myfun();" value='Submit'>
</form>
]]>
https://softechquery.com/discussion/how-to-create-form-captcha-validation-using-php-and-java-script/#post-131 <![CDATA[How to create form captcha validation using PHP and Java Script ?]]> https://softechquery.com/discussion/how-to-create-form-captcha-validation-using-php-and-java-script/#post-131 Thu, 03 Oct 2024 11:24:20 +0000 softechquery I want to create form captcha using php and java script

]]>
https://softechquery.com/discussion/spreadsheet_excel_reader-xlsx-is-not-readable/#post-130 <![CDATA[spreadsheet_excel_reader xlsx is not readable]]> https://softechquery.com/discussion/spreadsheet_excel_reader-xlsx-is-not-readable/#post-130 Thu, 03 Oct 2024 11:23:00 +0000 sumit convert your xlsx file to xls and it will work 🙂 tell me another option

]]>
https://softechquery.com/discussion/how-to-get-the-client-ip-address-in-php/#post-129 <![CDATA[Reply To: How to get the client IP address in PHP]]> https://softechquery.com/discussion/how-to-get-the-client-ip-address-in-php/#post-129 Thu, 03 Oct 2024 11:20:26 +0000 vanshika As shown below, covered two possible methods for getting the client IP address from a PHP script:

Using getenv() function: To obtain the IP address, we utilise the getenv(“REMOTE ADDR”) method.
In PHP, the getenv() method is used to retrieve the values of an environment variable. It is used to return the value of a specific environment variable.

Syntax:

<?php
 $ipaddress = getenv("REMOTE_ADDR") ;
 Echo "Your IP Address is " . $ipaddress;
?>

Determining IP Address using $_SERVER Variable Method: Another method is to use the $_SERVER[‘REMOTE ADDR’] or $_SERVER[‘REMOTE HOST’] variables to obtain the IP Address. The $_SERVER array variables are produced by web servers such as apache and can be utilised in PHP.
$_SERVER[‘REMOTE ADDR’] basically returns the IP address from which the request was submitted to the web server.
Syntax:

<?php
 $ipaddress = $_SERVER['REMOTE_ADDR']
 Echo "Your IP Address is " . $ipaddress;
?>
]]>
https://softechquery.com/discussion/how-to-get-the-client-ip-address-in-php/#post-128 <![CDATA[How to get the client IP address in PHP]]> https://softechquery.com/discussion/how-to-get-the-client-ip-address-in-php/#post-128 Thu, 03 Oct 2024 11:18:09 +0000 avi How can I get the client IP address using PHP?
I want to keep record of the user who logged into my website through his/her IP address.

]]>