Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   Help converting short php script to ASP (http://www.velocityreviews.com/forums/t788714-help-converting-short-php-script-to-asp.html)

Johnny Carson 07-21-2003 03:13 PM

Help converting short php script to ASP
 
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");
?>

Ray at 07-21-2003 03:52 PM

Re: Help converting short php script to ASP
 
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" <jcarson@tonightshow.com> wrote in message
news:MPG.1985bf1f576a2e94989695@msnews.microsoft.c 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");
> ?>




Johnny Carson 07-21-2003 04:09 PM

Re: Help converting short php script to ASP
 
>
> 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

Ray at 07-21-2003 04:22 PM

Re: Help converting short php script to ASP
 
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" <jcarson@tonightshow.com> wrote in message
news:MPG.1985cc3bda711c6c989696@msnews.microsoft.c 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




Johnny Carson 07-22-2003 02:12 PM

Re: Help converting short php script to ASP
 
<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...


All times are GMT. The time now is 10:54 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57