php

Is it enough to use set_time_limit in php when requesting webservices ?

Let's say I need to call a webservice several times in the same php function, to avoid my page hanging out if webservice fails for some reason, is it enough to set_time_limit in php ? What's the best practices ? Also I just read set_time_limit doesn't work when in safe_mode then what should I use ? ...

PHP routing for friendly URLs help

I am building a website that runs all of the code trough index.php. For example index.php?controller=something&id=01234. I want to use PHP to create friendly URLs, so I do this: $request = str_replace('/root/', '', $_SERVER['REQUEST_URI']); $params = explode('/', $request); $controllers = array('first_c', 'second_c', 'third_c'); if ...

How to integrate a custom form and add/edit/delete on wordpress

hello all i want to create a custom form with some fields that i could add/edit/delete on database how integrate my form with wordpress? do you know a website ,that have a tutorial about this process ? thanks ...

Handling Extended ASCII in File Uploads

A website I recently completed with a friend has a gallery where one can upload images and text files. The only accepted text file (to ease development) is .txt and normally goes off without a hitch (or not..) The problems I've encountered are the same of any developer: Microsoft's Extended ASCII. Before outputting the text from the f...

PHP stack occasionally showing blank pages

I've started getting a really strange error on a server of mine and I've no idea how to fix it. The basic setup is a Wordpress (not v3, the previous stable release) site on PHP-FPM + APC on nginx on Ubuntu Lucid. For five or so minutes at a time, some pages will just return straight out, blank page, no content. I'll wait for a bit, try ...

Couple PHP with AJAX States

Hey everyone, I have a puzzling problem with trying to make an ajax/static state program. What I am trying to do is allow a static linked app have ajax dynamic urls and everything is kinda fine until a page refresh. The problem: PHP Does not see the hash so it only sees the original URI request. So PHP loads the original page but then...

CakePHP: Why does validation fail to run?

I have started to look into CakePHP to increase my productivity. The problem is that I have run into a small problem, which has kept me occupied in more than one hour - when the form is submitted it is not validated. Even though I intentionally leave both fields blank it still saves and gives the OK-message. Hope somebody can help me g...

How important is it close an mysql connection in a website and why?

Possible Duplicate: close mysql connection important? How important is it close an mysql connection in a website and why? ...

Cutting down a length of a PHP string and inserting an ellipses

I want to turn a long string like reallyreallyreallyreallyreallylongfilename into something like reallyreallyre...yreallyreally. Basically, find the middle of the string and replace everything there until the length of the string is < 30 characters including an ellipses to signify there has been parts of the string replaced. This is my...

Problem getting text field as string from MySQL with PHP

Hello, I'm having this problem that's driving me nuts. I've got a MySQL database in which there is a table that contains a text field. I am querying the table in PHP and trying to put the content of the text field for each row into a var. I am doing something like this: for ($i=0;$i<$nbrows;$i++){ $id = $data[$i]['ID']; $descript...

How to do this type of incrementation in PHP?

I am using this category script: <?php include("connect.php"); $nav_query = mysql_query("SELECT * FROM `categories` ORDER BY `id`"); $tree = ""; $depth = 1; $top_level_on = 1; $exclude = array(); array_push($exclude, 0); while ($nav_row = mysql_fetch_array($nav_query)) { $goOn = 1; for ($x = 0; $x < count($exclude); $x++) { ...

Calling ASP .NET web service from php client

I have a simple ASP .NET web service running and I want call it from a php client. I m using nusoap soap client. The following is the client side php code: <?php require_once('lib/nusoap.php'); $wsdl="http://localhost:64226/Service1.asmx?wsdl"; $client=new soapclient($wsdl, 'wsdl'); $param=array('number1'=>'2', 'number2'=>'3'...

php json decode - get a value

I'm trying to extract a specific value from json content . Here it is link with the json code http://www.ebayclassifieds.com/m/AreaSearch?jsoncallback=json&amp;lat=41.1131514&amp;lng=-74.0437521 As you may see the the code displayed is json({items:[{url:"http://fairfield.ebayclassifieds.com/",name:"Fairfield"},{url:"http://newyork.ebayc...

Are there any Jquery/Ajax like libraries in php?

Im a little confused about this. I've only used php and html till now and wish to make my site web2.0-ish like most ajax based sites are. Are there any libraries i can use based on php? I know php is server side.. is there a client side ajax library or something? ...

php imagejpeg quality stinks: why?

im taking image uploads on a website and changing the images to thumbnails that fit onto a 100 x 100 white square. the problem is that the images look like they dont anti-alias properly. images sized down in photoshop look smooth, but these look crunchy, like super sharpened. take a look at these samples, showing full size on the left...

tips to make my website (php) hack proof

Possible Duplicates: What security issues should I look out for in PHP What should a developer know before building a public web site? The project i was working on is nearly complete and near launching ,But i want to make sure it is hack-proof as mine friend/partner thinks we have some enemies those can hire smart hackers t...

CodeIgniter database to view help

I'm new to Codeigniter and I'm trying to develop a simple website with a couple of pages. Under my "Work" view I have it looping through the database I've set up: <div id="content"> <?php foreach ($records as $row){?> <div class="item"> <p class="num"><?php echo $row->id;?></p> <h2><?php echo $row->title;?></h2> <p><?php ec...

Problem with gzip compressing utf-8 encoded php page. HELP!

i use this at top of my php page: if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); when page is save with ANSI encoding page was compressed. but when i change page encoding to utf-8 compression was faild. please help!!! i test compression on www.gidnetwork.com/tools/gzip-t...

Check to see if certain fields have been filled out before a form is submitted.

Hi all, I have a form that is sending data to a MySQL database and I want to make sure several of the fields are not left blank. I think I can figure out how to do this with JavaScript, but my question is should I? When I made the database table that I am working with I made the fields that I want to make sure are filled out NOT NULL t...

Creating a webpage with user accounts, what do I need to keep in mind?

I am trying to write a website that has user accounts. There isn't much sensitive information other than the password and email address. But I don't really understand what I'm doing; I'm kind of hacking it along as I go. Is there anything I should be keeping in mind with respect to security or any other important details? ...