Lazarus
Home
Forum
Help
TinyPortal
Search
Login
Register
Lazarus
»
Programming
»
General
»
i create some program of auto-web-page-programming but there's a problem
Free Pascal
Website
Downloads
Wiki
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
FAQ
Wiki
Bugtracker
Packages
IRC channel
Developer Blog
Follow us on Twitter
Latest SVN
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
Search
Advanced search
« previous
next »
Print
Pages: [
1
]
Author
Topic: i create some program of auto-web-page-programming but there's a problem (Read 1039 times)
whitehat
Jr. Member
Posts: 57
i create some program of auto-web-page-programming but there's a problem
«
on:
April 21, 2017, 12:40:27 pm »
hello this is a short program for my school homework our homework is about creating a program that allow the people who don't know how to program to create his own website without knowing any language of web-developing language beetwen whe just use a old version of lazarus + wincrt library there's some problem in my program i'm new in programming but i learn from my mistake every time can any one tell me how can i fix this problem
Code: Pascal
[Select]
program
best
;
uses
wincrt
;
type
tab
=
array
[
1
..
20
]
of
string
;
var
reponse
:
integer
;
t
:
tab
;
f
:
text
;
procedure
remplirehtml
(
var
t
:
tab
)
;
begin
t
[
1
]
:
=
'<html>'
;
t
[
2
]
:
=
'<head>'
;
end
;
procedure
icon
(
var
t
:
tab
)
;
var
posico
:
integer
;
iconn
:
string
;
begin
t
[
3
]
:
=
'<link rel="stylesheet" href="">'
;
writeln
(
'si tu veux tu peux mettre une icon dans votre site'
)
;
readln
(
iconn
)
;
posico
:
=
pos
(
'""'
,
t
[
3
]
)
+
1
;
insert
(
iconn
,
t
[
3
]
,
posico
)
;
end
;
procedure
title
(
var
t
:
tab
)
;
var
i
:
integer
;
titre
,
tit
:
string
;
co
:
integer
;
begin
t
[
4
]
:
=
'<title></title>'
;
writeln
(
'donner le titre de page >'
)
;
readln
(
titre
)
;
co
:
=
pos
(
'/'
,
t
[
4
]
)
-
1
;
insert
(
titre
,
t
[
4
]
,
co
)
;
end
;
procedure
script
(
var
t
:
tab
)
;
var
sc1
,
sc
:
integer
;
scr1
,
a
,
scr
:
string
;
begin
t
[
5
]
:
=
'<style> input[type=text] {width: %;padding: 12px 20px;margin: 8px 0;'
;
a
:
=
'box-sizing: border-box;border: 2px solid ;border-radius: 4px;}</style>'
;
writeln
(
'donner le width a votre form'
)
;
readln
(
scr
)
;
sc
:
=
pos
(
'%'
,
t
[
5
]
)
;
insert
(
scr
,
t
[
5
]
,
sc
)
;
t
[
5
]
:
=
t
[
5
]
+
a
;
writeln
(
'donner le coleur de votre form (input)'
)
;
readln
(
scr1
)
;
sc1
:
=
pos
(
';border-radius'
,
t
[
5
]
)
;
insert
(
scr1
,
t
[
5
]
,
sc1
)
;
end
;
procedure
bodyf
(
var
t
:
tab
)
;
begin
t
[
6
]
:
=
'</head>'
;
end
;
procedure
background
(
var
t
:
tab
)
;
var
up
,
backg
,
back
,
ch
:
string
;
k
:
integer
;
begin
{background page or image}
writeln
(
'backgournd or color'
)
;
readln
(
back
)
;
{choix d'image}
t
[
7
]
:
=
'<body background="">'
;
if
back
=
'background'
then
begin
write
(
'image url ? / image dans votre PC (url/pc):'
)
;
readln
(
up
)
;
if
up
=
'url'
then
begin
write
(
'donner l'
'url de background : '
)
;
readln
(
backg
)
;
k
:
=
pos
(
'""'
,
t
[
7
]
)
+
1
;
insert
(
backg
,
t
[
7
]
,
k
)
;
end
else
if
up
=
'pc'
then
begin
writeln
(
'donner le chemin de background : '
)
;
readln
(
backg
)
;
k
:
=
pos
(
'""'
,
t
[
7
]
)
+
1
;
insert
(
backg
,
t
[
7
]
,
k
)
;
end
;
end
;
{choix de background color not image}
if
back
=
'color'
then
begin
t
[
8
]
:
=
'<body bgcolor="">'
;
writeln
(
'donner le coleur : '
)
;
readln
(
backg
)
;
k
:
=
pos
(
'""'
,
t
[
8
]
)
+
1
;
insert
(
backg
,
t
[
8
]
,
k
)
;
end
;
{delete write(ch) ==> test}
end
;
procedure
h
(
var
t
:
tab
)
;
var
ch7
,
ch4
,
ch2
,
k2
,
k3
:
integer
;
i
:
string
;
ch8
,
ch6
,
ch3
,
ch
:
string
;
begin
writeln
(
'donner h? :'
)
;
readln
(
i
)
;
write
(
'donner le coleur de h: '
)
;
readln
(
ch3
)
;
t
[
9
]
:
=
'<h align="" style="color:;"></h>'
;
k3
:
=
pos
(
'h'
,
t
[
9
]
)
+
1
;
insert
(
i
,
t
[
9
]
,
k3
)
;
ch
:
=
copy
(
t
[
9
]
,
pos
(
i
,
t
[
9
]
)
,
1
)
;
k2
:
=
length
(
t
[
9
]
)
;
insert
(
ch
,
t
[
9
]
,
k2
)
;
ch2
:
=
pos
(
'color:'
,
t
[
9
]
)
+
6
;
insert
(
ch3
,
t
[
9
]
,
ch2
)
;
writeln
(
'donner l'
'align (center/right/left)'
)
;
readln
(
ch6
)
;
ch4
:
=
pos
(
'align="'
,
t
[
9
]
)
+
7
;
insert
(
ch6
,
t
[
9
]
,
ch4
)
;
writeln
(
'donner votre text'
)
;
readln
(
ch8
)
;
ch7
:
=
pos
(
'>'
,
t
[
9
]
)
+
1
;
insert
(
ch8
,
t
[
9
]
,
ch7
)
;
end
;
procedure
input
(
var
t
:
tab
)
;
var
in7
,
in6
,
in4
,
in2
,
repinput
,
fo1
,
fo2
:
string
;
in8
,
in5
,
in3
,
in1
,
i
,
inp
:
integer
;
begin
writeln
(
'donner le nombre d'
'input'
)
;
readln
(
inp
)
;
fo1
:
=
'<form method="POST" action=".php" name="f" onsubmit="return verif1()">'
;
fo2
:
=
'</form>'
;
for
i
:
=
1
to
inp
do
begin
insert
(
'<input type="" name="" align="">'
,
t
[
10
]
,
length
(
t
[
10
]
)
+
1
)
;
writeln
(
'tu veux ret ou ligne (oui/non) input['
,
i
,
']'
)
;
readln
(
repinput
)
;
if
(
repinput
=
'oui'
)
then
begin
insert
(
'<br />'
,
t
[
10
]
,
length
(
t
[
10
]
)
+
1
)
;
end
;
writeln
(
'donner le type d'
'input (text/password) ['
,
i
,
']'
)
;
readln
(
in2
)
;
in1
:
=
pos
(
'type=""'
,
t
[
10
]
)
+
6
;
insert
(
in2
,
t
[
10
]
,
in1
)
;
writeln
(
'donner align'
)
;
readln
(
in6
)
;
in5
:
=
pos
(
'align=""'
,
t
[
10
]
)
+
7
;
insert
(
in6
,
t
[
10
]
,
in5
)
;
writeln
(
'donner le nom du forme'
)
;
readln
(
in7
)
;
in8
:
=
pos
(
'name=""'
,
t
[
10
]
)
+
6
;
insert
(
in7
,
t
[
10
]
,
in8
)
;
end
;
t
[
11
]
:
=
fo1
+
t
[
10
]
+
fo2
;
end
;
procedure
areaf
(
var
t
:
tab
)
;
var
area3
,
area2
,
area
:
string
;
area4
,
area1
:
integer
;
begin
t
[
12
]
:
=
'<textarea rows="" cols=""></textarea>'
;
writeln
(
'donner les rows'
)
;
readln
(
area2
)
;
area1
:
=
pos
(
'""'
,
t
[
12
]
)
+
1
;
insert
(
area2
,
t
[
12
]
,
area1
)
;
writeln
(
'donner les cols'
)
;
readln
(
area3
)
;
area4
:
=
pos
(
'>'
,
t
[
12
]
)
-
1
;
insert
(
area3
,
t
[
12
]
,
area4
)
;
end
;
procedure
cre
(
var
f
:
text
;
var
reponse
:
integer
)
;
begin
writeln
(
' __ .__ '
)
;
writeln
(
' ___________ ____ _____ _/ |_|__| ____ ____ '
)
;
writeln
(
' / ___\_ __ \_/ __ \\__ \\ __\ |/ _ \ / \ '
)
;
writeln
(
'\ \___| | \/\ ___/ / __ \| | | ( <_> ) | \'
)
;
writeln
(
' \___ >__| \___ >____ /__| |__|\____/|___| /'
)
;
writeln
(
' \/ \/ \/ \/ '
)
;
repeat
writeln
(
'donner votre choix || (tu peux sortie si tu tape 0)'
)
;
writeln
(
'background(1)'
)
;
writeln
(
'title(2)'
)
;
writeln
(
'icon(3)'
)
;
writeln
(
'script(4)'
)
;
writeln
(
'h(5)'
)
;
writeln
(
'input(6)'
)
;
writeln
(
'areaf'
)
;
writeln
(
'reponse:'
)
;
readln
(
reponse
)
;
clrscr
;
case
reponse
of
1
:
background
(
t
)
;
2
:
title
(
t
)
;
3
:
icon
(
t
)
;
4
:
script
(
t
)
;
5
:
h
(
t
)
;
6
:
input
(
t
)
;
7
:
areaf
(
t
)
;
end
;
until
reponse
=
0
;
end
;
procedure
remplirefinal
(
var
f
:
text
;
t
:
tab
)
;
var
chx
:
string
;
j
:
integer
;
begin
rewrite
(
f
)
;
for
j
:
=
1
to
12
do
begin
writeln
(
f
,
t
[
j
]
)
;
end
;
end
;
begin
assign
(
f
,
'C:\tpw\4.txt'
)
;
bodyf
(
t
)
;
cre
(
f
,
reponse
)
;
remplirehtml
(
t
)
;
close
(
f
)
;
end
.
Logged
marcov
Global Moderator
Hero Member
Posts: 6097
Re: i create some program of auto-web-page-programming but there's a problem
«
Reply #1 on:
April 21, 2017, 12:58:35 pm »
So what problem is it?
Logged
whitehat
Jr. Member
Posts: 57
Re: i create some program of auto-web-page-programming but there's a problem
«
Reply #2 on:
April 21, 2017, 01:12:01 pm »
the problem is in the procedure of input when i finesh the work this is the result:
when i chose to create 2 input form the first is for login (text); and the second is for the password
i was surprise of the result there's 4 input 2 inside the <form></form> and tow Outside the <form> tag like the example :
Code: Pascal
[Select]
<html>
<head>
<link rel
=
"stylesheet" href
=
"jpg">
<title>hello again<
/
title>
<style> input
[
type
=
text
]
,
input
[
type
=
password
]
{width: 50%;padding: 12px 20px;margin: 8px 0;box-sizing: border-box;border: 2px solid red;border-radius: 4px;float: right;}
<
/
style>
<
/
head>
<body background
=
"">
<body bgcolor
=
"black">
<h4 align
=
"left" style
=
"color
:
red
;
">hello test<
/
h4>
<input
type
=
"text"
name
=
"f" align
=
"center"><br
/
><input
type
=
"text"
name
=
"f2" align
=
"center" >
<form method
=
"POST" action
=
"
.
php
"
name
=
"f" onsubmit
=
"return verif1
(
)
"><input
type
=
"text"
name
=
"f" align
=
"center"><br
/
><input
type
=
"text"
name
=
"f2" align
=
"center" ><br
/
><
/
form>
<
/
body>
<
/
html>
and here's the procedure of input for creation the form :
Code: Pascal
[Select]
procedure
input
(
var
t
:
tab
)
;
var
in7
,
in6
,
in4
,
in2
,
repinput
,
fo1
,
fo2
:
string
;
in8
,
in5
,
in3
,
in1
,
i
,
inp
:
integer
;
begin
writeln
(
'donner le nombre d'
'input'
)
;
readln
(
inp
)
;
fo1
:
=
'<form method="POST" action=".php" name="f" onsubmit="return verif1()">'
;
fo2
:
=
'</form>'
;
for
i
:
=
1
to
inp
do
begin
insert
(
'<input type="" name="" align="">'
,
t
[
10
]
,
length
(
t
[
10
]
)
+
1
)
;
writeln
(
'tu veux ret ou ligne (oui/non) input['
,
i
,
']'
)
;
readln
(
repinput
)
;
if
(
repinput
=
'oui'
)
then
begin
insert
(
'<br />'
,
t
[
10
]
,
length
(
t
[
10
]
)
+
1
)
;
end
;
writeln
(
'donner le type d'
'input (text/password) ['
,
i
,
']'
)
;
readln
(
in2
)
;
in1
:
=
pos
(
'type=""'
,
t
[
10
]
)
+
6
;
insert
(
in2
,
t
[
10
]
,
in1
)
;
writeln
(
'donner align'
)
;
readln
(
in6
)
;
in5
:
=
pos
(
'align=""'
,
t
[
10
]
)
+
7
;
insert
(
in6
,
t
[
10
]
,
in5
)
;
writeln
(
'donner le nom du forme'
)
;
readln
(
in7
)
;
in8
:
=
pos
(
'name=""'
,
t
[
10
]
)
+
6
;
insert
(
in7
,
t
[
10
]
,
in8
)
;
end
;
t
[
11
]
:
=
fo1
+
t
[
10
]
+
fo2
;
end
;
Logged
Handoko
Hero Member
Posts: 2147
My goal: build my own game engine using Lazarus
Re: i create some program of auto-web-page-programming but there's a problem
«
Reply #3 on:
April 21, 2017, 03:10:14 pm »
Because I'm not good in HTML and my Linux Lazarus/FPC can't run WinCRT properly, I can only rely on my eye-inspection.
You should change your code line 173 from:
Quote
t[11]:=fo1+t[10]+fo2;
To:
Quote
t[10]:=fo1+t[10]+fo2;
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Programming
»
General
»
i create some program of auto-web-page-programming but there's a problem
Recent
3D model format parsing?
by
Laphicet
[
Today
at 12:44:38 pm]
DecodeStringBase64() - co...
by
Thaddy
[
Today
at 12:43:26 pm]
Identifier not found "TWi...
by
Thaddy
[
Today
at 12:36:26 pm]
IFileOperation and moving...
by
Thaddy
[
Today
at 12:12:21 pm]
Lot of Packages not added...
by
matthius
[
Today
at 12:02:20 pm]
Lazarus 1.8.2 Anchor Dock...
by
JuhaManninen
[
Today
at 11:55:12 am]
Assistance with Android P...
by
Handoko
[
Today
at 11:44:41 am]
[HowTo] Android Developme...
by
HobbyDev
[
Today
at 11:14:40 am]
LAMW: Android 7.1.2
by
c4p
[
Today
at 11:06:17 am]
Linux TUN
by
Hiko222
[
Today
at 10:31:37 am]