2017-04-24 4 views
0

からの応答を取得すると呼ばれる 「にあなたの電子メールを置く場がある例他のウェブサイト

のために私は、コードが別のウェブサイト上で私にフォームの応答を提供したいと私は、コードの同じページ内の応答を取得します私の考えはあなたの電子メールが存在しない例

ため、この

$url = 'http://example.com/reset.php'; 
&email = [email protected]; 

//now i want excute email in the form inside the url 

do $email in the form of this $url and give me the response 

ある "「 "

をあなたのパスワードをリセット

と私は上記のウェブサイトに行かなくても、このすべてをよろしいはちょうど私がメール

を入れたときに私はあなたが私の考え を持って、ごめんなさいことを願って、フォームの応答であるかを知りたいです私の英語のために。

+0

あなたは 'cURL'と呼ばれている探しているツール:https://secure.php.net/manual/en/book。 curl.php – David

+0

どうやって使うの?私はそれを理解しようとしましたが、icouldではありません – AllordEmad

+0

"私は理解できませんでした"は本当に答えることのできない質問です。何を試しましたか?簡単な例から始めましょう(クイックGoogleの検索では多くのものが見つかります)。 – David

答えて

0

jQuery('#submit').click(function() { 
 
    var email = jQuery('#email').val(); 
 

 
    jQuery.post('http://example.com/reset.php', {email: email}).done(function (result) { 
 
     jQuery('#result').text(result.status); 
 
    }); 
 
    }); 
 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script> 
 

 
<input type="email" id="email"/> 
 
<button id="submit">Submit</button> 
 

 
<div id-"result"></div>

http://example.com/reset.php

$email = $_GET['email']; 

if (is_valid($email)) { 
    echo json_encode(array('status' => 'Your email is valid')); 
} else { 
    echo json_encode(array('status' => 'Your email is not valid')); 
} 

function is_valid($email) { 
    // do something to validate the email (for ex. check match in database etc) 
    // return true OR false 
} 
関連する問題