PHP &

3 Cevap php

Nasıl PHP & kullanarak bir form için bir önizleme düğmesi oluşturma hakkında gitmek istiyorum MySQL.

3 Cevap

<script language="JavaScript">
<!--
function formpreview(form) {
form.target='_blank';
form.action='preview.php';
form.submit();
}
//-->
</script> 
<input type="button" value="preview" onclick='formpreview(this.form)'>

sonra şablonu doldurmak için preview.php in $_POST dizi değerlerini kullanmak

Form bir PHP komut dosyası gönderildiğinde, o formdaki bilgileri otomatik komut dosyası için kullanılabilir yapılır. Bu bilgilere erişmek için birçok yol vardır. Norm bir veritabanı doğrudan eklemek için olduğunu.

Seni doğru anlama, o zaman bir GET veya POST yöntemi ile doğrudan kullanıcı girişi veri almak gerekir.

PHP Documentation for Variables from External Sources ile okudum

GET veya POST yöntemi ile doğrudan kullanıcı girişi veri almak.

ve sonra 2 oluşturmak "ise" bilge gibi döngü

if($_POST['preview'])// after completing the fields preview is clicked. 
{
//display the preview.... and provide a submit button in this preview

}

NOTE: the submit should also b available in form where INPUT is given , i.e , there should be three buttons, Submit, Preview and Reset..

 if($_POST['submit'])
{
//Finally,submit the values into the database..
//if needed redirect to the page of final display of form values...
}