I have a dynamically populated PHP dropdown menu that gathers the following information from the database: I then have a JavaScript function that shows the selected text – description in an input box for editing and then on submit update back into the database. Question: Is there away using JavaScript t…
Tag: php
Uploading an mp3 to my (php based) web server from an iPhone app
I’m looking to upload an mp3 file from my iPhone app to a given php page. To do this I found the ASIFormDataRequest class. Now I made a piece of code in my app like so: However I can’t figure out how to put my NSURL which points to the mp3 inside this request. I have tried the above, but
Can a switch statement take two arguments?
is it posible for a PHP switch statement to take 2 arguements? For example: Many thanks, I haven’t done PHP in years! Answer No, but if your case is as simple as what you have, just concatenate the two inputs and test for the concatenated values:
How can i surcharge a connection configuration from a controller in Lithium?
I’m building a GooglePlaces API, it is package as an http datasource. I thought it would be a good idea to ship it with a basic Places model & a basic gplaces connection so that the datasource could be used out of the box in my app PlacesController using : But i’d like to be able to somehow su…
Twitter OAuth (PHP): Need good, basic example to get started
Using Facebook’s PHP SDK, I was able to get Facebook login working pretty quickly on my website. They simply set a $user variable that can be accessed very easily. I’ve had no such luck trying to get …
Combine two arrays
I have two arrays like this: I want to combine these two array such that it does not contains duplicate and as well as keep their original keys. For example output should be: I have tried this but it is changing their original keys: Any solution? Answer Just use: That should solve it. Because you use string k…
jQuery Ajax post to php not catching variable
What am i doing wrong. PHP doesn’t seem to catch title and wrapper from $.ajax. Does the code look correct. The success message i get indicate an error that title is not found. jQuery main.html PHP process.php Answer Take a look: jQuery.ajax() The data parameter is better to be a Key/Value pairs object,…
What is the best way to make a breadcrumb with Code Igniter?
I wonder what a best way to make a breadcrumb with Code Igniter. 1 : Retrieve the strings with URL example : $this->uri->segment(2) 2 : Do you know another way ? I’d really like to have your opinion Answer Using URL segments is specific to how you have your URL structured – there is not alwa…
locale for Switzerland (to correctly display Swiss Franc)
I’m looking for the locale to set in PHP for Switserland, for a client that needs support for Swiss Franc. I can’t seem to find the correct locale for Switserland. Does anyone know which one I can use? I need it in the following format like: nl_NL, en_US, en_GB Answer it depends on what language y…
Why is part of the HTML email appearing as text in email client?
I am trying to send HTML emails with Codeigniter’s email class. This is how I am doing it: However, when I view the email in Gmail or outlook, I see bunch of HTML appearing as text at the top of the email and the rest of the email is displayed normally. Here is the HTML I am sending, its a