Sunday, January 28, 2007

Change master web server in interdev Project

if you want to start using another web server for your asp projects which you created in interdev 6.0 then you need to change the master web that you set when you created the project.
to do that you should do those steps:
1. release your working copy:
right click on your project-> release working copy
2. on the upper toolbar (File Edit View...) choose Project -> Web Project -> Copy Web Application ... -> set the new server name and the directory you want to creat the project in, un check the Add to existing Web Project and the press OK.
3. now create a new project, in the 2nd stem, choose to use an existeing remote directory!

have a nice programming!

Tuesday, January 16, 2007

How to recognize google visit

do you want to know if this visit is a google visit??
here is a simple asp code to do that:
< % robot=request.ServerVariables("HTTP_USER_AGENT") if (Instr(robot,"Googlebot")<>0) then
...
end if
% >

and this is how to do it with php script

< ? define("SYSTEM_FROM_NAME","Your name"); define("SYSTEM_FROM_EMAIL","Your email"); //---this script will send email to webmaster when google visit your pages. if(isset($_SERVER['HTTP_USER_AGENT']) && eregi("googlebot",$_SERVER['HTTP_USER_AGENT'])) { if ($QUERY_STRING != "") { $url = "http://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'].'?'.$QUERY_STRING; } else { $url = "http://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']; } $today = date("F j, Y, g:i a"); $headers = "From: ".SYSTEM_FROM_NAME." <".SYSTEM_FROM_EMAIL.">";
$message="";
$message.="Googlebot is crawling your site:\n";
$message.="Page: $url\n";
$message.="Date: $today \n";
$message.="IP: ".$_SERVER['REMOTE_ADDR']." \n";
mail(SYSTEM_FROM_EMAIL, "googlebot crawle - $url", "$message",$headers);}
? >