Closed Thread Icon

Topic awaiting preservation: This has got to be a common problem... (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12475" title="Pages that link to Topic awaiting preservation: This has got to be a common problem... (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: This has got to be a common problem... <span class="small">(Page 1 of 1)</span>\

 
sonicsnail
Bipolar (III) Inmate

From: Scotland
Insane since: Jun 2001

posted posted 10-17-2002 17:34

Ok, so I'm adding things to my database through form fields, and when I want to edit the values, I'm editing them in other form fields... normal so far.

Sometimes, I want to put HTML into the form field, for example to add a mailto link..

But when I go to edit it, the form field screws up, due to too many " symbols.

<input type="text" value="<a href="mailto...... etc etc - see the problem?

You must have all run into this problem before - yet its near impossible to search for in a search engine! - Thus my post.

Pls advise! (I'm using ASP)

Pete

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 10-17-2002 17:36

soncisnail: In php you'd use addslashes() - I assume there must be something similar in ASP.

___________________
Emps

FAQs: Emperor

sonicsnail
Bipolar (III) Inmate

From: Scotland
Insane since: Jun 2001

posted posted 10-17-2002 18:00

Empreor: (sorry, couldn't resist after your typo!)

I really must get into PHP.. though I can't see it being too popular in the corporate environment so its a difficult call.. (I don't want to buckle my brain with 2 new languages!)

Pete

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 10-17-2002 18:11

sinicsnail: I understand what you mean but PHP is easy to learn and you could pick it up as a hobby

By the way most people prefer to spell my name Emporer

Anyway things like this help:
http://www.aspemporium.com/aspEmporium/help/helpsys.asp?PRB004

and I got this:

quote:
function jq(str)
dim ret
ret=str & ""
ret=replace(ret,"\","\\") 'escape any backslashs
ret=replace(ret,"'","\'") 'escape any single quotes
ret=replace(ret,"""","\""") 'escape any double quotes
jq="'" & ret & "'" 'surround with single quotes
end function



from here:
http://www.asptraining.com/learn/remotescriptinglist.asp

which should prove handy.

___________________
Emps

FAQs: Emperor

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 10-17-2002 18:37

In HTML, you're not supposed to use backslashes to escape quotes, you're supposed to use &amp;quot; to escape them.

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 10-17-2002 19:29

Many times instead of worrying about slashes (which in PHP can get unwieldy if magic quotes is on and you are passing some data from page to page) I like to urlencode data like this and then decode it laters In JS you can use the escape funtions.



.:[ Never resist a perfect moment ]:.

Lurch
Paranoid (IV) Inmate

From: Behind the Wheel
Insane since: Jan 2002

posted posted 10-18-2002 09:47

in ASP isn't the escape character a # ?

i agree with Emperor- php is really easy to learn and i think its a great language. I'm learning a bit of ASP and Coldfusion now but still prefer PHP

I'm really new to ASP still so my sytax and everything else will be off here but this is what i'd do...

get the data from the db through the recordset.. (rs_update for example)
then build my form..

code:
<input type="text" value="<%=(rs_update.Fields.Item("db_fieldname").Value)%>">



that's the way I've done it and it worked for me I just tried putting html with "" in it too to make sure... hope it helps

--Lurch--

H][RO
Bipolar (III) Inmate

From: Australia
Insane since: Oct 2002

posted posted 10-22-2002 05:59

I also have to agree with php, ive learnt it recently and built a database and a few things from it, i like the way it works.

What's everyone elses preference here as far as server side scripting goes? Is there anything php can do that others cant or vice versa, or doesnt it make a difference?

Blacknight
Bipolar (III) Inmate

From: INFRONT OF MY PC
Insane since: Dec 2001

posted posted 10-25-2002 20:16

other whise the msdn Library over at microsoft is a good place to search for asp help http://msdn.microsoft.com

[This message has been edited by Blacknight (edited 10-25-2002).]

« BackwardsOnwards »

Show Forum Drop Down Menu