Q&A

  • 웹프로그램을 작성했는데 브라우저에 뜨지가 않습니다
델파이입문서에서 웹프로그램 작성프로그램이 있어

따라 했는데

웹브라우저로 조회할 경우 이페이지는 나타낼수

없다는 메세지가 나타나면서 제가 의도한 형태로

되지 않습니다.........

웹서버응용프로그램 개발 인터페이스는 CGI-STANDALONE형태입니다

오라클 TABLE을 조회하는 형태입니다........



이럴때는 어떤 것을 먼저 체크해야 한는지 가르쳐 주십시요



웹브라우저는 익스플로어5.0 입니다........



소스는 아래와 같습니다.........



unit Unitbbs;



interface



uses

Windows, Messages, SysUtils, Dialogs, Classes, HTTPApp, DBWeb, DBTables, Db;



type

TWebModule1 = class(TWebModule)

Table1: TTable;

Query1: TQuery;

PageProducer1: TPageProducer;

QueryTableProducer1: TQueryTableProducer;

DataSource1: TDataSource;

Database1: TDatabase;

Table1ID: TStringField;

Table1TITLE: TStringField;

Table1WRITER: TStringField;

Table1EMAIL: TStringField;

Table1COMTENT: TStringField;

procedure PageProducer1HTMLTag(Sender: TObject; Tag: TTag;

const TagString: String; TagParams: TStrings;

var ReplaceText: String);

procedure WebModule1WebActionItem1Action(Sender: TObject;

Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);

procedure WebModule1WebActionItem2Action(Sender: TObject;

Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);

procedure WebModule1WebActionItem3Action(Sender: TObject;

Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);

private

{ Private declarations }

public

{ Public declarations }

end;



var

WebModule1: TWebModule1;



implementation



{$R *.DFM}



procedure TWebModule1.PageProducer1HTMLTag(Sender: TObject; Tag: TTag;

const TagString: String; TagParams: TStrings; var ReplaceText: String);

var

BBSContent,ScriptName : string;

begin

ScriptName := '/Dp4Project/webbbs/webbbs.exe';

try

if comparetext(TagString,'Mytag') = 0 then

begin

Table1.open;

BBSContent := '';

with Table1 do

begin

while not EOF do

begin

BBSContent := BBSContent + '' + ''

+ Table1ID.AsString + '';

BBSContent := BBSContent + '' + Table1TITLE.AsString + '';

BBSContent := BBSContent + '' + Table1WRITER.AsString + '';

BBSContent := BBSContent + '' + Table1EMAIL.AsString + '';

next;

end;



end;

BBSContent := BBSContent + '';

ReplaceText := BBSContent;

Table1.close;

end;



except

ReplaceText := 'not ok!!!!!!!!!!!'

end;





end;



procedure TWebModule1.WebModule1WebActionItem1Action(Sender: TObject;

Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);

begin

Response.Content := PageProducer1.Content;

end;



procedure TWebModule1.WebModule1WebActionItem2Action(Sender: TObject;

Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);

begin

Table1.open;

if table1.Locate('ID',Request.QueryFields.Values['ID'],[]) then

begin

QueryTableProducer1.Header.Add('게시판내용보기');

QueryTableProducer1.Header.Add('');

QueryTableProducer1.Header.Add('
');

QueryTableProducer1.Header.Add('일련번호: ' + Table1ID.AsString+'
');

QueryTableProducer1.Header.Add('글쓴이: ' + Table1Writer.AsString+'
');

QueryTableProducer1.Header.Add('제 목: ' + Table1Title.AsString+'
');

QueryTableProducer1.Header.Add('

');

Response.Content := QueryTableProducer1.Content;

end;

Table1.close;

end;



procedure TWebModule1.WebModule1WebActionItem3Action(Sender: TObject;

Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);

var

BBSContent, TempStr, RecNum: String;

i : integer;



begin

if Request.QueryFields.values['option']='view' then

begin

BBSContent := '게시판 작성 화면';

BBSContent := BBSContent +'

';

BBSContent := BBSContent + '

';

BBSContent := BBSContent + '
이름은 : ';

BBSContent := BBSContent + '
제목은 : ';

BBSContent := BBSContent + '
E-mail : ';

BBSContent := BBSContent + '
하고 싶은 말은 : ';

BBSContent := BBSContent + '
';

BBSContent := BBSContent + '';

Response.Content := BBSContent;

end

else if Request.QueryFields.values['option']='write' then begin

Table1.append;

Table1Writer.AsString := Request.ContentFields.values['Writer'];

Table1Title.AsString := Request.ContentFields.values['Title'];

Table1Email.AsString := Request.ContentFields.values['Email'];

Table1Comtent.AsString := Request.ContentFields.values['question'];

TempStr := InttoStr(Table1.RecordCount+1);

RecNum := '';

for i:=0 to 3-length(TempStr) do

RecNum := RecNum+'0';

Table1ID.AsString := RecNum+TempStr;

try

Table1.post;

Response.Content:= '입력이 완료되었습니다.';

except

on E: EDBEngineError do

begin

ShowMessage(E.Errors[0].message);

Response.Content:= '입력중 에러발생.';

end;

end;

end;

end;



end.



0  COMMENTS