Hello. I have 3 mysql tables: events, artists and (artist) descriptions. All of them are in many-to-many relations.
Table 'events':
ID | eventTitle | etc.
-----------------------
1 | event 1 |
2 | event 2 |
etc.
Table 'artists':
ID | artistName | etc.
-----------------------
1 | artist 1 |
2 | artist 2 |
etc.
T...
I am responsible for the backend portion of an API, written in PHP, which is primarily used by a Flash client. What happens right now is: the Flash client makes a call, the backend loads the necessary data, does any necessary processing and post processing, logging and caching and then returns the result to the client.
What I would like...
Hi all
I'm working on a site here where I include parts of the site that are called in multiple locations in it's own sub directory. I created a file in said directory and tried to include it in a file, but for some reason tis' not working. Here's the code that is within that file.
<?php
require_once("a_file.php"); //this file loads
r...
I know I can bind params in Kohana like this
$this->db->query('SELECT * FROM products WHERE id = ?', array(14));
But is there a way to do it with identifiers (or whatever they are called?)
As in
$this->db->query('SELECT * FROM products WHERE id = :id', array(':id' => 14));
Thanks
...
I wrote this function to get the unread count of google reader items.
function GetUnread($sid)
{
$url = "http://www.google.com/reader/api/0/unread-count?all=true&output=xml";
$msg = urldecode($msg);
$msg = stripslashes($msg);
$msg = urlencode($msg);
$url = $url . $msg;
$purl = parse_url($url);
$uri = $pu...
I'm considering my options to implement pretty links for a new website.
I understand how to make the basics work, for example doing:
/view/postTitle/7895
I can just pick up the id 7895 and just ignore the title.
However, I see that some websites manage to get rid of ids altogether:
/view/postTitle
How does this work?
The only way ...
Normally I would just do this.
$str = preg_replace('#(\d+)#', ' $1 ', $str);
If I knew it was going to be utf-8 I would add a lowercase "u" modifier to the pattern and I think I would be good. But because of reports of utf-8 taking 2x and in some cases 3x the storage space than it would take if the native character set were used, I'm ...
Hello,
While developing a custom component I want to make a call to the controller from the view after the default template of view is rendered on the screen.
How can I do it?
...
Hello,
I want to call a function with call_user_func_array but i noticed that if an argument is a reference in the function definition and is a simple value in call_user_func_array, the following warning appears:
Warning: Parameter 1 to test() expected to be a reference, value given
Here is a simple example of what i am trying to do:
...
Hello,
I am looking at some sort of existing filter which can sanitize the user input to avoid XSS. Probably I can use htmlspecialchars for that. But at the same time I want to be able to parse all links (should match a.com, www.a.com and http://www.a.com and if it is http://www.aaaaaaaaaaaaaaaaaaaaaaaaaa.com then it should display it a...
Just need some help taking this hierarchical array...
Array (
[root] => Array ([attr] => Array ([id] => 1) [label] => Array ([value] => My Root)
[node] => Array (
[0] => Array ([attr] => Array([id] => 2) [label] => Array([value] => Category 1)
[node] => Array(
[0] => A...
I'm investigating for a piece of front-end web technology which customers will install onto their own web servers. The server-side technology stack needs to support acting as a SOAP client, but not much else. My primary goal is ease of deployment.
Ideally the customers wouldn't have to install any software, they could just drop in some...
I read from mysql website, I execute this:
SELECT CURTIME()
But then how to get the value? Using mysql_fetch_assoc()??
...
Hi
I have been asked a question but I cannot even start to answer is so could some one give me an idea of were to start on how to possibly answer it ,
I am not looking for the answer just some teaching on how to answer it
here goes:
Assuming "regsister_globals" and "magic_quotes_gpc" are turned on, Whats wrong with this piece of c...
Hi guys,
I need to have all PHP errors logged to a file on my centOS box. I think I'm doing everything I'm supposed to. Here's my .htaccess file:
php_flag display_errors off
php_flag log_errors On
php_flag error_log /var/www/vhosts/hostname/logs/fo_errors.log
In my php.ini, I have error_reporting=E_ALL set.
Apache does parse .hta...
I worked on a nice "force download file" script which purpose is to make sure files are being offered to download instead of displayed in the browser, no matter what type of file that is.
It used to work well but recently i received feedback that it wouldn't work, notably for pdf and xls files (MS Excel). The file is either detected as ...
I am currently building a query where both the field and value parts possibly consist of user inputted data.
The problem is escaping the fieldnames.
I'm using prepared statements in order to properly escape and quote the values but when escaping the fieldnames i run into trouble.
mysql_real_escape_string requires a mysql connection r...
Hi,
is there any possibility to "invoke" a class instance by a string representation?
In this case i would expect code to look like this:
class MyClass {
public $attribute;
}
$obj = getInstanceOf( "MyClass"); //$obj is now an instance of MyClass
$obj->attribute = "Hello World";
I think this must be possible, as PHP's SoapClient a...
Hi,
I can't figure out a good solution for limiting the storage amount a user may access with his files.
In the application users are allowed to upload a limit amount of files. The limitation is based on total file size. I.e. a user might be allowed to store 50 Mb on the server.
This number is stored in a database so that it can be ea...
my php session variable arent accessible when im on a page which is which has a varible being sent in its url i.e when on http://myurlId.php?id=1 php varible arent accessed .. when on a normal page with no varaibles being send with url session varibles are accessed just fine.
...