PHP 基本表格处理程序
<?php
$fields = array();
$fields{"Name"} = "Name";
$fields{"Email"} = "Email";
$fields{"Message"} = "Message";
$to = "webmaster@excelegance.com" ;
$from = $_REQUEST['Email'] ;
$name = $_REQUEST['Name'] ;
$headers = "From: $from";
$subject = "NCCDC Web contact -- From contact page";
$body = "WEB CONTACT FROM NCCDC \n\n We have received the following information:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); }
/*Second email */
$headers2 = "From: noreply@excelegance.com";
$subject2 = "Thank you for contacting NCCDC";
$autoreply = "Thank you for contacting us. Somebody will get back to you as soon as possible, usually within 48 hours. If you have any more questions, please consult our website at www.pdxchild.org";
$autoreply .= "\n\n You Wrote: \n".$_REQUEST["Message"];
if($from == '') {print "You have not entered an email, please go back and try again";}
else {
if($name == '') {print "You have not entered a name, please go back and try again";}
else {
$send = mail($to, $subject, $body, $headers);
$send2 = mail($from, $subject2, $autoreply, $headers2);
if($send)
{header( "Location: ../thankyou/" );}
else
{print "We encountered an error sending your mail, please notify webmaster@otcjugband.com"; }
}
}
?>
ActionScript 3 在AS3中声明和输出字符串值
//declare a String, and assign a value to it
var str:String = "This is a string.";
//trace the value of the String
trace(str);
Other @fractastical testMethod
public static testMethod void t1() {
//setup test data
Test.startTest();
User u = TestUtility.createTestUser([select id, name from Profile where name='Standard User' limit 1]);
System.runAs(u) {
}
Test.stopTest();
}
Other @umityalcinalp URLRewriter
http://blog.sforce.com/sforce/2010/05/url-rewriting-for-your-customizing-your-site-urls.html
global class ApexClassName implements Site.UrlRewriter {
global PageReference mapRequestUrl(PageReference externalUrl) {//}
global List<PageReference> generateUrlFor(List<PageReference> myForcedotcomUrls) {//...}
}
Note that a developer may not need all of the methods and may choose to return a null.
Here is the implementation of our the global Apex class that maps the URLs from our example:
global class myRewriter implements Site.UrlRewriter {
//Variables to represent the friendly URLs for pages
String DIRECTORY = '/friendly/';
//Variables to represent my custom Visualforce pages that display page information
String VISUALFORCE_PAGE = '/page?pageid=';
// The first global method for mapping external URL to an internal one
global PageReference mapRequestUrl(PageReference myFriendlyUrl){
String url = myFriendlyUrl.getUrl();
if(url.startsWith(DIRECTORY)){
String name = url.substring(DIRECTORY.length(),url.length());
//Select the ID of the page that matches the name from the URL
Page__c site_page = [select id from Page__c where name =:name LIMIT 1];
//Construct a new page reference in the form of my Visualforce page
return new PageReference(VISUALFORCE_PAGE + site_page.id);
}
//If the URL isn't in the form of a cmasforce page, continue with the request
return null;
}
// The second global method for mapping internal Ids to URLs
global List<PageReference> generateUrlFor(List<PageReference> mySalesforceUrls){
//A list of pages to return after all the links have been evaluated
List<PageReference> myFriendlyUrls = new
List<PageReference>();
for(PageReference mySalesforceUrl : mySalesforceUrls){
//Get the URL of the page
String url = mySalesforceUrl.getUrl();
//If this looks like a page that needs to be mapped, transform it
if(url.startsWith(VISUALFORCE_PAGE)){
//Extract the ID from the query parameter
String id= url.substring(VISUALFORCE_PAGE.length(), url.length());
//Query for the name of the cmsforce page to put in the URL
Page__c site_page2 = [select name from Page__c where id =:id LIMIT 1];
//Construct the new URL
myFriendlyUrls.add(new PageReference(DIRECTORY+ site_page2.name));
}
else {
//If this doesn't start like an cmsforce page, don't do any transformations
myFriendlyUrls.add(mySalesforceUrl);
}
}
//Return the full list of pages
return myFriendlyUrls;
}
}
Other LOREM
<p><strong>Lorem Ipsum</strong> - Ñто текÑÑ‚-"рыба",
чаÑто иÑпользуемый в печати и вÑб-дизайне. Lorem Ipsum ÑвлÑетÑÑ
Ñтандартной "рыбой" Ð´Ð»Ñ Ñ‚ÐµÐºÑтов на латинице Ñ Ð½Ð°Ñ‡Ð°Ð»Ð° XVI века. Ð’ то
Ð²Ñ€ÐµÐ¼Ñ Ð½ÐµÐºÐ¸Ð¹ безымÑнный печатник Ñоздал большую коллекцию размеров и форм
шрифтов, иÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÑ Lorem Ipsum Ð´Ð»Ñ Ñ€Ð°Ñпечатки образцов. Lorem Ipsum не
только уÑпешно пережил без заметных изменений пÑÑ‚ÑŒ веков, но и
перешагнул в Ñлектронный дизайн. Его популÑризации в новое времÑ
поÑлужили Ð¿ÑƒÐ±Ð»Ð¸ÐºÐ°Ñ†Ð¸Ñ Ð»Ð¸Ñтов Letraset Ñ Ð¾Ð±Ñ€Ð°Ð·Ñ†Ð°Ð¼Ð¸ Lorem Ipsum в 60-Ñ…
годах и, в более недавнее времÑ, программы Ñлектронной вёрÑтки типа
Aldus PageMaker, в шаблонах которых иÑпользуетÑÑ Lorem Ipsum.</p>
<div class="rc">
<h2 class="why"><span>Почему он иÑпользуетÑÑ?</span></h2>
<p>Давно выÑÑнено, что при оценке дизайна и композиции читаемый текÑÑ‚ мешает
ÑоÑредоточитьÑÑ. Lorem Ipsum иÑпользуют потому, что тот обеÑпечивает
более или менее Ñтандартное заполнение шаблона, а также реальное
раÑпределение букв и пробелов в абзацах, которое не получаетÑÑ Ð¿Ñ€Ð¸
проÑтой дубликации "ЗдеÑÑŒ ваш текÑÑ‚.. ЗдеÑÑŒ ваш текÑÑ‚.. ЗдеÑÑŒ ваш
текÑÑ‚.." Многие программы Ñлектронной вёрÑтки и редакторы HTML иÑпользуют Lorem
Ipsum в качеÑтве текÑта по умолчанию, так что поиÑк по ключевым Ñловам
"lorem ipsum" Ñразу показывает, как много веб-Ñтраниц вÑÑ‘ ещё дожидаютÑÑ
Ñвоего наÑтоÑщего рождениÑ. За прошедшие годы текÑÑ‚ Lorem Ipsum получил
много верÑий. Ðекоторые верÑии поÑвилиÑÑŒ по ошибке, некоторые -
намеренно (например, юмориÑтичеÑкие варианты).</p>
</div>
<div class="lc"><h2 class="where"><span>Откуда он
поÑвилÑÑ?</span></h2><p>Многие думают, что Lorem Ipsum - взÑтый Ñ
потолка пÑевдо-латинÑкий набор Ñлов, но Ñто не ÑовÑем так. Его корни
уходÑÑ‚ в один фрагмент клаÑÑичеÑкой латыни 45 года н.Ñ., то еÑÑ‚ÑŒ более
двух Ñ‚Ñ‹ÑÑчелетий назад. Ричард МакКлинток, профеÑÑор латыни из колледжа
Hampden-Sydney, штат ВирджиниÑ, взÑл одно из Ñамых Ñтранных Ñлов в Lorem
Ipsum, "consectetur", и занÑлÑÑ ÐµÐ³Ð¾ поиÑками в клаÑÑичеÑкой латинÑкой
литературе. Ð’ результате он нашёл неоÑпоримый первоиÑточник Lorem Ipsum в
разделах 1.10.32 и 1.10.33 книги "de Finibus Bonorum et Malorum" ("О
пределах добра и зла"), напиÑанной Цицероном в 45 году н.Ñ. Ðтот трактат
по теории Ñтики был очень популÑрен в Ñпоху ВозрождениÑ. ÐŸÐµÑ€Ð²Ð°Ñ Ñтрока
Lorem Ipsum, "Lorem ipsum dolor sit amet..", проиÑходит от одной из
Ñтрок в разделе 1.10.32</p><p>КлаÑÑичеÑкий текÑÑ‚ Lorem Ipsum,
иÑпользуемый Ñ XVI века, приведён ниже. Также даны разделы 1.10.32 и
1.10.33 "de Finibus Bonorum et Malorum" Цицерона и их английÑкий
перевод, Ñделанный H. Rackham, 1914 год.</p>
</div>
<h2 class="getsome"><span>Где его взÑÑ‚ÑŒ?</span></h2>
<p>ЕÑÑ‚ÑŒ много вариантов Lorem Ipsum, но большинÑтво из них имеет не вÑегда приемлемые
модификации, например, юмориÑтичеÑкие вÑтавки или Ñлова, которые даже
отдалённо не напоминают латынь. ЕÑли вам нужен Lorem Ipsum длÑ
Ñерьёзного проекта, вы навернÑка не хотите какой-нибудь шутки, Ñкрытой в
Ñередине абзаца. Также вÑе другие извеÑтные генераторы Lorem Ipsum
иÑпользуют один и тот же текÑÑ‚, который они проÑто повторÑÑŽÑ‚, пока не
доÑтигнут нужный объём. Ðто делает предлагаемый здеÑÑŒ генератор
единÑтвенным наÑтоÑщим Lorem Ipsum генератором. Он иÑпользует Ñловарь из
более чем 200 латинÑких Ñлов, а также набор моделей предложений. Ð’
результате Ñгенерированный Lorem Ipsum выглÑдит правдоподобно, не имеет
повторÑющихÑÑ Ð°Ð±Ð·Ð°Ñ†ÐµÐ¹ или "невозможных" Ñлов.</p>
C# '哪个'命令,在C#中
using System;
using System.IO;
using System.Text;
using Microsoft.Win32;
using System.Diagnostics;
class Script
{
const string usage = "Usage: cscscript which file\nVerifies which copy of the executable file would be executed if invoked from command-prompt.\n"+
"file - name of the executable file\n";
static public void Main(string[] args)
{
if (args.Length == 0 ||
(args.Length == 1 && (args[0] == "?" || args[0] == "/?" || args[0] == "-?" || args[0].ToLower() == "help")))
{
Console.WriteLine(usage);
}
else
{
string file = args[0].EndsWith(".exe") ? args[0] : args[0]+".exe";
string filePath = file;
if (File.Exists(file))
Console.WriteLine(Path.GetFullPath(filePath));
else
foreach(string dir in Environment.GetEnvironmentVariable("Path").Split(";".ToCharArray()))
{
if (File.Exists(filePath = Path.Combine(dir, file)))
{
Console.WriteLine(filePath);
break;
}
}
}
}
}
CSS CSS3旋转功能在IE中运行良好
iframe {
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
transform: rotate(-90deg);
position: absolute;
filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
}
PHP CSS调试
*:hover { outline: 2px dotted red; } * *:hover { outline: 2px dotted green; } * * *:hover { outline: 2px dotted orange; } * * * *:hover { outline: 2px dotted blue; } * * * * *:hover { outline: 1px solid red; } * * * * * *:hover { outline: 1px solid green; } * * * * * * *:hover { outline: 1px solid orange; } * * * * * * * *:hover { outline: 1px solid blue; }
Bash bash [script] - 使用wget下载网站
#! /bin/bash
# use this script for downloading websites using 'wget' utility
# replace URL field with the URL to be downloaded
URL="$1"
wget -Nrkpl 0 $URL
# wget flags and their functions
# -r = recursive: follows the links
# -k = changes links adresses to their local file adress
# -p = downloads images
# -l = recursion level. 0 for infinite.
exit
XML Ensim托管Exchange服务
<?xml version="1.0" encoding="utf-8" ?>
<soapenv:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:exc="http://ensim.com/unifyws/Exchange2K7WS" xmlns:com="http://ensim.com/unifyws/commontypes" xmlns:dat="http://ensim.com/unifyws/Exchange2K7WS/datatypes">
<soapenv:Header>
<exc:AuthInfo>
<com:Username>#xmlFormat(scope.cp4Username)#</com:Username>
<com:Password>#xmlFormat(scope.cp4Password)#</com:Password>
<com:Context>#xmlFormat(scope.cp4ResellerAccount)#</com:Context>
</exc:AuthInfo>
</soapenv:Header>
<soapenv:Body>
<exc:AddOrgService>
<exc:domainName>#xmlFormat(arguments.domainName)#</exc:domainName>
<exc:orgServiceDetails>
<dat:ExchangeVSCConfig>
<dat:Version>#xmlFormat(scope.cp4ExchangeVersion)#</dat:Version>
<dat:ExternalContacts>true</dat:ExternalContacts>
<dat:PublicFolders>true</dat:PublicFolders>
<dat:DTOutlookSetup>true</dat:DTOutlookSetup>
<dat:DTActiveSynch>false</dat:DTActiveSynch>
<dat:SendLimit>100</dat:SendLimit>
<dat:SendRecvLimit>130</dat:SendRecvLimit>
<dat:DiskSpace>#xmlFormat(arguments.diskSpace)#</dat:DiskSpace>
<dat:MailBoxLimit>#xmlFormat(arguments.numMailboxes)#</dat:MailBoxLimit>
<dat:PFDiskSpace>100</dat:PFDiskSpace>
<dat:POPEnabledMailboxLimit>#xmlFormat(arguments.numMailboxes)#</dat:POPEnabledMailboxLimit>
<dat:IMAPEnabledMailboxLimit>#xmlFormat(arguments.numMailboxes)#</dat:IMAPEnabledMailboxLimit>
<dat:OWAEnabledMailboxLimit>#xmlFormat(arguments.numMailboxes)#</dat:OWAEnabledMailboxLimit>
<dat:MAPIEnabledMailboxLimit>#xmlFormat(arguments.numMailboxes)#</dat:MAPIEnabledMailboxLimit>
<dat:MobilityEnabledMailboxLimit>0</dat:MobilityEnabledMailboxLimit>
<dat:ShFoldersEnLimit>#xmlFormat(arguments.numMailboxes)#</dat:ShFoldersEnLimit>
<dat:ShCalEnLimit>#xmlFormat(arguments.numMailboxes)#</dat:ShCalEnLimit>
<dat:ShContactEnLimit>#xmlFormat(arguments.numMailboxes)#</dat:ShContactEnLimit>
<dat:ShTasksEnLimit>#xmlFormat(arguments.numMailboxes)#</dat:ShTasksEnLimit>
<dat:GrpSchEnLimit>#xmlFormat(arguments.numMailboxes)#</dat:GrpSchEnLimit>
<dat:UMEnabledMailboxLimit>#xmlFormat(arguments.numMailboxes)#</dat:UMEnabledMailboxLimit>
<dat:AutoGrow>Never</dat:AutoGrow>
<dat:DiskSpaceLowerBound>0</dat:DiskSpaceLowerBound>
<dat:DiskSpaceIncrement>0</dat:DiskSpaceIncrement>
<dat:DiskSpaceUpperBound>0</dat:DiskSpaceUpperBound>
<dat:MailBoxLimitLowerBound>0</dat:MailBoxLimitLowerBound>
<dat:MailBoxLimitIncrement>0</dat:MailBoxLimitIncrement>
<dat:MailBoxLimitUpperBound>0</dat:MailBoxLimitUpperBound>
<dat:OrgInstances>1</dat:OrgInstances>
<dat:UnifiedMessages>false</dat:UnifiedMessages>
<dat:Compliances>false</dat:Compliances>
<dat:IsConsumerOrganization>false</dat:IsConsumerOrganization>
<dat:templates>
<dat:anyType xsi:type="xsd:string">Core</dat:anyType>
</dat:templates>
<dat:FlexibleMailboxSizes>true</dat:FlexibleMailboxSizes>
<dat:OTADeliveryPrefList>
<dat:MobileAccess>false</dat:MobileAccess>
<dat:USBDelivery>false</dat:USBDelivery>
<dat:EmailDelivery>false</dat:EmailDelivery>
<dat:OTADelivery>false</dat:OTADelivery>
<dat:SMSDelivery>false</dat:SMSDelivery>
</dat:OTADeliveryPrefList>
<dat:NumMobilityUsers>0</dat:NumMobilityUsers>
<dat:PFoab>true</dat:PFoab>
<dat:WEBoab>false</dat:WEBoab>
</dat:ExchangeVSCConfig>
</exc:orgServiceDetails>
<exc:info>
<dat:poolName>#xmlFormat(scope.cp4ExchangePoolName)#</dat:poolName>
</exc:info>
</exc:AddOrgService>
</soapenv:Body>
</soapenv:Envelope>