I’m completely at loss here and am about to wipe my hard drive clean and start from a fresh OS install. I’ve been trying for two days to create a new yii app in the terminal and have finally figured …
Tag: php
Track cursor movement of all the visitors on a web site
I know that there are many analytics tools available to track cursor movement of all the visitors on a website – these tools basically track the movement by giving a Javascript code which need to be pasted on the website. They all are quite expensive I am trying to develop it for my own website – …
How to use PHP with Visual Studio
First let me say I’ve never used PHP but I’m looking to learn it, so my question is this how do you use PHP within Visual Studio Ultimate? is it similar to how you declare JQuery i.e I’ve done multiple searches on Google, but I don’t get the answer I’m looking for. Or do I need a…
How to pass custom header to RESTful call?
There are some web service APIs that I need to connect to for my website. Most of the APIs involve something like this: But one web service requires the API key to be set in a custom HTTP header. How do I make the request to this API url and pass the custom header at the same time? Answer You
PDO were rows affected during execute statement
I have found many ways to use the exec statement for PDO, but I’m not sure it helps me. My understanding is that I have to use the execute() function for prepared statements. I am updating a row with data from user input, so I would like to use a prepared statement instead of the query() call. My code i…
How to encrypt the $_GET data in php?
As in php we use $_GET to pass variables in the url , i want to pass variables which include the id of the user which i want to be anonymous, so can something be done which can encrypt the variable …
download many archives for a server in one archive with php
I need to do an aplication to makes the user download a lot of pictures in the server choosing some criterias and only in one archive. i tried with php and pclzip.lib and zipstream libraries found on web, but none of the two methods work. with pclzip i only can compress 3Mb and with zipstream library in the m…
Use PHP To Generate Random Decimal Beteween Two Decimals
I need to generate a random number, to the 10th spot between 2 decimals in PHP. Ex. A rand number between 1.2 and 5.7. It would return 3.4 How can I do this? Answer You can use: or even better:
How to display localized time, based on a visitor’s location?
We’re developing a website, that will be used from people all over the world. There’s a chat section in the website and we want the messages to appear with a timestamp. I’m storing in a database a timestamp for each message. What is the way to show the right time for each message to visitor,…
Yii – dynamically change rules from controller
Let’s say I have a product which can have a colour. Depending on the product type, the colour field may or may not be required. If colour is always required, I would have the following in the product …