php

Does a simple `return` in a PHP function simply end the function prematurely?

I have just seen this // Check to see if the request is a HXR call if (request::is_ajax()) { // Send the 403 header header('HTTP/1.1 403 Forbidden'); return; } I have not seen a simple return before, and I have never used it. My only guess is that it simply acts the same as any return 'something' (halting the functio...

Frustration in Parsing XML or JSON with GWT

Hey everyone, For the past couple of days, I have been trying to get GWT to interpret either a JSONValue or a string of XML that gets passed back from the server (using PHP). I'm pretty frustrated, because I can't seem to get anything to work. For the XML, I have confirmed that the String passed from PHP to GWT is a correct XML string...

MySQL database of english words??

I'm looking for a list of English dictionary words for a password application I'm working on. Ideally the list can be easily inserted to a mysql database. Any suggestions? ...

Best library for PHP Sessions

I have been using the CodeIgniter system for a while now - but it has it's short comings. I am grateful for what it taught me, but now I need a library for a new non-codeigniter project and so I am looking around for ideas on which libraries have things right and which don't. I will probably have to take pieces from several libraries to ...

setting album art of a mp3 with php

I am looking for the best or any way to set the Album Art of mp3s using PHP. Suggestions? ...

How to change default version of PHP from 4 to 5?

My server have default php version of 4, so when I run some script saved as .php I have PHP 4. I want to change it, so I don't must use .php5 extension, I heared that there are something in .htacess. I want to run eyeOS on my server, but I don't want to change every line from .php to .php5 Help? ...

How to send file via FTP and bypass the quota limit?

Hello. My question is : On my server there are limit of max 2MB file sended by FTP. If I send it by some script in PHP, there are no restriction, and I want to send something around 3.8MB. Any ideas? ...

PHP Date function output in Italian

Hiya, Trying to output italian dates with date: <?php setlocale(LC_ALL, 'it_IT'); echo date("D d M Y", $row['eventtime']); ?> But it's still coming out in English, any ideas of what else i can do or what's wrong? it has to be script specific and not server wide... Thanks Shadi ...

strlen on 2 strings

if (strlen($title) && strlen($message) > 3) This returns true if $title is over 3 chars, I only want it to return true if BOTH is. Whats the correct way? Tried a bunch. FNYS. Help please. ...

PHP Tag Cloud

I am looking for help with the database scheme, not the actual "cloud" itself. In a site where users submit images and can tag images, how should the database be setup for optimal performance? I was thinking ID - int(11), unique, auto_incremenet tag - varchar(20) imageID - int(11) so suppose i upload an image, and tag it "toronto, s...

Speed up this code - PHP/SQL - Short Code but takes incredibly long at the moment

Right, this code goes through a rather large multidimensional array (has about 28,000 rows and 16 parts). Order of events: Check if the data exists in the database if it exists - Update it with the new data if it doesn't exist - Insert it Simple. But right now to go through this it has taken over 30min i think and Still going. $c...

General Error

SQL ERROR [ mysqli ] Can't find file: './tq/phpbb3_config.frm' (errno: 13) [1017] SQL SELECT config_name, config_value, is_dynamic FROM phpbb3_config BACKTRACE FILE: includes/db/mysqli.php LINE: 143 CALL: dbal->sql_error() FILE: includes/cache.php LINE: 51 CALL: dbal_mysqli->sql_query() FILE: common.php LINE: 212 CALL: cache->obta...

PHP performance hampered by require()

I ran my code through xdebug profiler and saw more than 30 percent of the time is spent on the require() calls. What is the best way to improve on this? I saw some posts about using __autoload, but there were conflicting statements about it's affect on APC (which we use), and doubts about it's use to improve performance. ...

PHP - Search for Domain Name Availability

I guys. I would like to know how to build on of those Domain Name Availability search that many hosting companies have. I've looked around SO and found a Question about it, but the guy that asked it used a class for the hole job, and he didn't posted its code or referred any source. Can somebody give me a hand how to build one for a w...

MySQL query error.

What's wrong with this MySQL query? $name = mysqli_real_escape_string($db,$_POST['name']); $email = mysqli_real_escape_string($db,$_POST['email']); $comment = mysqli_real_escape_string($db,$_POST['content']); $dt = date("F j, Y, g:i a"); $sql = mysqli_query($db, "INSERT INTO `tbl_contact` (`id`, `name`, `email`, `comment`, `date`) VALU...

How can I remove an html element and it's contents using RegEx

I have a div id like to remove from an output which looks like <div id="ithis" class="cthis">Content here which includes other elements etc..) </div> How can I remove this div and everything within it using PHP and regex? Thank you. ...

How can I rewrite query parameters to path parameters in Apache?

I currently have a website that I am trying to optimize in terms of SEO. I've got the site working with URLs such as: domain.com/?app=about In my app, $_GET[app] is set to 'about', as expected. Now, I want to make it so that a URL like domain.com/about is treated as if it were domain.com/?app=about. How can I do this in an Apach...

netbeans php debugger

Hi, I am using Window VISTA, XAMPP server. The X-debug is working. It stop when I put the xdebug_break().. after which it doesn't stop on any break points. nor it will do stepinto or any of those.... what am i missing.. THnks Cool ...

Following a Javascript link when scraping from a remote site using PHP

Given remote page: http://example.com/paged_list.aspx which uses a Javascript function call to display several pages of tabular data: javascript: show_page(1) javascript: show_page(2) and so on. Users click on the page links to display each page, which triggers a reload but with no query string, ie the URI remains the same. In scrap...

Trying to use PHP imap_open() with diff. linux interface(eth0:1, eth0:2). Any ideas?

Hey guys I am trying to use imap_open() with different linux interfaces but I can't find a possible solution. Nginx seems to have a module (http://wiki.nginx.org/NginxMailCoreModule) for mail servers but I am on Apache + PHP. cURL has something similar: curl_setopt($ch, CURLOPT_INTERFACE, "eth0:1") but can't find anything for PHP imap...