|
Author
|
Topic: Nedir bu işin sırrı? (Read 3066 times)
|
|
Oytun Tez
|
Biliyomusun, ben de asp nin o kadar kötü olmadığı düşünmeye başladım  ama benim de tercihim php olacaktır..
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Oytun Tez
|
Asp iki şekilde yazılabiliyor.. VBScript ve JScript ile.. VB de yaptığın compenent gibi eklentileri Asp serverına koyup onları kullanabiliyorsun sanırım..Ama o kadar kolay değildir herhalde onları yapmak 
|
|
|
|
|
Logged
|
|
|
|
serkan
Serkan Ceylani
Admin
Offline
Posts: 134
|
EXE programlari hazirlayip web de kullanmak, basit bir php programi yazmak kadar kolay...
Farkli hicbirsey yok...
Ornekler internette var,
Serkan
|
|
|
|
|
Logged
|
İletişim: xmpp:serkan@member.turk-php.com (Jabber) (Lütfen sorularınızı forum içinde sorunuz.) Arşiv: http://arsiv.turk-php.comSerkan
|
|
|
serkan
Serkan Ceylani
Admin
Offline
Posts: 134
|
http://www.deitel.com/books/cpphtp4/Bu kitap bastan sona c++ ile web tasarimini anlatiyor.O sayfada "source code download" yazan yere tikla ve kitabin tum kaynak kodunu indir  Ucretsiz zahmetsiz ornek kodlara ulasabilirsin...Asagiya ornek bir tane aliyorum: HTML Form: <?xml version = "1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- Fig. 16.15: cookieform.html --> <!-- Cookie Demonstration --> <html xmlns = "http://www.w3.org/1999/xhtml"> <head> <title>Writing a cookie to the client computer</title> </head> <body> <h1>Click Write Cookie to save your cookie data.</h1> <form method = "post" action = "/cgi-bin/writecookie.cgi"> <p>Name:<br /> <input type = "text" name = "name" /> </p> <p>Age:<br /> <input type = "text" name = "age" /> </p> <p>Favorite Color:<br /> <input type = "text" name = "color" /> </p> <p> <input type = "submit" name = "button" /> </p> </form> </body> </html>
<!-- ************************************************************************** * (C) Copyright 1992-2003 by Deitel & Associates, Inc. and Prentice * * Hall. All Rights Reserved. * * * * DISCLAIMER: The authors and publisher of this book have used their * * best efforts in preparing the book. These efforts include the * * development, research, and testing of the theories and programs * * to determine their effectiveness. The authors and publisher make * * no warranty of any kind, expressed or implied, with regard to these * * programs or to the documentation contained in these books. The authors * * and publisher shall not be liable in any event for incidental or * * consequential damages in connection with, or arising out of, the * * furnishing, performance, or use of these programs. * ************************************************************************** -->
Program: // Fig. 16.16: writecookie.cpp // Program to write a cookie to a client's machine. #include <iostream>
using std::cout; using std::cin;
#include <cstdlib> #include <string>
using std::string;
int main() { char query[ 1024 ] = ""; string dataString = ""; string nameString = ""; string ageString = ""; string colorString = ""; int contentLength = 0; // expiration date of cookie string expires = "Friday, 14-MAY-04 16:00:00 GMT"; // data was entered if ( getenv( "CONTENT_LENGTH" ) ) { contentLength = atoi( getenv( "CONTENT_LENGTH" ) );
// read data from standard input cin.read( query, contentLength ); dataString = query;
// search string for data and store locations int nameLocation = dataString.find( "name=" ) + 5; int endName = dataString.find( "&" ); int ageLocation = dataString.find( "age=" ) + 4; int endAge = dataString.find( "&color" ); int colorLocation = dataString.find( "color=" ) + 6; int endColor = dataString.find( "&button" ); // get value for user's name nameString = dataString.substr( nameLocation, endName - nameLocation ); // get value for user's age if ( ageLocation > 0 ) ageString = dataString.substr( ageLocation, endAge - ageLocation ); // get value for user's favorite color if ( colorLocation > 0 ) colorString = dataString.substr( colorLocation, endColor - colorLocation );
// set cookie cout << "Set-cookie: Name=" << nameString << "age:" << ageString << "color:" << colorString << "; expires=" << expires << "; path=\n"; } // end if // output header cout << "Content-type: text/html\n\n"; // output XML declaration and DOCTYPE cout << "<?xml version = \"1.0\"?>" << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 " << "Transitional//EN\" \"http://www.w3.org/TR/xhtml1" << "/DTD/xhtml1-transitional.dtd\">";
// output html element and some of its contents cout << "<html xmlns = \"http://www.w3.org/1999/xhtml\">" << "<head><title>Cookie Saved</title></head>" << "<body>"; // output user's information cout << "<p>The cookies have been set with the following" << " data:</p>" << "<p>Name: " << nameString << "<br/></p>" << "<p>Age:" << ageString << "<br/></p>" << "<p>Color:" << colorString << "<br/></p>" << "<p>Click <a href=\"/cgi-bin/readcookie.cgi\">" << "here</a> to read saved cookie data:</p>" << "</body></html>"; return 0;
} // end main
/************************************************************************** * (C) Copyright 1992-2003 by Deitel & Associates, Inc. and Prentice * * Hall. All Rights Reserved. * * * * DISCLAIMER: The authors and publisher of this book have used their * * best efforts in preparing the book. These efforts include the * * development, research, and testing of the theories and programs * * to determine their effectiveness. The authors and publisher make * * no warranty of any kind, expressed or implied, with regard to these * * programs or to the documentation contained in these books. The authors * * and publisher shall not be liable in any event for incidental or * * consequential damages in connection with, or arising out of, the * * furnishing, performance, or use of these programs. * *************************************************************************/
Program : // Fig. 16.17: readcookie.cpp // Program to read cookie data. #include <iostream>
using std::cout; using std::cin;
#include <cstdlib> #include <string>
using std::string;
int main() { string dataString = ""; string nameString = ""; string ageString = ""; string colorString = ""; dataString = getenv( "HTTP_COOKIE" ); // search through cookie data string int nameLocation = dataString.find( "Name=" ) + 5; int endName = dataString.find( "age:" ); int ageLocation = dataString.find( "age:" ) + 4; int endAge = dataString.find( "color:" ); int colorLocation = dataString.find( "color:" ) + 6; // store cookie data in strings nameString = dataString.substr( nameLocation, endName - nameLocation ); ageString = dataString.substr( ageLocation, endAge - ageLocation); colorString = dataString.substr( colorLocation ); // output header cout << "Content-Type: text/html\n\n"; // output XML declaration and DOCTYPE cout << "<?xml version = \"1.0\"?>" << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 " << "Transitional//EN\" \"http://www.w3.org/TR/xhtml1" << "/DTD/xhtml1-transitional.dtd\">";
// output html element and some of its contents cout << "<html xmlns = \"http://www.w3.org/1999/xhtml\">" << "<head><title>Read Cookies</title></head>" << "<body>"; // data was found if ( dataString != "" ) cout << "<h3>The following data is saved in a cookie on" << " your computer</h3>" << "<p>Name: " << nameString << "<br/></p>" << "<p>Age: " << ageString << "<br/></p>" << "<p>Color: " << colorString << "<br/></p>";
// no data was found else cout << "<p>No cookie data.</p>"; cout << "</body></html>"; return 0;
} // end main
|
|
|
|
« Last Edit: December 12, 2005, 09:14:37 pm by serkan »
|
Logged
|
İletişim: xmpp:serkan@member.turk-php.com (Jabber) (Lütfen sorularınızı forum içinde sorunuz.) Arşiv: http://arsiv.turk-php.comSerkan
|
|
|
|
Oytun Tez
|
Evet çok güzel birşey aslında C++ ile yapmak..Önceden de duymuştum ama elim gidip de yapamıyorum.. üff üff..birsürü şey var öğrenecek  .net, c++...off off 
|
|
|
|
|
Logged
|
|
|
|
PHYSiCaL_MeM
Yeni Kullanıcılar
Offline
Posts: 40
|
Şahsen web i kaptıktan sonra c++ a başlamayı düşünüyorum. Web konusnda daha oğrenilecek çooookkk şey var. Kendimi yeterli hissedince geçmeyi düşünüyorum. Ama ve lakin ikisini birden götürmek de var. Hayalim web server a eklentiler yapmak. Örneğin php ile bir ip yi scriptimizden banladık diyelim yaptığımız programla txt den veriyi okuyup o iplerin erişimini serverdan da kapatmak. Bunun gibi bir çok şey. acele etmemek lazım.. Herşey zamanla..
|
|
|
|
« Last Edit: December 13, 2005, 12:24:54 pm by PHYSiCaL_MeM »
|
Logged
|
|
|
|
|
MeW
|
Yaw web işini tamamen öğrenip c++ vb. programla dillerine geçeçez geçmesine lakin biz öğrenirken adamlar aynı hızda geliştiriyor. Hergün yeni yeni şeyler çıkıyor. Sanırım biz web işini bitirene kadar diğer programlama dilleri ile web işi birleşecek biz de ikisini birden öğrenmiş olacağız. --sanırım bu dediğim olması için çok fazla zaman da gerekmeyecek. hele ki online windows ve office'ten sonra bu webrogramlarında (güzel bi tabir oldu bu  ) arkası gelecek.--
|
|
|
|
|
Logged
|
|
|
|
isinan
PHP Öğrencisi
Offline
Posts: 54
|
Hersey guzel de gurularimiza bir soru. Bir web projesini C++,C gibi bir dille yapmanin avantaji nedir? Daha hizli ve guvenli olmasi mi? Madem boyle birsey mumkundu o zaman niye php cikti? Tamam C++ ile yapalim ama faydasi yoksa niye C++ ile ugrasayim. Bildigim kadariyle boyle bir sey cgi ile mumkun. Cgi kelimesi de internette cok gordugum ama somutlastiramadigim bir sey. Zannediyorum biraz isletim sistemiyle ilgili oldugu icin ve ben de isletim sistemi hakkinda fikir sahibi olmadigim icin somutlastiramiyorum.
|
|
|
|
|
Logged
|
|
|
|
|
Oytun Tez
|
Bana kalırsa C++ daha karmaşık sonuçta php den..C zaten öyle. C++ daha profesyonel ve complicated sistemlerde kullanılır.Ne bileyim bir google gibi bir yer gereksinim duyar c++ ile webrograma (evet bence de iyi bi kelime olmuş fakat telaffuzu zor  ) ... php de olayı daha basitlendirmek, c++'nin programlama özelliklerini (işletim sistemi taraflı) kaldırıp, web özellikleri eklenmesi falan için herhalde php yapıldı. (cümle karıştı pardon  ) Üstadlar yorum bekleriz biz 
|
|
|
|
|
Logged
|
|
|
|
serkan
Serkan Ceylani
Admin
Offline
Posts: 134
|
CGI ingilizce de "Common Gateway Interface" demek.Basitce arayuzun ismi CGI. Diyelim ki PHP "exe" dosyasi olarak derlendi ve sunucuda http://localhost/cgi-bin/php.exe gibi bir yere konuldu.Simdi siz "istek" yaptiginizda HTTP protokolunu kullaniyorsunuz.Bu protokol ile basit bir "text" mesaji, ---- sizin bilgisayarinizda kullandiginiz program tarafindan --- (ie,firefox v.b) hazirlanarak sunucuya iletiliyor.Deniliyor ki GET /istenilensayfa.php HTTP/1.1 . Bunlarla beraber zaman dil bilgileri hersey gonderiliyor... Aciklamali bilgi ve grafikler burda : http://arsiv.turk-php.com/makaleler/02/01/03/4981759Iste sunucu program "apache" bu bilgiyi isleyici programa geciriyor.Simdi siz PHP yi CGI modunda kurarsaniz bu durumda ".php" uzantili dosyalar " http://localhost/cgi-bin/php.exe" php.exe tarafindan islenir.Bu durumda apache "php.exe" programina bu veriyi gonderir."php.exe" bu istenilensayfa.php yi isler ve sonucta uretilen HTML apacheye gonderilir.Gordugun gibi ortada CGI diye bir program yok.Ama tum bu olaylarin butunune CGI diyoruz biz.Bunu PERL veya C# programi kullanarak da yapabilirsiniz...(C# konusunda emin degilim  Sende bir exe programi hazirlayip ornegin icinde cout<< "HTTP_HOST" (tamamen uyduruyorum) dersen, CGI dan(apacheden senin exe programina) gelen HTTP_HOST verisi program icinden erisilebilir olur.Islersin ve disariya cout<< ile yazdirmak istediginde aslinda ekrana degil ama "stream" tabir ettigimiz ve apacheden acilan senin exe programa acilan kanala sonucu yazdirmis oluyorsunuz. Eger nasil "HTTP cevap butunu" olusturulacagini biliyorsaniz (cok basit bir sey, adina bakmayin) onu cout<< ile ciktiya yazdiyorsunuz ve apache de bunu HAM cikti olarak browsera gonderiyor. VEYA PHP yi apache icinde butunlesik bir modul olarak kuruyorsunuz boylece apache kendi icinde herseyi gerceklestiriyor ve sonuc istemciye gidiyor.Buda mod_php oluyor... Umarim anlamissindir, Serkan
|
|
|
|
|
Logged
|
İletişim: xmpp:serkan@member.turk-php.com (Jabber) (Lütfen sorularınızı forum içinde sorunuz.) Arşiv: http://arsiv.turk-php.comSerkan
|
|
|
|
MeTrO
|
merhaba gerçi konunun yönü biraz değişmiş ama.... arkadaşım sen madem programlama da geliştirmeyi düşünüyorsun kendini... bence bu işi kaparken bir yandan da diğer teknolojilere bi göz gezdir.. sonra madem bu işten zevk alıyorsun o zaman bu işin okuluna git mutlaka. emin ol normalde lisee okula gitmek istemezken üniversite de haftasonu tatilinin gelmesini istemeyeceksin (ki şu anda ben öyleyim) haa biraz da gerçekler; şu anda eğer kendini iyi tanıtamadıysan veya iyi bir şirkette çalışmıyorsan biraz zor derim geçinmen... kendine bir şirket açarsın ki bu nerde ve kiminle açtığına göre değişir... mesela istanbul gibi bir yerde açarsan bu olayı aşmış ve senin bir haftada yapacağın işi 2 günde bitirecek GRUPLAR var (tabi sende hep böyle kalmayacaksın ama onlar senin hevesini kıracak.) veya da atıyorum nevşehir gibi bir yerde açtın şirketini nevşehirde kimse e-ticaret veya benzeri online işlerle uğraşmaz... dersin ki mesela " online olarak reklamınız yapılmış olur" adam da sana"ben şu iki sokağın başina 250 milyona iki tane pano kondururum reklam daha iyi olur" yani bunlari da gö önünde tut... haa illaki bilgisayar ve illaki yazılım diyorsan Bilgisayar Sistemleri ve Teknolojileri Öğretmenliği adında bir bölüm var (daha bir çok bölüm var ama ben bunu terçih ediyorum) hem bilgisayar hem öğretmenlik (Yani devlet dairesi) hem kendini geliştirebilirsin yani önü açık ve şu anda eksiği çok olan bir öğretmenlik bir yandan paraya "para" demek yerine kendin bi isim bulursun  diğer yandan kendini geliştirmenin zevkini alırsın (zorlanmadan) neyse ben yine çok konuştum  kolaygelsin... MeTrO
|
|
|
|
|
Logged
|
|
|
|
isinan
PHP Öğrencisi
Offline
Posts: 54
|
@serkan bilgi icin tesekkurler.
Httpnin nasil isledigini bilmeyen zaten iyi bir web programcisi olamaz. Httpyi biliyordum da cgi ve stream hakkindaki bilgilerimi de epey bi somutlastirmis oldum. Bu arada pipe, named pipe la stream arasindaki fark nedir diye sorsam konuyu cok mu saptirmis olurum? Evet bence de butun mesele windows tabanli olmam da.
|
|
|
|
|
Logged
|
|
|
|
|
 |