Hi all
I'm trying to watch for a file being modified in a long running php script. The basic algorithm is this:
...
$mtime = filemtime($filename);
sleep($delay);
if($mtime < filemtime($filename))
... // do something because file was changed elsewhere
Problem is filemtime returns the same value withing same script, e.g. if a scr...
i am working on cms in which users submits articles and visitors can vote on those articles,
so i am confused. should i make a vote behavior (since it deals with data) or i will me it on a component (because it is an action in my controller) ?
help is very appreciated.
...
Hi,
we have a big community website build in drupal, where the site has a mandatory agecheck before you can access the content of the website
it checks for a cookie to be present, if not, you get redirected to the agecheck page.
now we believe crawlers get stuck on this part, they get redirected to the agecheck and never get to crawl ...
I have been playing around with in app purchases for a few days, everything works fine up until the point where I try to validate the receipt with the app store, as i am constantly getting back an invalid status.
I am passing the receipt data to my PHP server then forwarding from there to the app store and once I get a valid response I...
Hi!
I'm trying my hand at TDD with PHP and am writing a webbased app to access articles in a MySQL database; this is the test function:
class TestArticleTestCase extends UnitTestCase {
...
public function testArticleGenerateInsertSqlString() {
$testArticle = new Article("12345", "2009-09-13 20:20:20", "Test heading", "Test text")...
I can think of one way to do this, however I don't know if its the only way.
On a page on my website, I have a two select boxes, a 'parent' select box and a 'child' select box. The values that are inside the 'child' select box depend on what is selected in the 'parent' select box. This would be easy to solve in JavaScript, via AJAX call...
New to this new and secure way of handling SQL's in PHP and MySql driven web based application, to secure the code from SQL injections. I am planning to start using mysqli with PDO. Can anyone please outline how should i get started and proceed.
Any reference to any article will also be helpful.
Thanks in advance.
...
I was hoping someone could give me some advice, I am hoping to implement a full site search on a website that I building with codeIgnitor, PHP and mySQL. I was hoping someone would be able to over me some advice on wheather there are any free API's that enable a full site search, or any tips on building my own, how would be the best way ...
Hi,
My friend asked me to update a PHP application that his company uses. I found out that the application uses .ini extension for DB configuration file. The file contains DB host address, username, and password!!. The problem is that I can access the file on web-browsers.
I am trying to understand why. Is there any particular reasons ...
EDIT:
So my remaining questions are: (1) should I use a 302 or 303 for the header() redirect? I believe 303 is the proper way. (2) Is $_SESSION the best way to pass variables to the ?contact=thankyou page?
My revised code:
if ( isset( $_POST[ 'submit' ] ) )
{
if ( is_bot() )
{
header( "Location: http://www.example.com/contact/...
I have a small problem, I want to load data from a PHP file and put them on a DIV.
Here's the Jquery code
// Store the username in a variable
var jq_username = $("#txt_checkuser").val();
// Prepare the link variable
var link = 'user.php?action=check&username=' + jq_username;
$('div #checkuser_hint').load(link);
So it works! but i...
I try to load a php file called summary.template.hp when the content in class profi is clicked and
load changepass.template.php when the content of class changepass is clicked.
There is no problem in loading in firefox. But in Internet Explorer 7 the summary.template.php file is loading but the changepass.template.php file is not loadi...
i have two tables in my database one is A other one is B
A is having few fields in which three are id,name,group
B is having feilds like id,title,description, etc.
i have to search the id's of title and description that are having data similar to table A's name or group and then have to insert the id's in a field of table A.
For exampl...
I'm trying to add some Google AdSense in a RSS stream. I don't want to use their "AdSense for RSS" because it relies on a third-party.
I noticed that in RSS, you cannot use the lesser/greater than characters because it breaks the RSS code. Fine, I use the htmlentities() function to escape those. It works fine to display basic HTTP in th...
Hi
looking at embedding a flv player into a page but wish to read the flv file from a non www accessible location. I tried to write a controller action which takes a encrypted querystring, decrypt it, then output the contents to the page using readfile() but nothing seems to happen.
I'm not sure if its becuase i'm sending the wrong con...
Hi,
I am relatively new to the Zend Framework.
I understand the usage of Zend_Table and can obtain data using the Zend functions from the table associated with that class.
For example I have a video table and in another table I have the association between the video and what category it is in.
Im a little stumped how to active a sele...
I'm new to PHP, and I am creating a basic CMS using PHP and MySQL. I'm struggling to get the checkbox information from my HTML page across into the database.
How can I make the values to appear as binary 0 or 1 values?
The HTML document is written as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w...
Why should we use static variables or static calls to static methods in PHP5?
Maybe to improve performance?
...
hi all,
i have foreach, which generate following arrays:
==== array 1 ====
array
0 =>
array
'tag' => string 'daf' (length=3)
1 =>
array
'tag' => string 'daa' (length=3)
2 =>
array
'tag' => string 'daf' (length=3)
3 =>
array
'tag' => string 'daaa' (length=4)
4 =>
array
'ta...
I need to validate measurements entered into a form generated by PHP.
I intend to compare them to upper and lower control limits and decide if they fail or pass.
As a first step, I imagine a PHP function which accepts strings representing engineering measurements and converts them to pure numbers before the comparison.
At the moment ...