php

what MySQL permissions are required for mysql_real_escape_string()?

what MySQL permissions are required for mysql_real_escape_string()? i want to create a db user with the minimum abilities specifically for using with mres()... ...

Codeigniter - How to achieve different member areas within a site? Tank_Auth

Hi, I have built an app using codeigniter which has 3 different member groups Admininstrators - Who login to a dashboard and have CRUD facilities to Add/Edit/Delete Events, shows and artists Clients - Who Login from the front end and see all the items that the admin have added via the back end. Media Partners - Who Login from the fro...

Will reducing number of includes/requires increase performance?

Hello, What is better practice for script performance tuning? This one? require_once("db.php"); if (!is_cached()) { require_once("somefile.php"); require_once("somefile2.php"); //do something } else { //display something } Or this one? require_once("db.php"); require_once("somefile.php"); require_once("somefile2.php"); if...

How can I group same values in a multidimention array?

How can I group same values in a multidimention array? I want this array( array('a' => 1, 'b' => 'hello'), array('a' => 1, 'b' => 'world'), array('a' => 2, 'b' => 'you') ) to become array( array( array('a' => 1, 'b' => 'hello'), array('a' => 1, 'b' => 'world') ), array('a' => 2, 'b' => 'you') ) ...

Preventing Zend Studio from splitting HTML tag arguments on multiple lines

I am trying Zend Studio before I buy it. I have noticed that a line like this: <input type="hidden" name="id" value="<?php echo $this->album ['id']; ?>" /> will be changed to this: <input type="hidden" name="id" value="album ['id']; ?>" /> during the Format operation. Is there anyway to prevent this? It is very messy in my opinio...

How to collect jquery.ajax() data in PHP ?

I send data from javascript to PHP like this: $.ajax({'url': 'my.php', 'type': 'POST', 'data': JSON.stringify(update_data), 'success': function(response) { alert(response); } }); Using HTTPFOX Firefox plug-in I see the following data in the POST DATA tab: {"file...

How to keep DOMDocument from saving < as &lt

I'm using simpleXML to add in a child node within one of my XML documents... when I do a print_r on my simpleXML object, the < is still being displayed as a < in the view source. However, after I save this object back to XML using DOMDocument, the < is converted to &lt; and the > is converted to &gt; Any ideas on how to change this beh...

php download as document file

php file download as document not working in IE ...

CRON behaves exactly like running a script in the browser?

I never used CRONs and I don't know hot to set up one so I use online cron websites to do it. Now I'm using http://www.setcronjob.com/ free account for testing. I use this service to run a script that fetches data from the web. The script uses PHPs file_get_contents and cURL. I want to know if running a CRON is behaves the same way as ...

How to manipulate and validate string containing conditions that will be evaluated by php.

Part of the program I am creating consists of the user creating conditions which I will store in a mysql database. I want the syntax to be somewhat easier than what php allows but since this will ultimately be run as php code using eval() it needs to have valid syntax. For example: User Input: 4<var1<=9 AND var2<6 Result should be: ...

Caching strategy, when does caching become pointless?

I'm pretty new to caching strategies and implementations. I'm working on a project that will be database intensive, but also have information being updated and changed very regularly. I've found enough info to know generally how to develop the caching function, but what I'm unsure about is the general strategy. If I cache all query r...

how to insert flash into form like http://www.mediafire.com

I would like to isert flash upload into my index file but I dont knoz how to insert flash. this is the link of the flash http://www.tinywebgallery.com/en/tfu/web_demo1.php i would like to insert like http://www.mediafire.com when you click to UPLOAED to MEDIAFIRE . thank you for your help. ...

Problem FaceBook application does not publish on the wall

First clarify that goes wrong on my server connection with FaceBook I can usually write things on the application. To start I decided to make one of phrases, sentences are like 6 random test and works well. I think the problem is that the function to publish on the wall and does not work, if I look at the Firefox Error Console fails Th...

How to control a C# Program from the web? Using AJAX maybe?

Hello. Can anyone explain how to send variables from the web (PHP, Javascript, etc.) to a C# program? I want to allow the web to tell the program what to do. Maybe I could use AJAX to send data to an auto-updating page, which the C# program can then read? That would also allow users to be logged-in to the page and therefore different dat...

Insert space between two captalized words?

Hello, I have two words combined like KitnerCoster And I want to add a space in the middle, is there any sort of trick anyone knows if seperating two words that are both captalized and that is the only difference. Regards, ...

PHP sorting multidimentional arrays

I have the following array. I need to sort this array by the nested array key [id]: Array ( [0] => Array ( [id] => 5 [category_id] => 12 ) [1] => Array ( [id] => 3 [category_id] => 12 ) [2] => Array ( [id] => 9 [category_id] => 12 ) [3] => Array ( [id] => 4 [category_id] => 12 ) ) ...

php xml function requirements

hi i am using the xml function simplexml_load_string for reading the xml string but there is no any output of this function i also use dom function but the same response of this. is there any another method of reading the xml? or is there any modification require on server to enable these function ...

Changing status with restrictions

I'm working on a status changing implementation for records. For example, when a record is created, it commences in a 'pending' state until a administrator changes its state to either 'active', 'rejected' or 'revoked'. The thing is, if a status has been changed from pending to active, the status cannot be changed back to pending or reje...

Verify email with codeigniter

Hi, How can I verify an email address with codeigniter? I just went through the manual, I couldn't find this. With email verification, i mean the exact same verification you see when registering on a community forum. Thanks in advance! ...

How get text with preg_match till end of word?

I need to find part of string which is equal to string till end of word. Example i have texts: "Start play. I need..." "Start playstation play" "start play, work" "start player" "start pay with..." Then i searching for "/^start play/'i" and found all phrases, but i need only phrases which ends with word play: 1, 3, 5 preg_match('...