I want to print out the id of the button I pressed. The id is set dynamically for each button in a table. This is my HTML code: And I want to print the id of the button here. Answer If you do not wish to use a hidden field, you could set your submit button like this: Then you
Tag: php
how to delete a file from folder in php
I have a folder ‘items’ in which there are 3 files item1.txt, item2.txt and item3.txt. I want to delete item2.txt file from folder. I am using the below code but it not deleting a file from folder. Can any body help me in that. Answer Initially the folder should have 777 permissions or try
php random image file name
Okay im using a snippet I found on google to take a users uploaded image and put it in my directory under Content But Im worried about duplicates so I was going have it upload the image as a Random …
PHP Sorting Inner, Inner Array
Okay I have an array like this: array { [0] => array { [0] => array { [“Time”] => “01:00:00” } [1] => …
Monolog FingersCrossedHandler
I am looking into using monolog in an application I am working on but I am unsure whether I would be able to implement what I require using the FingersCrosedHandler. I would like to only log DEBUG …
How to upload pic to Amazon s3 bucket and subfolder and display using php foreach
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…
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’]…