php

Keeping track of file dependencies across multiple files in a medium-size project

Hello, My PHP code is split between many files, and often I find myself using code like this this: require_once( "$preIP/functions.php" ); The problem is that I have to keep using this a lot, and sometimes these statements are becoming redundant. What kind of system do yo use/would recommend for keeping track of all the inter-depen...

Php code to convert .xml to .xls(Basically from xmlExcel to Excel spreadsheet)

Is there a way to convert .xml file to .xls using php code? ...

What is an alternitive for using action(); or forward(); in ZF for pulling out different controller/actions in the layout?

Basically in order to have a profile Block u need - let's say profile controller, PhotoController, may be dashboard to show at the same page at the same time and to reach this in the zend framework is sometimes done through helper action() or forward, are ther better options? ...

PHP preg_replace - Very quick question

Masters of regular expressions, please help! See this string: $string = "http://www.url.com/?fieldA=123&fieldB=456&fieldC=789"; Assuming "fieldB" always has a positive non-decimal numerical value (but not necessarily three digits long), what preg_replace command do I need to remove it completely, such that the string will the...

content not dying

I have a function, where if a variable is not defined, exit; is called, therefor it should not produce anything on the page but a blank page. it produces an error message right before it is exited actually. so when its supposed to execute, because the variable is not defined, it should die, but what happens is the error message is execut...

Custom permalinks switching function. Please check this logic...

I've got a setting in my theme options panel to allow the user to switch the permalinks setting to support friendly URLs. I'm only allowing /%postname%/ and /%postname%.html as options. I don't want to be triggering an htaccess rewrite everytime someone accesses a page on the site or views theme options, so I'm trying to code this to av...

How do I print array values in a range when values are supplied?

My php reads in xml and I want to ouput the values within a given range. I have no way of knowing the size of the array or the range. However, I do know where to start; I have a $key that holds my current location. I also know where to stop; I have the word "ENDEVENTS" between each set. I want to get the values from my current position (...

PHP Explode and Get_Url: Not Showing up the URL

hello! its a little bit hard to understand. in the header.php i have this code: <? $ID = $link; $url = downloadLink($ID); ?> I get the ID with this Variable $link --> 12345678 and with $url i get the full link from the functions.php in the functions.php i have this snippet function downloadlink ($d_id) { $res = @get_url ('' ...

What is the correct way to bootstrap Drupal with Kohana 3?

Hi, I am trying to implement single sign on between an existing Drupal site a Kohana 3 based webapp. Ideally I would like to load Drupal's session information into $GLOBALS using the bootstap: require_once('../includes/bootstrap.inc'); drupal_bootstrap(DRUPAL_BOOTSTRAP_SESSION); A post on the Kohana forum suggested that this should b...

Problem with double quotes and Input

Hi, i have the following code : <input type="text" value="<?php echo $_GET['msg']; ?>"> This input is automatically filled with the name that is writen in the previous page. So, if the user wrote : i like "apples" and banana The input will be broken because it will close the tag after the double quotes. I know i can avoid that by htm...

Trying to debug a symfony app showing the list of all the functions called, debug_backtrace() doesn't fits me.

Hi, im trying to debug a symfony app. I've added a debug_backtrace() calling to this function below. It outputs a list of functions called, but the save() function (that is just before the debug_backtrace() calling) is not that list.. why? any other way to debug that shows more things, in this case the save() calling ? protected funct...

How do you save rows to an array and print out in PHP using ODBC?

I have the following: while($myRow = odbc_fetch_array( $result )){ <--lots of rows $thisResult['name'] = $myRow["name"] ; $thisResult['race'] = $myRow["race"] ; $thisResult['sex'] = $myRow["sex"]; $thisResult['dob'] = $myRow["dob"]; } I can't figure out how to print this back out. I want to get each row and iterate t...

How To Disable Curl Debug Output in PHP

I wrote a PHP CUrl Class, if i execute Methods which should return the Content, it returns at first the Headers and after that the Content. So i cant parse any XML Data. I need to Disable This Sample Output. HTTP/1.1 200 OK Date: Thu, 01 Apr 2010 20:11:58 GMT Server: Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny4 with Suhosin-Patch mod_ssl/2....

MySQL Table structure of thumb UP & DOWN for comments system ?

Hello, i already created a table for comments but i want to add the feature of thumb Up and Down for comments like Digg and Youtube, i use php & mysql and i'm wondering What's the best table scheme to implement that so comments with many likes will be on the top. This is my current comments table : comments(id,user,article,comment,stamp...

zend_navigation and modules

Hi, I am developing an application at the moment with zend and I have seperated the app into modules. The default module is the main site where unlogged in users access and have free reign to look around. When you log in, depending on the user type you either go to module A or module B, which is controlled by simple ACLs. If you ha...

What is faster - using PEAR package or including required libraries directly into php code?

Hello, What will work faster - using PEAR package or require Some_Library.php files in code? For example, what is faster - using Smarty as PEAR module or using require_once("Smarty.php")? Have anyone tested this? Thank you ...

Pagination links do not work properly.

Hey, I'm still trying to get my pagination links to load properly. But I can't seem to find a solution to this one problem. the problem I am having is when I click any of the pagination number links to go the next page, the new content does not load. literally nothing happens and when looking at the console in Firebug, nothing is sent ...

PHP Explode: How to Download and Split a Specific HTML Part?

Hello, example: at this domain http://www.example.com/234234/go.html is only one iframe-code how can i get the url in the iframe-code? go.html: <iframe style="width: 99%;height:80%;margin:0 auto;border:1px solid grey;" src="i want this url" scrolling="auto" id="iframe_content"></iframe> i have this snippet, but its very bad coded.....

Scheduled cron job to check for pending activity

Using PHP ... This is for my personal use so I'm thinking maybe 3-4 emails a day. I'm at a point where I can send an email to a dedicated email address where my script parses the message and stores it into a DB. Now, I need to figure out the best way to check the records in the DB for any upcoming task. I feel like I'm missing something...

AS3 equivalent of PHP key array

Hey all, title may be abit misleading but i didnt know the correct way to write it. Basically, how can i do the AS3 equivalent of this php code: return array('x' => 0, 'y' => 0); ...