Most of the applications that I'm finding, inncluding LiveHelp and PHP Live Chat! feature terrible, un-commented, non-cross-browser compatible Javascript.
I'm looking for chat software that uses a Javascript framework to avoid some persistent and common bugs related to the DOM.
...
I am working on a web application which requires the user to login before they see or do anything. No part of this app should be accessible without being logged in. (Except of course, the login controller)
Currently I am using sessions to handle the authentication and I have put code in each controller in the init() function to check i...
I want to retrieve NAME OF FORM from php when i am submitting a form. Can i find the NAME OF FORM by PHP?
...
Hello people,
I am diving into the world of unit testing. And i am sort of lost. I learned today that unit testing is testing if a function works.
I wanted to test the following function:
public function getEventById($id)
{
return $this->getResource('Event')->getEventById($id);
}
So i wanted to test this function as follows:
p...
Hi guys, I have gotten the photo upload function to work with this code,
<?php
include_once 'facebook-php-sdk/src/facebook.php';
include_once 'config.php';//this file contains the secret key and app id etc...
$facebook = new Facebook(array(
'appId' => FACEBOOK_APP_ID,
'secret' => FACEBOOK_SECRET_KEY,
'cookie' => true,
...
Can someone provide me a reference to a good PHPUnit mock guide? The one in the official documentation doesn't seem to be detailed enough. I am trying to study PHPUnit by reading the source code, but I am not familiar with the term matcher, invocation mocker, stub return, etc.
I need to know about the following:
1) How to expect multi...
I know JavaScript is client side and PHP is server-side. I also know this is an odd question. However, the CMS editor I'm using will not allow php to be stored to the database (it's the same editor used by Dupral). I can store JavaScript though.
Can I import a php file with JavaScript. Or rather read the php file, store the content in a...
Possible Duplicate:
Requesting NAME OF FORM by php
I have a form with no captcha and this is submitting by POST method.I am fearing for Spamming. User can spam my database by ajax. How will i protect it by Spammers.ANy idea.. thanks in advance.
...
I am trying to make a module to add a table to a form in another module. I found I can add the new data in a module_form_alter hook but how to I get it to run through a theme hook? The module I am trying to modify has a theme hook for the page I want to modify. I don't want to change the original form I just want to add a table with n...
The following code brings up all the fixtures from the database.
while ($row = mysql_fetch_assoc($result))
{
echo $row['date'];
echo $row['home_user'];
echo $row['home_team'];
echo $row['away_user'];
echo $row['away_team'];
}
The problem I have is all the fixtures are just listed.
T...
I have a form into which the visitor can enter data, and I want to store this data in a mysql database via the $_POST variable. What do I need to prevent sql injection?
...
$from = $_POST['from'];
$to = $_POST['to'];
$message = $_POST['message'];
$query = "SELECT * FROM Users WHERE `user_name` = '$from' LIMIT 1";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$fromID = $row['user_id'];
}
I'm trying to have $formID be the user_id for a user in my database. Eac...
I have put together the following code, the problem is that each while loop is only returning one set of data.
$result = mysql_query("SELECT date FROM ".TBL_FIXTURES." WHERE compname = '$comp_name' GROUP BY date");
$i = 1;
echo "<table cellspacing=\"10\" style='border: 1px dotted' width=\"300\" bgcolor=\"#eeeeee\">";
while ...
I have a huge chunk, so large that I can't manually edit the file and need to read it in and do regex operations to see what's wrong.
Basically - my server is PHP 5.1.6 and I can't update it. This features an older json_decode which is less featured than the 5.2/5.3 versions.
json_decode returns NULL and json_last_error is being invoke...
I've been experimenting with OpenID, and have set up a sample web page to access using my OpenID account. I'm using the Php OpenID Library by Janrain and it wasn't working with my Google Account. A little research led me to this question, which suggests the problem is that Google uses https and...
... it's likely the setup for making...
I'm working with Colorbox and if I specify to use an iframe with it then the $_SERVER['HTTP_X_REQUESTED_WITH'] variable is no longer available to me. I need that in order to detect if ajax has loaded so then I can include a header/footer or not.
Anyway to get this variable or is there another variable that I can get when I use iframe?
...
I want Pi to like 100,000,000 decimals/digits...
And variables (well for me) say they have a limit of 67,000,000 bytes...
Is there any way around this?
can you save the first 10,000 characters/digits into one?
can you save it into an array 10,000 in each?
Is there a way?
If so how? Thanks alot...
...
I am trying to pass some JavaScript variables that I have assigned to form variables into a query string used by a jQuery plug in called fancybox. If I hard code in the string that I want lightbox works great, however I need it to pass some form values in there to make it work as desire.
<script type="text/javascript">
$(document)....
What is the easiest way to duplicate an image variable in PHP.
Normally you can simply do $varnew = $varold.
But with a GD library variable if I did the above and then edited $varnew then $varold would be effected too.
Obviously one way would be to reopen the file or to make a new image and copy it into it. Is there an easier way?
...
Okay, here's what I'm trying to do. I am running a MySQL query for the most recent posts. For each of the returned rows, I need to push the ID of the row to an array, then within that ID in the array, I need to add more data from the rows. A multi-dimensional array.
Here's my code thus far.
$query = "SELECT * FROM posts ORDER BY id DES...