LaxLoafer 71 Posting Whiz in Training

Requests for https://malsup.github.com/jquery.form.js are being 301 redirected to http://malsup.github.io/jquery.form.js, hence the mixed content issue.

The resource is also available via HTTPS so you could possibly link directly to https://malsup.github.io/jquery.form.js, as long as you're confident it won't change.

LaxLoafer 71 Posting Whiz in Training

If you're relying on the HTTP referrer header to prevent hot linking there are a couple of issues you might need to think about. The header can be spoofed. And it's not uncommon for the referrer to be blank, such as when someone bookmarks a resource.

I haven't attempted to block hot linking myself, but what I would try doing is setting a domain cookie so that at least you know they've visited your site. Then when they request the download, their browser will include the cookie in the request header, which you can test against.

If you need to protect resources more thoroughly, consider implementing a way for users to authenticate themselves, such as with a username and password, and/or restricting access by IP address.

LaxLoafer 71 Posting Whiz in Training

I'm unable to find any mention of SSI on your host's site. To test whether SSI is enabled you could try something like outputting the date - just insert <!--#echo var="DATE_LOCAL" --> into the body of your document.

LaxLoafer 71 Posting Whiz in Training

You might want to have a look at HTML Imports.

The directive you have used is a server-side include, which may need enabling on your web server in order to work. Note the 'file' or 'virtual' argument of the include directive should specify a path somewhere inside the web root directory. If you are hoping to share the file between sites I guess you might want to consider hard linking to or copying the file instead.

LaxLoafer 71 Posting Whiz in Training

If the file is corrupt you'll probably have a hard time trying to recover the contents. That's why it's important to keep backup copies :-)

In the unlikely event you don't have a backup, try looking for a temporary file. Sometimes applications will create such files while a document is open and delete them when finished. It's just possible a temporary file may still exist, especially if the fault that caused the corruption also terminated the application unexpectedly.

Which operating system are you using?

LaxLoafer 71 Posting Whiz in Training

The point at which you're calling the document.getElementById('imageTwo') the image element doesn't actually exist. As a result, the value of image will be null.

You need to call the function after the IMG tag has been created. You can do this either by placing a script block after the tag, or defining a body.onload function and placing it within. For example:

<html>
<head><title></title>
<script>
function myOnload() {
    image = document.getElementById("imageTwo");
}
function moveright() {
    image.style.left = (x += 5) + "px";
}
</script>
</head>
<body onload="myOnload()">
<img src="image.jpg" id="imageTwo">
<a href="#" onclick="moveright();">Move right</a>
</body>
</html>

Don't forget to include your CSS, otherwise style.left might be ignored.

LaxLoafer 71 Posting Whiz in Training

HTTPS helps to prevent cookie theft by MITM attacks. However if a site has an XSS vulnerability the cookies can still be stolen. And if that site relied solely on a session cookie for authentication then an attacker could gain access to your account without needing to login.

LaxLoafer 71 Posting Whiz in Training

Try setting the CSS style to clear: left for the DIV elements on lines 1, 11, and the other one not shown in your snippet, i.e. the DIVs that are the immediate ancestors of the image tags.

LaxLoafer 71 Posting Whiz in Training

They should be available on python.org. Look for the x86 MSI installers.

http://www.python.org/download/releases/2.7.6/
http://www.python.org/download/releases/2.7.3/

LaxLoafer 71 Posting Whiz in Training

Line 16, document.getElementById("demo") is returning null. There is no element with the ID demo.

Insert something like <p id="demo"></p> at line 11 and you should find it'll work.

LaxLoafer 71 Posting Whiz in Training

The user-agent string contains the information you need. Using JavaScript you can access it through the browser's navigator object, e.g. navigator.userAgent.

LaxLoafer 71 Posting Whiz in Training

You might be able to disable directory browsing in your web server's configuration. Visitors should then see an HTTP 403 error page instead.

Another option would be to redirect requests for the URL to products.html, or some other page.

If a web server finds a default web page located in the directory it will serve that instead of a directory listing. Default web pages are typically named something like 'index.htm', 'default.aspx', or 'index.php'. It depends on your configuration.

So, if you wish to prevent visitors from browsing a directory, you might get away with simply dropping in an empty default page.

Which web server are you using?

LaxLoafer 71 Posting Whiz in Training

Hi M,

There are a variety of ways you can pass data between pages. Have you considered using cookies, session variables, query strings, or form requests?

Could you tell us which methods you have tried. Which methods do not match your requirement and why?

You may find Microsoft's ASP.NET Session State Overview page helpful.

LaxLoafer 71 Posting Whiz in Training

Taking ownership of a file owned by SYSTEM isn't normally a problem. Perhaps something is holding the file open? Have you tried booting into safe mode and attempting to take ownership?

If you succeed I expect you'll then need to assign some permissions, to allow you to delete the file, otherwise you would see an access denied error.

Did Gerbil's suggestion work out?

LaxLoafer 71 Posting Whiz in Training

You might need to take ownership of the file before you can delete it. Log in to a command prompt as administrator and type takeown /? to get more help.

LaxLoafer 71 Posting Whiz in Training

There's a C implementation in the Adobe PostScript SDK. Have a look on the developer site, under filters...

LaxLoafer 71 Posting Whiz in Training

Is that URL correct, or have the NSA squished it already? Doesn't seem to be working.

LaxLoafer 71 Posting Whiz in Training
LaxLoafer 71 Posting Whiz in Training

Someone I don't know was given an encrypted hard disk and a USB stick containing the keys. The hard disk had a glass platter. He was instructed to hide the USB stick somewhere safe, and 'accidentally' drop the hard disk if challenged. The glass platter would break and any data would be unrecoverable.

Unfortuantely it wasn't his lucky day, and when customs pulled him over he dropped the USB stick instead. I guess he must have been walking funny.

LaxLoafer 71 Posting Whiz in Training

Hi Beep

Have you checked the EXIF data? The x-resolution and y-resolution fields should match the image. If they don't, Windows Photo Viewer uses these values regardless and displays a squashed image.

This sort of problem can apparently occur when a photo is resized or rotated, typically with older image editing software. If the software doesn't recognize EXIF, or support asymmetrical resolutions, the EXIF data won't get updated appropriately.

A quick search on the Internet might suggest a tool that will batch fix the images for you, or report the correct EXIF information. Can anyone recommend a utility?

LaxLoafer 71 Posting Whiz in Training

You dont need anything. All you need is a text editor

I agree with Jorge, but I would like to recommend using an HTML/css editor instead. Although HTML and CSS can certainly be edited in a text editor, they don't generally provide useful features like HTML and CSS validation or code completion. A decent HTML editor can help you avoid the type of mistakes that beginners often make. It'll save you a lot of frustration.

LaxLoafer 71 Posting Whiz in Training

Hi Somjit

It's unnecessary to have a website in order to learn HTML and CSS. If you save web pages and style sheets to your local file system you should find any modern web browser is able to open them.

However there are some aspects of the web that are easier to learn if you have access to a web server. Without a server you may struggle with things like forms, cookies and AJAX requests.

Once you've got to grips with the basics of HTML and CSS, have a go at installing a web server locally. That way you can create your own websites locally, for free. As many as you like :-)

Two popular web servers are IIS and Apache, both of which are available for free.

LaxLoafer 71 Posting Whiz in Training

Hi Sania

ABCpdf installs itself to the global assembly cache (GAC) by default. Open up the Add Reference dialog, select the browse tab and navigate to...
C:\Windows\assembly\GAC_MSIL\ABCpdf\
There you should find a subfolder, named '8.1.1.6__a7a0b3f5184f2169' or similar, inside which is the ABCpdf DLL. Add it as a reference to your project.

Which version of Visual Studio are you using?

LaxLoafer 71 Posting Whiz in Training

Did you add a reference to the component from your Visual Studio project? Right-click on your project in the solution explorer and select 'Add reference...', look for WebSupergoo.ABCpdf under the .NET tab.

It's useful to include some namespaces also, so add the following to the top of your C# code file...

using WebSupergoo.ABCpdf8;
using WebSupergoo.ABCpdf8.Objects;
using WebSupergoo.ABCpdf8.Atoms;
using WebSupergoo.ABCpdf8.Operations;

or for VB.NET...

Imports WebSupergoo.ABCpdf8
Imports WebSupergoo.ABCpdf8.Objects
Imports WebSupergoo.ABCpdf8.Atoms
Imports WebSupergoo.ABCpdf8.Operations

The 'Getting Started' section of the documentation provides some further help.

LaxLoafer 71 Posting Whiz in Training

ABCpdf - it's a PDF component for ASP.NET, suitable for use in multi-threaded environments.

One way you could convert your ASPX page would be to simply pass the URL to the AddImageUrl function. Something like...

Doc theDoc = new Doc();
theDoc.AddImageUrl("http://www.example.com/somepage.aspx");
theDoc.Save(Server.MapPath("htmlimport.pdf"));
theDoc.Clear();

There's a slightly more complex multi-page example to be found in the product documentation, written in C# and VB.NET

The component makes use of the Trident and Gecko rendering engines, so the PDF generated should match what you'd expect to see in Internet Explorer or FireFox. If you want to find out immediately how ABCpdf will render your web page, try out the online demonstration - no need to install anything.

Disclosures, past and present: see profile ;-)

LaxLoafer 71 Posting Whiz in Training

Hi Tumbleweedracef

Have you tried running IE in safe mode?

This'll ensure all add-ons are prevented from loading. If the problem disappears in safe mode then it would suggest an add-on issue; in which case you could try disabling the add-ons in turn until the culprit is found.

To start IE in safe mode press Windows Key + R, type 'iexplore -extoff', then press enter.

Have a go at visiting the sites while in safe mode and let us know what you see.

Another possibility, albeit a longshot, it might be worth checking to see if a sticking keyboard or mouse button is the cause.

LaxLoafer 71 Posting Whiz in Training

In some instances, yes.

Clicking on a hypertext link sends a GET request. The following link and form send similar requests...

<a href="/somescript.php?id=123>Go get it!</a>

<form name="form1" method="GET" action="/somescript.php" >
<input name="id" type="text" value="123" />
<input type="submit" />
</form>

Hypertext links don't send POST requests, although there are ways to trigger a POST request with the help of JavaScript and AJAX. You probably wouldn't want to go down that road if you needed to ensure the behavior of the link remains consistent. What might happen if someone visits your site with JavaScript disabled in their client?

LaxLoafer 71 Posting Whiz in Training

They're called Sitelinks...

Google decides which of your URLs are eligible, and when they show.

It's not possible to specify links should appear, AFAIK. However, if you wish to prevent certain links from appearing, Google Webmaster Tools will enable you to this.

LaxLoafer 71 Posting Whiz in Training

Hi Feblioz

It's not immediately obvious what's wrong.

However, there are quite a few errors in you code that perhaps you need to correct first...

  • Your 'a' tags are not properly closed
  • Left and Right are not valid elements for HTML
  • The stylesheet might not be applied in quite the way you expect, e.g. consider "#threeCols left, #threeCols centre {", instead of "threeCols left, center {".

Did you create the code in notepad? You may find it easier to work in a dedicated HTML editor with support for HTML and CSS validation.

LaxLoafer 71 Posting Whiz in Training

... when i tried to change the permissions i get "access is denied"

If you're unable to change permissions as an administrator, you possibly need to take ownership of the folder first.

Folder properties > Security tab > Advanced > Owner tab > Edit...

LaxLoafer 71 Posting Whiz in Training

XML has it's uses, even as a simple database.

One advantage is that an XML file is generally easier to fix than a corrupt database.

The format is also platform independent, so sould you later decide to switch from Apache to IIS, or Windows to Linux, you can use the exact same file.

From a security perspective, XML is a plain text format. Anyone with read access will be able to view the file contents. If you don't wish to make the file publicly visible, apply security permissions. Best to avoid placing it in your public HTML folder ;-)

LaxLoafer 71 Posting Whiz in Training

Geoff,

What I believe you're attempting to do is usually best done without the use of JavaScript.

Using style sheets it's possible to assign a background image to an 'a' element. You can also specify the color of the link when a mouse hovers over with the :hover CSS Pseudo class...

This should work on all modern browsers.

Have a look at the following example. Let us know if it doesn't match what you're hoping to achieve.

<html>
<head>
<title></title>
<style type="text/css">
a.button {
	background: url(graphics/industry_button.jpg);
	display: block;
	width: 133px;
	height: 30px;
	color: Red;
}

a.button:hover {
	color: #066;
}
</style>
</head>
<body>
	<a class="button" href="industry.php">Industry</a>
</body>
</html>
LaxLoafer 71 Posting Whiz in Training

Gotboots,

Your code looks great, but there are quite a few errors...

  • Your function 'margin()' is missing a closing curly brace '}'.
  • 'onupdate' isn't an input element event, AFAIK. Try 'onchange' instead.
  • The input element values are of type string, so your conditional test will not work as expected. Try converting the strings to integer values with the parseInt() function, e.g. var LIST = parseInt(document.getElementById("list").value);
  • Note that javascript statements end with a semicolon. You're missing about three.

The doctype declaration in your HTML isn't quite right too. Which development environment are you using? Find one that supports syntax checking, HTML validation, and code completion. This'll help you to reduce errors and should make learning HTML or JavaScript a little easier.

LaxLoafer 71 Posting Whiz in Training

Willy,

Your code is calling document.write() after the page has finished loading. This will quite likely invalidate the HTML document tree. You browser would not have been expecting further data, so could this explain the problem you're seeing?

One possible solution would be to create another element. If you give the element an 'id', you'll then be able to reference it later on, by using document.getElementById(), and update the content of that element. That way you'll keep the structure of your HTML document intact.

For example:

<html>
<head>
<title></title>
<script type="text/javascript">
    function adding() {
        var p = document.getElementById('p1');
        p.innerHTML = "some result";
    }
</script>
</head>
<body>
<p onclick="adding(); return false;">Click to display result</p>
<p id="p1"></p>
</body>
</html>
LaxLoafer 71 Posting Whiz in Training

You'll find the name of the browser's layout engine is typically included in the user-agent string. Using Javascript you can access this through the navigator object. See: navigator.userAgent

To redirect to another URI you can set window.location...

So, your code might look something a little like this:

<script type="text/javascript">
    if (navigator.userAgent.indexOf('Gecko') > 0)
        window.location = "http://www.example.com";
</script>

Be aware it is possible for the user agent string to be faked. If your browser detection needs to be more resilient then you may want to research 'browser sniffing'.

It's likely there are already scripts that will do this for you and freely available to use. Unfortunately I don't have one to suggest at this time. Apologies.

LaxLoafer 71 Posting Whiz in Training

Hi Riswan

You'll need a web server in order to process Active Server Pages (ASP).

Microsoft's web server is part of Internet Information Services (IIS). This is usually installed to server editions of Microsoft operating systems, such as Windows 2008. It'll work on Windows 7 also, and should be adequate for development purposes, but suspect there are limitations that might make it unsuitable for demanding enterprise applications.

IIS is not installed on Windows 7 by default. You can find out how to install and configure it on Microsoft's TechNet here...

To get started in writing ASP scripts, I would suggest installing Visual Web Developer Express, which is available for free from Microsoft. You'll find the installation includes a development web server that requires little or no configuration, which should help you to get up to speed.

Note that ASP and ASP.NET are two different languages. ASP.NET is a newer scripting language, based on the .NET Framework, and integrates better with newer versions of IIS. ASP on the other hand uses good old COM.

LaxLoafer 71 Posting Whiz in Training

Oops - I've posted twice :-(
Can this one be deleted?

LaxLoafer 71 Posting Whiz in Training

Hi Vinaysrk

The TimeSpan.Parse() method accepts strings representing timespans, not dates. The format for timespans is documented here on MSDN:

TimeSpan.Parse Method (String)

I notice also in line 4 of your code you're attempting to assign a TimeSpan to a string. You'll get a "Cannot implicitly convert type" error message at compile time.

Assuming date1 and date2 actually contain dates, I think your code should use the DateTime structure and look something like this:

DateTime date1 = DateTime.Parse(TextBox1.Text);
DateTime date2 = DateTime.Parse(TextBox2.Text);
TimeSpan ts = date1 - date2;
TextBox3.Text = ts.ToString();

DateTime.Parse will thow exceptions if an invalid date is entered, so you'll want to catch this, unless you're 100% sure the user is never going to enter an invalid date.

LaxLoafer 71 Posting Whiz in Training

Thanks but..
I've tried the following in DOS:
I copied the same name of that file and paste it in the DOS and used it in the ren command like this:
ren K:\AL JAMAL FE AL ISLAMÿÿÿÿ[2011-08-01-15-29-10].ts newFile.ts
I also tried the rename command..
Nevertheless, nothing went okay!
I always got the following message:
The syntax of the command is incorrect.
(I've attached an image of what I've done on MS-DOS)
Thanks in advance.

MeOnly,

The message in your screen grab reads "The syntax of the command is incorrect". You're seeing this error because the ren command is expecting two parameters only. You need to enclose the filenames in quotation marks if the string contain spaces.

However, this won't solve the problem because the filename contains an illegal character, between the "ÿÿÿÿ" and opening square bracket.

Give DOS another chance. Try this from the command line...

Type "DIR /X". This will reveal the filename's short DOS name. Yay!

On my system it looks something like this:
2011-07-09 19:36 1,032 ALJAMA~1.TS AL JAMAL FE AL ISLAMÿÿÿÿ[2011-08-01-15-29-10].ts

Note the short 8.3 format name. From the command line again, see if you can then rename it:

REN ALJAMA~1.TS newFile.ts

jingda commented: Excellent Help +10