php

how to show image that are stored above Document_Root

I set the src attribute of img the way below but was not working : src="/../files/filenamee" the image is not shown. How to do it correctly? ...

rename not supporting multi-byte characters

If I write: rename('php109.tmp','test.jpg'); then it's fine and working. but if I change it into: rename('php109.tmp','中文.jpg'); it'll report "No such file or directory...". But the multi-byte characters can be written into database then read out fine, why it fails when towards rename ? ...

Rapid Prototyping Twitter Applications?

I'm looking forward to create a bunch of Twitter applications for a website, and was wondering what solution stack worked best when trying to rapidly prototype small twitter applications? Google App Engine + Python/Django? Google App Engine + Java? Heroku + RoR? Good Old LAMP? Also, any recommendations on particular frameworks/librar...

how to get file system encoding by php

not file encoding , but file system. why I ask this is because that I find functions like rename,copy use the same encoding as file system,And I don't know how to change that,so the only thing I know I can do is using iconv to change it to encoding of file system. Better if you know how to set encoding of rename,copy! ...

Ways to determine returning "anonymous" guests in PHP

Two types of users visit my website: registered users and guests. Registered users are tracked and retained by PHP session, cookies and individual logins. Guests I find trickier to manage so I give little to no authority to contribute content. I want to open up editing for users (registered or not) to save favourites, shopping carts, vo...

PHP mail() function not using "from" address

$to = "[email protected]"; $subject = "Auction Registration Confirmation"; $from = "From: [email protected]"; $body = "Test Message"; if (mail($to, $subject, $body, $from)) { echo("<b>Message sent</b>"); header( "Location: http://www.mydomain.com/thankyou.html" ); } else { echo("<b>Message failed</b>"); } Now the prob...

Migrating an existing PHP site to use URL re-writing (Pretty URL's)

I currently have a community site that I run that is made up of 15 or so php pages. It is not currently very dynamic, only using php for includes/templates. Currently no content is generated via a query string. The pages do not follow a standard naming convention and there are many inbound links. I am looking to expand the site (and st...

file upload problem in my server..

I am trying to upload file using php. I am using the function move_uploaded_file. However it work okay in my local machine but when I test it in the server , it is not working. How can I know what is missing in my server. Thanks IN advance. ...

PHP: Sort an array

I've got an array with data from a MySQL table in nested set model I'd like to get sorted, not only alphabetical but also with the child nodes directly after the parent node. Example - array to be sorted (before the sorting): Array ( [0] => Array ( [id] => 1 [name] => Kompetenser [parent] ...

Auto insert text into vim

When debugging some php scripts it would be very handy if I had a shortcut that would insert a piece of text like an echo with the current linenumber and filename. echo "Hello at filename.php at linenumber"; Even auto inserting some text like a comment with a static echo would be sweet. /* DEBUG */ echo "in here"; Is this possible in...

what templating engine options are there for PHP?

I wonder what options there are for templating in PHP? If the templating code can be very similar to PHP, it'd be best. ...

how to use Smarty better with PHP?

I found that using Smarty with PHP, sometimes extra time will need to be used for 1) using quite different syntax than PHP itself 2) need to check small cases, because documentation doesn't give finer details, such as for "escape" http://www.smarty.net/manual/en/language.modifier.escape.php it doesn't say escape:"quotes" is for double...

Sending email in Delphi without smtp and using php function at server

Using Delphi, i want to send a text message to my web server using winsock, and then use an email php function on the server to post the message. First i have done the sending procedure (Procedure SendEmail): it reads a text file (log) and POST it to my server. On the server, the message is received by aa email php function named email....

Extending classes in the database

I am working on a php project that needs to store information about various buildings and will store different types of information depending on the type of the building: Class Building { var $location var $name } The Building class will be extended by classes like, House and Office so the classes will look like this (just an ...

How to tell the difference between a page refresh and closing a page

I have a web app game and while in the game I want to have it so if a user closes the page or their browser, it will automatically log them out. I tried using the onbeforeunload event attached to the window: window.onbeforeunload = function() { // perform logout functions here } The problem is, that will also fire if the user refr...

Paypal integration help!

I am trying to figure this site out http://integrationwizard.x.com/ecpaypal/code.php to integration the payment system into my site but i am really confused on how to get it to work. the site im doing this for is http://alldaywhite.com/ this is what i did if you enter some information on the first page the second page will be the paym...

Getting json on Ajax response callback

Hey! I am trying to create a little ajax chat system (just for the heck of it) and I am using prototype.js to handle the ajax part. One thing I have read in the help is that if you return json data, the callback function will fill that json data in the second parameter. So in my php file that gets called I have: header('Content-type...

PHP Zip extractTo - problem with permissions

Hi I'm trying to unzip a Zip archive in PHP using extractTo. The PHP script is running via the webbrowser i.e. as "nobody". The script: 1) creates a new subdirectory (e.g. "abc"), with permissions 0777 and owner "nobody" under document root (i.e. one level above public_html) 2) copies the Zip file (from an incoming FTP directory und...

Dynamic Default Module in Zend Framework

Does anyone know of a way to set the default module dynamically in Zend Framework and not run into namespace issues? For example, what I want to do is have a table of modules that are allowed to be loaded, with one of them set as the default module. For example, I may have: admin blog calendar as modules that can be loaded. If I have ...

Linking Facebook Connect

Hello guys, I've started working on integrated Facebook Connect with my app. I have a slight lack of knowledge problem though. I can perfectly make it so you log into Facebook Connect on my site, etc, shows your details all FB Connect functions work. But, how do I make it so I can store the facebook user ID into my MySQL database as pa...