Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Help converting short php script to ASP

Reply
Thread Tools

Help converting short php script to ASP

 
 
Johnny Carson
Guest
Posts: n/a
 
      07-21-2003
I've got this PHP script working on one of my sites and
now need an ASP version for my intranet.

I don't know ASP, can anyone help out?

Know of anyway to NOT have a blank browser window open
when clicking on the link or even a better solution to
prevent spam harvesters?


<?
// email.php
// usage:
//
// <A HREF="email.php?to=me&domain=mydomain.com">E-Mail Me</a>-->
//
//

if (!isset($to))
//if(!isset($_GET['to']))
{
// $_GET['to'] = "info";
$to = "info";
}

if(!isset($domain))
{
//$_GET['domain'] = "mydomain.com";
$domain = "mydomain.com";
}

// $to = $_GET['to'];
// $domain = $_GET['domain'];

$email_address = $to."@".$domain;

// send email header to page
header ("Location: mailto:$email_address");
?>
 
Reply With Quote
 
 
 
 
Ray at
Guest
Posts: n/a
 
      07-21-2003
Try something like:

If IsEmpty(sTo) Then sTo = Request.Querystring("to")
If IsEmpty(sDomain) Then sDomain = Request.Querystring("domain")
sEmailAddress = sTo & "@" & sDomain
Response.Redirect "mailto:" & sEmailAddress

I didn't do it with the lines commented out the way that you have it,
though. You have the querystring lines commented out in your PHP code.

I don't know of any way to not have a blank browser window return. I
understand your pain about trying to hide e-mail addresses from spam
crawlers...

Ray at work


"Johnny Carson" <> wrote in message
news: om...
> I've got this PHP script working on one of my sites and
> now need an ASP version for my intranet.
>
> I don't know ASP, can anyone help out?
>
> Know of anyway to NOT have a blank browser window open
> when clicking on the link or even a better solution to
> prevent spam harvesters?
>
>
> <?
> // email.php
> // usage:
> //
> // <A HREF="email.php?to=me&domain=mydomain.com">E-Mail Me</a>-->
> //
> //
>
> if (!isset($to))
> //if(!isset($_GET['to']))
> {
> // $_GET['to'] = "info";
> $to = "info";
> }
>
> if(!isset($domain))
> {
> //$_GET['domain'] = "mydomain.com";
> $domain = "mydomain.com";
> }
>
> // $to = $_GET['to'];
> // $domain = $_GET['domain'];
>
> $email_address = $to."@".$domain;
>
> // send email header to page
> header ("Location: mailto:$email_address");
> ?>



 
Reply With Quote
 
 
 
 
Johnny Carson
Guest
Posts: n/a
 
      07-21-2003
>
> If IsEmpty(sTo) Then sTo = Request.Querystring("to")
> If IsEmpty(sDomain) Then sDomain = Request.Querystring("domain")
> sEmailAddress = sTo & "@" & sDomain
> Response.Redirect "mailto:" & sEmailAddress
>
> I didn't do it with the lines commented out the way that you have it,
> though. You have the querystring lines commented out in your PHP code.
>
> I don't know of any way to not have a blank browser window return. I
> understand your pain about trying to hide e-mail addresses from spam
> crawlers...
>

<SNIP>

Thanks, that worked as do all your tips/suggestions/solutions

I've tried munging but they can now decode those.

I'm still looking for a better way. If I find something better, I'll
be sure to post it here for you.

JC
 
Reply With Quote
 
Ray at
Guest
Posts: n/a
 
      07-21-2003
He he... Thanks...

Yeah, the whole spam thing really just sucks a lot. I think this is why
more and more sites have feedback forms instead of mailto e-mail addresses.
You'll see many sites that also have things like:

E-mail us at ray AT mydomain DOT com

But for a professional site, you can't really do any nonsense like that. I
think you may be able to use a client side solution like this:

<script language="javascript">
window.open('mail'+'to:'+'person'+'@'+'domain'+'.c om');
</script>

You could split up that string as much as you like or encrypt and decrypt,
etc.

Ray at work




"Johnny Carson" <> wrote in message
news: om...
> >
> > If IsEmpty(sTo) Then sTo = Request.Querystring("to")
> > If IsEmpty(sDomain) Then sDomain = Request.Querystring("domain")
> > sEmailAddress = sTo & "@" & sDomain
> > Response.Redirect "mailto:" & sEmailAddress
> >
> > I didn't do it with the lines commented out the way that you have it,
> > though. You have the querystring lines commented out in your PHP code.
> >
> > I don't know of any way to not have a blank browser window return. I
> > understand your pain about trying to hide e-mail addresses from spam
> > crawlers...
> >

> <SNIP>
>
> Thanks, that worked as do all your tips/suggestions/solutions
>
> I've tried munging but they can now decode those.
>
> I'm still looking for a better way. If I find something better, I'll
> be sure to post it here for you.
>
> JC



 
Reply With Quote
 
Johnny Carson
Guest
Posts: n/a
 
      07-22-2003
<SNIP>
> <html>
> <head>
> <script>
> function mailLink(username, domain, comthingy)
> {
> var sMailTo="mailto:";
> var sAddress=username + "@" + domain + "." + comthingy;
> window.open(sMailTo + sAddress);
>
> }
> </script>
> </head>
> <body>
> <a href="#" onclick="mailLink('bob','something','com');">TEST</a>
> </body>
> </html>
>
>

<SNIP>
> > think you may be able to use a client side solution like this:
> >
> > <script language="javascript">
> > window.open('mail'+'to:'+'person'+'@'+'domain'+'.c om');
> > </script>
> >
> > You could split up that string as much as you like or encrypt and decrypt,
> > etc.


Yes but this won't work for clients with js disabled. I DID find a good one in
PHP from http://rsscripts.tripod.com/scripts/securemaill.htm called SecurEmailL
Very cool. I'd like to see it converted to ASP...
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference of extern short *x and extern short x[]? Andre C Programming 5 07-17-2012 07:38 PM
PHP Training Institute In Delhi, Live Projects on PHP. Short TermPHP Courses, PHP Scripts, PHP Training with Live Projects. Rajive Narain Java 0 09-18-2009 10:47 AM
unsigned short, short literals Ioannis Vranos C Programming 5 03-05-2008 01:25 AM
longs, long longs, short short long ints . . . huh?! David Geering C Programming 15 01-11-2007 09:39 PM
unsigned short short? slougheed@gmail.com C++ 4 10-16-2006 11:25 PM



Advertisments