php

Using NSURLRequest to pass key-value pairs to PHP script with POST

Hi, I'm fairly new to objective-c, and am looking to pass a number of key-value pairs to a PHP script using POST. I'm using the following code but the data just doesn't seem to be getting posted through. I tried sending stuff through using NSData as well, but neither seem to be working. NSDictionary* data = [NSDictionary dictionaryWit...

about post data

hi,everyone.my question like this: post.php <?php $str = "testmytest"; $str_serialize = serialize($str); http_post_fields("get_post.php", array('str' => $str_serialize)); ?> get_post.php <?php if (isset($_POST['str'])) { $echo $_POST['str']; $str = unserialize($_POST['str']); echo $str; } ?> i can not unserialize the $str...

SimpleDOM sortedXPath date sorting works on localhost but not on remote server.

Here's what i'm trying to do: 1) Take a basic XML page (data.xml) 2) Load it with simpleDOM 3) Use simpleDOM sortedXPath to sort all XML items by their pubDate 4) Display sorted output Here is the code I currently have. My code below outputs exactly what I need when run it on my localhost (XAMPP w/PHP 5.3) but on my remote server (which...

Showing Selected Values on a Multiselect box

Hi, I have made a single page for adding as well as editing data. In the page i have a multiselect box. I want to know how can i display the selected values in case of editing? My code is : $categories=$objdb->select("vtiger_cf_601", false, "*", false, false); $discountstudentInfo = $objdb->select('paytbl_discounts_students', false, "...

Format PHP Source Code on Save with Zend Studio for Eclipse

I would expect this option to exist in PHP -> Editor -> Save Actions but the only thing available there is to "remove trailing whitespace"... It's available in JavaScript -> Editor -> Save Actions but not php :( Is there a plugin that will let me do this? ...

Isn't fb_sig_friends supposed to be there?

According to the docs, Facebook is supposed to send both fb_sig_canvas_user and fb_sig_friends for a canvas application. Sadly, I only get fb_sig_canvas_user and NOT fb_sig_friends. Is there anything I have to do to get this parameter? Or is there any other way to retrieve the friends of the visiting (not-yet-authorized) user, without ...

should i put a semi-colon after a single php statement?

for example some html.... <p class="date"><?php echo $date; ?></p> more html... ...

Change array format in PHP.

I have an array like: Array ( [6] => Array ( [quantity] => 23 [orgId] => 6 [validity] => 20 ) [2] => Array ( [quantity] => 5 [orgId] => 2 [validity] => 2 ) [5] => Array ( [quantity] => 5 [...

Remove main editor from wordpress edit page screen

Hi Anyone know of a way to remove the main editor from the page edit screen? And not just with css. I've added a few other meta boxes with the tinymce and they collide with the main one. I have a class that removes other meta boxes from the edit screen, but I cant get rid of the main editor this way. I've tried to add 'divpostrich' and...

how to limit the number of datas in word

Hi I am exporting data from php page to word,, there i get 'n' number of datas in each page .... How to set the maximum number of data that a word page can contain ,,,, I want only 20 datas in a single page This is the coding i use to export the data to word In mysql_table.php the table for the pdf document is be generated <?...

PHP & HTML Purifier error: Undefined variable: dirty_html

I'm trying to install HTML Purifier http://htmlpurifier.org/ but I get the following error Undefined variable: dirty_html. I was wondering how can I fix this problem? Here is the PHP code. require_once '../../htmlpurifier/library/HTMLPurifier.auto.php'; $config = HTMLPurifier_Config::createDefault(); $config->set('Core.Encoding', '...

Kohana V3 Auth module user_token functionality

Hi, Could anybody brief about user_token functionality in Auth module? What is a use and how this incorporates in Auth module? ...

php in_array - unexpected behavior

Not sure why this is happening, but my script doesn't seem to be able to return true for in_array more than once... $saved = '15,22'; $set = explode(",",$saved); //results in Array ( [0] => 15 [1] => 22 ) Then, I query the database: $result = pg_query("SELECT did,vid,iid,value FROM demographicValues"); if(pg_num_rows($result) ...

Help organising controllers logically

Hi guys, I'm working on a site which i'm developing using an MVC structure. My models will represent all of data in the site, but i'm struggling a bit to decide on a good controller structure. The site will allow users to login/register and see personal data on a number of pages, but also still have access to public pages, e.g FAQs, Co...

Handling Incoming Mail to Multiple Recipients in PHP

Alright, this may take a moment or two to explain: I'm working on creating an Email<>SMS Bridge (like Teleflip). I have a few set parameters to work in: Dreamhost Webhosting PHP 5 (without PEAR) Postfix MySQL (If Needed) What I have right now, is a catch-all email address that forwards the email sent to a shell account. The shell ...

PHP XML Strategy: Parsing DOM to fill "Bean"

I have a question concerning a good strategy on how to fill a data "bean" with data inside an xml file. The bean might look like this: class Person { var $id; var $forename = ""; var $surname = ""; var $bio = new Biography(); } class Biography { var $url = ""; var $id; } the xml subtree containing the info might look lik...

Sql query problem

I have the below sql query that will update the the values from a form to the database $sql= "update leads set category='$Category', type='$stype', contactName='$ContactName', email='$Email', phone='$Phone', altphone='$PhoneAlt', mobile='$Mobile', fax='$Fax', address='$Address'...

PHP - *fast* serialize/unserialize?

I have a PHP script that builds a binary search tree over a rather large CSV file (5MB+). This is nice and all, but it takes about 3 seconds to read/parse/index the file. Now I thought I could use serialize() and unserialize() to quicken the process. When the CSV file has not changed in the meantime, there is no point in parsing it agai...

How do browsers/PHP handle characters outside the set characterset?

I'm looking into how characters are handled that are outside of the set characterset for a page. In this case the page is set to iso-8859-1, and the previous programmer decided to escape input using htmlentities($string,ENT_COMPAT). This is then stored into Latin1 tables in Mysql. As the table is set to the same character set as the pa...

File counter adds 2 instead of 1

I made a simple counter, but it increments by 2 instead of 1. $handle = fopen('progress.txt', 'r'); $pro = fgets($handle); print $pro; // incremented by 2, WTF? fclose($handle); $handle = fopen('progress.txt', 'w'); fwrite($handle, $pro); fclose($handle); Everytime I read the file it has been incremented ...