php

PHP Username's for login system

HI , I am stuck with a little thing, I need to allow muplite users to be able to login my php code works with one member how can I make it so mulitple users can login, If there is a better way using MySql please let me know $upload_username = "username"; $upload_password = "password"; Thanks ...

Web Session or Sessionless

I'm thinking about creating a 'session' table that contains a random #, User ID, Date/Time that is populated when a user logs in and the random # used in each displayed page to uniquely identify the person. Each time the user displays a page the record will be updated with the most recent date/time activity, if there has been no activit...

How to make jscon_encode work with multibyte characters?

echo '<a title=' .json_encode("按时间先后进行排序") . '>test</a>'; The above will generate something like "\u6309\u65f6\u95f4\u5148\u540e\u8fdb\u884c\u6392\u5e8f" and it's a mess! ...

When NOT to use MVC in a Web Application?

I was working on sketching out some ideas for a new project, and realized that I was having some difficulty getting things to fit into an MVC framework (In the case, CodeIgniter) In a way I liked. While I believed this can be overcome by working with the design some more and figuring out a better layout, It got me to thinking: could MVC...

Ajax with slide effects onready witout using a toolkit

I'm really not that good at Javascript and that, so I need another bit of help. I want to be able to do a quick bit of AJAX using PHP then when the ajax response is finished show the response in a div and SLIDE it down nicely. The basic AJAX side of it is no problem. But I want to be able to have it slide nicely without using any framew...

Php multithread

Php, isn't really made for multithread but do you have any workarround to deal with threads in php. ...

get_file_contents fails with 400 response code

I have the strangest issue ever. I'm trying to get results of CGI script running on the same server with get_file_contents and it works everywhere except my local machine under Ubuntu. It works when I ask it to get url from different server (same script running on production), it works deployed on different server, I'm absolutely sure I...

Cleanup Symfonys View Templates

I'm evaluating the PHP webframework: Symfony for a project. Everything is quite well organized so far, except for the view templates which suffer from an unreadable/error prone mix of html and php (I was trying to adapt the views to use clean urls and that just turned out to be an exercise in "spot the delimiters"). Is there any methods...

Can't add contents to file using file_put_contents

I'm outputting the contents of a file to another file, but the contents is just not being put into the second file. It creates the file but does not put the output to the file, it displays the output on the screen. require_once 'templates/'.$layout.'/contact.php'; ob_start(); $content = ob_get_clean(); file_put_contents($dir.'/contact....

full-text searching for non-English text in sqlite

How can I make some ful-text searching in non-english texts with sqlite? I use php5.3, with pdo_sqlite. CREATE VIRTUAL TABLE example USING FTS3(title TEXT, TOKENIZE icu hu_HU) This one is dont throw an Exception, but just a 0 byte length .sqlite file has been created. I dont see any virtual table. Below this link, i read that pdo_sqli...

Clever way to validate get parameter in Zend

When you're writing a form you can configure the zend_form_element objects according to your needs. (Adding validators and filters) Is there a clever way to achieve the same for the validation of "pure" GET parameters? My task is to make sure that the application is secure and I am thinking about using the form validators and their cha...

How to convert human readable date to milliseconds since the unix epoch?

how to do this? ...

Drupal VS Zikula

Hi guys! Im new to drupal (just finished my first web site with it), i found it very simple and powerfull to use. Recently, i've been asked to build a community with Zikula. They prefer to use zikula becose it is the 'evolution' of phpnuke, that is the cms that they currently use (i have 'restayling and rebuild' it). Moreover, I want...

Is there a function make a copy of a PHP array to another?

Is there a function make a copy of a PHP array to another? I have been burned a few times trying to copy PHP arrays. I want to copy an array defined inside an object to a global outside it. ...

Problems with PHP API for Amazon CloudWatch service ... returning Internal Error Response Status Code: 400

I am trying to set up the PHP API for CloudWatch found here. There are 2 samples with the library and I have managed to get the first (ListMetricsSample.php) to display a list of the metrics available for my running instances in Europe. As far as I can see though this just lists the metrics, there are no values for the metrics given in t...

Weird PHP error: 'Can't use function return value in write context'

I'm getting this error and I can't make head or tail of it. The exact error message is: Fatal error: Can't use function return value in write context in /home/curricle/public_html/descarga/index.php on line 48 Line 48 is: if (isset($_POST('sms_code') == TRUE ) { Anybody knows what's going on??? PS Here's the full functio...

Javascript with PHP

Dear users, I have an overlay image that is created in Javascript using the 'Createelement' function. Now I would like to know if I can attach a handler to the mouseover event using PHP? Can you give an example pls? The image appears only when hovering over the element below it. Regards, T UPDATE I want to handle the mouseover...

I have a base64 encoded png, how do I write the image to a file in PHP?

What's the proper way in PHP to create an image file (PNG), when I have the base64 encoding? I've been playing around with: file_put_contents('/tmp/'. $_REQUEST['id'].'.png', $_REQUEST['data']); do I need to decode? should I be using the gd library? ...

PHP includes Statement

I was wondering how include worked. i thought it was making 2 files or more into one big file for example file 1 includes file 2. file 1 is in the root directory while file 2 is in root/include/file2. so if file 2 needed to include something from the root/include directory then instead of putting include("file3.php"); i would need to ...

Interpreted vs. Compiled Languages for Web Sites (PHP, ASP, Perl, Python, etc.)

I build database-driven web sites. Previously I have used Perl or PHP with MySQL. Now I am starting a big new project, and I want to do it in the way that will result in the most responsive possible site. I have seen several pages here where questions about how to optimize PHP are criticized with various versions of "it's not worth goi...