php

How can I pass variables from a form within the Wordpress platform?

Hi, I'm building a website using Wordpress. The WP-Events plugin is being used to display a list of upcoming events. What I need is for people to be able to confirm their attendance at any particular event. WP-Events is a bit awkward in that it's customised using a template that is only able to be edited with the Wordpress admin. I...

PHP function return value nested array removed

I have a function that builds a collection of user objects from the database: public static function GetUsersByGroup($instanceID, $groupID) { $col = null; if($groupID != null) { $col = UserGroup::GetCollection("User" ,_DB_GET_ALL_INSTANCE_USERGROUP_MEMBERS,array ($instanceID, $groupID)); } els...

Remove namespace from XML using PHP

Hello everyone! I have an XML document that looks like this: <Data xmlns="http://www.domain.com/schema/data" xmlns:dmd="http://www.domain.com/schema/data-metadata" > <Something>...</Something> </Data> I am parsing the information using SimpleXML in PHP. I am dealing with arrays and I seem to be having a problem with the names...

PHP error wrapper?

I don't know if the term I'm using is right, but what I'm looking for is something similar to what you get with zend server. Take a look at this. It looks like on an error, it dumps the request along with a stack trace and function parameters as well as some other info. It lets you view it in a nice interface. I know this wouldn't be ha...

Help with this JOIN

$threads = mysql_query("SELECT DISTINCT t.id, t.title FROM threads t LEFT JOIN comments c ON t.id = c.parentID ORDER BY c.date DESC"); while ($thread = mysql_fetch_assoc($threads)) { echo "<li><a href=\"?threadID=$thread[id]\">".htmlspecialchars($thread['title'])."</a></li>\n"; } Can ...

Cannot include a file in php

I am running the code below in some if/else statements, I have a weird issue in the same file this exact code below works fine, however in another area if it is called I get this error; Warning: include() [function.include]: URL file-access is disabled in the server configuration in C:\webserver\htdocs\processing\process.friends.php on ...

drupal hook functions and their arguments

I'm reading through Pro Drupal development right now, and an example on page 82 uses the following function: function menufun_menu_link_alter(&$item, $menu){ if ($item['link_path'] == 'logout'){ $item['link_title'] = 'Sign off'; } } I understand that I can find out what parameters "hook_menu_link_alter" takes by looking ...

storing simple user action/click tracking (associative array in text??)

I've been storing some simple user click-actions in text files so I can easily refer to them. I'm not looking to go the full db route, as I'm looking to learn hadoop, and should be able get the data from my log files, but until then I'm looking for a fairly light-weight solution. I could continue with the txt file route, but it ends u...

Finding Zip Codes in a Specific Radius

I have found this popular PHP/MySQL Script called Zip Location by SaniSoft and it works great besides one thing: It doesn't in some instances. It seems that any radius under 20 miles returns the same amount of zip codes as 20 miles. I have searched all over google, but to no avail and I was wondering if someone had some insight on this ...

[php] underlinks also

Hi! I'm not very good at explaining in english but i'll give it a go. Hope you understand. In php i have this script that fetches an URL and displays the content. So far so good. The content is shown like this: eg. site.php?url=http://google.com But WHEN i click on something in the page, eg. google.com, then my site disappears and th...

Which php files are secure?

For example, using CodeIgniter, and not really dealt with .php files. Are any of the .php files in the directory structure readable? If not why not? Why can't I browse to config.php in my CI directory? Is it just unix file permissions? Thank you. ...

How can I avoid PHP session errors?

Occassionaly I run accross this error in PHP, how can I fix this or what cause it? Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disab...

mysqli using prepare

Hello guys. I need some help, I have created this function and it works fine, but now I need to use "prepare" in MySQLi. Can I get some help? I have tried http://dk.php.net/manual/en/mysqli.prepare.php but I don't really understand how to prepare work with MySQLi. My db obj is ( $this->db ) in my class. I need a sample of my own cod...

php: take a thumbnail from a quicktime (movie) file

Does someone know if it's even possible (in PHP) to take a frame/thumbnail from a quicktime movie on the server? Something like the usual GD thumbnail generation, but for .mov files. thanks! note: I'm using dreamhost, so I don't have more than web-panel access to the server. ...

Facebook developemt in PHP - newbie questions

I'm working on a project synching a facebook application with a regular website. The db has got a users table, but the table only has got the user ID of each user of the application. The user id is the facebook user id of the people. For each user in the users table, I need to fetch their name, and other info from facebook. The client ...

Apache mod rewrite returns blank screen for php files with wordpress header included

Here's simplified .htaccess file: RewriteEngine On RewriteRule ^index$ index.php On my local lamp server everything works fine, but there are some problems on production server. myurl/index returns only blank screen, php is not parsed. When required file is accessed directly (myurl/index.php) it works fine. I noticed that this prob...

php doesnt show error

hi im working in php on suse11.0 my problem is when i type a wrong syntax or query it doesnt show error only blank page shown at this situtaion thanks ...

Real-world testing of CakePHP controllers?

I'm writing a new application with CakePHP (just-released 1.2.4), using SimpleTest 1.0.1. I have read the relevant sections of the Cookbook, searched on the Bakery, and read Mark Story's postings on controller testing (the hard way and with mocks). Unfortunately, none of this talks about real-world testing of non-trivial controllers. Lo...

Parsing XML CDATA with PHP

Hello people, I have a little problem that I can't figure out how to solve. I have an XML (actually it's RSS) file that I'm trying to parse with PHP, but the CDATA tag come out blank. Here's the XML Code and here's the PHP file Everything works fine, except that the description tag is not printing. I would be very grateful if some o...

Eclipse PDT installation

I have a project that's intended to use some PHP as well as Java and Javascript, so I installed the PDT PHP plug-in for Eclipse, using the Install New Software menu option. Now Eclipse agrees PDT is installed, but no PHP features like creating or editing PHP files are appearing anywhere. Is there something else I need to do to activate P...