Reply
ASP help please
Old 11-06-2006, 03:15 PM ASP help please
kline11's Avatar
King Spam Talker

Posts: 1,287
Name: John
Location: USA
I need a little asp help (Chris I hope you read this). Is there any way to use Request.Form to see if an image exsists within a form field without using the image in a submit button, (i.e <input), but rather <img src...?
kline11 is offline
Reply With Quote
View Public Profile Visit kline11's homepage!
 
When You Register, These Ads Go Away!
Old 11-06-2006, 03:24 PM Re: ASP help please
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,945
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Assuming I read this right:

Code:
Dim Your_Field
Your_Field = Request.Form ("Your_Field")
if InStr (1, Your_Field, "<img src=""", 1) > 0 then
....
Hirst isn't the only ASP guru in dis piece, you know. He's one of two, dammit, and I want my cred!
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 11-07-2006, 10:44 AM Re: ASP help please
kline11's Avatar
King Spam Talker

Posts: 1,287
Name: John
Location: USA
Thanks Adam, I'll see if this works...the problem is "Your_Field" is an input field, I want to the code to make sure a static image is present within the form. Does this make sense?

I know Hirst isn't the only guru, he just the only one I know...now I know two. Thanks! sending talkupation your way...sorry I can't yet...I have to spread som Talkupation around first? I guess I has sent some your way the last time.

Last edited by kline11 : 11-07-2006 at 10:46 AM.
kline11 is offline
Reply With Quote
View Public Profile Visit kline11's homepage!
 
Old 11-07-2006, 10:57 AM Re: ASP help please
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,945
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
heh no problem. I just want attention.

I'm not sure I follow, but I guess what you're asking is if you can traverse the contents of a web page within ASP to determine if a piece of code exists for a static image.

If that's the case, the only way I know how is with a component called ASPTear. ASPTear "visits" other web pages and extracts the HTML code within them for future manipulation.

http://www.alphasierrapapa.com/IisDe...nents/AspTear/

Supposedly, there's a way to do it using XMLHTTP (Microsoft's HTTP component object dealy) but I've never had a reason to try it since ASPTear usually works for me.
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 11-07-2006, 11:01 AM Re: ASP help please
kline11's Avatar
King Spam Talker

Posts: 1,287
Name: John
Location: USA
No, it doesn't work. I need to use request.form for the img tag, not an input field. Why? To make sure the "static" image is present in order for them to submit the form. Is this possible?
kline11 is offline
Reply With Quote
View Public Profile Visit kline11's homepage!
 
Old 11-07-2006, 11:20 AM Re: ASP help please
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,945
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Dude, you're going to have to show me this form so that I can see what you're trying to accomplish.

A static image is a static image and has nothing to do with a form whatsoever. It's just coded in.

The only other thing I can think of is if you want someone to upload an image, but I'm not speculating any more until I see this.
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 11-07-2006, 12:05 PM Re: ASP help please
kline11's Avatar
King Spam Talker

Posts: 1,287
Name: John
Location: USA
Here's the form code:
Code:
<form action="http://www.searchbliss.com/refer-it.asp" method="post" target="_blank" name=frmReferral>
<table border="0" cellpadding="2" cellspacing="0">
<tr> 
<td align="right"><font face="Arial" size="-1"><strong>Your Name:</strong></font></td>
<td> 
<input type="text" name="txtFromName" size="15">
</td>
</tr>
<tr> 
<td align="right"><font face="Arial" size="-1"><strong>Your E-mail:</strong></font></td>
<td> 
<input type="text" name="txtFromEmail" size="15">
</td>
</tr>
<tr> 
<td align="right"><font face="Arial" size="-1"><strong>Friend's Name:</strong></font></td>
<td> 
<input type="text" name="txtFromFName" size="15">
</td>
</tr>
<tr> 
<td align="right" height="2"> 
<div align="center"><font face="Arial" size="-1"><strong>Friend's E-mail:</strong></font></div>
</td>
<td valign="top" align="left" height="2"> 
<input type="text" name="txtToEmail" size="15">
</td>
</tr>
<tr> 
<td colspan="2"> 
<div align="center"> 
<input type="reset" value="Reset" name=rstReferral>
<input type="submit" value="Send E-mail" name=subReferral>
<br>
<!-- Please do not remove below this line or it won't work --><a href="http://www.searchbliss.com/" target="_blank"><img src="http://www.searchbliss.com/poweredby.gif" width="200" height="26" border="0" alt="Powered by SearchBliss Web Tools"></a>
<script language="JavaScript">
<!--
y0="<input type=hidden name=url value="+window.location+">";
//--->
</script>
<script language="JavaScript">
<!---
document.write(y0);
//--->
</script>
</div>
</td>
</tr>
</table>
</form>
The linked image I want to remain in the script. If someone removes it, then I want an Error message posted instead of a confirmation message. It's to keep people from removing the "powered by" logo/link to SearchBliss.

Thanks for your help.
kline11 is offline
Reply With Quote
View Public Profile Visit kline11's homepage!
 
Old 11-07-2006, 01:14 PM Re: ASP help please
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,945
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Code:
<img src="http://www.searchbliss.com/poweredby.gif" width="200" height="26" border="0" alt="Powered by SearchBliss Web Tools">
Is THAT the image you're talking about? And if it is, are you doing what I think you're trying to do (i.e. write a refer-a-friend script to send an HTML email from one friend to another?)

If that's the case, you don't even need to worry about whether your image is linked in the form. You can add output to the email and format it in HTML.

http://www.w3schools.com/asp/asp_send_email.asp

There's a sample there to get you started.

IF you're going to do that, though, there is one very important caveat you'll need to watch out for...Hotmail, CompuServe, Rogers/Yahoo, and other ISP/mail server providers will often filter out emails that have images and put them in the junk mail folder. I had a client about 2 weeks ago that went through that very issue...so we had to strip out his logo from the emails we were sending. They were legit emails, but the logo threw the mail servers off.
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 11-07-2006, 03:23 PM Re: ASP help please
kline11's Avatar
King Spam Talker

Posts: 1,287
Name: John
Location: USA
I'm sorry Adam, I'm having trouble getting my point accross.

Yes, that is the image.

I offer the "refer a friend" email form as free website content to my visitors.
Info here:
http://www.searchbliss.com/email-referral-box.htm

What I am trying to do is find a way to prevent users from removing the linked image (back to SearchBliss) from the script. All works great, I just need a way to send an error message if the linked image was removed, and not send the email. I know I can't use the Request object for this because it only reads input fields. I can do this if I change the image into an image button, but then search engines will not count it as a backlink. I'm stumped.

Maybe it isn't possible? Thanks again.

Last edited by kline11 : 11-07-2006 at 03:24 PM.
kline11 is offline
Reply With Quote
View Public Profile Visit kline11's homepage!
 
Old 11-07-2006, 03:26 PM Re: ASP help please
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,945
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Again, it is possible.

The key to this is NOT to have the image as part of the values being passed from the form. You can always add things to form input.

For example:

Dim Some_HTML
Some_HTML = Request.Form ("Some_HTML_Field")
Some_HTML = Some_HTML & "<a href=""http://www.yaddayadda.com""><img src=""<A href="http://yourimage.com/goes/here.gif"">http://yourimage.com/goes/here.gif"" width=""image width"" ...

If it's added in post facto, then your user will never be able to manipulate it and you can put it pretty much whever you want.

Side note: it's always good practice to assign form/querystring inputs to variables. Besides being able to manipulate them as I did above, it's a lot easier to work with from a coding standpoint and it avoids unnecessary server calls.

Last edited by ADAM Web Design : 11-07-2006 at 03:27 PM.
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 11-07-2006, 03:30 PM Re: ASP help please
kline11's Avatar
King Spam Talker

Posts: 1,287
Name: John
Location: USA
Thanks Adam.
kline11 is offline
Reply With Quote
View Public Profile Visit kline11's homepage!
 
Old 11-07-2006, 03:53 PM Re: ASP help please
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,945
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
No probs, buddy. Here's hoping it works out for ya!

:
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 11-09-2006, 03:59 PM Re: ASP help please
kline11's Avatar
King Spam Talker

Posts: 1,287
Name: John
Location: USA
Sorry Adam, it's not working out because using the form input makes the linked image un-spiderable. I want it to count as a backlink. I will see if there is another way.
kline11 is offline
Reply With Quote
View Public Profile Visit kline11's homepage!
 
Old 11-09-2006, 04:19 PM Re: ASP help please
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,945
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Then add it to both the output (as I suggested) and as a regular image somewhere on the form itself. Nothing saying you can't do both.

There is always a way. Just be creative, that's all.
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 11-25-2006, 03:42 PM Re: ASP help please
kline11's Avatar
King Spam Talker

Posts: 1,287
Name: John
Location: USA
Well, I got it to work! Now when the referral form is submitted, the referring page is loaded on the server and checked for the image link. If it is there, the email is sent, if not, an error message is shown and the email is not sent. You can test it here:
http://www.searchbliss.com/email-referral-box.htm

Just copy the form and try it, then remove the image link and try it again. Let me know if anyone experiences a problem. I haven't done this with the spanish version yet, so select the english version to test it. Thanks Adam and Chris (who helped in the SearchBliss forums) for all of your help!
kline11 is offline
Reply With Quote
View Public Profile Visit kline11's homepage!
 
Old 12-05-2006, 01:47 PM Re: ASP help please
kline11's Avatar
King Spam Talker

Posts: 1,287
Name: John
Location: USA