폼메일 소스 (PHP)

프로그래밍/PHP|2015. 1. 27. 11:19
반응형

첨부파일의 압축을 풀면
070.html 과 send.php 파일이 있습니다.


send.php 파일을 열어서 세번째줄 tomail 부분에 수신자 Email 주소를 넣고 저장하세요.

웹서버로 업로드 후, 웹브라우저로 070.html 파일을 불러오면 메일폼이 나옵니다.

해당 내용입력 후 발송하면 됩니다.

 

form_mail.zip


반응형

댓글()

글 복사시 출처 자동으로 넣어주기

반응형

글 복사시 출처 자동으로 넣어주기
2006/08/02 16:26 in HTML/CSS/JS

 

스크립트


<script type="text/javascript" language="javascript">
  // 글 복사시 출저 삽입함수 호출
  function contents_cp()
  {
     if (window.event)
     {
        window.event.returnValue = true;
        window.setTimeout('attach_kinref()', 25);
     }
  }

  // 클립보드에 들어갈때 출처 삽입하기
  function attach_kinref()
  {
     if (window.clipboardData) // IE
     {
        // get data from clipboard
        var txt = window.clipboardData.getData('Text');

        // attach the source at the end of text
        // 아래 빨간색 글씨 부분에 자신이 원하는 출처 글귀를 넣으면 됨.
        txt = txt + 'rn출처 : 상현넘™ [SHBLITZ.NET]';

        // set data to clibboard
        var result = window.clipboardData.setData('Text', txt);
     }
  }
</script>

 


사용하기
* 문서 전체에 반영하기
  <body onCopy='contents_cp();'> html 내용 </body>

 

* 특정 부분에만 반영하기
  <div onCopy='contents_cp();'> 내용 </div>

 

작성 : 상현넘™ [SHBLITZ.NET]

 


반응형

댓글()

php5 에서 domxml_open_mem() 함수 사용하기

프로그래밍/PHP|2015. 1. 27. 11:18
반응형

dumxml_open_mem() 함수는 php4 버전에서 사용하던 함수이며
설치하신 php버전(5)에서 사용하지 않는 함수입니다.
대신 관련라이브러리를 다운받아 소스에서 include 하시면 사용이 가능합니다.

http://alexandre.alapetite.fr/doc-alex/domxml-php4-php5/index.en.html

위 링크 내용을 참고 바랍니다.
[내용] domxml-php4-to-php5.php 를 다운받고, 홈페이지 소스폴더에 넣은 후
            php 코드 상단에 아래와 같이 넣어 사용하면 됩니다.

if (PHP_VERSION>='5')
require_once('domxml-php4-to-php5.php');

 

 

반응형

댓글()

Parse error: syntax error, unexpected T_PRIVATE, expecting ']' in

프로그래밍/PHP|2015. 1. 27. 11:18
반응형

에러 발생 소스 파일을 열고

 

[private] 부분을 [$private] 로 변경한다    <- 앞에 $ 추가

 

 

반응형

댓글()

세션 유지 확인 페이지 (test.php)

프로그래밍/PHP|2015. 1. 27. 11:18
반응형

<?
session_start();
$mytimeout = 720 * 60; // minutes * 60
echo session_id();

phpinfo();
?>

반응형

댓글()

[html] 웹페이지 자동 이동 소스

반응형

<meta http-equiv="refresh" content="0;url=http://sysdocu.tistory.com">

0초만에 http://sysdocu.tistory.com 페이지로 이동 (브라우저상의 주소도 변경됨)

반응형

댓글()

AlertDialog 메시지 창 띄우기

프로그래밍/Android (Java)|2015. 1. 27. 11:07
반응형

[공통]

import android.content.DialogInterface;

import android.app.AlertDialog;

import android.view.View.OnClickListener;




메세지를 띄우고 [확인] 버튼만 적용할 경우

1
2
3
4
5
6
7
8
9
AlertDialog.Builder alert = new AlertDialog.Builder(MyActivity.this);
alert.setPositiveButton("확인", new DialogInterface.OnClickListener() {
    @Override
    public void onClick(DialogInterface dialog, int which) {
    dialog.dismiss();     //닫기
    }
});
alert.setMessage("테스트 메세지");
alert.show();



메세지를 띄우고 [확인], [취소] 버튼으로 적용할 경우


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
AlertDialog.Builder alert_confirm = new AlertDialog.Builder(MyActivity.this);
alert_confirm.setMessage("프로그램을 종료 하시겠습니까?").setCancelable(false).setPositiveButton("확인",
new DialogInterface.OnClickListener() {
    @Override
    public void onClick(DialogInterface dialog, int which) {
        // 'YES'
    }
}).setNegativeButton("취소",
new DialogInterface.OnClickListener() {
    @Override
    public void onClick(DialogInterface dialog, int which) {
        // 'No'
    return;
    }
});
AlertDialog alert = alert_confirm.create();
alert.show();


[출처] http://shstarkr.tistory.com/144



뒤로가기로 종료하려고 할때 해당 alert 창이 뜨도록 하려면 아래 URL 을 병합하여 사용하자. - 동훈

http://sysdocu.tistory.com/942

반응형

댓글()

webview 배경색 변경

프로그래밍/Android (Java)|2015. 1. 27. 11:06
반응형

So in my views .xml file I simply added a

android:background="@+drawable/backgroundmain"

and use

web.setBackgroundColor(0);

To make the webview transparent to see the background image behind.


[출처] http://stackoverflow.com/questions/1260422/setting-webview-background-image-to-a-resource-graphic-in-android

반응형

댓글()

Preference 기본 예제

프로그래밍/Android (Java)|2015. 1. 27. 11:06
반응형

SharedPreferences pref = getSharedPreferences("setting", 0);    // setting.xml 으로 생성

SharedPreferences.Editor edit = pref.edit();


// 호출

String test = pref.getString("fcm_message", "old_data");


// 입력

edit.putString("fcm_message", "new_data");

edit.commit();



* 참고

setting.xml 과 같이 파일명을 지정하지 않고 default 값을 원할 경우 아래와 같이 사용합니다.


SharedPreferences pref = getDefaultSharedPreferences(this);


반응형

'프로그래밍 > Android (Java)' 카테고리의 다른 글

AlertDialog 메시지 창 띄우기  (0) 2015.01.27
webview 배경색 변경  (0) 2015.01.27
아이디 및 패스워드 저장 체크박스  (0) 2015.01.27
Intent 활용 예시  (0) 2015.01.27
배경 패턴이미지 적용  (0) 2015.01.27

댓글()

아이디 및 패스워드 저장 체크박스

프로그래밍/Android (Java)|2015. 1. 27. 11:05
반응형

간단한 예제



프레퍼런스를 활용한 예제


원하는 항목을 체크한뒤 종료하면


다시 실행했을 때 체크했던 항목이 불려져온다


체크하지 않았던 항목은 삭제된다



 MytestPref.zip


[출처] WareHouse (http://makerj.tistory.com/100)


반응형

'프로그래밍 > Android (Java)' 카테고리의 다른 글

webview 배경색 변경  (0) 2015.01.27
Preference 기본 예제  (0) 2015.01.27
Intent 활용 예시  (0) 2015.01.27
배경 패턴이미지 적용  (0) 2015.01.27
자바 날짜/시간 계산 예제 코드 (다양한 예제) 2  (0) 2015.01.27

댓글()

Intent 활용 예시

프로그래밍/Android (Java)|2015. 1. 27. 11:05
반응형

// 웹페이지 띄우기
Uri uri = Uri.parse("http://www.google.com");
Intent it  = new Intent(Intent.ACTION_VIEW,uri);
startActivity(it);


// 구글맵 띄우기
Uri uri = Uri.parse("geo:38.899533,-77.036476");
Intent it = new Intent(Intent.Action_VIEW,uri);
startActivity(it);


// 구글 길찾기 띄우기
Uri uri = Uri.parse("http://maps.google.com/maps?f=d&saddr=출발지주소&daddr=도착지주소&hl=ko");
Intent it = new Intent(Intent.ACTION_VIEW,URI);
startActivity(it);


// 전화 걸기
Uri uri = Uri.parse("tel:xxxxxx");
Intent it = new Intent(Intent.ACTION_DIAL, uri);  
startActivity(it); 


Uri uri = Uri.parse("tel.xxxxxx");
Intent it = new Intent(Intent.ACTION_CALL,uri);
// 퍼미션을 잊지 마세요. <uses-permission id="android.permission.CALL_PHONE" />


// SMS/MMS 발송
Intent it = new Intent(Intent.ACTION_VIEW);   
it.putExtra("sms_body", "The SMS text");   
it.setType("vnd.android-dir/mms-sms");   
startActivity(it); 


// SMS 발송
Uri uri = Uri.parse("smsto:0800000123");   
Intent it = new Intent(Intent.ACTION_SENDTO, uri);   
it.putExtra("sms_body", "The SMS text");   
startActivity(it); 


// MMS 발송
Uri uri = Uri.parse("content://media/external/images/media/23");   
Intent it = new Intent(Intent.ACTION_SEND);   
it.putExtra("sms_body", "some text");   
it.putExtra(Intent.EXTRA_STREAM, uri);   
it.setType("image/png");   
startActivity(it);


// 이메일 발송
Uri uri = Uri.parse("mailto:xxx@abc.com");
Intent it = new Intent(Intent.ACTION_SENDTO, uri);
startActivity(it);


Intent it = new Intent(Intent.ACTION_SEND);   
it.putExtra(Intent.EXTRA_EMAIL, "me@abc.com");   
it.putExtra(Intent.EXTRA_TEXT, "The email body text");   
it.setType("text/plain");   
startActivity(Intent.createChooser(it, "Choose Email Client")); 


Intent it = new Intent(Intent.ACTION_SEND);     
String[] tos = {"me@abc.com"};     
String[] ccs = {"you@abc.com"};     
it.putExtra(Intent.EXTRA_EMAIL, tos);     
it.putExtra(Intent.EXTRA_CC, ccs);     
it.putExtra(Intent.EXTRA_TEXT, "The email body text");     
it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");     
it.setType("message/rfc822");     
startActivity(Intent.createChooser(it, "Choose Email Client"));  


// extra 추가하기
Intent it = new Intent(Intent.ACTION_SEND);   
it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");   
it.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/mysong.mp3");   
sendIntent.setType("audio/mp3");   
startActivity(Intent.createChooser(it, "Choose Email Client"));


// 미디어파일 플레이 하기
Intent it = new Intent(Intent.ACTION_VIEW);
Uri uri = Uri.parse("file:///sdcard/song.mp3");
it.setDataAndType(uri, "audio/mp3");
startActivity(it);


Uri uri = Uri.withAppendedPath(
  MediaStore.Audio.Media.INTERNAL_CONTENT_URI, "1");   
Intent it = new Intent(Intent.ACTION_VIEW, uri);   
startActivity(it); 


// 설치 어플 제거
Uri uri = Uri.fromParts("package", strPackageName, null);   
Intent it = new Intent(Intent.ACTION_DELETE, uri);   
startActivity(it);


// APK파일을 통해 제거하기
Uri uninstallUri = Uri.fromParts("package", "xxx", null);
returnIt = new Intent(Intent.ACTION_DELETE, uninstallUri);


// APK파일 설치
Uri installUri = Uri.fromParts("package", "xxx", null);
returnIt = new Intent(Intent.ACTION_PACKAGE_ADDED, installUri);


// 음악 파일 재생
Uri playUri = Uri.parse("file:///sdcard/download/everything.mp3");
returnIt = new Intent(Intent.ACTION_VIEW, playUri);


// 첨부파일을 추가하여 메일 보내기
Intent it = new Intent(Intent.ACTION_SEND);  
it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");  
it.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/eoe.mp3");  
sendIntent.setType("audio/mp3");  
startActivity(Intent.createChooser(it, "Choose Email Client"));


// 마켓에서 어플리케이션 검색
Uri uri = Uri.parse("market://search?q=pname:pkg_name");  
Intent it = new Intent(Intent.ACTION_VIEW, uri);  
startActivity(it);  
// 패키지명은 어플리케이션의 전체 패키지명을 입력해야 합니다.


// 마켓 어플리케이션 상세 화면
Uri uri = Uri.parse("market://details?id=어플리케이션아이디");  
Intent it = new Intent(Intent.ACTION_VIEW, uri);  
startActivity(it);
// 아이디의 경우 마켓 퍼블리싱사이트의 어플을 선택후에 URL을 확인해보면 알 수 있습니다.


// 구글 검색
Intent intent = new Intent();
intent.setAction(Intent.ACTION_WEB_SEARCH);
intent.putExtra(SearchManager.QUERY,"searchString")
startActivity(intent);[/code]

[출처] 아이군의 블로그 (http://theeye.pe.kr/archives/1242)

반응형

댓글()