|
Wednesday, 10 January 2007
Is this the future of web debugging? I think so.
Thursday, 21 December 2006
I’ve been asked a question similar to this one a number of times over the last few years:
Our business partner has a “members only” area on their public website and they have given us our very own “access code” in order to gain access to that area. How do we access the “members only” area directly, bypassing their web form which prompts for the “access code”?
Provided your business partner’s website doesn’t bother checking the “HTTP referer” field when the request is made by the client software connecting to them, something as simple as this will do:
<form action="http://someinsecurewebsite.com/" method="post">
<a href="javascript:document.forms[0].submit()">click me, click me</a>
<input name="accesscode" type="hidden" value="abc123" />
</form>
I’m assuming that your business partners URL for the web form is “http://someinsecurewebsite.com/”, the name of their access code field is “accesscode” and that your allocated access code is “abc123″. I’m also assuming that your web page which contains the above code has no other forms and that the client browser has JS enabled.
I won’t comment on what I think of the practice of providing such a weak security mechanism to provide access to restricted areas of public websites. I’ll save that for a future post. But let’s just say that it’s still a popular choice when you only want to discourage the general public from seeing certain sections of your website.
Thursday, 16 November 2006
I recently got an email from one of our readers who found our Spellchecking from Visual Basic article useful but wanted to know if there was a way to ensure that Microsoft Word was installed before attempting to invoke the spellchecking function.
The short answer is “yes, there is”. The actual VB6 code required isn’t all that much but you’ll have to call the Windows API to do it. Put the following code into a module and name it something meaningful:
Read more >>
Saturday, 28 October 2006
Most websites have “contact forms”, which allow customers to get in touch with the website owners, without the owners necessarily having to reveal their contact email address. The customer typically fills in their name, email address and some message text. When the customer submits the contact form for processing, the server software then constructs an email message and sends it to the website administrator or owner.
Read more >>
Saturday, 14 October 2006
It’s only recently that I discovered the PHP function fgetcsv(), which offers a quick and powerful way of handling CSV data, such as that exported by Excel and other spreadsheets.
Using fgetcsv(), the process of reading in a CSV file and printing the results in a HTML table is as simple as this:
$fp = fopen('test.csv', 'r') or die('cannot open file');
echo "<table>\n";
while ($line = fgetcsv($fp, 4096)) {
$max = count($line);
echo "<tr>\n";
for ($i = 0; $i < $max; $i++) {
echo "<td>{$line[$i]}</td>\n";
}
echo "</tr>\n";
}
echo "</table>\n";
fclose($fp) or die('cannot close file');
The real power of fgetcsv() is that it automatically handles the double quotes and any embedded commas which may be present in the source data.
|