Parsing content in html tags using regex
Hi I want to parse content from <td>content</td> and <td *?*>content</td> and <td *specific td class*>content</td> How can i make this with regex, php and preg match? ...
Hi I want to parse content from <td>content</td> and <td *?*>content</td> and <td *specific td class*>content</td> How can i make this with regex, php and preg match? ...
I am trying to create a login system with Zend that when a user tries to access a restricted page they will be taken to a login page if they aren't signed in. The issue I'm having is getting the URL they were trying to access before hand. Is there a Zend Function that will return everything after the base Url? For example, I need "mod...
I'm trying to connect to a DB2 databse from a windows machine using XAMPP. When I try to load the php_ibm_db2 module I get the following error "PHP Startup: ibm_db2: Unable to initialize module Module compiled with module API=20060613 PHP compiled with module API=20090626 These options need to match" How do I fix this and connect t...
I have a simple code written (based on some tutorials found around the internet) to parse and display an XML file. However, I only know how to reference an XML file stored on my server and I would like to be able to use an XML file that is being returned to me from a POST. Right now my code looks like this: if( ! $xml = simplexml_lo...
Need to be able to use dates beyond the 32-bit timestamp limit so upgraded our server to Windows Server 2003 64-bit version. And running php 5.2.5 64-bit. However still can't use dates beyond the 32-bit limit. echo strtotime("11-11-2050"); returns nothing. Running php on IIS 6.0 using C:\WINDOWS\system32\inetsrv\fcgiext.dll Let me ...
I've noticed different "dumping" behaviors when using PHP's DOMDocument's saveXML() and saveHTML() methods. Here is a simple example of dumping the copyright symbol (). <?$domDoc = new DOMDocument(); $domDoc->loadHTML("©"); echo $domDoc->saveHTML(); echo $domDoc->saveXML(); echo $domDoc->saveXML($domDoc); ?> The three du...
Hello all, I am trying to save lots of variables to a database and its getting ridiculous now. I am using PHP and MySQL. Is there a way, I can get the array value and the array keys (array keys are exactly saqme as the table column/field names) in one go without having to add a new variable and table column pair. To be honest, I just ...
I've seen an code example where someone does a $dbh->rollback(); when there occurs an PDOException. I thought the database will rollback automatically in such a case? ...
I am (as a follow-up to this question) looking for a way to wrap APIs around default functions in my PHP-based web applications, databases and CMSs. I have looked around and found several "skeleton" frameworks. In addition to the answers in my question, there is Tonic, a REST framework I like because it is very lightweight. I like RES...
I have a list of items in a particular order so I've decided to store them in an array $items = array( "apple", "banana", "pear" ); If the program is called with the parameter "banana" I need to be able to say "apple" comes before and "pear" comes after. Currently I'm doing something like this: foreach($items as $k=>$v) { if...
I'm finishing a CMS (Control Management System) written in PHP5 and that uses Zend Framework an CKEditor (www.ckeditor.com). I have plans to make it commercial but I don't know what kind of license to use in the software. The code will be open (I won't compile or encrypt PHP code with any things like Zend Guard). People can: Create p...
Hi, I am using PHP curl method to get a string type response. To create the request I use: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_FAILONERROR, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($...
I just cant figure out why am getting error 1064 from this query //prep the data for database use $manufacturer_id = $_GET['id']; $manufacturer_display_name = mysql_prep($_POST['manufacturer_display_name']); $manufacturer_name = mysql_prep($_POST['manufacturer_name']); $query = "UPDATE IT_manufacturer SET manufacturer_name = '...
$headers=array( $requestMethod." /rest/obj HTTP/1.1", "listable-meta: ".$listablemeta, "meta: ".$nonlistmeta, 'accept: */*', ); In the above example, I'd like to omit the whole line if $listablemeta or $nonlistmeta is blank. Assume $listablemeta is blank. Then the array would be: $headers=array( $request...
I am needing to use sessions for my php page, so, on my index.php page, I add session_start(); right after the opening php tag. But, this page has some includes, inside of which have other includes. So, deeper down, when I want to call a $_SESSION var, it is not working. How can I access a session var even deep down into .inc files? ...
I'd like to be able to take a 1-frame SWF file and convert it to PNG through PHP. I'm okay with using command-line tools to get this done. How could I go about doing this? I found an ActiveX library, but that seems like one too many layers. I also see that Gnash seems to have a PNG output class, but I can't figure out how to get to that...
Error Message: SQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND domain = 'ard.qc' AND snapshot_id = 2010 AND locale = 'en_US'' at line 1 SQL Query: SELECT entity_id, content_id FROM collateral_cms_mapping WHERE entity_id IN ({$en...
I had to take over a project where someone quit and need help understanding about how a type of gateway might work. It would be easy if I knew what gateway was used, but unfortunately we are unaware of what the plan was. Can someone help me figure out how this actually communicates with a gateway? It seems to me like the code is sen...
I have asked aqbout timezones and date/time before but this is a more specific question, more about Objects in PHP. <?PHP //set the user's time zone on page load date_default_timezone_set("America/Los_Angeles"); //convert the timestamp from DB into the user's time $timestamp = '2008-05-01 13:44:19'; //this would normally be returned ...
I have a bunch of Bout nodes. Each Bout is associated with a school, and a player who goes to that school. I am thinking it will work to do this association through taxonomy. (The schools and players are drawn from a list that remains fairly constant over time.) One idea is to have the school name be the parent term, with players as chi...