![]() | |
| | #1 (permalink) |
| Cevizci Üyelik Tarihi: 06/2005
Mesaj: 111
|
Form icindeki bilgileri post ettigimde ayni sayfada alip database e gondermek istiyorum. PHP Kodu: Kod: <form name="newvendor" action="<?=$PHP_SELF."".$QUERY_STRING;?>" method="post" target="_self"> |
| | |
| | #3 (permalink) |
| Cevizci Üyelik Tarihi: 06/2005
Mesaj: 111
|
linkteki id degeri isime yariyor. Ayni sayfada eger ilk defa girmisse form cikiyor. Submit etmisse id 1 oluyor ve databasee query gonderiyor. Eger action kismini kaldirirsam submit ettirdigimi nasil anlayip queryi calistiricam ?
|
| | |
| | #7 (permalink) |
| Cevizci Üyelik Tarihi: 06/2005
Mesaj: 111
|
arthonun dedigi gibi actioni bos birakip targeti kaldirdim. If icin ise dediginiz gibi post ettirerek kontrol ettirdim. Sonuc : Ayri pencere acilmakla kalmayip hem if hem de elseteki islemler gerceklesti. Yani hem form cikti hem de veriler database'e girildi. |
| | |
| | #9 (permalink) |
| Cevizci Üyelik Tarihi: 06/2005
Mesaj: 111
| Kod: <? session_start();?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>New Vendor</title>
<script type="text/javascript">
function closewindow(){
self.location.href = 'newvendor_popup.php'
}
function kapat()
{
window.opener.document.location.reload();
return true;
}
</script>
</head>
<body>
<?
$QUERY_STRING = "newvendor_popup.php?id=1";
$pass = $_GET["id"];
if(!$_POST['userid'])
{
?>
<form name="newvendor" action="" method="post">
<table width="200" border="1" cellspacing="1" cellpadding="1">
<tr>
<th scope="row">Vendor Name</th>
<td><input name="vendorname" type="text" size="30" /></td>
</tr>
<tr>
<th scope="row">Contact Name</th>
<td><input name="contactname" type="text" size="30" /></td>
</tr>
<tr>
<th scope="row">Address1</th>
<td><input name="address1" type="text" size="30" /></td>
</tr>
<tr>
<th scope="row">Address2</th>
<td><input name="address2" type="text" size="30" /></td>
</tr>
<tr>
<th scope="row">Address3</th>
<td><input name="address3" type="text" size="30" /></td>
</tr>
<tr>
<th scope="row">Address4</th>
<td><input name="address4" type="text" size="30" /></td>
</tr>
<tr>
<th scope="row" align="center" colspan="2"><label><u>Telephone Numbers</u></label><br /></th>
</tr>
<tr>
<th scope="row">Voice</th>
<td><input name="voice" type="text" size="30" /></td><th scope="row">Ext1</th><td><input name="ext1" type="text" size="10" /></td>
</tr>
<tr>
<th scope="row">Voice2</th>
<td><input name="voice2" type="text" size="30" /></td><th scope="row">Ext2</th><td><input name="ext2" type="text" size="10" /></td>
</tr>
<tr>
<th scope="row">Pager</th>
<td><input name="pager" type="text" size="30" /></td>
</tr>
<tr>
<th scope="row">Home</th>
<td><input name="home" type="text" size="30" /></td>
</tr>
<tr>
<th scope="row">Fax1</th>
<td><input name="fax1" type="text" size="30" /></td>
</tr>
<tr>
<th scope="row">Fax2</th>
<td><input name="fax2" type="text" size="30" /></td>
</tr>
<tr>
</tr>
<tr>
<th scope="row">Terms of Payment</th>
<td><input name="payment" type="text" size="30" /></td>
</tr>
<tr>
<th scope="row">Email</th>
<td><input name="email" type="text" size="30" /></td>
</tr>
<tr>
<th scope="row">Web Address</th>
<td><input name="web" type="text" size="30" /></td>
</tr>
<tr>
<th scope="row">Notes</th>
<td><textarea name="notes" rows="5" cols="25"></textarea></td>
</tr>
<tr>
<input type="hidden" name="userid" value="<?=$_SESSION["userid"]?>" />
<td align="center" colspan="4"><input type="submit" value="OK"/> <input type="reset" value="Reset" /> </td>
</tr>
</table>
</form>
<?
}
else{
$vendorname = $_POST["vendorname"];
$contactname = $_POST["contactname"];
$address1 = $_POST["address1"];
$address2 = $_POST["address2"];
$address3 = $_POST["address3"];
$address4 = $_POST["address4"];
$voice = $_POST["voice"];
$voice2 = $_POST["voice2"];
$pager = $_POST["pager"];
$home = $_POST["home"];
$fax1 = $_POST["fax1"];
$fax2 = $_POST["fax2"];
$ext1 = $_POST["ext1"];
$ext2 = $_POST["ext2"];
$email = $_POST["email"];
$payment = $_POST["payment"];
$web = $_POST["web"];
$notes = $_POST["notes"];
$userid = $_POST["userid"];
$_SESSION["userid"] = $userid;
include("../functions/functions.php");
db_connect();
$query = "insert into vendor(VendorName,ContactName,ContactAddress1,ContactAddress2,ContactAddress3,ContactAddress4,TelephoneVoice1,TelephoneVoice2,Pager,Home,Fax1,Fax2,Ext1,Ext2,Email,TermsofPayment,Website,Notes,UserId) values('$vendorname','$contactname','$address1','$address2','$address3','$address4','$voice','$voice2','$pager','$home','$fax1','$fax2','$ext1','$ext2','$email','$payment','$web','$notes',$_SESSION[userid])";
mysql_query($query) or die(mysql_error());
print("<script language='javascript'>closewindow();</script>");
}
?>
</body>
</html>
|
| | |
![]() |
| Bookmarks |
| Seçenekler | |
| |
Benzer Konular | ||||
| Konu | Konuyu açana göre | Forum | Cevap | En Son Mesaj |
| Formdan bilgileri aynı sayfada almak? | turansoylu | ASP | 8 | 05/12/2006 17:58 |
| Aynı sayfada bi yere link ile gonderme?? | militaN | Web Tasarım | 5 | 26/12/2005 12:04 |
| html form elemanlarini sayfada nasil ayni formatda goruntuleyebilirim | hebeler | Web Tasarım | 6 | 19/11/2005 23:23 |
| Ayni sayfada veritabanimdaki farkli tablolardan istenilen kaydi almak | benimsitem | ASP | 5 | 10/05/2005 13:24 |
| Ayni sayfada birden fazla charset sorunu? 10 PUANLIK SORU :) | terstokat | Web Tasarım | 5 | 07/12/2002 02:23 |
| Reklamlar & Desteklenenler | |
| Hassas Valf | Hassas Kaplama | Antalyamız | Gazete | Ticari Bilişim | Hakan Müştak | Rüya Tabirleri | Kadın | Hastalıklar | Cepte msn ve e-posta | Webmaster | Antalya Aupair | Turkish Property Antalya | Forum | Chat | Perde | Adsl | Araba | bolindir.com | guncelle.com | livescore | Web Tasarım | evden eve nakliyat | forum | evden eve | sohbet | Resimcim| Kalifiye İnsan Kaynakları | Web Tasarım | Oyun | Yusuf KOÇ | Akın Yorulmaz | şiir | UFO | Web Tasarım | Oyunlar | Canlı Tv | |