MattEvans 473 Veteran Poster Team Colleague Featured Poster

I suppose, you could do it by writing some code that sends all post requests from one site to the other site, for both sites. You might end up with heavy duplication (every post will be saved at both sites).

Perhaps you'd be better off using a third (data) server or picking a primary (site + data) server, and holding only short references to posts on the other (site) server(s). Then, when a site displays a post, it requests the appropriate information from the primary/data server.

It'd require some careful thought; there's a number of technologies you could use to setup communication between the servers, and a number of ways you could store the information.

You might suffer a load-time disadvantage if you're having to connect to a remote location /read from a remote location every time you have to serve a request; not to mention a much bigger security concern.

By far, the most efficient way is to park multiple domains into one big server (all the data is on the same physical computer so sharing is easy; but there appears to be more than one site), or to use a number of servers in the same physical location with a protected local connection between them.

As you consider such things, it gets more and more costly...

iFrames could work =P

MattEvans 473 Veteran Poster Team Colleague Featured Poster

- Buy a mobile phone with WAP and use that in school.

or

- If you have a legitmate educational reason to use a site, ask why it's blocked and if it can be un-blocked.

or

- I won't be held accountable for the type of advice I'd give otherwise, so I won't give any.. But if you're really persistant, you'll find a way ^_-

MattEvans 473 Veteran Poster Team Colleague Featured Poster

you can turn them off on the table tag itself:

<table border="0"><tr><td>etc</td></tr></table>
[B](this will turn off the border throughout that table)[/B]

or with CSS:

table
{
    border-style:none;
}
[B](this will disable borders for all tables on a page that includes that rule)[/B]

I prefer to do it manually (first example) on all tables, and then turn them on where I want them with CSS.

The partial borders happen when you have cells without data in them.. if you wanted an unbroken border, just put this into otherwise empty cells:

&nbsp;

It will force the cell to 'exist' and be rendered with a proper border.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

The only problem I can see on the face of it is that you defined the get function as taking two parameters and you're only calling it with one parameter...

That doesn't usually cause a problem (Javascript is quite forgiving), but it's worth checking.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Do you really think VB script in a browser is going to be allowed unrestricted access to the FileSystemObject? Or any kind of file/network interface access for that matter.

That might work as a desktop VBScript application; but I'm sure even I.E would notice you're trying to do something potentially dangerous if you put that on a webpage.

I know you're just trying to print and it seems quite harmless, but if IE allowed you, as a web developer, to have access to a user's filesystem or the windows script host, it wouldn't be able to reliably stop you doing what you pleased with either of them. Because of that, you'll likely find that attempting to access either of them on any level is made illegal.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

I've removed a couple of your rows for the purpose of demonstration, code follows this explanation.

Some things to look at:

- Each input has a new name, the name is either "qty", "price", "total" (etc) followed by a number that represents the row's index.
- The calls to the function total() are now calls to row_total(row), where row is the index of the row that needs to be recalculated.
- A new function 'grand_total()' calculates the grand total after each row total is recalculated.. i don't know whether you needed that but it looked like you were perhaps trying to do it. For the benefit of that function; the constant NUM_ROWS is defined as being the count of rows in the table.
- There is no error checking - This is important to consider because if you enter non-numeric data where numeric data is expected, you'll get funny NaN (not a number) entries in your totals, and they will propogate into the grand total field.

Code's been tested on Opera 9 and Firefox 2. Can't test it on IE because I'm not a Windows user.

Post back if you need more help.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<script>
var ROW_COUNT = 3;
function total_row(row)
{
   var qty = parseFloat(document.procure["qty"+row].value);
   var unitprice = parseFloat(document.procure["price"+row].value);
   document.procure["total"+row].value = qty*unitprice;
	 total_grand();
}
function total_grand()
{
	var sum = 0;
	for(var i = 1; i <= ROW_COUNT; i++)
	{
		var row_total = …
MattEvans 473 Veteran Poster Team Colleague Featured Poster

But... I suppose this is about the best sort of protective means you'll get with protecting interpretted code:

http://en.wikipedia.org/wiki/Obfuscation
http://en.wikipedia.org/wiki/Obfuscated_code


http://www.raizlabs.com/software/phpobfuscator/

MattEvans 473 Veteran Poster Team Colleague Featured Poster

1)I have my hesitations about my web code being revealed to everyone through the "view page source" feature of web browsers. Apparently the source review may reveal quite a few hints that affect security. Is there a way to prevent people from seeing this?

- Don't implement any kind of security using javascript, implement it at the server. The source for serverside scripts is never shown in a View Source, and can't be seen unless your server is compromised or you have lax protection/errors there.

2)Being a web developer (especially PHP) I would like to know how I can restrict my programs to run on specific domains only. In this way if someone steals my code he can not deploy it on his server.

As MidiMagic said; if someone steals your code, they're clearly going to remove any protection you've added to it.

In PHP you've got very little hope of effective code protection, but even if you have a compiled program, it's going to be crackable in some way or another.

Better to just be proud if people want to use your creations than to spend too much effort getting tied up in trying to make them inpenetrable.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

what code have you got? if you post what you have so far, it'd be easier to understand what your trying to do.

if you use a naming (identifying) convention, it might help, if you pass in parameters to your function that differ for each row it might help, if you bind the javascript event handlers at runtime rather than specifying them using HTML attributes it might help, but... without seeing some code it's hard to give useful pointers.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

You can do it only with php.

You can do it with any serverside language, and any client side script should be able to get the query string indirectly from the page URL.

PHP does it through Zend, which does it through C++; and it's delivered into an application's environment by the server software; so clearly, you can access it using other means than only PHP.

I'm sure you meant something different; and I don't mean to bite your head off; but there's a full wealth of ways in which you can access that data, PHP is one way to do it.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Well, it worked ok.

Here's the code I ran:

<html>
<head>
<title>Javascript test...</title>
<script type="text/javascript">
function addPullquote()
{
  var myTextArea = document.getElementById("commentBox");
  myTextArea.value = myTextArea.value + '[dohtml]<p class="pullquote">This is your pullquote.</p>[/dohtml]';
}
</script>
</head>
<body>

<textarea id="commentBox" cols="80" rows="40">

</textarea>

<button onclick="addPullquote();">Add quote</button>

</body>
</html>

Make sure:
- You give the textarea an ID and not just a name (and make sure the id is identical on the textarea and the document.getElementById() statement, the case is important to)
- You put the script in the <head> section
- You remember nested quoting rules !
- You don't make javascript statements span multiple lines.. It might be the way you pasted it there, but if your javascript statement is like:

myTextArea.value = myTextArea.value + '[dohtml]<p class='pullquote'>
This is your pullquote. 
</p>
[/dohtml]';

The fact that the statement spans more than one line when it's not expected to will cause it to fail.

(If you wanted multiple lines in plaintext output [which you might in a textarea], you could use this escape character: '\n' to do that.)

Any luck now?

MattEvans 473 Veteran Poster Team Colleague Featured Poster

No.. You should put a type="text/css" attribute in the <style> tag, in order to comply with guidelines and the like.

Most browsers don't give a stuffing about the type of <script> tags and <style> tags. They make a default assumption that <script> is javascript and <style> is CSS. But hey. you should conform to guidelines, that assumption might not always be the case.

You could also specify the type of all script and style on a page using:

Metatags! (or real HTTP headers)
<meta http-equiv="Content-Script-Type" content="text/javascript" >
<meta http-equiv="Content-Style-Type" content="text/css" >

However, that won't help you much here, it won't make a difference to the Javascript, which incedently is correctly typed (even thought text/javasript isn't a valid MIME type atall ^_-)

With regard to your javascript, I'm gonna give it a test run and let you know the results.. will post back in 5 mins,,

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Heck I still like the center tag.

I see it as a bonus of sorts, if a page looks as close as possible to how it looks with a stylesheet as it does without one.

So, I've started CSS-aligning blocks, then putting center tags inside, then putting data.

Q: Hey isn't that terrible for accessibility?! people might not want to see your titles/subtitles/copyright statements in the middle of their page?
A: Well, they didn't have to click to my site ^_-

MattEvans 473 Veteran Poster Team Colleague Featured Poster

I won't claim to know exactly why it won't work, and I don't know how you could make it work in that way.

However; a flash .swf file is not an image file. To put a flash object on a page, you have to have to 'embed' it on a page. Using an actual 'embed' tag work in most cases sometimes, but the apparent 'correct' way is to use 'object' tags.

The best way is to use embed tags inside object elements, because 'object' does some compatibiity delegation. (so if object fails, embed should work)

Linking a flash file from an image tag (equivelent to putting it as a background image in CSS) will not work; in the same way as linking an html file to an 'image' tag's src won't work. The browser expects the response to looking for that source image to return an image type result, if it doesn't find one, it treats it as it would if nothing was at that location. (Note: If the flash file identified itself as an image type, it wouldn't be processed as a flash movie,)

If you know how to embed flash movies on a page, and just want objects to appear on top of it (as if it was a background), you might have some sucess with absolutely positioned elements 'on top' of the movie. That's quite a detailed subject in itself, but as a snippet:

<html>
<body style="margin:0;padding:0">
<embed src="your_flash.swf" type="application/x-shockwave-flash"/>
<div style="color:white;position:absolute;left:0;top:0;"> …
mattyd commented: help with Flash\\ ;) +3
MattEvans 473 Veteran Poster Team Colleague Featured Poster
<script type="text/javascript">
function addPullquote(){
  var myTextArea = document.getElementById("commentBox");
  myTextArea.value = myTextArea.value + '[dohtml]<p class='pullquote'>
This is your pullquote. 
</p>
[/dohtml]';
}
</script>

You have another quote-nesting problem =P:

myTextArea.value = myTextArea.value + '[dohtml]<p class='pullquote'>This is your pullquote. </p>[/dohtml]';

You cannot put the same kind of unescaped quote in a quoted block as is being used to quote the block. To solve:

myTextArea.value = myTextArea.value + "[dohtml]<p class='pullquote'>This is your pullquote. </p>[/dohtml]";

or

myTextArea.value = myTextArea.value + '[dohtml]<p class="pullquote">This is your pullquote. </p>[/dohtml]';

or

myTextArea.value = myTextArea.value + '[dohtml]<p class=\'pullquote\'>This is your pullquote. </p>[/dohtml]';
([B]if you're using this with that forum software that eats backslashes, do this instead:[/B]
myTextArea.value = myTextArea.value + '[dohtml]<p class=\\'pullquote\\'>This is your pullquote. </p>[/dohtml]';
)

or (last one)

myTextArea.value = myTextArea.value + "[dohtml]<p class=\"pullquote\">This is your pullquote. </p>[/dohtml]";
([B]this one for that forum software again:[/B]
myTextArea.value = myTextArea.value + "[dohtml]<p class=\\"pullquote\\">This is your pullquote. </p>[/dohtml]";
)

See if that helps ^_-

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Well, stuff I've been reading about this says the PHP type is application/x-httpd-php rather than x-mapp-php4 ... however, your server could be configured differently..

http://www.spiderpro.com/bu/buphph001.html
http://snippets.dzone.com/posts/show/459

So, I'd try:

AddType application/x-httpd-php .php .htm

and if that's still failing:

AddHandler application/x-httpd-php .htm
MattEvans 473 Veteran Poster Team Colleague Featured Poster

If you know where PHP is installed; you could try something like:

AddType temp/php .html .htm
Action temp/php /usr/bin/php

where the red path is the absolute path to the PHP executable on your server.

Depending on how PHP is configured to determine the source file; you might even be able to use funky stuff like this to direct a *.htm file to a processing executable:

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*)\.htm /usr/bin/php [L]

again, you need to know the path to the PHP executable.

With Apache .htaccess files, if there's some 'almost critical' mistake in the file, it can cause other parts of the file to not be applied; so not being able to see the server error log is a bit of a downer.

One thing you might want to try... if you only want the .htm files to be processed as PHP, make the error pages .html (that shouldn't be causing a problem though).

EDIT: Alternatively.....

...

Try this:

AddHandler x-httpd-php htm

Instead of the AddType.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Not Quite Resolved! :( Whats wrong with back slash? The code works in testbed but wont cop the backslash on my board (ipb) ?

Hmm... perhaps your board software is looking for escaped characters and eating them.. o_O

try either:

document.write("<a href=\\"" + link[random_num] + "\\" target=\\"_blank\\">");
document.write("<img src=\\"" + image[random_num] + "\\" border=\\"0\\"></a>");

(double backslash should be escaped to backslash by your board software which can then go on to be the javascript escape character when the page is rendered)

or (my prefered way):

document.write('<a href="' + link[random_num] + '" target="_blank">');
document.write('<img src="' + image[random_num] + '" border="0"></a>');

(all literal strings in the Javascript are quoted with single quote characters, and attributes in the dynamically created elements are quoted with double quote characters :- escaping doesn't matter)

MattEvans 473 Veteran Poster Team Colleague Featured Poster

try changing:

cellText.onClick="return changestatus(this,this.parentNode,document.form_enc);"

to:

cellText.onclick=function(){return changestatus(this,this.parentNode,document.form_enc);};

That's a weird error message though... You tend to get that error (in firefox) when you try and access html elements out of context (i.e. without a <html><body> /etc around them), or when you try to access 'null' elements or null returns...

What exactly does the error say?

MattEvans 473 Veteran Poster Team Colleague Featured Poster

target = "_blank" should work.

change:

document.write("<a href=\"" + link[random_num] + "\">");

to

document.write("<a href=\"" + link[random_num] + "\" target=\"_blank\">");
MattEvans 473 Veteran Poster Team Colleague Featured Poster

I use any (free + linux) markup-highlighting text editor [at the moment Kate].. and Opera for debugging strangely enough. Firefox can be useful sometimes

MattEvans 473 Veteran Poster Team Colleague Featured Poster

If you just 'return' a stored zip file or other file to a browser, you don't have to do anything. For example, if a user visits:

http://www.example.com/example.zip

The zip file will ordinarily be handled by the browser's MIME configuration, and the user will be allowed to download it.

However. If your server's MIME handler configuration is messed up, then the server might try to process the file internally, or send the file as if it were page content. You'd have to talk to your hosting provider or look in your server software manual and tell the server NOT try to try to handle zip files, but send them with a valid MIME type.

If you're 'creating' zip data and sending it back from a request, you would need to specify a Content-Type header that described the content =P

MattEvans 473 Veteran Poster Team Colleague Featured Poster

That isn't neccessarily enough.

The Content-type header is truely specified in the head of a HTTP response, not the head of the HTML page. That META tag might result in some subtle changes to a page as it's rendered as HTML, but infact, a page has to be interpretted as (at-least) XML for that META tag to ever get processed.

If your server is sending a HTTP response header of text/plain, followed by HTML code; your page will not be rendered or processed as HTML.

If you could be clearer in your problem (an online example would be useful), then it would be easier to understand what's actually happening.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

I think I misunderstood your original question.

If you're output when viewing a page in the browser is plain text (i.e. not formatted at-all as HTML), then there's a couple of potential reasons:

- the page isn't saved with an extension that maps to the HTML mime type (*.html, *.htm are good choices; *.txt is not). EDIT: if your page is created from a VB.NET application, ignore that reason.

- the page is being sent with an incorrect Content-Type header (a correct Content-Type is text/html, a bad one is text/plain)

Do you have an accessible (online) version of the page?

MattEvans 473 Veteran Poster Team Colleague Featured Poster

For the 'special characters' you might want to try escaping them into HTML entities; or using a different page encoding.

If you don't have too many 'special characters' you can escape them as according to the following table:

http://www.htmlhelp.com/reference/html40/entities/

(There's 3 page of tables [lots of special characters])

If you need to change the encoding (you're using a non-latin character set and, in that case, you have loads of 'special characters') check this out ..

http://www.w3.org/TR/html4/charset.html#h-5.2.1

I'm not sure about the HYPERLINK question.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Try <td valign="middle" ...etc> instead of <tr valign="middle" ... etc> ... alternatively; try the vertical-align: CSS property (on the TD again).

MattEvans 473 Veteran Poster Team Colleague Featured Poster

The best way to get around 'running out' of body onload space is to handle it using a custom function; an even better way is picking some sort of add event handler policy (using custom functions) and adhering to it..

A sneaky cheat way is to add extra empty body sections after your main body section and put onload events in them.. that may not work on XHTML browsers... but I don't think there could be a rule against it in the XHTML schema ^_-

The reason alot of things want to be in body onload is because body onload means 'do this when the page has finished loading'. that's a good thing from two perspectives.
- firstly, it eliminates the risk of javascript DOM methods failing and giving cryptic errors because elements don't exist yet.
- secondly, it means that the page can be fully loaded (and viewable by a user) before a potentially lengthly javascript process is invoked.

if you don't want the page to be fully loaded before doing something; you could use body onbeforeload="". but that might screw with javascript + HTML DOM interaction on some browsers. if you're careful, you can use inline javascript;
but there's a number of script/object ordering rules you should follow...

[B]Order 1[/B]
<html><body>
<div id="test">
<script>
document.getElementById("test").innerHTML = "hello";
</script>
</div>
</body></html>
[B]Works OK (opera and firefox). HOWEVER, I'm not sure if all of the properties of the DIV should or could be …
MattEvans 473 Veteran Poster Team Colleague Featured Poster

Am I even in the right forum??

Not really, but I can't think of a better one...

If you have access to it, is there anything in your Apache error log? That can often be helpful.

I'm assuming you did all the standard stuff, like saving the .htaccess file directly in your public_html or htdocs folder?

You also might want to try:

AddType x-mapp-php4 .html
AddType x-mapp-php4 .htm

instead of putting it on one line...

The error log file will definately be helpful for working out what the problem is... Most virtual hosting plans let you see your part of the server error log, if you're running Apache yourself, it's easy to find ([apache directory]/logs/error_log)

MattEvans 473 Veteran Poster Team Colleague Featured Poster

that bit of XSLT will still match to the root node; regardless of its namespace. I'd put:

<xsl:template match="/">
  <xsl:apply-templates select="*"/> 
</xsl:template>

or do some processing within that block..; without a select or name on the <apply-templates/> node, I think that's an illegal instruction.

If you have undeclared namespaces; some XSLT processors will fail. If you take those xmlns attributes out; then any 'xsi' or 'xpdl' nodes in your document will be illegal...

MattEvans 473 Veteran Poster Team Colleague Featured Poster

ah.. it wont do that for you automatically. it will only be able to work out the person viewing a page's browser..

if you want to asociate forum users with their browsers... you'll have to hack your forum program.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

...a search for my name on Google (without a space, [as my display name]); puts something related to me on the top of page 2 of the results; two things infact; and something on page 3 aswell.

All those other MattEvans had better watch out... ;)

If I'd signed up with a silly name like "ImmortalWarrior" (don't laugh, I used that name for years); it wouldn't be much of an acolade, but it's my real name!

I think I'm gonna tell that too everyone I meet from now.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

It can be done with PHP. It'll be (quite) alot of PHP.

Searching for keywords would be done best at the point where your forum program receives and saves posts; you can check any new post against keywords for subscribers and issue mail to people who are interested there and then.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Personally, I'd lose the document.write():

<html>
<head>
<script type="text/javascript">
  function showBrowserLogo()
  {
    var strBrowserId = navigator.userAgent;
    var strImage = "";
    
    alert(strBrowserId);
    
    if (strBrowserId.indexOf("Mozilla")!=-1 && strBrowserId.indexOf("Firefox")!=-1) 
    {
      strImage="http://firefox.iprakash.com/images/browser_icons/firefox";
    }
    else if (strBrowserId.indexOf("Netscape")!=-1) 
    {
      strImage="http://ca.ku.ac.th/images/netscape-icon.gif";
    }
    else if (strBrowserId.indexOf("Opera")!=-1) 
    {
      strImage="http://www.dw-bg.com/img/opera_23_20.jpg";
    }
    else if (strBrowserId.indexOf("MSIE")!=-1) 
    {
      strImage="http://www.aulapublica.com/categorias/Internet%20explorer.jpg";
    }
  
    var objImage = document.getElementById('browser_logo');
  
    objImage.src = strImage;
  
    return;
  }
</script>
</head>
<body>
<img src="" id="browser_logo"/>
<script type="text/javascript">
showBrowserLogo();
</script>
</body>
</html>

I would also try and get the 'script' section I've put within the body into the body onload event (on that example it's easy =

<body onload="showBrowserLogo();">
<img src="" id="browser_logo"/>
</body>

)

That may come out better because (most) browsers always call the onload event when a page loads or reloads, (and browsers that don't remember the JS/DOM state of pages)

MattEvans 473 Veteran Poster Team Colleague Featured Poster

The easiest way is to identify the inputs rather than name them:

<html>
    <body>
        <script language="javascript">
            function Function1() { document.getElementById('TextBox').value = "You clicked the first button.";}
            function Function2() { document.getElementById('TextBox').value = "You clicked the second button.";}
        </script>
        <input type="text"  [b]id="TextBox"[/b] name="TextBox"  value="This is the text box."><br>
        <input type="button" name="Button1" value="Button 1" onClick="Function1();">
        <input type="button" name="Button2" value="Button 2" onClick="Function2();">
    </body>
</html>

Those 'id' attributes have got to be unique.

There are other ways to get at objects that aren't id'ed; see this page:

http://www.pageresource.com/dhtml/ryan/part4-2.html

MattEvans 473 Veteran Poster Team Colleague Featured Poster

I think the poster wants 'rotating' (as in dynamically chosen) information rather than 'rotating' (as in rotary motion) etcs.

If you use Javascript to do this, you have to 'dupe' search engines (and non-JS browsers) by presenting at least one valid block of information by default. You can then use JS to 'swap' that block with a randomly chosen block when the page has loaded. You could probably do that with an iFrame even, to limit the need to type HTML into .js includes. There's better ways than using iFrames, but it's certainly possible.

Ideally, you'd want to do this on the server side (using PHP/ASP or similar) to present slightly different pages/pieces of content for a request based on a random number.

You shouldn't see any decline from an SEO perspective if you're doing this serverside (although you wont be able to guarantee which page version is indexed at any time). With the JS version, you'll only suffer if you don't present default (JS disabled) information, or if you don't neccessarily want the default information to be indexed.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

You can run an executable on the server machine; but not on the client's machine.

VB probably isn't so common as a serverside application language; but hey, it could work.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

It depends. It can be done in Javascript or using a serverside language.

Which would you rather do?

For reference, that part of the URL is called the 'query string'.

Server side langauges often have simplified interfaces to access the 'variables' in a query string. Javascript has no such interface; but it is possible to get reference to the entire URL of a page (address + query string), and to split that down into its component parts.

An example is here:

http://www.activsoftware.com/code_samples/code.cfm/CodeID/59/JavaScript/Get_Query_String_variables_in_JavaScript

(That's a somewhat wasteful procedure if you want to repeatadly get at the different variables in a query string; but its not too bad if you have alot of potential variables and are only interested in a few of them)

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Can someone tell me how to load the welcome page not in a frame (of the login page) but in the entire window

Yep.

Don't use frames.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

You may would like to try

our $MY_VARIABLE_AS_CONSTANT;

That's pretty much what I ended up doing; I like the 'keyword' appearance of constants though.

like STATUS_ERROR instead of $STATUS_ERROR :lol:

the other option is to have a package that exports functions in main:: namespace.

I tried something similar; to have a package that returns the STATUS_ERROR constant from a get_error_status() function, and check it with an is_error_status($) function.

That got hella convuluted after a while.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

AAhhahh...

I noticed my copy constructor for XMLOpen was being called quite regularly; I hadn't used any reserve() value in the 'openers' vector.

My copy constructor deliberately anulls the pointer to the 'next' item in each Segment.. so somehow avoiding uncontrolled copying of the XMLOpen segments fixes the problem.

That needs looking into definately... But at least I'm not staring blankly at the screen wondering what's going on..

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Hm, I should add my test cases:

The first test is a manual setup without holding any information about the chain sequence:

Segment root;
XMLOpen o("hello");
root.setNext(&o);
XMLOpen o2("goodbye");
o.setNext(&o2);
root.fromHere();

This gives the output below:

This (0xbffff4a0)[Must be overriden] takes next(0xbffff480)[<hello >]
This (0xbffff480)[<hello >] takes next(0xbffff450)[<goodbye >]
Must be overriden<hello ><goodbye >

Blue parts are debugging information from the getNext() function; the red line is the actual output. 'Must be overidden' is the standard output from a Segment.

This is the test using the XMLChain (which is neccessary)

XMLChain chain;
chain.open("hello");
chain.open("goodbye");

chain.output();
This (0xbffff420)[Must be overriden] takes next(0x804f510)[<hello >]
This (0x804f510)[Must be overriden] takes next(0x804f704)[<goodbye >]
Must be overridenMust be overriden<goodbye >

Round brackets are memory addresses, square brackets are the Segment's current contents.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Relevant header definitions are as:

class XMLChain
{
	private:
		Segment root;
		std::vector<XMLOpen*> chain;
		Segment * immediate;
		std::vector<XMLOpen> openers;

The function in question is:

void XMLChain::open(std::string tag)
{
	Segment * last_immediate = immediate;
	openers.push_back( XMLOpen ( tag ) );
	XMLOpen * cast_immediate = &(openers.back());
	(*last_immediate).setNext( cast_immediate );
	immediate = cast_immediate;
	return;
}

Considerations are:

- XMLOpen is a subclass of Segment

My problem is:

Calling XMLChain::open one time has the desired effect; that is;

- the 'immediate' pointer is derived (which references the last Segment of any type to be created into an XMLChain).
- an XMLOpen segment is created and placed to the back of the 'openers' vector.
- the address of the backend of the openers vector is sent to the reference of the immediate pointer via 'setNext()'; this means that the last Segment sees the new XMLOpen Segment as the 'next' part of its output sequence.
- a pointer to the new XMLOpen address replaces the immediate pointer; for next time

However. Calling XMLChain::open again causes the last XMLOpen Segment to be treated as if it were an unextended Segment when I check the output (Segments are like a linked list, with each subclass having a specialized constructor and std::string output() function). The same happens on the next and subsequent attempts to call XMLChain::open; that is, the 'root' Segment has a line of Segments down to the last added Segment subclass, which is treated as if it were …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Sorry; the function name there is unloadAllJS not hideAllJS...

But..

It actually wont hide JS from the View Source in most browsers, Most browsers display the source code of the HTML page exactly as it was received (that is, irrespective of what Javascript subsequently does to the page)

The only thing it will hide is the display of Javascript elements in live DOM explorers like that which comes with Firefox... If you really want to hide JS functions; you should put them all in linked .js files and use the same kind of hotlink protection you would for images (conditional redirection at the server)

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Sort of; but if you don't wish people to see the links, you probably should not put them on the Internet... If you want to restrict certain people from accessing the links; encrypting page content isn't the best way to go about it.

Do you want spiders to not see the links; or people to not to see the links?

Search spiders are like very fast people on very low-end browsers capable of following every link on your site, probably simultaneuosly. If you don't link to things; spiders can't see them. If you make your links difficult for a person to follow; spiders will find them difficult to follow. There's ways to stop spiders following links; and it's alot easier to stop (amicable) spiders from following links than it is to stop people following them.

Providing that enough of your page can be interpretted by a person on a browser without client-side-scripts; (even better, if it can be interpretted by looking at the source of the page as it is from the 'View Source' button); and providing that content is considered acceptable to the search engine's rules; then your pages will be indexed in some way.

If your page when viewed from the 'View Source' button is an unintelligable mix of encrypted HTML code; search spiders wouldn't understand it.

To answer your question (very generally); if you (effectively) stop users from seeing something, you stop spiders from seeing it to. If you stop spiders from …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

That's not really an error so to speak; it's a message that says is "I looked at the URL http://www.cityofchicago.org/csrinterface/request to find a schema document to validate/process nodes under the namespace declared to conform to this schema; and I couldn't find one.)

If you change process specific namespaces to look for that URL as the schema, that would very probably cause an error. If you're just using a namespace to visually categorise a load of (your own) nodes; that's less likely to be critical; but you should probably define a valid schema for them to conform to.

Did an actual error occur?

MattEvans 473 Veteran Poster Team Colleague Featured Poster

you will have to add to the body onload event to call that function.

put the code within a script tag in the head section and change the opening body tag to say:

<body onload="hideAllJS();">

if you've allready got some functions called in body onload; do this:

<body onload="exampleFunction1(); exampleFunction2(); exampleFunctionETC();  hideAllJS();">

calling that function from any place other than body onload (which is called supposadly 'after' all loading has occured) may either have a detrimental effect on JS functions within a page; or fail to remove certain blocks.

MattEvans 473 Veteran Poster Team Colleague Featured Poster

The important thing is how (and even more importantly when) you decrypt your page. If your page content is decrypted using javascript or other client-side means; then, because most search engines don't process client side scripts; your page wil not be indexed with relevant content.

If you decrypt during a server side operation, or use an encrypted transfer protocol (like SSL); and basically providing your page ends up as decrypted source being delivered as a result of a request; then search spiders won't know the difference.

If you're encrypting page content for any reason other than 'hiding the source code', then why do you want the pages to be indexed in search engines?

MattEvans 473 Veteran Poster Team Colleague Featured Poster

My Firefox identifies itself as:

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0

So if you remove the 'Mozilla' or the 'Firefox' from your first if condition; it works ok. To be sure; go with:

if ((navigator.userAgent).indexOf("Mozilla")!=-1 && (navigator.userAgent).indexOf("Firefox")!=-1)

That will check for the navigator string containing the word 'Mozilla' and the word 'Firefox', but not neccessarily the phrase "Mozilla Firefox".

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Default security settings for offline content are quite strict; because offline content is supposed to have access to its immediate environment (the user's filesystem) For that reason, you may not be able to disable security dialogues. They wouldn't be very secure if you could.

If your hyperlinks are just hrefs to the files on the user's computer; you have absolutely no control over how a browser or a user chooses to deal with those files; in the same way as you have no control over whether a user chooses to open or save a file when presented with a download box. There's plenty of good reasons why.

If you were to change your tactics somewhat, and embed the music onto your pages; you'd have alot more control over the display of the embedded media player; but perhaps still security errors if you're accessing local content (files on the user's machine), and it'll be more work for you developing a way to access the (hidden) media players.

For code to embed a WindowsMediaPlayer into an HTML page:
http://www.mioplanet.com/rsc/embed_mediaplayer.htm

If you want to hide that player, remove this line:

style="position:absolute; left:0;top:0;"

and replace it with this line:

display="none"

if you want it to not play automatically; remove this line:

<PARAM NAME="AutoStart" VALUE="True">

and see the bit at the bottom of that page for controlling the player using Javascript. [insert your media player ID].start() probably works to start a media player that doesn't have …

MattEvans 473 Veteran Poster Team Colleague Featured Poster

Well. CDATA, and I suppose PCDATA also (I didn't even know that existed) are blocks within an XML file that are declared as 'deviant' from the natural XML format.. So If you put your dlls or whatever into an XML file, that wouldn't be converting them into XML, it would be wrapping XML tags around them and saving them as XML.

What you want to do avani, doesn't make a whole lot of sense right now. Why do you want to send DLLs in XML messages? There is probably a more normal solution to what your trying to do, i.e. loading a local DLL based on instructions in XML messages, or initializing the download of a DLL based on instructions in an XML message.

Although I suppose you could theoritically 'paste' program code inside XML and send it around, you cannot convert the syntax of a compiled DLL/EXE (or most compilable source code) into the syntax of an XML file. There's too many reasons why not.