php

Special characters from MySQL database (e.g. curly apostrophes) are mangling my XML

I have a MySQL database of newspaper articles. There's a volume table, an issue table, and an article table. I have a PHP file that generates a property list that is then pulled in and read by an iPhone app. The plist holds each article as a dictionary inside each issue, and each issue as a dictionary inside each volume. The plist doesn'...

Attaching javascript events to form widgets

I have a form with a drop down menu and I want to do a javascript action whenever the user changes the selection. I imagine it is possible find the input later, using javascript, and attach an event to to it; but it seems like it would be easier if there was some sort of attribute or option that could be defined in form->configure(): e....

Good PHP / MYSQL hashing solution for large number of text values

Short descriptio: Need hashing algorithm solution in php for large number of text values. Long description. PRODUCT_OWNER_TABLE serial_number (auto_inc), product_name, owner_id OWNER_TABLE owner_id (auto_inc), owener_name I need to maintain a database of 200000 unique products and their owners (AND all subsequent changes to owner...

php not well formed?

Hi Everyone, when my site loads, it stops half way because of specific php code. When I try commenting out the php code, the whole page loads properly (input boxes, buttons etc.) This is the code that causes the issue <?php //if the add location button is clicked, the add location, the whole form will not be submitted ...

Why does echo-ing "<! <" return "<! >"?

Here is my exact code. <?php echo "<! <"; ?> And this is the returned string. <! > Why is the last character changing? ...

Getting XML Numbered Entities with PHP 5 DOM

Hello guys, I am new here and got a question that is tricking me all day long. I've made a PHP script, that reads a website source code through cURL, then works with DOMDocument class in order to generate a sitemap file. It is working like a charm in almost every aspect. The problem is with special characters. For compatibility reaso...

How do I return the value of the owner and id attributes respectively from an XML result set using PHP?

I am using PHP to iterate over the following result set, the aim is to build a hyperlink for each result using a foreach loop. I have stored the XML result in $images, and have constructed this loop: foreach ($images as $image) { //Build link to each photo returned //base URL $flickrPhotoUrl = 'http://www.flickr.com/photos/'; ...

Writing direct to disk with php

I would like to create an upload script that doesn't fall under the php upload limit. There might be an occasion where I need to upload a 2GB, or larger file and I don't want to have to change the whole server execution to above 32MB. Is there a way to write direct to disk from php? What method might you propose someone would use to...

PHP mySQL - replace some string inside string

i want to replace ALL comma , into ,<space> in all address table in my mysql table. For example, +----------------+----------------+ | Name | Address | +----------------+----------------+ | Someone name | A1,Street Name | +----------------+----------------+ Into +----------------+----------------+ | Name ...

Who can give me a "Google suggest" php code?

I want to creat a web which has google search, but I do not know how to make the "Google suggest", Who can give me a "Google suggest" php code? Thx! ...

PHP - OCI and PDO OCI failed to run

Hi there, I am trying to install lighttpd and php separately on Windows XP. I successfully get the server to run. However, I failed to get the OCI to run in my server. Error message saying that failed to load the PDO Driver for OCI. When I check on phpinfo(), no OCI/PDO OCI driver is loaded. I got the correct dll file and php.ini corr...

Tim Thumb for an External Host / CDN

I'm running a stock copy of tim thumb on a clients website. Works great but does not support external hosts for the pictures. My clients uses an amazon CDN / Flickr for all of their websites pictures which doesnt allow me to resize on the fly. Has anyone found a work around for this? http://code.google.com/p/timthumb/ ...

PHP not outputting errors?

My webpage is putting out a 500 Internal Server Error. I've turned on E_ALL for error reporting in the php.ini, and restarted the httpd. I've even used error_reporting(E_ALL) and error_reporting(-1) but still no luck. Any suggestions? OS: CentOS5.5 PHP: 5.2.6 HTTPD: Apache/2.2.3 ...

How do I put array into columns

$db = mysql_connect("", "", "") or die("Could not connect."); mysql_select_db("",$db)or die(mysql_error()); $sql = "SELECT * FROM table where 1"; $pager = new pager($sql,'page',6); while($row = mysql_fetch_array($pager->result)) { echo $row['persons']."<br>"; } mysql_close($db); above code output : Mathew Thomas John Stewart...

How to disable Dwoo cache ?

Hi, I want to disable the cache in the template system Dwoo. Just for my dev mode. But then I tried to invoke setcache () or modify Dwoo classes and nothing works. Someone has an idea? Thank you ...

Drupal and Login Toboggan -- infinite redirect loop

I'm getting a redirect loop when using Login Toboggan. It doesn't happen all of the time and I think I've narrowed it down to something with the session, specifically the active-tabs[last-active-href] value. Since it's intermittent, I was able to print out a session of a working copy and a non-working copy. Here are both: WORKS -- Arr...

counting twice in a query, once using restrictions

Given the following tables: Table1 [class] [child] math boy1 math boy2 math boy3 art boy1 Table2 [child] [glasses] boy1 yes boy2 yes boy3 no If I want to query for number of children per class, I'd do this: SELECT class, COUNT(child) FROM Table1 GROUP BY class and if I wanted to qu...

Anyone have a good solution for scraping the HTML source of a page with content (in this case, HTML tables) generated with Javascript?

Anyone have a good solution for scraping the HTML source of a page with content (in this case, HTML tables) generated with Javascript? An embarrassingly simple, though workable solution using Crowbar: <?php function get_html($url) // $url must be urlencode(d) { $context = stream_context_create(array( 'http' => array('timeout' => 12...

Paypal integration with php codeigniter...

How to get started with Paypal integration with php codeigniter? Where should i start? Any suggestion? ...

Zend redirect problem

I'm trying to redirect to http://localhost/site/public/admin/login from http://localhost/site/public but for some reason, it keeps redirecting to http://localhost/admin/login The code I am using is: $this->_response->setRedirect('/admin/login')->sendResponse(); This is really frustrating me, and any help would be grealy appr...