I have a traffic exchange and every time a site is viewed I want it to insert in to a table which looks like: -user -site The user is default of 1 and I don’t insert in to it because I thought for an INSERT IGNORE you need a column that stays in the same. My current query: I have
Tag: php
Calculate the number of months between two dates in PHP?
Without using PHP 5.3’s date_diff function (I’m using PHP 5.2.17), is there a simple and accurate way to do this? I am thinking of something like the code below, but I don’t know how to account for leap years: I’m trying to work out the number of months old a person is. Answer You may …
Paypal notify_url and return_url. Receiving variables without IPN using PHP
I am trying to set up a simple payment option to paypal, but am having some trouble/confusion with the return and notify URLS. I am fairly new to php and have accomplished this previously in asp, but I have now become lost. SO my basic paypal form: As you can see the form posts to paypal, and then returns dep…
How can i give div background color based on count with differences of 3 within while loop
I have a div with several boxes within while loop. I want to give the two alternative div background color. For first 3 boxes i have to give the first color. Then for next 3 boxes i’v to give next …
s3 direct upload restricting file size and type
A newbie question but I have googled abit and can’t seem to find any solution. I want to allow users to directly upload files to S3, not via my server first. By doing so, is there any way the files can be checked for size limit and permitted types before actually uploading to S3? Preferably not to use f…
What are the .ini files in /etc/php5/conf.d folder for?
I get that the .ini files in /etc/php5/cli have to do with CLI usage of PHP, the files in /etc/php5/fpm are about FastCGI/FPM aspect of PHP, but what about the .ini files located in /etc/php5/conf.d? Answer From /usr/share/doc/php5-common/README.Debian.gz (on an Ubuntu system with PHP installed): Additionally…
Get custom product attributes in Woocommerce
In Woocommerce, I am trying to get product custom attribute values but I fail miserably and I don’t get anything. So I tried: And I’m getting this raw data: I know that there is a value because it is shown in the attribute section, but I just can’t find a way to get it displayed with my cust…
Auto fill text box depending on Drop Down value
This might be a stupid question but I would like to have a clarification on how to go about this. I have come across quite a few articles that let to set the values of a text box depending on the choices made in a drop down menu using jQuery and Ajax. My issue is when I’m trying to do
PHP code for moving the cursor using the twitter API
So I already have a script that collects the first 4999 followers ids of a twitter user using the API in xml format. I semi understand how the cursor process works but I am confused how to implement it to loop until it gathers all the followers. The user I am attempting to gather will take about 8 calls. Any
Multi-tenant PHP SaaS – Separate DB’s for each client, or group them?
You’ll have to bear with me here for possibly getting some of the terminology slightly wrong as I wasn’t even aware that this fell into the whole ‘multi-tenant’ ‘software as a service’ category, but here it does. I’ve developed a membership system (in PHP) for a clien…