Javascript – is_numeric() PHP like function

Here below a javascript function to recall the PHP isNumeric behaviour:

is_numeric() in Javascript

Facebooktwitterredditpinterestlinkedinmail

HTML – hide address on mouse over

If you need to hide the href address a browser usually shows when the mouse is over a particular link you can follow the below example.

This is useful especially if the href contains special javascript code we want to hide to destination user.
This method is however not suggested because the site will result not clear, and also not fair for the user; avoiding the possibility to evaluate the selected element. A proper and well build site should avoid such tricks.

Facebooktwitterredditpinterestlinkedinmail

HTML – website redirect with frames

A clear way to redirect to another website is to use frames. Here below a simple code to put in your index.html:

For a better result a title and a shortcut icon can be added to have a result closer to the final website. Here below the new example code:

 

Facebooktwitterredditpinterestlinkedinmail

Apache – ModRewrite – redirect site to a subfolder

If you want to redirect your website to a subfolder you can edit (or create) the root file .htaccess using Apache ModRewrite

You can insert the following code:

This method is useful also to create different installation (and version) of your website in different folders. You can edit then .htaccess file to redirect to one or another installation.

Facebooktwitterredditpinterestlinkedinmail

Joomla: get Objects (database, user, application)

Here below the code to programmatically obtain:

Access to Database Object

Access to User Object:

Access to App Object:

Access to Document Object:

 

Facebooktwitterredditpinterestlinkedinmail

Joomla: get UserGroupId by name programmatically

You can obtain Joomla UserGroup id by name with the following code:

 

Facebooktwitterredditpinterestlinkedinmail

Joomla: redirect user to Login programmatically

If you want your component function to be accessed by your user prior to login programmatically you can use the following code:

You can include the function in your helper class

helpers/yourcomponent.php

You can call the function in your MVC code with the following instructions:

 

Facebooktwitterredditpinterestlinkedinmail