I'm a big fan of simpletest because it's what I know. It has excellent support for mocking and web-testing.
But I'm always scared of stagnating so any compelling arguments to switch would be appreciated.
...
Hi,
I'm loading data from my database, and exporting to an Excel file via a method I found on this site: http://www.appservnetwork.com/modules.php?name=News&file=article&sid=8
It works, but what I want to do now is format the text before it exports - change the font and text size. Does anybody have any ideas on how to do this?
...
I have Eclipse PDT with Subclipse installed and currently have a PHP project drawing from a repository on my production server. I have VMWare Workstation installed with Linux and was hoping to use that as a debug server using XDebug. The problem is that when I update files, they are only committed to the repository on my production ser...
Hi All,
I am building a PHP app in CodeIgniter. CI sends all requests to the main controller, /index.php.
However, I don't like to see the index.php in the URL, so I've used mod_rewrite, as per the CI documentation.
The rule is as follows:
RewriteEngine on
RewriteCond $1 !^(images|inc|favicon\.ico|index\.php|robots\.txt)
RewriteRu...
I have a script which logs on to a remote server and tries to rename files, using PHP.
The code currently looks something like this example from the php.net website:
if (ftp_rename($conn_id, $old_file, $new_file)) {
echo "successfully renamed $old_file to $new_file\n";
} else {
echo "There was a problem while renaming $old_file to $n...
In my webpage, I want the website to greet the user, but the username is surrounded by 'single quotations'. Since this isn't to prevent MySQL injection, i just want to remove quotes around my name on the display page.
Ex: Welcome 'user'!
I'm trying to find the way where i can strip the quotations around the user and have it display on t...
Let's say we have a method signature like
public static function explodeDn($dn, array &$keys = null, array &$vals = null,
$caseFold = self::ATTR_CASEFOLD_NONE)
we can easily call the method by omitting all parameters after $dn:
$dn=Zend_Ldap_Dn::explodeDn('CN=Alice Baker,CN=Users,DC=example,DC=com');
We can also call the metho...
I'm porting an application from php to fastcgi (c). My host runs apache.
Since the fastcgi app would be running in a loop, I could open a mysql connection, and leave it open for all incoming requests. Is this recommended?
I think I've read about an equal number of opinions saying the connection is way more expensive than the request an...
Hi all,
I'm currently running into some issues resizing images using GD.
Everything works fine until i want to resize an animated gif, which delivers the first frame on a black background.
I've tried using getimagesize but that only gives me dimensions and nothing to distinguish between just any gif and an animated one.
Actual resizi...
$images = array();
$images[0][0] = "boxes/blue.jpg";
$images[0][1] = "blah.html";
$images[1][0] = "boxes/green.jpg";
$images[1][1] = "blah.html";
$images[2][0] = "boxes/orange.jpg";
$images[2][1] = "blah.html";
$images[3][0] = "boxes/pink.jpg";
$images[3][1] = "blah.html";
$images[4][0] = "boxes/purple.jpg";
$images[4][1] = "blah.html";
...
Hello, I am trying to change the rows output by php in a table to links. I have added the a href tags to the example below, however it results in an unexpected T_VARIABLE. I have tried it without the extra quotes, but this displays a blank table. I am not sure what the flaw in the logic is.
while($row = mysql_fetch_row($result))
{
e...
I'm trying to make a class that will execute any one of a number of stored procedures with any amount of variables
Im using php and mysqli
My class enumerates an array and constructs a string based on the number of elements if any
giving something like this CALL spTestLogin(?,?) for example
I now need to bind the input from my array u...
I have an existing web app that allows users to "rate" items based on their difficulty. (0 through 15). Currently, I'm simply taking the average of each user's opinion and presenting the average straight from MySQL. However, it's becoming clear to me (and my users) that weighting the numbers would be more appropriate.
Oddly enough, a...
I want ajax application to process a simple form with textinput and submit button only , and without validation , i want to add this with a php script .
I ask this because i don't know how to program with ajax or javascript .
...
Most of my PHP apps have an ob_start at the beginning, runs through all the code, and then outputs the content, sometimes with some modifications, after everything is done.
ob_start()
//Business Logic, etc
header->output();
echo apply_post_filter(ob_get_clean());
footer->output();
This ensures that PHP errors get displayed within the ...
Help!
I have a PHP (PHP 5.2.5) script on HOST1 trying to connect to an MySql database HOST2. Both hosts are in Shared Host environments controlled through CPanel.
HOST2 is set to allow remote database connections from HOST1.
The PHP connect I'm using is:-
$h2 = IPADDRESS;
$dbu = DBUSER;
$dbp = DBPASS;
$DBlink = mysql_conn...
I want my php script to create an output file in a folder based on the date. The way I'm doing this is that its supposed to get the foldername/filename from a text file outputted by another program which I am unable to edit.
So the file its grabbing the data from looks like this:
data/newfolder/10302008/log_for_Today.txt | 24234234...
I've read everywhere about how great they are, but for some reason I can't seem to figure out how exactly I'm supposed to test something. Could someone perhaps post a piece of example code and how they would test it? If it's not too much trouble :)
...
Assuming one has an abstract base class "foo" with __get() defined, and a child class "bar" which inherits from foo with a private variable $var, will the parent __get() be called when trying to access the private $var from outside the class?
...
Hello,
In PHP, I can write:
$vname = 'phone';
$$vname = '555-1234';
print $phone;
... And the script will output "555-1234".
Is there any equivalent in Perl?
Edit: Thanks, CMS.
Is there any way to constrain $phone to the scope of the local block, as if I'd written "my $phone"? Using "my $$vname" gives me "Can't declare scalar dere...