php

Moving from wordpress.com to self-hosted wordpress blog

Hello, I have been writing articles on the wordpress.com blog, now i am looking to move it to self-hosted wordpress blog but i wonder: 1) Should i move all my articles on the new blog or just put an article on my last blog that more articles will be posted on my new blog? 2) If i move all articles on my new blog, i am not sure about...

In Drupal 6, is there a way to take a custom field from the latest post to a taxonomy term, and display it in a view?

The title for this question pretty much sums up what I'm asking. I've got a list of taxonomy terms, and I'm using a view to display the latest post to each one. I'd like to also display a custom field set up in CCK just under this. Currently, I'm just using "date updated" of the taxonomy term itself which was easy to set up in views. I...

POST String Decoding in PHP

Is ther any built in function in PHP to decode przysi%25C4%2599gam%2520s%25C5%2582u%25C5%25BCy%25C4%2587 into przysięgam służyć ? ...

SSL in overlay window for login

HI I have to implement login over SSL in my website. for example https://www.myweb.com/loginForm - this is the login form page https://www.myweb.com/loginProcess - this is the action which process the form -authenticates user. I am able to do this with usual web form but the problem is the overlay dialog box for login for example...

XAMPP mail not working with PHP mail() function.

Hi guys, I just installed XAMPP, Apache is running, so is MySQL and Mercury. In Dreamweaver I created a php file with a mail($to,$subject,$msg,'From:'.$email); function, but when I ran the file from localhost it showed an error. After playing around with xampp control panel, turning mercury on and off, it's not showing any errors, yet ...

how to add a meta tag to the page template from Wordpress plugin?

I want to add a meta tag like this one: <meta name="key" content="value" /> to some of the pages in Wordpress. I know, I can add this into my template and it will show up. But the thing is, I am not allowed to even touch the template. It's totally template independent. So, I have to add the meta tag only by doing something in my plu...

PHP: Shortest way to check if a variable contains positive integer?

I want to check if user input a positive integer number. 1 = true +10 = true .1 = false -1 = false 10.5 = false Just a positive number. No characters. No special character. No dot. No minus sign. I tried is_int() function but it is returning false even on positive integers. Is there a string to int problem? Thanks ...

how can i set cookie in curl

i am fetching somesite page.. but it display nothing and url address change. example i have typed http://localhost/sushant/EXAMPLE_ROUGH/curl.php in curl page my coding is= $fp = fopen("cookie.txt", "w"); fclose($fp); $agent= 'Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9) Gecko/2008052906 Firefox/3.0'; $ch = curl_init(); ...

How to decode a JSON String with several objects in PHP?

Hi, guys! I know how to decode a JSON string with one object with your help from this example http://stackoverflow.com/questions/2543389/how-to-decode-a-json-string But now I would like to improve decoding JSON string with several objects and I can't understand how to do it. Here is an example: { "inbox": [ { "firstName": "Brett", ...

Codeigniter Strip HTML tags from input

What is the best method to strip htnl tags from the input? How can i remove the HTML tags while validating the input $this->form_validation->set_rules('description', 'Description', 'trim|xss_clean'); Do I need to add custom call back method to validation rules? ...

which type of files are forbidden to upload

I want to put a section in my site where people can upload things and I was wondering which type of files I should forbid for them to upload. ...

Permissions error in WordPress site using move_uploaded_file on theme directory

I have a site in which I'm getting the following error when trying to use move_uploaded_file operation (see below)... I also notice that when I attempt to delete a theme, WordPress asks me for my FTP credentials. I believe these issues are connected. Do you agree? Warning: move_uploaded_file(/home2/mySite/public_html/wp-content/th...

Wrong colors when merging images with PHP

Hi, I want to get images ID's and creat from files a merged image according to the given ID's. This code is called by ajax and return the image file name (which is the server time to prevent browser caching). code: if (isset($_REQUEST['items'])){ $req_items = $_REQUEST['items']; } else { $req_items = 'a'; } $items = explode(',',$r...

@attribute elements in XML

Here is my XML: ["link"]=> array(2) { [0]=> object(SimpleXMLElement)#244 (1) { ["@attributes"]=> array(3) { ["type"]=> string(9) "text/html" ["href"]=> string(48) "http://twitter.com/MoodleDan/statuses/1226112723...

How can I open VLC via browser with PHP (Mac OS X)

I'm trying to open VLC via browser and make it instantly play the given video file on Mac OS X. This runs on my local server and is only meant to run locally - therefore I already run apache (MAMP) with my username and with group "staff" (defined in httpd.conf). YES - I do know that VLC has http interface - however that is not what I n...

Google search: Scrape results page in PHP for total results

Is it possible to scrape the Google search results page using PHP to pull out the total number of search results found? If so how would I go about doing this? Thanks ...

Split a HTML string into two strings without slicing through a word and preserving HTML in PHP

I'm looking for a way to split a string containing HTML in to two halves. Requirements: Split a string by a number of chars Must not split in the middle of a word Must not include HTML chars when calculating where to split the string For example take the following string: <p>This is a test string that contains <strong>HTML</strong> ...

CodeIgniter: placing PHP functions?

Hello, I'm still quite new to CodeIgniter and I was wondering, where should I place my PHP functions that has nothing to do with Controllers and Views, for example, a function that access a local file. Thank you. ...

Unable to access value of nested array element

I'm having an issue getting the value of a nested array element. Here's what I've got: print_r($environment); // Outputs Array ( [0] => Array ( ['parameter'] => Vibration ['conditions'] => 204 ['method'] => D ) [1] => Array ( ['parameter'] => Immersion ...

PHP Database connection practice

I have a script that connects to multiple databases (Oracle, MySQL and MSSQL), each database connection might not be used each time the script runs but all could be used in a single script execution. My question is, "Is it better to connect to all the databases once in the beginning of the script even though all the connections might not...