• 10-07-2009, 10:41:48
    #1
    Merhaba arkadaşlar

    Bu şekilde txt okuyup form içine yazdırıyorum daha sonra gönder diyip veritabanına kaydediyorum.

    Ben bunu istiyorumki tek tek forma gönder demektense okuyup direk yazsın ancak .txt içinde makale

    başlık:bla bla bla bla
    kelimeler:bla,bla,bla
    metin:bla bla bla bla...

    diye yazıyor. yazarken bunları ayırması lazım. nasıl yapabilirim yardımcı olabilir misiniz?

    <?
    include "baglanti.php";
    //Okumak için dosyaya erişelim
    $dosya = fopen($_GET[dosya],"r");
    //Kontrol
    if(!($dosya))
    {
    echo("Hata: ");
    echo("yeni_dosya.txt bulunamadı.\n");
    exit;
    }
    include "editor.php";
    ?>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9" />
    <div align="center">
    <h1>Makale Gönder</h1>
    <form action="gonder.php" method="post">
    <table align="center" border="0" cellpadding="5" cellspacing="5">
    	<tr>
    		<td width="80" align="right">Başlık:</td>
    		<td width="600"><input type="text" name="baslik"></td>
    	</tr>
    	<tr>
    		<td align="right">Kelimeler:</td>
    		<td ><input type="text" name="kelime" style="width:300px;"></td>
    	</tr>
    	<tr>
    		<td align="right">Kısa Metin:</td>
    		<td><textarea name="kisa" rows="5" cols="85"></textarea></td>
    	</tr>
    	<tr>
    		<td align="right">Metin:</td>
    		<td><textarea name="metin" id="metin" rows="5" cols="50">
    			<?
    			//satır satır okuyalım
    			while(!feof($dosya))
    			{
    				$satir = fgets($dosya, 255);
    				echo("$satir <br>\n");
    			}
    			?>
    			</textarea>
    		</td>
    	</tr>
    	<tr>
    		<td></td>
    		<td><input type="submit" value="Gönder"></td>
    	</tr>
    </table>
    </form>
    </div>
    <?
    //dosyayı kapatalım
    fclose($dosya);
    ?>
  • 10-07-2009, 11:03:23
    #2
    Üyeliği durduruldu
    şöyle yapsanız txt dosyasına

    <!--Başlık başlıyor -->
    bla bla
    <!--Başlık bitiyor-->

    <!--Kelimeler başlıyor -->
    kelimerler vs vs
    <!--Kelimeler bitiyor-->

    <!--Metin başlıyor -->
    metin içergi
    <!--Metin bitiyor-->

    bunu ise file_Get_content ile baglanıp explode,preg_match,preg_match_all ilede almak en mantıklısı gibi geliyor.
  • 10-07-2009, 11:05:18
    #3
    .txt içeriği bu şekilde

    Title: 
    3 Different Types Of Camera’s:  Box, Folding-Roll, And Viewfinder
    Word Count:
    403
    Summary:
    This article will outline 3 different types of camera’s: Box, Folding-Roll, and Viewfinder. This information will help you decide which camera suits your photography needs the best.
    For over several decades the box camera was the gadget of choice for the typical amateur photographer. This is because it was cheap and simple, yet still capable of excellent results under most conditions. Box cameras were usually fitted with a single-element lens, a limited range opening contr...
    Keywords:
    cameras,box camera,viewfinder,folding-roll camera
    Article Body:
    This article will outline 3 different types of camera’s: Box, Folding-Roll, and Viewfinder. This information will help you decide which camera suits your photography needs the best.
    For over several decades the box camera was the gadget of choice for the typical amateur photographer. This is because it was cheap and simple, yet still capable of excellent results under most conditions. Box cameras were usually fitted with a single-element lens, a limited range opening control,
  • 10-07-2009, 11:09:48
    #4
    Üyeliği durduruldu
    <!-- baslik--> 
    3 Different Types Of Camera’s:  Box, Folding-Roll, And Viewfinder 
    Word Count: 
    403 
    Summary: 
    This article will outline 3 different types of camera’s: Box, Folding-Roll, and Viewfinder. This information will help you decide which camera suits your photography needs the best. 
    For over several decades the box camera was the gadget of choice for the typical amateur photographer. This is because it was cheap and simple, yet still capable of excellent results under most conditions. Box cameras were usually fitted with a single-element lens, a limited range opening contr... 
    <!-- baslik bitti--> 
    <!-- etiket-->
    Keywords: 
    cameras,box camera,viewfinder,folding-roll camera
    <!-- etiket bitti--> 
    <!-- metin -->
    This article will outline 3 different types of camera’s: Box, Folding-Roll, and Viewfinder. This information will help you decide which camera suits your photography needs the best. 
    For over several decades the box camera was the gadget of choice for the typical amateur photographer. This is because it was cheap and simple, yet still capable of excellent results under most conditions. Box cameras were usually fitted with a single-element lens, a limited range opening control,
    <!-- metin bitti -->
    $baglan = file_get_contents("metinler.txt");
    
    preg_match("'<!-- baslık-->(.*?)<!-- baslık bitti-->'si",$baglan,$baslik);
    
    echo $baslik[1];
  • 10-07-2009, 11:28:44
    #5
    Loverzsoft kodları ekledim.

    index.php

    <?
    include "baglanti.php";
    //Okumak için dosyaya erişelim
    $dosya = fopen($_GET[dosya],"r");
    //Kontrol
    if(!($dosya))
    {
    echo("Hata: ");
    echo("yeni_dosya.txt bulunamadı.\n");
    exit;
    }
    include "editor.php";
    ?>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9" />
    <div align="center">
    <h1>Makale Gönder</h1>
    <form action="gonder.php" method="post">
    <table align="center" border="0" cellpadding="5" cellspacing="5">
    	<tr>
    		<td width="80" align="right">Başlık:</td>
    		<td width="600"><input type="text" name="baslik"></td>
    	</tr>
    	<tr>
    		<td align="right">Kelimeler:</td>
    		<td ><input type="text" name="kelime" style="width:300px;"></td>
    	</tr>
    	<tr>
    		<td align="right">Kısa Metin:</td>
    		<td><textarea name="kisa" rows="5" cols="85"></textarea></td>
    	</tr>
    	<tr>
    		<td align="right">Metin:</td>
    		<td><textarea name="metin" id="metin" rows="5" cols="50">
    			<?
    			//satır satır okuyalım
    			while(!feof($dosya))
    			{
    				$satir = fgets($dosya, 255);
    				echo("$satir <br>\n");
    			}
    			?>
    			</textarea>
    		</td>
    	</tr>
    	<tr>
    		<td></td>
    		<td><input type="submit" value="Gönder"></td>
    	</tr>
    </table>
    </form>
    </div>
    <?
    //dosyayı kapatalım
    fclose($dosya);
    ?>
    gönder.php
    <?
    include "baglanti.php";
    $baslik = $_POST['baslik'];
    $kisa = $_POST['kisa'];
    $metin = $_POST['metin'];
    $kelime = $_POST['kelime'];
    mysql_query("Insert Into icerikler (baslik,kisa,metin,kelime,tarih) values ('$baslik','$kisa','$metin','$kelime',now())");
    ?>
    <script language="javascript" type="text/javascript">
    alert('Makale eklendi');
    window.location = "index.php?dosya=metinler/"
    </script>
    Herhangi bir metin.
    Title: 
    3 Ways CCTV Can Help Your Business
    Word Count:
    356
    Summary:
    Many business managers and owners discount the idea of installing a CCTV system on their premises. Worried about costs and benefits, they use other security measures to protect their stock and their staff.
    CCTV systems could be more beneficial than you think. Here are three key ways that CCTV can help to protect your business.
    Deterrent
    Although they won’t stop all crime, it is thought that visible CCTV systems act as a deterrent to would-be criminals. It’s far less ...
    Keywords:
    cctv, cctv systems
    Article Body:
    Many business managers and owners discount the idea of installing a CCTV system on their premises. Worried about costs and benefits, they use other security measures to protect their stock and their staff.
    CCTV systems could be more beneficial than you think. Here are three key ways that CCTV can help to protect your business.
    Deterrent
    Although they won’t stop all crime, it is thought that visible CCTV systems act as a deterrent to would-be criminals. It’s far less risky to steal from a shop with no CCTV than from one that explains its system clearly in a window poster and which has highly visible cameras. The presence of a camera at the entrance or exit of a building and watching over key areas like retail sales floors or IT suites can make the difference between your business being targeted and the criminal moving on.
    Evidence and Interference
    Depending on the type of system you install, CCTV has the potential both to stop a crime before it occurs and to provide the police with valuable images that can help them to detain a suspect. Monitored systems, where the images are fed from the camera to a real-time monitor, allow security staff to see what’s happening at the premises at all times. If they pick up anyone behaving suspiciously they can alert staff on the ground who may be able to prevent a crime. Recorded systems, on the other hand, should give ***** information on the appearance and activities of any criminals, which can make a huge difference to a police investigation.
    Peace of mind
    For anyone working in, shopping in or visiting your business premises, the knowledge that there is a working CCTV system in place brings peace of mind. Not only does it let your employees know that you are concerned for their safety, but customers and visitors recognise it as a deterrent and automatically feel safer than in a business where there are no cameras at all. Whilst not everyone likes the presence of CCTV cameras in public places, most people would say that such systems make them feel more comfortable.
  • 10-07-2009, 11:38:27
    #6
    Üyeliği durduruldu
    hocam tek yapmanız gereken

    $baglan = file_get_contents("metinler.txt");

    preg_match("'<!-- baslık-->(.*?)<!-- baslık bitti-->'si",$baglan,$baslik);

    ile çekmek ve textbox'a value="'.$baslik[1].'"
    yapmanız zor olan birşey göremiyorum.

  • 10-07-2009, 11:54:01
    #7
    LoverzSoft adlı üyeden alıntı: mesajı görüntüle
    hocam tek yapmanız gereken
    $baglan = file_get_contents("metinler.txt");
    preg_match("'<!-- baslık-->(.*?)<!-- baslık bitti-->'si",$baglan,$baslik);
    ile çekmek ve textbox'a value="'.$baslik[1].'"
    yapmanız zor olan birşey göremiyorum.

    Dediğin gibi yaptım oldu.

    Baslık, kelime ve kısa metni alabiliyorum ancak ana metini alamıyorum.

    dosya.php

    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9" />
    <?
    $baglan = file_get_contents("1.txt");
    preg_match_all("#Title:(.*?)Word Count:#s", $baglan, $baslik); 
    preg_match_all("#Summary:(.*?)Keywords:#s", $baglan, $kisa); 
    preg_match_all("#Keywords:(.*?)Article Body:#s", $baglan, $kelime); 
    preg_match_all("#Article Body:(.*?)#s", $baglan, $metin); 
    for ($i=0; $i<count($baslik[1]); $i++) 
    {
    	$txtbaslik=$baslik[1][$i];
    	$txtkisa=$kisa[1][$i];
    	$txtmetin=$metin[2][$i];
    	$txtkelime=$kelime[1][$i];
    	echo $txtbaslik;
    	echo "<br>";
    	echo $txtkisa;
    	echo "<br>";
    	echo $txtmetin;
    	echo "<br>";
    	echo $txtkelime;
    }
    ?>
    metin.txt

    Title: 
    3 Different Types Of Camera’s:  Box, Folding-Roll, And Viewfinder
    Word Count:
    403
    Summary:
    This article will outline 3 different types of camera’s: Box, Folding-Roll, and Viewfinder. This information will help you decide which camera suits your photography needs the best.
    For over several decades the box camera was the gadget of choice for the typical amateur photographer. This is because it was cheap and simple, yet still capable of excellent results under most conditions. Box cameras were usually fitted with a single-element lens, a limited range opening contr...
    Keywords:
    cameras,box camera,viewfinder,folding-roll camera
    Article Body:
    This article will outline 3 different types of camera’s: Box, Folding-Roll, and Viewfinder. This information will help you decide which camera suits your photography needs the best.
    For over several decades the box camera was the gadget of choice for the typical amateur photographer. This is because it was cheap and simple, yet still capable of excellent results under most conditions. Box cameras were usually fitted with a single-element lens, a limited range opening control, and a single-speed shutter.
    Next up is the Folding-Roll Film Camera, which was also very popular but not quite as much so as the box camera. The folding camera came in several types of formats, but basically, it was a box camera whose lens was included into a movable disk that could slide back and forth on a rail, allowing the lens to change focus from close to long range.
    There were more complicated models available, but they were more expensive and considered very high quality. But, the most important benefit that they had over the box camera, was their compact design when folded, which made them easier to pack and transport. There has been something of a minor renaissance in folding-roll film cameras in recent years, with appearance of several new professional instruments. They are appreciated for their large negative size and compact design.
    Next is a Viewfinder type camera which does not use a lens to view the subject but instead relies on a separate viewing system in the camera for aiming and for focus. The range finder camera allows for accurate focus, however, by using two views of the same subject to adjust focus. In this camera there are two images in the viewfinder. One is usually only a portion of the viewer area and is usually slightly yellowish in color. The photographer adjusts the focus ring on the lens and as they do the two images move. When both on directly on top of each other they blend together and almost disappear which signifies that the camera is in focus. The rangefinder is accurate and very quiet as well as being light weight. It is also useful for taking pictures in low light conditions or for candid photographs. These cameras can easily be spotted because of their double view windows in the front.
    Enjoy your photography hobby and remember – keep experimenting with different angles and new lighting. Don’t be afraid to get creative!
  • 10-07-2009, 12:06:57
    #8
    Üyeliği durduruldu
    txt nin sonuna ekle <!--Bitti --> ekle
    preg_match_all("#Article Body:(.*?)<!--Bitti -->#s", $baglan, $metin);
    olarak dene
  • 10-07-2009, 12:12:27
    #9
    LoverzSoft adlı üyeden alıntı: mesajı görüntüle
    txt nin sonuna ekle <!--Bitti --> ekle
    preg_match_all("#Article Body:(.*?)<!--Bitti -->#s", $baglan, $metin);
    olarak dene
    binlerce .txt var hepsinin sonuna ekleme yaparsam zor olur.

    kod ile bunun çözümü yok mu