Author Topic: Question for Web Developers  (Read 4647 times)

Offline shadowlight

  • Obsessively Audiophilic
  • ****
  • Posts: 990
Question for Web Developers
« on: January 09, 2012, 07:14:32 AM »
Not 100% sure if it is the right location.  If not please feel free to move it to the right location.

I am not a web developer hence the question.

I currently have the following code and I need to figure out a way to escape special character's in the code.

<a href="http://10.7.2.202:81/dvwl?p1=$(url.host)&p2=$(cs-categories)">Restore access to site</a>

The url.host and cs-categories are dynamically created and the cs-categories variable is likely to have special characters like "/" and ";" which I would like to escape.

TIA

Offline BobM

  • Audio Neurotic
  • *****
  • Posts: 3318
Re: Question for Web Developers
« Reply #1 on: January 09, 2012, 07:16:59 AM »
You might want to ping Mike Cullinan directly. He's an expert on these things. Here's a link to his site:

www.mentalpixel.com
Laugh and the world laughs with you. Cry and you'll have to blow your nose.

Offline Barry (NJ)

  • Audio Neurotic
  • *****
  • Posts: 1712
Re: Question for Web Developers
« Reply #2 on: January 09, 2012, 07:24:22 AM »
What's generating the code, and by 'escape' do you mean replace with spaces or remove?
Happiness is when your system overcomes your nervosa ;) 
So much media, so little time... My Media Room...

Offline shadowlight

  • Obsessively Audiophilic
  • ****
  • Posts: 990
Re: Question for Web Developers
« Reply #3 on: January 09, 2012, 07:33:09 AM »
What's generating the code, and by 'escape' do you mean replace with spaces or remove?

I will take any option: replace with space or remove or just change "/" to %2F.  The url.host and cs-categories is being generated by Bluecoat proxy server.

Offline Barry (NJ)

  • Audio Neurotic
  • *****
  • Posts: 1712
Re: Question for Web Developers
« Reply #4 on: January 09, 2012, 07:56:25 AM »
Sorry, I'm not familiar with Bluecoat, your best bet is to get a hold of Mike, I'll send him a note to point him here ;)
Happiness is when your system overcomes your nervosa ;) 
So much media, so little time... My Media Room...

Offline machinehead

  • Obsessively Audiophilic
  • ****
  • Posts: 507
    • Affordable Web Design & Development
Re: Question for Web Developers
« Reply #5 on: January 09, 2012, 08:57:43 AM »
Im not so technical.. well I know some things.. ;)

Try this:
http://www.webtoolkit.info/javascript-url-decode-encode.html


http://us3.php.net/urlencode
http://msdn.microsoft.com/en-us/library/ms525738
http://docstore.mik.ua/orelly/perl/perlnut/c17_110.htm

javascript:

function TestEncoding()                   
{                   
  var inputString=document.forms["TestEncodingForm"]["inputString"].value;
  var encodedInputString=escape(inputString);
  encodedInputString=encodedInputString.replace("+", "%2B");
  encodedInputString=encodedInputString.replace("/", "%2F");
  document.forms["TestEncodingForm"]["encodedInputString"].value=encodedInputString;
}

May help...
Let me know..
Mike
http://www.mentalpixel.com
Its cool ndude.