php

php regex unlimited pattern

I'm looking to extend the regex below so I can have unlimited number of braces. ((?:{[0-9]:[a-z]+})?) So my string can handle {1:foo}{2:bar}{3:more} Any ideas will be appreciate it! ...

Converting an input text value to a decimal number

Hi, I'm trying to work with decimal data in my PHP and MySql practice and I'm not sure about how can I do for an acceptable level af accuracy. I've wrote a simple function which recives my input text value and converts it to a decimal number ready to be stored in the database. <?php function unit ($value, $decimal_point = 2) { ret...

Is switching to PHP 5.3 a good idea?

I'm using PHP 5.2.11. I've seen that 5.3 version has several backward incompatibility issues and because of that some code might require changes. Since my website is hosted on shared server, many have suggested that those server won't upgrade to 5.3 in near future (probably due to incompatibility issues for many shared users). Would it...

php debuggers which are not bloated

any suggestions for good php debuggers, which are not bloated? i tried using xdebug with dbgp plugin on notepad++, but it seems the dbgp plugin isn't compatible with notepad++ and hence, didn't work out crashing the app every time i accessed the debugger. any other suggestions? ...

Update twitter profile image using OAuth

I'm trying to get twitter update_profile_image to work using OAuth. I was using curl with regular authentication and everything was working fine, but I switched to OAuth using this library, and now everything except update_profile_image works. I read something about twitter OAuth having problems with multipart data, but that was a whil...

Call to undefined function recaptcha_get_html() How to fix?

Hello all im getting the following error. I tried putting the files everywhere i can and no fix. is there something else i have to do to make this work? thanks here is the error Fatal error: Call to undefined function recaptcha_get_html() in /home/folder/public_html/site/views/users/register.php on line 75 ...

How do I write object classes effectively when dealing with table joins?

I should start by saying I'm not now, nor do I have any delusions I'll ever be a professional programmer so most of my skills have been learned from experience very much as a hobby. I learned PHP as it seemed a good simple introduction in certain areas and it allowed me to design simple web applications. When I learned about objects,...

Replacing ’ character in PHP

Hello, I'm having a hard time trying to replace this weird right single quote character. I'm using str_replace like this: str_replace("’", '\u1234', $string); It looks like I cannot figure out what character the quote really is. Even when I copy paste it directly from PHPMyAdmin it still doesn't work. Do I have to escape it somehow? ...

Covert time format in php

How would I covert a date formatted like this Thu, 08 Jul 2010 15:51:01 into a date like this Thursday July 8th, 2010 3:51 pm. Also, how would I filter the first sting to not include time, so that it could look like this in the end Thursday July 8th, 2010 ...

Help with PHP data mangling as with sed/awk/grep

Ok guys.. I have a HTML i need to parse into a php script and mangle the data around abit. For best explanation I will show how I would do this in a bash script using awk, grep, egrep, and sed through a god awful set of pipes. Commented for clarity. curl -s http://myhost.net/mysite/ | \ # retr the document awk '/\/\a...

Should I Abandon Adobe Flash for HTML5 and <canvas> ?

I'm currently looking into developing Facebook applications and was planning on using Flash as the basis of my application, I have test built some simple PHP Facebook applications and I know enough about action-script 3 to start me on my way, but the API for Facebook development in AS looks far more tedious than the PHP one. my question...

php url routing question

Hi, http://mysite.com/songs/company-name/song-name i want to redirect it to http://mysite.com/songs/index.php?name=company-name&amp;song=song-name i read some articles about that mod_rewrite but actually i couldnt understand exactyly, i appreciate if you can help me. thanks EDIT: mod rewrite is enabled ...

cookieless sessions with ajax

I've been developing a quite "big application" with PHP & kohana framework past 2 years, somewhat-successfully using my framework's authentication mechanism. but within this time, and as the app grown, many concerning state-preservation issues arisen. main problems are that cookie-driven sessions: can't be used for web-service access...

Inserting database structure into MySQL with PHP?

Yo. I'm trying to find a way to insert a whole database structure into MySQL with PHP. Now, my main question is if there's any way to do this beyond just inserting the whole bloody thing line by line? edit: By "insert structure", i mean add the database and the tables - no more. Thanks. ...

Serializing form data with field names that have dots in them.

Does the serialize function in jQuery replace dots ('.') with underscores? For example, I have a form field such as: <input id="Project.name" name="Project.name" type="text"> When the form is POSTed, I'm serializing the form data and sending it to another PHP file to save. The dots seem to be converted to underscores. Is this norma...

Images not uploading when htmlentities has 'UTF-8' set

I have a form that, among other things, accepts an image for upload and sticks it in the database. Previously I had a function filtering the POSTed data that was basically: function processInput($stuff) { $formdata = $stuff; $formdata = htmlentities($formdata, ENT_QUOTES); return "'" . mysql_real_escape_string(stripslashes($...

Redirecting in a PHP page to another PHP page.

I have a register.php, login.php, and main.php. How do i redirect user after after registration submit to login page and then login page submit to main page. ...

How can I have a certain set of CSS properties affect only IE users?

definately one or the other, not one and the other if.... HTML doesnt have an else function.. or does it? could you please be so kind as to code it in your answer im a php newb but so far getting nice results! this one's got be buggered though. if browser = IE then css/ie.css else css/moz even a webkit 3rd option if you think its need...

PHP: how to send email basics

I'm would like to use PHP to send email from my localhost to other people. What do I need to do that? For example do I need to install mailserver? If I'm not mistaken there's is a language that you don't need a mailsever to send email. Is it right? Inside the PHP.ini, there is [mail function]. How to configure this? I checked on the In...

Is there a way to use css sprites inside dinamic contents?

I mean, using css sprites on non static content like: Inside while(mysql_fetch_array())... ...