php

date default timezone set problem

Hi, I'm using the function $data=date_default_timezone_set("Y-m-d"); and I'm getting the date like 0000-00-00 in my table. Can any one help me ? ...

Development Process for Quick, Simple, Good looking freelance websites

I would like to ask those web developers who do freelance what their development process is for creating quick, simple websites for clients. The kind of sites I am referring to would be simple sites for small businesses. Maybe 4-8 pages, a contact form, simple jquery slide show, that type of thing. What development methods / process hav...

How to turn off kohana's string sanitisation temporarily

I'm building a dynamic form in Kohana and notice that it is doing the following: echo "'"; results in ' in the output instead of a literal ' character. I suspect its xss_clean getting in the way which is normally a good thing, but if I want to avoid it I have to code differently when I need a literal ' output to the page. ...

Get Cookies PHP

Hi, I'm setting a cookie on an anchor click on my page: $("#btn_twitter_signin").click(function() { $.cookie("bookmarklet_twitter_signin", "true"); }); and on the server side i'm trying to retrieve it $_COOKIE['bookmarklet_twitter_signin'] but strangely i'm getting an "Undefined index: bookmarklet_twitter_signin", though i mad...

Recursive regex in PHP

Possible Duplicate: RegEx match open tags except XHTML self-contained tags Hi to all! Could you please explain to me a little about a recursive regular expression in PHP PCRE? So, for example I have general nested html: <div id="first"> <b>some text</b> <div id="second"> <div id="third"> ... </...

What is a mature PHP solution to use for user logins?

I have never really done any serious web programming, other than just a blog or a static web page. For a web application I am developing though, I need to have web site logins. In an attempt to not reinvent the wheel, how can I implement logins? Is there a "drop-in" component somewhere? I'm not averse to fooling around with cryptograph...

Facebook graph API and post-remove callback with the new Graph SDKs (PHP)

I can't find any documentation in the new Facebook Graph/Authorization API documentation about how to handle post-remove callbacks from the Facebook server. With the REST API, this page described how to handle this. Any ideas on how to do this with the new PHP SDK? Do we need to do the signature verification ourselves? What's the equi...

Any javascript jquery plugin to select image from folder

I am using form ehere use has to type the image name like images/pic1.jpg Is there any way that user can graphically select the image and then the path automatically gets populated in that box thanks ...

PHP Convert ISO date to more readable format?

Just a simple question. How do I convert a PHP ISO time (like 2010-06-23T20:47:48-04:00) to something more readable? Is there a function already built in PHP? I've looked around but I haven't seen anything to convert times. If there's not a function, is it possible? Thank you ...

Simulate HTTP POST (Form)?

I need to populate my database with test data. But my data needs to be manipulated to be put into the form by my PHP FORM before upload. How can I automatic the process of filling out my web application form field, which also need to accept uploading images? ...

PDO, mysql, transactions and table locking

For fun I am replacing the mysqli extension in my app with PDO. Once in awhile I need to use transactions + table locking. In these situations, according to the mysql manual, the syntax needs to be a bit different. Instead of calling START TRANSACTION, you do it like so... SET autocommit=0; LOCK TABLES t1 WRITE, t2 READ, ...; ... do ...

Encoding mailto link with body text

I'm trying to create a mailto link using PHP. Basically my function gets the body text from database and then creates the html tag like this: <a href="mailto:?subject=sample&body=sometexthere">send</a> well, the problem is that my body text may contain non standard characters, like accents and so, so i need to encode the body text bef...

Programatically find and replace text in pdf

I'm trying to create a web script that will allow me to alter PDF templates that I have uploaded and re-output them. I have tried Zend already which allows me to write to a PDF but that means leaving the PDF blank in certain space which is to primitive for what I need. PDFFlip was not any better. We need to implement functionality so we...

How to output XML safe string in PHP?

I am doing some stuff that needs to output xml(utf-8) using PHP scripts. It has strict format requirements, which means the xml must be well formed. I know 'htmlspecialchars' to escape, but I don't know how to ensure that. Is there some functions/libraries to ensure everything is well formed? ...

What is the most extensive PHP/MySQL combo book?

I know this isn't a directly programming related question but I need some help in deciding which book to buy. I usually never buy books, instead I download instructional videos and ebooks from file sharing sites. But I want to buy one big fat book now that I can read on the subways to and from work. So for MASTERING php/mysql which book...

regex for extracting anchor in a url

I'm trying to extract an anchor tag and everything behind it from a url using preg_replace. I found one to remove everything after the #, but I want one that removes the # and everything behind it. http://blah.com#removethis Thanks, Steve ...

WordPress Search Box + CMS Queries

Hi, Hoping someone can assist - I'm currently developing a website in HTML/CSS that will eventually be converted into a WordPress CMS - this is the first time I am attempting this and have a few queries regarding this: 1) Within the current site I am developing, I want to have a "Search" box feature by where the user can search on any ...

Read IIS log files using PHP

Anybody knows how to read IIS log files using PHP? Thanks ...

Fatal error: Call to undefined function: imagecreate()

Hi, I'm trying to put some graphics on a web page and at my prototype at the computer it's all working fine at the localhost. But now I uploaded the files to a server and I'm having a problem to plot some graphics. In my computer they are plotted, but on the server they are not. I'm getting this error Fatal error: Call to undefined fu...

Question Marks Instead of Chinese Characters

I'm trying to place some Chinese text on a website, but as soon as the page is placed online, instead of Chinese text, i see a row of question marks ?????????? ??????????? I tested the same page on a WAMP server before putting it online (all the pages have a php extension) and the Chinese characters show just fine, it is only when the p...