Long story short, I'm developing an in-house report engine. It is entirely web based (utilising PHP and various AJAX techniques) and interprets data stored in a MySQL database by our production software. It runs on an Ubuntu 8.04 server, and all employees have a linux user account on that machine. I set up a login system using pam_auth t...
Hello I have a couple questions about PHP exec() and passthru().
1)
I never used exec() in PHP but I have seen it is sometimes used with imagemagick. I am now curious, what is some other common uses where exec is good in a web application?
2)
About 6 years ago when I first started playing around with PHP I did not really know anythi...
I have a page that generates a $_SESSION['variable'] that is dynamic, so when you refresh the page the session has a different value everytime ( just a value of 0-10 ). But when I refresh the page in firefox, nothing shows up, but in IE it works fine. I also tried in Opera but it doesn't show up there either. Anyone know why it's not ech...
I've searched the questions on here, but I don't have a good understanding of how to use the error handling in jQuery's AJAX (im a noob, so it just really doesn't make sense.)
Can anybody describe this to a beginner? I'm currently posting information to a PHP script via AJAX, but want to allow jQuery to recognize if the returned data fr...
This may have been asked before, and I have seen similar solutions... Perhaps I am thinking about this incorrectly.
I would like to have one link called user/edit if the user is an admin it should route to admin_ if they are a basic user it should route to user_ etc... Is there a way to do this in a slick way?
I have seen solutions tha...
I'm still getting the hang of more advanced MySQL queries, so bear with me here...
I have a table (1 table) with the following columns: name, source, destination, count
I want to group my results by name, then subgroup them by the pairing between destination and source.
So far all I have is this query:
SELECT name, destination, sourc...
On the Facebook FQL pages it shows the FQL table structure, here is a screenshot below to show some of it.
You will notice that some items are an array, such as meeting_sex, meeting_for current_location. I am just curious, do you think they are storing this as an array in mysql or just returning it as one, from this data it really ma...
I must be missing something. I'm trying to stub methods on a class in PHPUnit, but when I invoke the method on the mock object, it tells me that method is undefined.
Example class to stub:
namespace MyApp;
class MyStubClass
{
public function mrMethod()
{
// doing stuff
}
}
To stub it, I write:
// specifying all ge...
I have multiple text files, which are simple reports, that must be reviewed and validated by users. I would like to pull the report into an html div element then add form fields at absolutely positioned locations.
For example, the report may have monthly sales by sales rep:
Jan Feb Mar
13 9 11
I want the user to see t...
I'm creating a TV Guide which lists programmes coming up (and on some listings, previous airings from the past), with all data stored in a database. It runs in PHP, my version being 5.28 (upgrading to 5.30 or 6 soon).
Below is a script which works (note the field airdate is stored as DATETIME in the database):
[Disclaimer: The script ...
Hi all. I have some legacy C code (as a macro) that I am not allowed to change in any way, or replace.
This code (eventually) outputs out a digest (C) string based on the source string, performing an operation on the hash value for each character in the string.
#define DO_HASH(src, dest) { \
unsigned long hash = 1111; // Seed. You ...
I am trying to get the xmlrpc extension to work for php5 in MAMP (1.8.4).
I checked what version of PHP 5 was installed:
$ /Applications/MAMP/bin/php5/bin/php -v
PHP 5.2.11 (cli) (built: Dec 12 2009 13:19:08)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
with Zend Extension Man...
I have been fighting the timezone battle for weeks now, everyone thinks they know the solution and then they get a million upvotes but the reality is I am totaly 100% stuck, no answer ever given for timezone support in PHP/MySQL has worked 100% for me, so I am asking the question again on here in as much detail as I possibly can with cod...
I have a page which has a drop list inside a form. The drop list contains 'Categories' of ads.
Depending on the value chosen in the drop list, I use javascript to show/hide DIVS on the page, which all contain different form inputs for the user to fill in.
All this still inside the form!
Now, when the user has filled in all form inputs ...
$string = 'I like banana, banana souffle, chocobanana and marshmellows.";
$arr = some_function($string);
// $arr = ('banana'=>3,'I'=>1,'like'=>1....);
do you have an idea how to do this most efficiently?
...
Thank you to all who helped me with my last question (http://stackoverflow.com/questions/2031451/tv-guide-written-in-php-problems-with-datetime-and-database-functions/2031673#2031673) - however, what I'm trying to do is paginate the results now, as seen here:
http://pastebin.com/fccf3500
Is there a way to get this to work as a paginatio...
The setup:
I have a standard .php file (index.php) that contains two includes, one for header (header.php) and one for footer (footer.php). The index.php file looks like this:
index.php
<?php
include header.php;
?>
<h2>Hello</h2>
<p class="editable">Lorem ipsum dolar doo dah day</p>
<?php
include footer.php;
?>
header.php like thi...
I have this code to get the user name that a friend has messaged to someone like user to from message. mysql_num_rows is not working and my user names come up as unknown. Does this have something to do with mysql_num_rows()?
function getusername($userid) {
$sql = "SELECT username FROM user WHERE `id` = '".$userid."' LIMIT 1";
...
I am trying to customize the Products Ordered report so that it only shows a summary of the products that have an SKU starting with XX. I have been following the tutorial at http://magentocoder.jigneshpatel.co.in/reports/create-custom-reports-in-magento-admin/ to extend the module, but this tutorial shows how to extend the report by addi...
I been looking at some database (MySQL) wrapper classes, A lot of them work like this,
1) Run the sql query
2) while fetching associative mysql array, they cyle through the results and add them to there own array
3) then you would run the class like this below and cycle through it's array
<?php
$database = new Database();
$result = $...