p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: search for double quotes in string


Message #1 by "Kate Twin" <kate@e...> on Wed, 28 Nov 2001 12:53:51 -0000
Maybe this one:

> > startstr=3DinStr(0,strContents,"""")

Yes, there are 4 of them, it's not a typo :)
Two quotes right behind each other means you need one quote, so ASP can make 
the difference of a quote as content, and a quote used to start or end a 
string.

greetz
Steven



On Wednesday 28 November 2001 15:25, gbrown@c... wrote:
> Hi
>
> Can you use html codes like that, not come across before. Normally I check
> for chr(34).
>
> Hth
>
> Regards
> Graham
>
> > This is a multi-part message in MIME format.
> >
> > ------=_NextPart_000_001F_01C1780B.BAE5CBC0
> > Content-Type: text/plain;
> > 	charset="iso-8859-1"
> > Content-Transfer-Encoding: quoted-printable
> >
> > hi,
> >
> > i'm creating a content management application that uploads templates to 
> > a file to display on a web page, and to do this I need to search the 
> > template's html code for images, take the image pathname and store it in
>
> 
>
> > a database. However, I'm having difficulties extracting the image 
> > pathname from the html code. I'm using the InStr function:
> >
> > startstr=3DinStr(0,strContents,"<img src=3D")
> >
> > to find the start of the image tag, but then i need to find the end of 
> > the pathname. Ideally I would use the InStr function again and search 
> > for the next double quote but I can't get this to work. I've tried
> >
> > endstr=3DinStr(startstr,strContents,"&#34;")
> >
> > but it doesn't seem to find anything.
> >
> > Can anyone help?
> >
> > kate
> >
> > ------=_NextPart_000_001F_01C1780B.BAE5CBC0
> > Content-Type: text/html;
> > 	charset="iso-8859-1"
> > Content-Transfer-Encoding: quoted-printable
> >
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > <HTML><HEAD>
> > <META http-equiv=3DContent-Type content=3D"text/html; 
> > charset=3Diso-8859-1">
> > <META content=3D"MSHTML 6.00.2462.0" name=3DGENERATOR>
> > <STYLE></STYLE>
> > </HEAD>
> > <BODY bgColor=3D#ffffff>
> > <DIV><FONT face=3DArial size=3D2>hi,</FONT></DIV>
> > <DIV><FONT face=3DArial size=3D2><BR>i'm creating a content management 
> > application
> > that uploads templates to a file to display on a web page, and to do 
> > this I need
> > to search the template's html code for images, take the image pathname 
> > and store
> > it in a database. However, I'm having difficulties extracting the image 
> > pathname
> > from the html code. I'm using the InStr function:</FONT></DIV>
> > <DIV>&nbsp;</DIV>
> > <DIV><FONT face=3DArial size=3D2>startstr=3DinStr(0,strContents,"&lt;img
>
> 
>
> > src=3D")</FONT></DIV>
> > <DIV>&nbsp;</DIV>
> > <DIV><FONT face=3DArial size=3D2>to find the start of the image tag, but
>
> 
>
> > then i need
> > to find the end of the pathname. Ideally I would use the InStr function 
> > again
> > and search for the next double quote but I can't get this to work. I've 
> > tried
> > </FONT></DIV>
> > <DIV>&nbsp;</DIV>
> > <DIV><FONT face=3DArial
> > size=3D2>endstr=3DinStr(startstr,strContents,"&amp;#34;")</FONT></DIV>
> > <DIV>&nbsp;</DIV>
> > <DIV><FONT face=3DArial size=3D2>but it doesn't seem to find 
> > anything.</FONT></DIV>
> > <DIV>&nbsp;</DIV>
> > <DIV><FONT face=3DArial size=3D2>Can anyone help?</FONT></DIV>
> > <DIV>&nbsp;</DIV>
> > <DIV><FONT face=3DArial size=3D2>kate</FONT></DIV>
>
> <BR>
> ---<BR>
> Steven.Broos@N...<BR> 
> $subst('Email.Unsub')<BR>
>
>
> Read the future with ebooks at B&amp;N<BR>
> http://service.bfast.com/bfast/click?bfmid=2181&amp;sourceid=38934667&amp;c
>ategoryid=rn_ebooks </BODY></HTML>
>
> > ------=_NextPart_000_001F_01C1780B.BAE5CBC0--

  Return to Index