I have the following code from Codeigniter index.php
My understanding is that,
If / of string position in $system_folder (in this case CIcore_1_7_1) is false,
and if realpath function exists AND (I don't understand here) is not false,
$system_folder is assigned to (I don't understand here) /$system_folder.
else $system_folder is assign...
I want to use temporary tables in my PHP code. It is a form that will be mailed. I do use session variables and arrays but some data filled in must be stored in a table format and the user must be able to delete entries in case of typos etc. doing this with arrays could work (not sure) but I'm kinda new at the php and using tables seems ...
We set a global in our prepend file used to form the path for our require_once calls. For example:
require_once($GLOBALS['root'].'/library/particleboard/JsonUtil.php');
Problem is, when I run PHPUnit's skeleton test builder, the prepend file is not run, so the global is never set. When I run
cd /company/trunk/queue/process; phpunit...
I don't understand... I'm doing something and when I do print_r($var); it tells me that I have an array, so naturally I think I have an array yet when I do
if(is_array($xml->searchResult->item))
it returns false
I use this array with foreach(); in documentation it says that foreach() won't work with anything else but array, so assu...
I've tried using the examples from this page, but I can't output any results.
This is my IF statement that works:
if (!empty($address['street2'])) echo $address['street2'].'<br />';
And this is my none-working shorthand code
$test = (empty($address['street2'])) ? 'Yes <br />' : 'No <br />';
// Also tested this
(empty($address['stre...
I'm currently having issues with my Facebook app being ported to CI from raw PHP.
The issue I'm having is that I have a CI driven redirect:
function signedin()
{
echo "signed in?";
}
function save_user_data()
{
$insert['uid'] = $_POST['uid'];
$this->db->insert('users', $insert);
redirect('signedin');
{
Based upon how all of the ...
Hi all,
I'm trying to read a file when ever an error occurs within my scripts so I can throw a custom error page.
When using ob_start/set_error_handler I am unable to use file_get_contents or ob_start within the callback to get the contents of my error template.
Does anyone know how I can output my custom template (and using eval) wi...
I keep seeing CakePHP and CodeIgniter referred to as full stack MVC frameworks, whereas Zend Framework is said to be non-full stack. What exactly does this mean?
...
Hi, i'm a wordpress user and i have a php code, and in that php code there is an area to put a url in: $url = "http://blabla.com"; well in wordpress you can call post permalinks with this code: <?php the_permalink(); ?> What i want to do is putting <?php the_permalink(); ?> instead of http://blabla.com above in the php code. Target is: g...
I have a folder full of 2000 images, all unique and named like this:
/images/0001.jpg (... 2000.jpg)
I need to be able to access 100 random, unique images. Something like this:
/sets/0001/001.jpg (... 100.jpg)
I need hundreds of "sets of unique images" like this.
I made one example set using a folder and a htaccess file with 100 lin...
On Java side, we have a servlet filter that handles authentication. We don't have to change all other servlet or JSPs to add authentication to the page, unless the page needs customized content.
How can we achieve the same on PHP? We don't use any frameworks on PHP.
...
Typical performance of Python scripts are about 5 times faster than PHP. What are the advantages of using faster server side scripting languages? Will the speed ever be felt by website visitors? Can PHP's performance be compensated by faster server processors?
...
here is the code :
if( false == (file_get_contents($jsonaddress)))
{
//error
print ('Error with stream, getting file instead !<br />');
$jsonaddress = 'listedesodeurs.txt';
}
else
{
//noerror
print ('Sucessfully GET data from JSON stream<br />');
$jsoncontent = file_get_contents($jsonaddress);
$size = fil...
I'm using CodeIgniter but I think this can apply to any web framework.
The "nav bar" and the site I'm making is Flash. Normally when you link to a page in CodeIgniter, you use the anchor() function, which you pass URL segments to, and it builds a hyperlink. But how can I link to pages within Flash? Hopefully there's a way other than cha...
class TestClass extends PHPUnit_Framework_TestCase {
function testSomething() {
$class = new Class();
$this->assertTrue($class->someFunc(1));
}
function testSomethingAgain() {
$class = new Class();
$this->assertFalse($class->someFunc(0));
}
}
Hi, do I really have to create $class for every test function I create? Or is ...
I am getting an error in my view:
Warning (512): SQL Error: 1054: Unknown column 'Model.id' in 'where clause' [CORE\cake\libs\model\datasources\dbo_source.php, line 525]
$sql = "SELECT Model.model_id, Model.pic_location, Model.model_name FROM models AS Model WHERE Model.id = '20' LIMIT 1"
$error = "1054: Unknown column '...
I have the following code that selects all the different template files out of a folder... The file names I have are:
template_default.php
template_default_load.php
template_sub.php
template_sub_load.php
I only want to select the ones without the _load in the file name so I used this code:
preg_match('/^template_(.*)[^[_load]]{0}\....
Guys,
I am grabbing user IP address, and then I want to determine whether that IP address is in accessible range or not.
What I am doing is, in my PHP script i am using 'ip2long' function and compare it with allowed range of ip address.
I know this is not a clean way to do that...does anyone have better idea to do that?
Any help appr...
I am building an e-commerce website from scratch and have to make a special product configuration page.
It's only 1 type of product, but it is configurable on several levels:
Color (about 4 different options). Value is a VARCHAR.
Material (about 10 different options). Value is a VARCHAR.
Size (About 30 different options). Has 2 Val...
I need to convert single line comments (//...) to block comments (/*...*/). I have nearly accomplished this in the following code; however, I need the function to skip any single line comment is already in a block comment. Currently it matches any single line comment, even when the single line comment is in a block comment. That can't ha...