0
で$変数を含めますは、私はアヤックスが行われたときの画像を返すようにしようとしていますが、私は応答してセッション変数を含める方法がわからない、これは私のコードでAjaxの成功機能
<?php
// using time() as the cache buster, the image will never be cache by the browser
// to solve it, you need to add condition that will check if the image has change or not.
// or maybe you need to change the filename if it changes without adding a cache buster.
echo $_SESSION['sess_img_chofer']."?v=".time();
そして、あなたのjavascriptに:その後、私はあなたがこのようprocess.php
でその画像のファイル名をエコーすることができます#new-image
HTML注入には注意が必要です。 .attr( 'src'、 'uploads/img /' + image).attr($( '#new-image')のようなものです。 '、' img-upload ')) ' – Phil
@ vher2これはうまくいっている、問題はそれが新しいイメージを更新しないということです、私は新しいアイデアをリリースするためにF5を与えなければなりませんか? – GePraxa
これは古い画像 '$ _SESSION ['sess_img']'です。 – vher2