What's New

CSS & HTML click on links and text select bug

If you ever got in trouble with this problem… like… you can’t click on links because something else is covering them(invisible div or something like that)… you just need to add this simple CSS trick to the div via a class or id…

Send data to PHP via AJAX and get response

This is the simple script that I use every time I build one page sites… I use this code to update, delete, modify, add data to Mysql or other DB’s…

This code also get the class or id of the clicked link and can display a result there or in another div… this script can also be modified to play other important parts in the web app…

Hope it helps.

Resolve Google Page Speed “Leverage Browser Caching” Problem

PHP – set hour to Eastern European Time(Bucharest)

This is the test script, you normally just need the first line of code.
Enjoy!

jQuery (Ajax) Contact form with all elements

This is my default CONTACT form built with jQuery and CSS.
The form uses a jQuery call to a PHP script that inserts data into a Mysql DB and sends two emails of confirmation, all this under the hood… meanwhile, there is a CSS only animation that displays a message that the data is been sent to the server and shows a positive message if that data was sent without errors and an error message if there was an error.

Mysql: Table structure for table `contact`

This is the basic table structure for my contact section on many projects I work on…
The id field is auto_increment and the time field is just a PHP time() string.

jQuery + CSS – Activate DIV background colour and deactivate other DIV’s bg colour

This little code delivers all the magic, if you are into one page websites/apps like me, this short code will simply save you lots of time.
This code simply activates(changes the style) of an DIV that is clicked on and removes the same style applied to other DIV(active button) in case it has another active style applied to another DIV.
It can be combined with a little CSS code to display a beautiful color transition.
You can see the code running on this little jsFiddle I made: https://jsfiddle.net/cosminr/ampjtwjp/

PHP & HTML – easy spam prevention using hidden form fields (sample code)

The easy and fast working method of securing your forms agains spam bots is as easy as a few lines of PHP and HTML code.

Spam bots, at least, most of them, crawl random websites and fill their forms with all kind of ads or unwanted content. There are a lot of alternatives to stop this, Google Captcha, reCaptcha, etc., I used all of this methods, they work pretty well but, sometimes, when you move your site to a new server or domain, you need to spend a lot of time working around this methods to make them work again.

I simply tried a really simple method that I found a few years ago, the method implies using simple PHP and HTML to trick the bot to fill a field that the user doesn’t see(hidden via CSS).

The code is pretty simple…

Here is the HTML…

 

Here is the PHP…