Jul
07
2011
0

PHP: Write to a file

The following code writes to a file, it will overwrite the current contents of the file:


$string = "file contents goes here";
$myFile = "file.php";
$fh = fopen($myFile, 'w') or die("can't open file");
fwrite($fh, $string);
fclose($fh);

Make sure you give file.php write access on the server (Apache chmod 775 normally works).

Written by Pete in: php |
Jul
07
2011
0

PHP: Limit a strings characters

This function will limit the number of words shown if the total character limit is over a certain number and add … after the string. Very useful if you want to trim titles or anywhere where you are limited by space:


function limitCharacters($string){
$count = strlen($string);
// change 50 to the number of characters you want to check for
if($count > 50){
//change 5 to the number of words you want to limit to.
//change ... to anything you want to use to show its clipped
$newstring = implode(' ',array_slice(explode(' ',$string),0,5)).'...';
}else{
$newstring = $string;
}
return $newstring;
}

To call the function simply use:

limitCharacters($mystring);

Written by Pete in: php |
Jul
07
2011
0

Dreamweaver Locked Files

When opening a file in dreamweaver in OSX you get the following message:

“index.html is a locked files and can be viewed but not changed.”

1. To fix this open finder.
2. Right click on the file or folder.
3. Under sharing and permissions give everyone read and write access.
4. If its a folder click the cog and select ‘Apply to enclosed items’

Written by Pete in: dreamweaver,OS X |
Jul
06
2011
0

BES Server Logs

Here are the abbreviations for the BES Server Logs:

ACNV = BlackBerry Attachment Conversion
ALRT = BlackBerry Alert
ASRV = BlackBerry Attachment Service
BBUA = BlackBerry User Admin Service
CBCK = Backup Connector
CEXC = Exchange Connector
CMNG = Management Connector
CNTS = Notes Connector
CONN = BlackBerry Synchronization Connector
CTRL = BlackBerry Controller
DISP = BlackBerry Dispatcher
HHCG = BlackBerry Configuration Tool
MAGT = BlackBerry Messaging Agent
MDAT = BlackBerry Mobile Data Service
MDBC = BlackBerry Database Consistency Service
MNGR = BlackBerry Manager
POLC = BlackBerry Policy Service
ROUT = BlackBerry Router
SYNC = BlackBerry Synchronization Service

These are located in:

C:\Program Files\Research In Motion\BlackBerry Enterprise Server\Logs

Written by Pete in: Blackberry |
Jul
05
2011
0

Double-Clicked Documents Slow to Open In Word

Click start > run
Type cmd
In the black box type:
netstat -a
Look for “SYN_SENT” and the IP associated with it.

Click start > run
Type regedit
Search for that IP and delete any references to it as a network share (often in printer folders).
Close and restart.

Written by Pete in: Microsoft Office |
Jul
04
2011
0

Blackberry Administration Service Won’t Start

You get the following error:

“The BlackBerry Administration Service – Application Server service terminated unexpectedly.
It has done this 1 time(s). The following corrective action will be taken in 60000 milliseconds: Restart the service.”

Implement the following fix:

Click Start, click Run, type regedit, and then click OK.
Locate and then click the following subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
Right-click ReservedPorts, and then click Modify.
Paste the following at the bottom.
48855-48858
45588-45588
49955-49955
45599-45599

Restart the server.

Written by Pete in: Blackberry |
Jun
23
2011
0

Find out PHP Version installed from Command Line

At the prompt type:

php -v

Written by Pete in: php |
Jun
11
2011
0

redsn0w hangs on “uploading ramdisk”

If when using redsn0w to jailbreak your iphone you find it hangs at “uploading ramdisk” take the following steps to resolve the problem.

 

Close and reopen redsn0w

Before selecting your firmware open task manager and find the redsn0w.exe process. Right click this process and click Set affinity.

Uncheck CPU 0 in the Processor Affinity menu.

Carry on using redsn0w as normal and the problem should be solved!

Written by Benjie in: Apple,Mobile | Tags: , , ,
May
20
2011
1

Emails in Outlook Showing Strange Charactersets

To fix this problem, login to your outlook web access.

Click Options

Under Email-Security click the download button for the latest S/MIME Control.

This will need to be done on any computer you use to send email from.

Written by Pete in: Microsoft Exchange/Outlook |
Apr
30
2011
1

Html Form Buttons not displaying correctly in mobile safari [Solved]

This is problem caused by safari attempting to default buttons in the mobile browser to its own apple look. A simple fix can be done using CSS. First add a class to your input button tag in the form which you may already have put there:

<input type="submit" value="SUBMIT" name="submit" class="mySubmitClass" />

then in your stylesheet add the following to fix the issue once and for all:

.mySubmitClass {
    -webkit-appearance: none;
}


Written by Tris in: Apple,css,Mobile | Tags: , ,

Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes