php

PHP upload file using PUT instead of POST

I read something about this on PHP docs, but it's not clear to me: Do the most widely used browsers (IE, FF, Chrome, Safari, Opera, ...) support this PUT method to upload files? What HTML should I write to make the browser call the server via a PUT request? I mean do I need to write a FORM with an INPUT file field and just replace the ...

Spelling correction in Sphinx?

Hello. I was about to integrate the Sphinx-based search into the website, but I've found that there's no built support for spelling correction. Folks on the web suggest using pspell or other third-party libraries to get things done, but the problem is the data I'm going to search in, contains mostly "technical" terms like brand names, t...

move selected item from one selectbox to another selectbox(with duplicate prevention)

i have two select box, now what i want is i want to move option from one select box to another via a button below is my code: php <table> <tr> <td> <select size="5" id="suppliedMovies" name="suppliedMovies"> <option selected="selected" value="">Select Movie</option> <option val...

Load a controller into an other controller in cakephp

im developing a web application, using multiple pages, each with their own controller. The problem now is that there are some variables in a controller, created for one page, that are required for an other page ( with a different controller). Therefor i need to load one controller into the other one. I did this by adding App::impor...

How to display XML in HTML in PHP?

Hello, I have a string with XML: $string = " <shoes> <shoe> <shouename>Shoue</shouename> </shoe> </shoes> "; And would like display it on my website like this: This is XML string content: <shoes> <shoe> <shouename>Shoue</shouename> </shoe> </shoes> So I would like to do it: on site, not in textbox ...

Show values in TDropDownList in PRADO.

I m new to PRADO, I have a file Home.page with code: <%@ Title="Contact List" %> <h1>Contact List</h1> <a href="<%= $this->Service->constructUrl('insert')%>">Create New Contact</a> <br/> <com:TForm> <com:TDropDownList ID="personInfo"> <com:TListItem Value="value 1" Text="item 1" /> <com:TListItem Value="value 2" Text="item 2" Se...

=& operator in PHP

Example: $this->sql =& new GuestBook_SQL; What does it do? ...

how i can use SAX parser

This is what the result should look like when i parse it through a SAX parser http://img13.imageshack.us/img13/6950/75914446.jpg This is the XML source code from which i need to generate the display: <orders> <order> <count>37</count> <price>49.99</price> <book> <isbn>0130897930</isbn> <title>Core Web Programmi...

PHP: Grab an image from a stream (in an img tag) but if it's not there, i don't want the img tag written. How?

I currently have code like this in a web based file called 'view_file.php' to grab an image from an internal network. <img src="put_file.php?type=<?=$TN_TYPE;?>&path=<?=$TN_PATH;?>&filename=<?=$TN_FILENAME;?>" /> The 'put_file.php' script allows access to an internal server that we don't want to expose to the internet. This script che...

curved text in php

Hi, i am need of watermark an image with curved text. i had gone through some sites in internet, but i couldn't find the code which i need. somebody please tell me how to generate curved text in php thanks and regards tismon ...

How to disable form submit if the username is not available

I have checked the user name availability. The problem is, even if the username is not available, the form is posting. Edited Code: <SCRIPT type="text/javascript"> $(document).ready(function(){ $("#emailch").change(function() { var usr = $("#emailch").val(); if(usr.length >= 3) { $("#status").html('<img src="imag...

drupal: standard way for creating a slug from a string

Hi there, A slug on this context is a string that its safe to use as an identifier, on urls or css. For example, if you have this string: I'd like to eat at McRunchies! Its slug would be: i-d-like-to-eat-at-mcrunchies I want to know whether there's a standard way of building such strings on Drupal (or php functions available from ...

Improving Performance on this Image Creation function

Hello all, I am making use of GD2 and the image functions to take in a string and then convert that into an image using different fonts at different sizes. The function I use is below. Currently, its pretty quick but not quick enough. The function gets called about 20 times per user and the images generated are always new ones (differe...

Using PHP to extract data from an ATOM feed and using it reverse lookup coordinates to an actual address.

Basically I have a public feed: http://www.google.com/latitude/apps/badge/api?user=-1671995934285587708&amp;type=atom If you go to my Google Profile you can see it says: "Gareth is in 6 Seaside Gardens, Mullaloo WA 6027, Australia (1 minute ago)" google.com/profiles/Gareth.B.Hall How can I, using PHP, display my location on a website t...

How to run my php code in every X minute?

Hi Gods, i try to make a "status monitor" for our small network. After the page was load i make a ping for every IP which i addedd. Its, ok. But i would like to do this ping in every X minute, without reload my hole page. I can make it if i reload the page with header refresh, but i would like to do this witout reload. I think i have...

WSDL using soapclient

Hi, Need to access a webservice using soapclient.I have the following settings. ini_set('default_socket_timeout', 120); $client = new SoapClient( "http://example.com/OnlineOrderProcessingWS.asmx?WSDL", array('proxy_host' => "proxy url", 'proxy_port' => proxy port ) ); $param=array("varname1"=>'value1',"varname2"=>'va...

Change array structure in PHP.

Refers to my previous question : Show values in TDropDownList in PRADO. ok fine the array i receive from query is an object array like : ContactRecord Object ( [id] => 1 [name] => leo [_recordState:protected] => 1 [_connection:protected] => [_invalidFinderResult:protected] => [_e:TComponent:private] => Array ( ) ) ContactRecord Object (...

PHP Redirection with Post Parameters

Hello, I have a webpage. This webpage redirects the user to another webpage, more or less the following way: <form method="post" action="anotherpage.php" id="myform"> <?php foreach($_GET as $key => $value){ echo "<input type='hidden' name='{$key}' value='{$value}' />"; } ?> </form> <script> document.getElementById('m...

Connecting to an MS SQL Server from Silverlight?

Normally, I would use a PHP webservice to do this, but since the front-end is hosted on a linux box, I need another way to do this (so I don't have to go through the trouble of installing FreeTDS, etc. I will if I have to). Is there a better way to do this? I'm not a web guy, but I'm trying my best. ...

Zend Framework - Not Connecting to IMAP mail server - instead dumps empty php file

Hi guys I'm trying to connect to an imap mail server using zend frameworks Zend_Mail_Storage_Imap function. Its working with some accounts but with most accounts it just dies out. I'm connecting using: $mail = new Zend_Mail_Storage_Imap(array('host' =>$current_dept->incoming_server, 'ssl' =>$current_dept->ssl, 'port'=>$current_dept->inc...