How to make a button execute a php script?

Basic scenario: Store currently authenticated user’s unique id and time in a .txt file in the following format (as JSON): json_encode([‘user_id’ => 1, ‘created_at’ => (new DateTime(‘now’))->format(‘Y-m-d H:i:s’)]); Check the stored user_id and created_at fields in the file when a user attempts to sign in. If the file is empty, log the user in and … Read more

Pop Images like Google Images

#images{ padding:30px; } #images img{ position:relative; float:left; height:100px; margin:5px; transition:0.3s; box-shadow: 0 0 0 10px #fff; } #images img:hover{ z-index:2; transform: scale(1.2); } #images img:hover:after{ content: attr(title); } <div id=”images”> <img src=”http://dummyimage.com/180×120/000/fff” alt=””/> <img src=”http://dummyimage.com/175×104/f0f/fff” alt=””/> <img src=”http://dummyimage.com/150×100/a3d/fff” alt=””/> <img src=”http://dummyimage.com/278×125/cf5/fff” alt=””/> <img src=”http://dummyimage.com/199×120/e46/fff” alt=””/> <img src=”http://dummyimage.com/207×480/361/fff” alt=”” /> <img src=”http://dummyimage.com/400×107/081/fff” alt=”” /> <img src=”http://dummyimage.com/50×40/cc3/fff” … Read more

Making a window pop under in chrome

I take back my comment, is possible. The following worked for me. (tested latest production chrome) var url = “yourURL.html”; window.open(url, “s”, “width= 640, height= 480, left=0, top=0, resizable=yes, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no”).blur(); window.focus(); Like all things, if you annoy your visitors you will have less visitors.

Javascript,calling child window function from opener doesn’t work

The window creation is not a blocking operation; the script continues to execute while that window is opening and loading the HTML & javascript and parsing it. If you were to add a link on your original page like this: <a href=”#” onclick=”addWindow.getMaskElements();”>Test</a> You’d see it works. (I tried it just to be sure.) **EDIT … Read more

Input fields hold previous values only if validation failed

This problem is in JSF 2 also recognized and explained in detail in the following answer: How can I populate a text field using PrimeFaces AJAX after validation errors occur? If you were using JSF 2, you could have used OmniFaces’ ResetInputAjaxActionListener or PrimeFaces’ <p:resetInput> or resetValues=”true” for this. To the point, you need to … Read more

How change position of popup menu on android overflow button?

To overlap only, use this approach: PopupMenu popupMenu = new PopupMenu(getContext(), this, Gravity.NO_GRAVITY, R.attr.actionOverflowMenuStyle, 0); To get a PopupMenu with a bright background and a detailed control over the offsets use this approach: styles.xml <style name=”PopupMenuOverlapAnchor” parent=”@style/Theme.AppCompat.Light”> <item name=”android:overlapAnchor”>true</item> <item name=”android:dropDownVerticalOffset”>0dp</item> <item name=”android:dropDownHorizontalOffset”>0dp</item> </style> Code: ContextThemeWrapper contextThemeWrapper = new ContextThemeWrapper(getContext(), R.style.PopupMenuOverlapAnchor); PopupMenu popupMenu = new … Read more

Popup over incoming-call screen

If you want to keep the Call activity still clickable, but not have any controls on your overlay, you can do this by calling getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE); getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL); In the onCreate() method of the activity that is shown over the call. The layout parameters useable together with this are: android:windowBackground=”@android:color/transparent” android:windowIsTranslucent=”true” android:windowAnimationStyle=”@android:style/Animation.Translucent”