I am using the code here: http://net.tutsplus.com/tutorials/php/how-to-use-amazon-s3-php-to-dynamically-store-and-manage-files-with-ease/ …to create a bucket and subdirectories for users who upload pics for personal use when logged in. After uploading the pics successfully to the s3 server, they are dis…
Using Fancybox’s Current image as document title
I currently have a web site I am building, with an image gallery on the posts. My question here is: How do I take the current image’s title attribute, and make it the document title. Explained: When image one, with a title of “Beautiful, isn’t it?” is opened in the gallery, the documen…
How to split text based on specific word
I have a text which contains the word “Article” many times for example: My text title Article 1 bla bla Article 2 bla bla … I want to split the text like this: Answer Instead of trying to find a split pattern, you should look for a matching pattern: It matches Article, followed by anything u…
Optimizing regex for sentence sanitizer
This is a sentence sanitizer. This is the test sentence: hello [[[[[[]]]]]] friend…..? how are you [}}}}}} It should return: hello friend…..? how are you But instead it is returning: hello friend. .. .. ? how are you. So there are 2 problems and I can’t find a solution around them: the set o…
CakePHP cannot find UsersController
I have been following the blog tutorial on cakephp.org and I had adding and editing the posts table working fine. I wanted to add a user login but I am having trouble when following the tutorial. When …
Failed to parse time string at position 41 (i): Double timezone specification
I’m using the jquery daterangepicker, which in turn uses the jQuery datapicker. My Ubuntu system works fine. The browser is sending a parseable string: $dateStarted = new DateTime($post[‘startDate’]…
PHP MySQL Insert Ignore Inserting Too Much Data
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
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 …