php

SoapClient save request to file instead of sending it

Is there a way to save the soap request SoapClient sends when calling __soapCall to a file instead of sending it to the actual server? I'm trying to save the soap requests to a queue and then send them over a period of time (the requests will be very different). I'm using Zend_Soap. ...

Keyboard input in PHP

I am trying to control stuff with PHP from keyboard input. The way I am currently detecting keystrokes is with: function read() { $fp1=fopen("/dev/stdin", "r"); $input=fgets($fp1, 255); fclose($fp1); return $input; } print("What is your first name? "); $first_name = read(); The problem is that it is not reading t...

Parse errors are not displayed

Hi all, I want PHP to display parse errors on screen. What I get instead is a blank page. Nothing gets written to server's error log file. My setup: PHP5.2.9/IIS 6 (not Apache!). My PHP.INI: error_reporting=E_STRICT display_errors = On display_startup_errors = On log_errors = On error_log = "C:\Program Files\Zend\ZendServer\logs\php_...

PHP: Setting permissions so I can write a file?

I am trying to create a file with PHP here is my code: $file_to_send = 'ftp_test_from_created_file.txt'; chmod($file_to_send, 0777); $fh = fopen($file_to_send,'w'); $tsv_line = 'Hey\tThese\tAre\tTab\tSeperated\tValues'; fwrite($fh, $tsv_line); fwrite($fh, '\n'); $tsv_line = 'Hey\tThese\tAre\tToo'; fwrite($fh, $tsv_line); fclose($fh); ...

Can I setup eclipse to show code changes (I have svn)

I have used netbeans before with svn, and I liked how it showed me what I had changed since last commit, using the coloring in the left margin. Can Elipse do the same? I have installed svnclipse.... ...

how to make a PHP file run-able only through CLI mode?

It's available to browser, but I don't want it to execute when browsed by user, say,when browsed should exit, is there a way to detect whether it's currently Cmmand Line Mode? ...

how to detect $result is a valid MySQL result resource in mysql_fetch_array($result)

It's written in PHP, and sometimes when I restart mysql, will report: Debug Warning:line 24 - mysql_fetch_array(): supplied argument is not a valid MySQL result resource Is there any way to detect if $result is a valid MySQL result resource? ...

How to Bitwise compare a String

I am working on a function that takes in a series of permission strings, less than 255 characters and assigns them to an entity. Each string assigned is unique, but there are so many that dropping them into an array, serializing them and pushing into a database and pulling them out later and de-serializing them or recalculating from a q...

Is a simple id->json in SQLite store reasonable for a cheap and dirty Q&A storage?

The Situation I have a very compressed time schedule to write a simple (basically write-only web app). The app is to be a mostly jQuery-driven question tree. The questions and tree will probably need to change both before and after the site launches. The answers will get emailed... I probably don't even need to store them, but I'm g...

how to test connectivity in PHP?

Suppose you are now connected to a jabber server, then how can you check whether your connection to the jabber server is lost or not? ...

What is a good Ruby on Rails and PHP hosting?

I'm looking Ruby on Rails and PHP hosting service(shared space or a dedicated server). I would like to see two options first before buying one of them: PHP and can upgrade to Ruby on Rails later with additional cost Ruby on Rails and PHP I've looked at Dreamhost, Bluehost and RailsPlayground and all of them seem to have pros and cons...

GZIP (static compression) with IIS7 and PHP running under Fast CGI

Does anyone have gzip (static compression) working with IIS7 and PHP running under Fast CGI? The gzip works on our server with ASP.NET apps compressing JS and CSS files but doesn't seem to work with a PHP application. ...

php mysql fulltext search: lucene, sphinx, or ?

This is admittedly similar to (but not a duplicate of) http://stackoverflow.com/questions/737275/pros-cons-of-full-text-search-engine-lucene-sphinx-postgresql-full-text-search, however what I am looking for are specific, supported, recommendations from the benefit of experience with more than one of the available systems (there seems to ...

Zend Studio SVN -- how do I tell if a file is locked by another user?

Does anyone know how to tell if a file is currently locked by another user in svn using the Zend Studio IDE? Cheers. ...

How to pass GET and POST data to the php executable?

I am writing a web server in C# and I'm trying to add support for PHP. I have it mostly working, except I don't know how to past GET and POST data to the PHP executable when i pass the file to it. I've been testing with GET since I haven't gotten to getting POST requests handled on the server, and I have the string of the arguments that ...

Fairly simple regex question in PHP

Ok, i'm a regex doofus. I only ever learn enough to get me by, but i would like to know how to do the below regex without using a php ternary operator in the middle of it. Also it may be ugly but it works... '^". $date[0].(($date[0] == 0)?'?':'').$date[1]."[/.-]".$date[2].(($date[2] == 0)?'?':'').$date[3]."'"; uhm. as you can see im u...

Help to make decision on huge reporting

Hi All I would like to ask your opinion to my case. We have big table. And monthly we do reporting on that table. That is we need to download up to 20000 records as PDF or Excel file and print it out. I am planning to generate reports in real time. No in advance generation. Is it a good way to solve my problem ? or if u have better idea...

Different Image depending if user has already voted

I am developing a links voting site, and I have this function, to check if the user already voted the link: function has_voted($user) { try { $db = parent::getConnection(); $query = "select id from votes where username = '$user' and article_id = $this->id"; $results = parent::exe...

Which PHP Framework is most closely cloned to ActiveRecord (RoR)

As the question says it all. Which framework in PHP is most closely cloned to ActiveRecord (Ruby on Rail). I have gone through many frameworks claiming to be based on ActiveRecord ideology but unfortunately none really come any close to ActiveRecord. Wny? Are there any such frameworks that I have missed? ...

expanding a mysql JOIN query in PHP

I need to alter my existing JOIN query below to also include the data from users.image correlating to the UserID of the post maker. Something like: users.image WHERE users.UserID = posts.userid I am not very good with join queries yet. How would I do this? Existing Query: $result = mysql_query("SELECT posts.* FROM listen JOIN pos...