php

php-cgi.exe - does it detect and handle both CGI and FastCGI? If so, how?

The impression I get both from Microsoft's discussions about FastCGI and PHP, and also from Coast R&D's site, is that php-cgi.exe is able to detect whether it is being used in either a CGI or FastCGI context. If so, how does it do it, as I'd like to have similar functionality in my own product. ...

Cost of scaling Rails vs cost of scaling PHP vs Python frameworks

I guess this question has been asked a lot around. I know Rails can scale because I have worked on it and it's awesome. And there is not much doubt about that as far as PHP frameworks are concerned. I don't want to know which frameworks are better. How much is difference in cost of scaling Rails vs other frameworks (PHP, Python) assum...

Display japanese text came from database in php

Recently I worked in a project in where I need to display japanese text which are come from database. I already use meta http-equiv="Content-Type" content="text/html; charset=utf-8" It help to display the static text. But when it come from database it display "??????????" type text. How can I solve this kind of problem? ...

How can I protect a directory using PHP?

Notice, this is a remote server, I don't have access to it, only to the FTP. I want to do this using purely PHP, not .htaccess. Is there a way similar to .net, where you put the web.config file and you set who can access it and their password? ...

mysql_num_rows() argument not valid

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/ango/public_html/ficha/findUser.php on line 201 This is the code: $query = mysql_query("SELECT ango_turnos.planilla.fecha_turno, ango_turnos.planilla.cod_estado, ango_personas.dominio_interno.* FROM ango_turnos.planilla RIGHT OUTER JO...

Why would php say two equal things are unequal?

I'm trying to see if a user logging in has entered the right password, which is stored as an md5 hash. when i echo the hash of the password entered, it matches exactly the hash of the one in the database, but it still thinks its false. Heres the code: echo md5($_POST['pass']); if ($user->match_password($_POST['pass']) == true) { ....

Google Calendar PHP - Event URL / ID? (Zend_Gdata)

Hey everyone, I have modified my PHP web app to add events to a Google Calendar. Currently, it adds successfully. However, now I wish to delete and edit events. This seems easy to do, except for the fact that I don't know what event URL is associated with each event. Am I supposed to set this event URL (or ID?) upon adding an event? H...

Mysql Update or Insert with empty values

A quick question. I'm using php to insert new records in a database table - if the record exists, an update command is run instead. My question is, if the incoming record has fields that are empty but the data already in the database is not empty, does the update command overwrite the existing data with the empty values? Much appreci...

how to pass the url value in curl php

$description = "some test data and url"; $description .="http://www.mydata.com?test=1&user=4&destination=645&source=stackoverflow"; curl_setopt($sch, CURLOPT_URL, "myserverurl"); curl_setopt($sch, CURLOPT_HEADER, 0); curl_setopt($sch, CURLOPT_POST, true); curl_setopt($sch, CURLOPT_RETURNTRANSFER , 1); curl_setop...

language translation in php

How is language translation handled in PHP? I need to change the language of a site based on user preferences. Also, I may not have access to the client source code. At most, I could upload a folder of my own and do the dynamic translation myself. As far as I know, the basic process would be: Send Language 1 output to global function ->...

open/edit/save csv files with php

Is there any php/mysql software that can pull data from a mysql database or a csv file, and allow you to edit, perhaps copy/paste new rows, then save this file as a csv? needs to be web based. any pointers will help. ...

require_once () or die() not working

Does anyone know why my require_once () or die(); is not working. It's always shown the Fatal error instead of the error message that I key in into the die(). See below for my code: require_once ('abc.php') or die("oops"); Error message display as below "Fatal error: controller::require_once() [function.require]: Failed opening re...

How to check for duplicate files in php?

What I really want to do is check if the same file exists before or after uploading the file, is there a efficient way to do it? Well, that's it! Edit: Actually it doesn't matter if its after or before, as long as it can detect dups. ...

How to develop a commenting system for a blog?

I know it has to do something with MySQL and PHP, but i don't have any idea about it. Moreover, can comebody please tell me how to include "recent comments" in the footer section? Thanks in advance! ...

Automatically Restarting a chat server application on system restart

I developed a chat application with an attendant chat server. Everything is working fine. The issue now is the fact that whenever the chat server goes down (for instance, the server system shuts down as a result of power failure or some other problem), by the time the server system come back on, the chat server would have to be restarted...

How to logout when using .htaccess (and .htpasswd) authentication?

Possible Duplicate: HTTP authentication logout via PHP Hi I have a some functionality on my website protected using .htaccess and .htpasswd. When users attempt to access this, they get prompt to enter details. They enter their details and get in and can see stuff etc. All works fine. My question is how do I create a logout f...

What is C# equivalent of preg_match_all?

The theme is i opened a file and get all it's data into string and i am matching this string with the regex returning none. But the same regex in PHP is returning values for the same text using preg_match_all. Anyone having a idea? ...

Posting to website using captcha

Hi, Currently I'm wondering if there is a way to post to a website using captcha for a human-check. The following question is asked, ofcourse this is done with random numbers: Type this number in digits; 'twohundredandfive': [ input ] The form is sent using AJAX. So when reloading the website the number to be typed changes. A way to...

tinymce changing urls

I have tinyMCE on a simple text file editor, but when i enter a url that is the same as the server, and include the text file through php, it reads http://../directory, instead of http://www.domain.com/directory. ...

How to output JavaScript with PHP

Hi, I am new to PHP. I need to output the following JavaScript with PHP. This is my code: <html> <body> <?php echo "<script type="text/javascript">"; echo "document.write("Hello World!")"; echo "</script>"; ?> </body> </html> But it's showing the error: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /var...