php

Soap returning a HTTP request failed error

I'm getting this error when trying to open a WSDL but I've also tested other valid HTPP address and I'm getting the same error. Could this be something in my php.ini configuration? I have checked allow_url_fopen and that is set to on. here is the exact error: failed to open stream: HTTP request failed! ...

Handing dates in Zend_Form - changing to and from date formats

Hi, I'm working on a Zend Framework (v1.7) application that calls for a few forms that users need to enter dates on. The user is prompted to enter dates in the dd/mm/yyyy format, but the MySQL database wants the dates to be presented in yyyy-mm-dd format. Therefore, i'm having to do the following: Loading the form Grab the data fr...

YUI custom events and simutaneous actions

I'm working on a JavaScript application that has to perform two separate checks via AJAX. Depending on the result of each check, behavior differs. The case I'm interested in here is when both checks are successful. I've identified a few ways to do this, and I want to get some feedback from SO about what they think the best approach is...

jquery: selectbox with diffrent output on diffrent selections

Hello! I'm trying to get input box to show different dates depending on the users selection from select box. If user select today today date should show if tomorrow, the date for tomorrow. My qustion is how do I get the select box to show the correct date? <?php $tomorrow = date("Y-m-d", mktime(0, 0, 0, date("m") , date("d")+2, date...

Use "mysql_fetch_row" to retrieve results from database and insert into array using PHP and mysqli?

Hi, I need to retrieve data from several rows and then insert the results into an enumerated array so then I can use a "for" loop to echo it... I have this (I already connected to the database): $genres_sql = 'SELECT genreID FROM genres WHERE imdbID = ?'; if ($stmt->prepare($genres_sql)) { // bind the query parameters $stmt->bind_par...

CodeIgniter - multiple instances of a model

I am using CodeIginter as my PHP framework. I am explaining the situation below: - I need three models named: - User_Model Relation_Model Reminder_Model Now consider the situation: User_Model is already written. I am writing Relation_Model. My friend will write the Reminder_Model. Relation_Model instantiates User_Model, and uses t...

Web framework maintainability

Hopefully the last question in choosing an implementation language for this web app, but before pitching to anyone, we would like to know what your experiences are with maintaining an application. We maintained (and since moved to a hosted solution) a web portal based on Perl. The problem was that we had cases where Perl was updated o...

PHP syntax checking?

I'm using TextWrangler to edit PHP code. I often run into the problem that the code just displays as a blank page in my development environment. Is there a good way to further target which place I should look in my code for the problem? Right now I'm just manually running through every line any time I run into this, but I'm guessing...

Mixing PHP's mysqli data access functions?

I've seen a couple of questions over the last few days that have used mysqli but where the answers appear to have not recognised the difference between $stmt->execute() and $db->query(). As I understand it, there are two differing models for accessing results in mysqli. This one uses raw SQL and requires the programmer to escape the in...

How can I take a screenshot of a website with PHP and GD?

How can I create a screenshot of a website using PHP and the GD library. ...

Date Range In PHP?

I have a DB created by a third party vendor that I'm now writing a new UI for. The DB stores event start times as unix timestamps (in GMT). What I need to do is query this for a one day range. So presumably I simply need to do a: SELECT * WHERE start > $last_night_at_midnight AND start < $tonight_at_midnight The problem I'm running i...

How to get user data in form in Symfony 1.2?

I'm using Symfony 1.2 in a standard Propel form class. public function configure() { $this->setWidgets(array( 'graduate_job_title' => new sfWidgetFormInput( array(), array( 'maxlength' => 80, 'size' => 30, 'value' => '' ) ) )); //etc } However, I want the value of this field to come from the user information, which I'd no...

Firefox 3: Cannot delete cookies that were set in JavaScript on the server

I am trying to write PHP code to delete all of the user cookies on my domain. Here is what I got: <?php $domain = 'www.example.com'; $deleteExpiration = time() - 60*60*24*365*10; // 10 years ago foreach (array_keys($_COOKIE) as $cookie) { setcookie($cookie, 0, $deleteExpiration, '/', $domain); } Running this code on http://www.ex...

PHP and MYSQLi - Bind parameters using loop and store in array?

Hi, It will be easier to explain with the next code (It's wrong, by the way): $selectGenre_sql = 'SELECT genreID FROM genres WHERE dbGenre = ?'; if ($stmt->prepare($selectGenre_sql)) { // bind the query parameters $stmt->bind_param('s', $genre); // bind the results to variables $stmt->bind_result($genres); // execute the ...

PHP pass function as param then call the function?

I need to pass a function as a parameter to another function and then call the passed function from withing the function...This is probably easier for me to explain in code..I basically want to do something like this: function ($functionToBeCalled) { call($functionToBeCalled,additional_params); } Is there a way to do that.. I am us...

php5: To __construct() or to ClassName()?

Hey, I just started pondering this and figured I could use some input. I've long been using '__construct()' for all my constructor needs in php5, even though the obviously better looking 'ClassName()' would work just as well. I remember switching to __construct because it would forcibly break on older php installations but I don't think...

Serial comm with PHP on Windows

Greetings all. I am looking for a way to communicate with RS232 serial COM port on windows. I have found 2 solutions on the net, one which is not totally free (introduces deliberate delays on the function) and another with limited capability on Windows. The latter can only write to a COM port on Windows, not read. I can't look at the c...

What is the quickest way to build admin interfaces in PHP?

What's the quickest way to build admin interfaces in PHP? It can be a framework, a library/libraries coupled with a particular approach, or whatever. Background: I'm a Django developer spoiled by auto admin who has to deliver a web-app in PHP. The app is very admin-area/form heavy and has different access levels. ...

Scaling phpBB?

I'm looking to scale an existing phpBB installation by separating the read queries from the write queries to two separate, replicated MySQL servers. Anyone succeeded in doing this, specifically with phpBB? The biggest concern I have so far is that it seems like the queries are scattered haphazardly throughout the code. I'd love to hear ...

SQL Query causing page to go blank

I'm making a website using php and I'm having some trouble with an SQL query. $dataArray = array(); $result = mysql_query("SELECT * FROM test WHERE web_id='$websiteID'") or die(mysql_error()); while ($row = mysql_fetch_array($result)) { $k = $row['kfoo']; $v = $row['vbar']; $dataArray[$k] = $v; } That's the code as it...