string variable - weird error - help me!!!!

B

Bob Barrows

Look up these functions in online help (http://tinyurl.com/7rk6)
Instr, Left, InstrRev and Mid

If this does not help, show us your code.
(No, you're theory does not make any sense, without being able to see your
code.)

HTH,
Bob Barrows
 
S

Steven Nash

hi,

I have a variable which has lots of text (html code more specifically)
assigned to it. What I need to do is to strip away large chunks of it from
the beginning and end of it.

I need to recognise some div tags as the beginning and end of the string and
to throw everything else away. I have no guarantees that the surrounding
text will be the same each time it is used. So does anybody know how to seek
out and find some characters and strip everything before it and then to find
a closing tag and strip everything after it.

The problem I am currently having is a puzzling one, if i strip away text
from a hard coded variable, everything gets posted to my database just fine,
however when i try it on my form retrieved string variable my start position
is always '0', indicating that the text i am seeking has not been found.

My theory is that the search will not read new lines, and is only reading
the very first line of text from the string and nothing else.

Does anybody know if this is a correct theory, and if so how I can get my
search coding to go onto the next line?


any help would be greatly appreciated
 
T

Tom B

<!-- #INCLUDE file="db.asp" -->
<%
dim objConn
dim objRS
set objConn = Server.CreateObject("ADODB.Connection")
set objRS = Server.CreateObject("ADODB.Recordset")
objConn.Open webdataDB
objRS.ActiveConnection = objConn %><html>
<head>
<title> Nashie's content manager </title>
<script language="JavaScript">


var viewMode = 1; // WYSIWYG

function Init()
{
iView.document.designMode = 'On';
}

function selOn(ctrl)
{
ctrl.style.borderColor = '#000000';
ctrl.style.backgroundColor = '#B5BED6';
ctrl.style.cursor = 'hand';
}

function selOff(ctrl)
{
ctrl.style.borderColor = '#D6D3CE';
ctrl.style.backgroundColor = '#D6D3CE';
}

function selDown(ctrl)
{
ctrl.style.backgroundColor = '#8492B5';
}

function selUp(ctrl)
{
ctrl.style.backgroundColor = '#B5BED6';
}

function doBold()
{
iView.document.execCommand('bold', false, null);
}



function doBGcolor()
{
var newcolor = showModalDialog("popups/select_color.html", "resizable:
no; help: no; status: no; scroll: no;");
if (newcolor != null) { document.execCommand('forecolor', false,
"#"+newcolor); }
}


function doItalic()
{
iView.document.execCommand('italic', false, null);
}

function doUnderline()
{
iView.document.execCommand('underline', false, null);
}

function doLeft()
{
iView.document.execCommand('justifyleft', false, null);
}

function doCenter()
{
iView.document.execCommand('justifycenter', false, null);
}

function doRight()
{
iView.document.execCommand('justifyright', false, null);
}

function doOrdList()
{
iView.document.execCommand('insertorderedlist', false, null);
}

function doBulList()
{
iView.document.execCommand('insertunorderedlist', false, null);
}

function doForeCol()
{
var fCol = prompt('Enter foreground color', '');

if(fCol != null)
iView.document.execCommand('forecolor', false, fCol);
}

function doBackCol()
{
var bCol = prompt('Enter background color', '');

if(bCol != null)
iView.document.execCommand('backcolor', false, bCol);
}

function doLink()
{
iView.document.execCommand('createlink');
}

function doImage()
{
var imgSrc = prompt('Enter image location', '');

if(imgSrc != null)
iView.document.execCommand('insertimage', false, imgSrc);
}

function doRule()
{
iView.document.execCommand('inserthorizontalrule', false, null);
}

function doFont(fName)
{
if(fName != '')
iView.document.execCommand('fontname', false, fName);
}

function doSize(fSize)
{
if(fSize != '')
iView.document.execCommand('fontsize', false, fSize);
}

function doHead(hType)
{
if(hType != '')
{
iView.document.execCommand('formatblock', false, hType);
doFont(selFont.options[selFont.selectedIndex].value);
}
}

function doToggleView()
{
if(viewMode == 1)
{
iHTML = iView.document.body.innerHTML;
iView.document.body.innerText = iHTML;

// Hide all controls
tblCtrls.style.display = 'none';
selFont.style.display = 'none';
selSize.style.display = 'none';
selHeading.style.display = 'none';
iView.focus();

viewMode = 2; // Code
}
else
{
iText = iView.document.body.innerText;
iView.document.body.innerHTML = iText;

// Show all controls
tblCtrls.style.display = 'inline';
selFont.style.display = 'inline';
selSize.style.display = 'inline';
selHeading.style.display = 'inline';
iView.focus();

viewMode = 1; // WYSIWYG
}
}

function ProcessNews() { // Assign the HTML code to a hidden form variable
var
htmlCode = iView.document.body.innerHTML;
document.frmNews.newsPost.value = htmlCode;


// Make sure that all fields are completed
//if(document.frmNews.author.selectedIndex == 0)
//{
//alert('Please select an author for this news post.');
//document.frmNews.author.focus(); return false;
//}


if(document.frmNews.title.value == '')
{
alert('This news post must contain a title.');
document.frmNews.title.focus(); return false;
}


//if(document.frmNews.topics.selectedIndex == -1)
//{
//alert('Please select a topic for this news post.');
//document.frmNews.topics.focus();
//return false;
//}


if(document.frmNews.newsPost.value == '')
{
alert('Please enter some content for this news post.');
iView.focus();
return false;
}
return true;
}
</script>
<style>

.butClass
{
border: 1px solid;
border-color: #D6D3CE;
}

.tdClass
{
padding-left: 3px;
padding-top:3px;
padding-bottom:5px;
}

..dropdownstyle { font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px; font-style: normal; line-height: normal; background-color:
#FFFFFF}
</style>

<body onLoad="Init()">
<p>&nbsp;</p>
<table width="100%" border="0">
<tr>
<td width="25%">&nbsp;</td>


<td width="47%">
<center>
<%


'<form name="post" method="post" action="">
'<font face= verdana size=2> Page Title:</font>
'<input type="text" name="title" style="font-family:verdana;
font-size:12; color:black; background-color:white; border-width: 1px;
border-color:black" size="60">
'</form></center>

%>





<%
dim action
action = Request.Form("action")
if action = "addNews" then
addNews()
else
showNewsForm()
end if
sub showNewsForm()
'HTML Code for news form goes below %>


<form onSubmit="return ProcessNews()" name="frmNews" action="editor.asp"
method="post">



<table width="575" height="30px" border="0" cellspacing="0"
cellpadding="0" bgcolor="#D6D3CE">
<tr>
<td width="10%" height="30" class="title" colspan="2">
<h2> Add News Post</h2>
</td>
</tr>
<tr>
<td width="20%" height="22" class="title">

</td>
<td width="80%" height="22" class="title">



</td>
</tr>
<tr>
<td width="20%" height="22" class="title">
<p style="margin-left:5"> Title: </p>
</td> <td width="80%">
<input type="text" name="title" maxlength="50" style="width:335px">
</td>
</tr>
<tr>
<td width="20%" height="22" class="title">
<p style="margin-left:5"> Topic(s): </p>
</td>
<td width="80%" height="22">

</td>
</tr>
<tr>
<td width="10%" height="22" colspan="2">
<hr width="98%" size="1" noshade color="gray">
</td>
</tr>
</table>

<table id="tblCtrls" width=100% height="32" border="0" cellspacing="0"
cellpadding="0" bgcolor="#D6D3CE">
<tr valign=center>

<td height="28" valign="center">
<select name="selFont"
onChange="doFont(this.options[this.selectedIndex].value)"
class="dropdownstyle">
<option value="">-- Font --</option>
<option value="Arial">Arial</option>
<option value="Courier">Courier</option>
<option value="Sans Serif">Sans Serif</option>
<option value="Tahoma">Tahoma</option>
<option value="Verdana">Verdana</option>
</select>


<select name="selSize"
onChange="doSize(this.options[this.selectedIndex].value)"
class="dropdownstyle">
<option value="">-- Size --</option>
<option value="1"><font size=1>1</font></option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
</select>


<img alt="Save" class="butClass" src="save.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doSave()">
<img alt="Bold" class="butClass" src="bold.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doBold()">
<img alt="Italic" class="butClass" src="italic.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doItalic()">
<img alt="Underline" class="butClass" src="underline.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doUnderline()">
<img alt="Left" class="butClass" src="left.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doLeft()">
<img alt="Center" class="butClass" src="center.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doCenter()">
<img alt="Right" class="butClass" src="right.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doRight()">
<img alt="Ordered List" class="butClass" src="ordlist.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doOrdList()">
<img alt="Bulleted List" class="butClass" src="bullist.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doBulList()">
<img alt="Text Color" class="butClass" src="forecol.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doForeCol()">
<img alt="Text Color" class="butClass" src="textcol.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doBGcolor()">
<img alt="Hyperlink" class="butClass" src="link.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doLink()">
<img alt="Image" class="butClass" src="image.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doImage()">


</td>
</tr>
</table>
<div id=iView style=width: 415px; height:205px contentEditable=true></div>
<input type="hidden" name="action" value="addNews"> <input type="hidden"
name="newsPost" value="">

<table width="574" height="30px" border="0" cellspacing="0"
cellpadding="0" bgcolor="#D6D3CE">
<tr>
</tr>
</table>
</form>


' - see section below


<% end sub
sub addNews()
dim author
dim title
dim topics
dim newsPost

dim intStartVal
dim intEndVal
dim intSubStrLen
dim intNewStartVal
dim PostVar

author = Request.Form("author")
title = Replace(Request.Form("title"), "'", "''")
topics = Request.Form("topics")
'newsPost = Replace(Request.Form("newsPost"), "'", "''")
newsPost = Request.Form("newsPost")
NewVar=newsPost

'Response.Write(NewVar)

'NewVar = "XXpXXpgggggggggggggggggggggggggXXPXXP<div id=iView style=width:
415px; height:205px
contentEditable=true>ggggggggggggggggggg</div>gggggggggggggggggggghhhhhhhhhh
hhggggggggggggggggggggggggggg"

'StartValue = instr(NewVar, "<div id=iView style=width: 415px; height:205px
contentEditable=true>")
StartValue = instr(NewVar, "<html>")
Response.write("StartValue is ")
Response.write(StartValue)


EndValue = instrrev(NewVar, "</div>")
SubStringLength = EndValue + 7
NewStartValue= StartValue + 1

Response.Write("<BR>")

SubStringLength = SubStringLength - NewStartValue

'PostVar = Mid(NewVar, StartValue, 300)
PostVar = Mid(NewVar, 1, 50)

objConn.Execute "insert into content(title,content) values('" & title & "',
'" & PostVar & "')"
Response.Write "<b>New news post added OK, here's what you
added:<br><br></b>"



Response.Write("<BR>")
Response.write("intSubStrLen is ")
Response.write(intSubStrLen)
Response.Write("<BR>")

Response.Write Request.Form("newsPost")
objConn.Close
set objConn = nothing
end sub
%>

<table width=99% height="30px" border="0" cellspacing="0"
cellpadding="0" bgcolor="#D6D3CE">
<tr>
<td class="tdClass" colspan="1" width="80%"></td>
<td class="tdClass" colspan="1" width="20%" align="right">

&nbsp;&nbsp;&nbsp;
</td>
</tr>
</table>

</td>



<td width="28%"> </td>
</tr>
</table>

</body>
</html>
 
T

TomB

I haven't used regular expressions, and neither are you, so it's not really
relevant.
I'd start by setting your StartVal = Instr(NewVar,"id=iView")-5

Everything looks right to me, so I'd take a close look at the NewVar to
ensure that what's in there is what you expect.
 
S

Steven Nash

I have already made sure that the code is being assigned.

I have already done a response.write, and since before i added the search
code I was posting the raw unedited variable into a database, I know that
the variable has data assigned to it.

Also If I do defined trim beginning and end it works fine.
So the problem is within the counting operation, the search itself, it isn't
finding the code i am specifying for some reason, I have no idea why this is
the case.

Everytime I try to post my code snippets into this Outlook window (i am
viewing this as a newsgroup via outlook), it tries to post it as code to be
interpreted. Thats why i put it up on my website and suggested somebody look
at around line 400.

Somebody on 4guysfromrolla said: 'I assume you're using regular expressions?
you know you can specify the multiline property, right?'

anyone know what he means by multiline property???
 
S

Steven Nash

cheers.

any information on this multiline property?
its the only thing I can see it being, why else would it not go to the next
line of my string?


Tom B said:
<!-- #INCLUDE file="db.asp" -->
<%
dim objConn
dim objRS
set objConn = Server.CreateObject("ADODB.Connection")
set objRS = Server.CreateObject("ADODB.Recordset")
objConn.Open webdataDB
objRS.ActiveConnection = objConn %><html>
<head>
<title> Nashie's content manager </title>
<script language="JavaScript">


var viewMode = 1; // WYSIWYG

function Init()
{
iView.document.designMode = 'On';
}

function selOn(ctrl)
{
ctrl.style.borderColor = '#000000';
ctrl.style.backgroundColor = '#B5BED6';
ctrl.style.cursor = 'hand';
}

function selOff(ctrl)
{
ctrl.style.borderColor = '#D6D3CE';
ctrl.style.backgroundColor = '#D6D3CE';
}

function selDown(ctrl)
{
ctrl.style.backgroundColor = '#8492B5';
}

function selUp(ctrl)
{
ctrl.style.backgroundColor = '#B5BED6';
}

function doBold()
{
iView.document.execCommand('bold', false, null);
}



function doBGcolor()
{
var newcolor = showModalDialog("popups/select_color.html", "resizable:
no; help: no; status: no; scroll: no;");
if (newcolor != null) { document.execCommand('forecolor', false,
"#"+newcolor); }
}


function doItalic()
{
iView.document.execCommand('italic', false, null);
}

function doUnderline()
{
iView.document.execCommand('underline', false, null);
}

function doLeft()
{
iView.document.execCommand('justifyleft', false, null);
}

function doCenter()
{
iView.document.execCommand('justifycenter', false, null);
}

function doRight()
{
iView.document.execCommand('justifyright', false, null);
}

function doOrdList()
{
iView.document.execCommand('insertorderedlist', false, null);
}

function doBulList()
{
iView.document.execCommand('insertunorderedlist', false, null);
}

function doForeCol()
{
var fCol = prompt('Enter foreground color', '');

if(fCol != null)
iView.document.execCommand('forecolor', false, fCol);
}

function doBackCol()
{
var bCol = prompt('Enter background color', '');

if(bCol != null)
iView.document.execCommand('backcolor', false, bCol);
}

function doLink()
{
iView.document.execCommand('createlink');
}

function doImage()
{
var imgSrc = prompt('Enter image location', '');

if(imgSrc != null)
iView.document.execCommand('insertimage', false, imgSrc);
}

function doRule()
{
iView.document.execCommand('inserthorizontalrule', false, null);
}

function doFont(fName)
{
if(fName != '')
iView.document.execCommand('fontname', false, fName);
}

function doSize(fSize)
{
if(fSize != '')
iView.document.execCommand('fontsize', false, fSize);
}

function doHead(hType)
{
if(hType != '')
{
iView.document.execCommand('formatblock', false, hType);
doFont(selFont.options[selFont.selectedIndex].value);
}
}

function doToggleView()
{
if(viewMode == 1)
{
iHTML = iView.document.body.innerHTML;
iView.document.body.innerText = iHTML;

// Hide all controls
tblCtrls.style.display = 'none';
selFont.style.display = 'none';
selSize.style.display = 'none';
selHeading.style.display = 'none';
iView.focus();

viewMode = 2; // Code
}
else
{
iText = iView.document.body.innerText;
iView.document.body.innerHTML = iText;

// Show all controls
tblCtrls.style.display = 'inline';
selFont.style.display = 'inline';
selSize.style.display = 'inline';
selHeading.style.display = 'inline';
iView.focus();

viewMode = 1; // WYSIWYG
}
}

function ProcessNews() { // Assign the HTML code to a hidden form variable
var
htmlCode = iView.document.body.innerHTML;
document.frmNews.newsPost.value = htmlCode;


// Make sure that all fields are completed
//if(document.frmNews.author.selectedIndex == 0)
//{
//alert('Please select an author for this news post.');
//document.frmNews.author.focus(); return false;
//}


if(document.frmNews.title.value == '')
{
alert('This news post must contain a title.');
document.frmNews.title.focus(); return false;
}


//if(document.frmNews.topics.selectedIndex == -1)
//{
//alert('Please select a topic for this news post.');
//document.frmNews.topics.focus();
//return false;
//}


if(document.frmNews.newsPost.value == '')
{
alert('Please enter some content for this news post.');
iView.focus();
return false;
}
return true;
}
</script>
<style>

.butClass
{
border: 1px solid;
border-color: #D6D3CE;
}

.tdClass
{
padding-left: 3px;
padding-top:3px;
padding-bottom:5px;
}

.dropdownstyle { font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px; font-style: normal; line-height: normal; background-color:
#FFFFFF}
</style>

<body onLoad="Init()">
<p>&nbsp;</p>
<table width="100%" border="0">
<tr>
<td width="25%">&nbsp;</td>


<td width="47%">
<center>
<%


'<form name="post" method="post" action="">
'<font face= verdana size=2> Page Title:</font>
'<input type="text" name="title" style="font-family:verdana;
font-size:12; color:black; background-color:white; border-width: 1px;
border-color:black" size="60">
'</form></center>

%>





<%
dim action
action = Request.Form("action")
if action = "addNews" then
addNews()
else
showNewsForm()
end if
sub showNewsForm()
'HTML Code for news form goes below %>


<form onSubmit="return ProcessNews()" name="frmNews" action="editor.asp"
method="post">



<table width="575" height="30px" border="0" cellspacing="0"
cellpadding="0" bgcolor="#D6D3CE">
<tr>
<td width="10%" height="30" class="title" colspan="2">
<h2> Add News Post</h2>
</td>
</tr>
<tr>
<td width="20%" height="22" class="title">

</td>
<td width="80%" height="22" class="title">



</td>
</tr>
<tr>
<td width="20%" height="22" class="title">
<p style="margin-left:5"> Title: </p>
</td> <td width="80%">
<input type="text" name="title" maxlength="50" style="width:335px">
</td>
</tr>
<tr>
<td width="20%" height="22" class="title">
<p style="margin-left:5"> Topic(s): </p>
</td>
<td width="80%" height="22">

</td>
</tr>
<tr>
<td width="10%" height="22" colspan="2">
<hr width="98%" size="1" noshade color="gray">
</td>
</tr>
</table>

<table id="tblCtrls" width=100% height="32" border="0" cellspacing="0"
cellpadding="0" bgcolor="#D6D3CE">
<tr valign=center>

<td height="28" valign="center">
<select name="selFont"
onChange="doFont(this.options[this.selectedIndex].value)"
class="dropdownstyle">
<option value="">-- Font --</option>
<option value="Arial">Arial</option>
<option value="Courier">Courier</option>
<option value="Sans Serif">Sans Serif</option>
<option value="Tahoma">Tahoma</option>
<option value="Verdana">Verdana</option>
</select>


<select name="selSize"
onChange="doSize(this.options[this.selectedIndex].value)"
class="dropdownstyle">
<option value="">-- Size --</option>
<option value="1"><font size=1>1</font></option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
</select>


<img alt="Save" class="butClass" src="save.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doSave()">
<img alt="Bold" class="butClass" src="bold.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doBold()">
<img alt="Italic" class="butClass" src="italic.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doItalic()">
<img alt="Underline" class="butClass" src="underline.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doUnderline()">
<img alt="Left" class="butClass" src="left.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doLeft()">
<img alt="Center" class="butClass" src="center.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doCenter()">
<img alt="Right" class="butClass" src="right.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doRight()">
<img alt="Ordered List" class="butClass" src="ordlist.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doOrdList()">
<img alt="Bulleted List" class="butClass" src="bullist.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doBulList()">
<img alt="Text Color" class="butClass" src="forecol.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doForeCol()">
<img alt="Text Color" class="butClass" src="textcol.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doBGcolor()">
<img alt="Hyperlink" class="butClass" src="link.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doLink()">
<img alt="Image" class="butClass" src="image.gif"
onMouseOver="selOn(this)" onMouseOut="selOff(this)"
onMouseDown="selDown(this)" onMouseUp="selUp(this)" onClick="doImage()">


</td>
</tr>
</table>
<div id=iView style=width: 415px; height:205px contentEditable=true></div>
<input type="hidden" name="action" value="addNews"> <input type="hidden"
name="newsPost" value="">

<table width="574" height="30px" border="0" cellspacing="0"
cellpadding="0" bgcolor="#D6D3CE">
<tr>
<td width="10%" height="50" class="title" colspan="2">
<input type="submit" name="submit" style="width: 415px" value="Add News Post</tr>
</table>
</form>


' - see section below


<% end sub
sub addNews()
dim author
dim title
dim topics
dim newsPost

dim intStartVal
dim intEndVal
dim intSubStrLen
dim intNewStartVal
dim PostVar

author = Request.Form("author")
title = Replace(Request.Form("title"), "'", "''")
topics = Request.Form("topics")
'newsPost = Replace(Request.Form("newsPost"), "'", "''")
newsPost = Request.Form("newsPost")
NewVar=newsPost

'Response.Write(NewVar)

'NewVar = "XXpXXpgggggggggggggggggggggggggXXPXXP<div id=iView style=width:
415px; height:205px
 
T

Tom B

I was concerned that spaces or other characters may have been the problem
with your "Instr" so I suggested looking for id=iView (which would be
unique...right) and subtracting 5 to get to the beginning of the <div>
< d i v id=iView>
5 4 3 2 1

That was my thinking anyway.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,085
Members
48,773
Latest member
Kaybee

Latest Threads

Top