php

Pagination of text from xml file onto html page.

O.K. so I'm developing a website to feature my fiction writings. I'm putting all of my documents into XML files, pulling and parsing them from the server with PHP and displaying them on the page. You can visit the page here for an example. As implied from the background image, What I would like to do is take the text and split it int...

php array any mysql problem

i have table called config contian config_name | config_value know i want to extract it like that `config_name` | `config_value` `articles_limit` | `10` now i want php code give me an array like that articles_limit => 10 ...

Multiple dynamic selections

I need a way of having multiple selections but only one visible at a time. When the user wants to add another selection he/she clicks a button,checkbox,radio..whatever They need to be able to add an unlimited number of selections. Any Ideas? ...

Twitter API Call Failing Intermittently

I'm using PHP to display the most recent tweet from a user. This is in Wordpress. This works most of the time - but sometimes, I get this error: file_get_contents(http://api.twitter.com/1/statuses/user_timeline/[username].json) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in [...]...

PHP short circuit lazy evaluation, where is it in the php.net manual?

Sorry if this sounds like a really silly question. But I Googled the web and also Googled specifically both the php.net site and the stackoverflow.com site. I know PHP does short circuit lazy evaluation when using and, or, &&, || operators, but where is it stated loud and clear in the PHP manual??? I found only Wikipedia as the only 't...

MySQL INSERT Query

I have problem with my MySQL query: include '../inc/mysql_config.php'; $sql="INSERT INTO ordrar (id, order, namn, adress, postnummer, postort, email, status) VALUES (NULL, '$order','$namn','$adress','$postnummer', '$postort', '$email', '$email', '$status')"; mysql_query($sql); if (!mysql_query($sql)) { die('Erro...

including php document from root

I have PHP pages in diffrent directorys in my root eg. http://mydomain.com/forum/?action=thread&threadid=9284 http://mydomain.com/library/?s=achievements I need to include a file on every php document which is in root dir. include('header.php'); does not work On for example /root/forum/index.php i want to include header.php t...

POST image on web server problem

Hi Gurus I'm trying to post a jpg image to a web server. I've tested my PHP script at the server and I'm being able to upload an image using a form. Now I'm trying to make a Blackberry application to POST the image to the server using the same script however when I test the Java code, PHP tells me that NOTHING was POSTed, I'm not sure w...

Determine Filesize of Email Attachment Before Downloading

I'm using Zend Mail library to access email and download email attachments. Is there a way to determine the attachment's filesize before downloading? ...

Problem storing trademark symbol from jQuery through PHP to Mysql

In a MySql text column there is a trademark ™ symbol which is displayed in an html textarea field and looks correct. A change is made to the textarea data and it is submitted via jQuery. When it arrives in PHP it appears to be translated to \u2122 and gets updated in mysql that way. When that data is now retrieved to the web page it app...

How to duplicate a post http request with files without curl?

I want to duplicate a HTTP POST request from a form which includes file elements, as if there were just 2 action attributes with different targets on the form element. So far I have not been able to do this successfully with cURL for one reason or another, so I'm looking for alternatives (that don't use the cURL library what-so-ever, t...

Can a php proxy script call javascript functions like click?

Hello, I'm adding to a PHProxy script to GET a certain page and fills in required forms with cURL and some R.E. This page is usually submitted with a button. I'm not posting directly to a page because the other server uses an IIS server with an 'viewstate' variable that I can't seem to proxyify correctly without receiving viewstate err...

how to do str_replace on everything that is returned with get_defined_vars? (php)

Hi, how do i do a str_replace on everything that is returned in get_defined_vars? doing it with normal strings is easy, but what about objects/classes? ...

jQueryUI autocomplete not working

I was using this code earlier today and it worked fine, then I apparantly changed something and it doesnt work. ive tried reinstalling jQueryUI but it doesnt help. <script type="text/javascript"> $(function() { function loadpage(webpage) { window.location.replace( webpage ); } $("#searchform").autocomplete({ ...

MySQL query within another query's while loop in PHP

I have the following code: $query = mysql_query("SELECT * FROM activity ORDER BY activity_time DESC LIMIT 50"); while($result = mysql_fetch_array($query)) { extract($result); if ($activity_type == "discussion") { $query = mysql_query("SELECT * FROM discussions WHERE discussion_uuid = '$activity_ref'"); while($re...

how do I override php://input when doing unit tests

I'm trying to write a unit test for a controller using Zend and PHPUnit In the code I get data from php://input $req = new Zend_Controller_Request_Http(); $data = $req->getRawBody(); My code works fine when I test the real application, but unless I can supply data as a raw http post, $data will always be blank. The getRawBody() meth...

How can i code and decode urls from IDN in php?

Hi, im doing a site to check, register, etc of domains, i have to make it IDN compliant. Right now i have something like this: echo $domain; $domain = idn_to_ascii($domain); echo $domain; $domain = idn_to_utf8($domain); echo $domain; and im getting this: testing123ásd123 xn--testing123sd123-wjb testing123ĂĄsd123 as you can se...

Using jQuery to "auto-fill" a second text box, based on input from the first.

Alright, so basically what I'm trying to do is use the value (which in most cases is autocompleted) of a text box to fill in another text box with data pulled from the database. The user will input a name in one box and once that input loses focus, a second is auto populated with the name's associated email address. I've seen a few dif...

Do no not want Zend Framework View's short tag. Is there an alternative to $view->setUseStreamWrapper(true) ?

I'm trying to learn the Zend Framework, my first framework, and I came across the View section. In order to out put stuff from the controller to the view, I have to use short tags. I don't want to do this because of XML. The only option, I've found so far, is $view->setUseStreamWrapper(true) which apparently kills performance. I was wond...

Database migration through php

I have a mysql database that I am trying to migrate into another database. THey have different schema's and I have written a php script for each table of the old database in order to populate its data in to the new one. The script works just fine but the problem is that it does not move all the data. for example if I have a table and all...