Logic Archives - Nabtron Technology & Programming Guide Mon, 11 Nov 2019 12:17:29 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.2 https://i0.wp.com/nabtron.com/wp-content/uploads/2018/12/nabtron-icon-50.jpg?fit=32%2C32&ssl=1 Logic Archives - Nabtron 32 32 13047128 Convert string variable characters to ASCII codes using PHP https://nabtron.com/convert-string-variable-characters-to-ascii-codes-using-php/ https://nabtron.com/convert-string-variable-characters-to-ascii-codes-using-php/#respond Fri, 11 Jun 2010 03:57:57 +0000 http://nabtron.com/?p=1904 In situations where you want to convert the value stored in your variable to ascii code in PHP you can use the following code. function nabascii($input) { foreach (str_split($input) as $obj) { $output .= '&#' . ord($obj) . ';'; } return $output; } Call the code by using: $myvariable = "nabeel"; echo nabascii($myvariable); This small […]

The post Convert string variable characters to ASCII codes using PHP appeared first on Nabtron.

]]>
https://nabtron.com/convert-string-variable-characters-to-ascii-codes-using-php/feed/ 0 1904
How to remove last (few) characters of a string variable in PHP https://nabtron.com/how-to-remove-last-two-characters-of-a-string-variable-in-php/ https://nabtron.com/how-to-remove-last-two-characters-of-a-string-variable-in-php/#comments Thu, 03 Jun 2010 00:03:35 +0000 http://nabtron.com/?p=1867 If you are in a situation where you need to remove last few (one or two, or even three or so on) characters from a variable using php, then the solution is pretty much simple. Simply use this function to remove any number of desired characters from your string (variable) substr($your-variable,0,-1); In the above function […]

The post How to remove last (few) characters of a string variable in PHP appeared first on Nabtron.

]]>
https://nabtron.com/how-to-remove-last-two-characters-of-a-string-variable-in-php/feed/ 2 1867
How to check if a website url is valid – PHP https://nabtron.com/how-to-check-if-a-website-address-exists-php/ https://nabtron.com/how-to-check-if-a-website-address-exists-php/#comments Wed, 02 Jun 2010 23:48:48 +0000 http://nabtron.com/?p=1866 There are various ways of checking if a given variable of website url is valid or not. However most of they try to get content of the webpage or ping it etc. The way that i prefer to use is by fopen command in a function or separately. Use this code to confirm or verify […]

The post How to check if a website url is valid – PHP appeared first on Nabtron.

]]>
https://nabtron.com/how-to-check-if-a-website-address-exists-php/feed/ 4 1866
How to remove extension from a file name using PHP https://nabtron.com/how-to-remove-extension-from-a-file-name-using-php/ https://nabtron.com/how-to-remove-extension-from-a-file-name-using-php/#comments Wed, 02 Jun 2010 16:37:28 +0000 http://nabtron.com/?p=1864 This code can be used to remove an extension from the file name using php. If manipulated abit, it can also be used to find the extension of php and echo it. function RemoveExtension($strName) { $ext = strrchr($strName, ‘.’); if($ext !== false) { $strName = substr($strName, 0, -strlen($ext)); } return $strName; } $Name = ‘file.txt’; echo RemoveExtension($filename); However, in my case, i tried using it with a bunch of […]

The post How to remove extension from a file name using PHP appeared first on Nabtron.

]]>
https://nabtron.com/how-to-remove-extension-from-a-file-name-using-php/feed/ 1 1864
How to code custom submit form in php in wordpress https://nabtron.com/how-to-code-custom-contact-form-in-php-in-wordpress/ https://nabtron.com/how-to-code-custom-contact-form-in-php-in-wordpress/#comments Tue, 27 Apr 2010 01:32:43 +0000 http://nabtron.com/?p=1793 Today I got an sms from my friend regarding some query related to wordpress custom form coding (through plugin or theme directly) . Although i am sleepy while writing this post, I will try to be as much descriptive as I can. Do let me know if anything in the tutorial is ambiguous. The question […]

The post How to code custom submit form in php in wordpress appeared first on Nabtron.

]]>
https://nabtron.com/how-to-code-custom-contact-form-in-php-in-wordpress/feed/ 28 1793
How to Remove Virtumart Image from Joomla Store (Joomla! 1.5 virtuemart 1.1.4) https://nabtron.com/how-to-remove-virtumart-image-from-joomla-store-joomla-1-5-virtuemart-1-1-4/ https://nabtron.com/how-to-remove-virtumart-image-from-joomla-store-joomla-1-5-virtuemart-1-1-4/#comments Sat, 30 Jan 2010 10:54:08 +0000 http://tech.nabtron.com/?p=1235 NOTE: This article is supposed to be for educational purposes only. This is tested on virtuemart 1.1.4 running on Joomla! 1.5 When we install virtuemart on joomla! it shows the logo for virtue mart on each shop page with link to virtuemart site. Yes, its their right to show it because it’s their script and […]

The post How to Remove Virtumart Image from Joomla Store (Joomla! 1.5 virtuemart 1.1.4) appeared first on Nabtron.

]]>
https://nabtron.com/how-to-remove-virtumart-image-from-joomla-store-joomla-1-5-virtuemart-1-1-4/feed/ 2 1235
SI Captcha Issue – CAPTCHA image not displayed https://nabtron.com/si-captcha-issue-captcha-image-not-displayed/ https://nabtron.com/si-captcha-issue-captcha-image-not-displayed/#comments Tue, 17 Nov 2009 15:31:31 +0000 http://tech.nabtron.com/?p=842 Today i got contacted by a very nice person via my facebook profile regarding this blog. He mentioned that the Captcha image is not being displayed on the blog comments so it was not possible to post any comments. Well i quickly verified that the captcha was really broken! There was captcha image not displayed […]

The post SI Captcha Issue – CAPTCHA image not displayed appeared first on Nabtron.

]]>
https://nabtron.com/si-captcha-issue-captcha-image-not-displayed/feed/ 4 842
WordPress Plugin error – Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at / . . . https://nabtron.com/wordpress-plugin-error-warning-session_start-function-session-start-cannot-send-session-cache-limiter-headers-already-sent-output-started-at/ https://nabtron.com/wordpress-plugin-error-warning-session_start-function-session-start-cannot-send-session-cache-limiter-headers-already-sent-output-started-at/#comments Sun, 27 Sep 2009 06:51:37 +0000 http://tech.nabtron.com/?p=525 Today while developing a wordpress plugin, i experienced an error when i activated it. Although the plugin worked as it was expected to, but the error was there and seemed as if my plugin is conflicting with si-captcha for wordpress plugin. The error was: Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already […]

The post WordPress Plugin error – Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at / . . . appeared first on Nabtron.

]]>
https://nabtron.com/wordpress-plugin-error-warning-session_start-function-session-start-cannot-send-session-cache-limiter-headers-already-sent-output-started-at/feed/ 8 525
Detect users internet browser (firefox, safari, iphone, ipod, ipad, internet explorer, opera ) and redirect to different page specific to it https://nabtron.com/detect-users-browser-firefox-safari-iphone-ipod-internet-explorer-opera-and-redirect-to-load-different-page-specific-to-that-browser/ https://nabtron.com/detect-users-browser-firefox-safari-iphone-ipod-internet-explorer-opera-and-redirect-to-load-different-page-specific-to-that-browser/#comments Wed, 05 Aug 2009 15:25:56 +0000 http://tech.nabtron.com/?p=281 Some times we need to detect the browser of the user in order to redirect them to browser specific page, or to do any other task that is related to displaying that website for that particular user’s browser, e.g firefox, opera, internet explorer, safari, or are coming from an iphone or an ipod. Edit: You […]

The post Detect users internet browser (firefox, safari, iphone, ipod, ipad, internet explorer, opera ) and redirect to different page specific to it appeared first on Nabtron.

]]>
https://nabtron.com/detect-users-browser-firefox-safari-iphone-ipod-internet-explorer-opera-and-redirect-to-load-different-page-specific-to-that-browser/feed/ 23 281
Restrict script use (number of times per day) using php & mysql https://nabtron.com/restrict-script-use-number-of-times-per-day-using-php-mysql/ https://nabtron.com/restrict-script-use-number-of-times-per-day-using-php-mysql/#comments Wed, 08 Jul 2009 23:14:12 +0000 http://tech.nabtron.com/?p=66 If you are a programmer and want your script to be restricted to say 5 time use only per day, then here is the basic idea about how to do it in this post. Please let me know if you feel any difficulty or need any code example etc too. We need to make a […]

The post Restrict script use (number of times per day) using php & mysql appeared first on Nabtron.

]]>
https://nabtron.com/restrict-script-use-number-of-times-per-day-using-php-mysql/feed/ 1 66