SlideShare a Scribd company logo
Ring Documentation, Release 1.5.2
The Response
#!c:ringbinring.exe -cgi
Load "weblib.ring"
Import System.Web
New Page
{
divstart([ :style = styledivcenter("800px","500px") ])
boxstart()
text ( "HTTP GET Response" ) newline()
boxend()
divstart([ :style = stylefloatleft()+stylewidth("10%")+
47.5. HTTP Get Example 365
Ring Documentation, Release 1.5.2
stylecolor("black")+stylegradient(58) ])
newline()
text ( "Name : " )
newline() newline()
text ( "Address : " )
newline() newline()
text ( "Phone : " )
newline() newline()
text ( "Age : " )
newline() newline()
text ( "City : " )
newline() newline()
text ( "Country : " )
newline() newline()
text ( "Note : " )
newline() newline()
divend()
divstart([ :style = stylefloatleft()+stylewidth("90%")+
stylecolor("black")+stylegradient(47) ])
divstart([ :style = stylefloatleft() + stylewidth("1%") ])
newline()
divend()
divstart([ :style = stylefloatleft() + stylewidth("95%") ])
newline()
text ( aPageVars["Name"] )
newline() newline()
text ( aPageVars["Address"] )
newline() newline()
text ( aPageVars["Phone"] )
newline() newline()
text ( aPageVars["Age"] )
newline() newline()
text ( aPageVars["City"] )
newline() newline()
text (aPageVars["Country"] )
newline() newline()
text ( aPageVars["Notes"] )
newline() newline()
divend()
divend()
divend()
}
Screen Shot:
47.5. HTTP Get Example 366
Ring Documentation, Release 1.5.2
47.6 HTTP POST Example
The Page User Interface
#!c:ringbinring.exe -cgi
Load "weblib.ring"
Import System.Web
New Page
{
boxstart()
text( "Post Test")
newline()
boxend()
divstart([ :style=StyleFloatLeft()+StyleWidth("100px") ])
newline()
text( "Number1 : " ) newline() newline()
text( "Number2 : " ) newline() newline()
divend()
formpost("ex7.ring")
divstart([ :style = styleFloatLeft()+StyleWidth("200px") ])
newline()
textbox([ :name = "Number1" ]) newline() newline()
textbox([ :name = "Number2" ]) newline() newline()
submit([ :value = "Send" ] )
divend()
formend()
}
Screen Shot:
47.6. HTTP POST Example 367
Ring Documentation, Release 1.5.2
The Response
#!c:ringbinring.exe -cgi
Load "weblib.ring"
Import System.Web
New Page
{
boxstart()
text( "Post Result" )
newline()
boxend()
divstart([ :style = styleFloatLeft()+styleWidth("200px") ])
newline()
text( "Number1 : " + aPageVars["Number1"] )
newline() newline()
text( "Number2 : " + aPageVars["Number2"] )
newline() newline()
text( "Sum : " + (0 + aPageVars["Number1"] + aPageVars["Number2"] ) )
newline()
divend()
}
Screen Shot:
47.6. HTTP POST Example 368
Ring Documentation, Release 1.5.2
47.7 Upload Files
The Page User Interface
#!c:ringbinring.exe -cgi
Load "weblib.ring"
Import System.Web
New page
{
boxstart()
text( "Upload File" )
newline()
boxend()
for x = 1 to 3 newline() next
formupload("ex9.ring")
text( "Customer Name : " )
textbox([ :name = "custname" ])
newline() newline()
divstart([ :style = styleFloatLeft() + styleWidth("90px") ])
uploadfile("file") newline() newline()
uploadfile("file2") newline() newline()
submit([ :value = "Send" ])
divend()
formend()
}
Screen Shot:
47.7. Upload Files 369
Ring Documentation, Release 1.5.2
The Response
#!c:ringbinring.exe -cgi
Load "weblib.ring"
Import System.Web
cUploadPath = "C:/Apache2.2/htdocs/ringapp/upload/"
cUploadFolder = "/ringapp/upload/"
New page
{
boxstart()
text( "Upload Result" )
newline()
boxend()
newline()
divstart([ :style= styleFloatLeft() + styleWidth("100px") ])
text( "Name : " + aPageVars["custname"] )
newline()
divend()
if aPageVars["file"] != char(13)
getuploadedfile(self,"file")
ok
if aPageVars["file2"] != char(13)
getuploadedfile(self,"file2")
ok
}
Func getuploadedfile oObj,cFile
# here we use object.property
# instead of object { } to avoid executing braceend method
cFileName = cUploadPath + oObj.getfilename(aPageVars,cFile)
47.7. Upload Files 370
Ring Documentation, Release 1.5.2
write(cFileName,aPageVars[cFile])
system("chmod a+x "+cFileName)
oObj.newline()
oObj.text( "File "+cFileName+ " Uploaded ..." )
oObj.newline()
imageURL = cUploadFolder+oObj.getfilename(aPageVars,cFile)
oObj.link([ :url = imageURL, :title = "Download" ])
oObj.newline()
oObj.image( [ :url = imageURL , :alt = :image ] )
oObj.newline()
Screen Shot:
47.7. Upload Files 371
Ring Documentation, Release 1.5.2
47.8 Cookies
The Page User Interface
#!c:ringbinring.exe -cgi
Load "weblib.ring"
47.8. Cookies 372
Ring Documentation, Release 1.5.2
Import System.Web
New page
{
boxstart()
text( "Cookie Test" )
newline()
boxend()
newline()
link([ :url = "ex11.ring", :title = "Use Cookies" ])
cookie("custname","Mahmoud Fayed")
cookie("custage",28)
}
Screen Shot:
The Response
#!c:ringbinring.exe -cgi
Load "weblib.ring"
Import System.Web
New Page
{
boxstart()
text( "Cookies Values" )
newline()
boxend()
link([ :url = "ex10.ring", :title = "back" ])
newline()
divstart([:style="float:left;width:200px"])
text( "Name : " + aPageVars["custname"] )
newline()
text( "Age : " + aPageVars["custage"] )
newline()
divend()
}
Screen Shot:
47.8. Cookies 373
Ring Documentation, Release 1.5.2
47.9 URL Encode
The Page User Interface
#!c:ringbinring.exe -cgi
Load "weblib.ring"
Import System.Web
New Page
{
boxstart()
text( "URLEncode" )
newline()
boxend()
link([ :url = "ex5.ring?Name="+URLEncode("-*{Mahmoud}*-")+
"&Address=Egypt&Phone=123456&Age=28&Notes=Programmer",
:title = "Test URL Encode" ])
}
Screen Shot:
Screen Shot:
47.9. URL Encode 374

More Related Content

PDF
The Ring programming language version 1.2 book - Part 29 of 84
PDF
The Ring programming language version 1.5.1 book - Part 39 of 180
PDF
The Ring programming language version 1.10 book - Part 51 of 212
PDF
The Ring programming language version 1.5.3 book - Part 41 of 184
PDF
The Ring programming language version 1.5.4 book - Part 41 of 185
PDF
The Ring programming language version 1.6 book - Part 43 of 189
PDF
The Ring programming language version 1.9 book - Part 49 of 210
PDF
The Ring programming language version 1.7 book - Part 44 of 196
The Ring programming language version 1.2 book - Part 29 of 84
The Ring programming language version 1.5.1 book - Part 39 of 180
The Ring programming language version 1.10 book - Part 51 of 212
The Ring programming language version 1.5.3 book - Part 41 of 184
The Ring programming language version 1.5.4 book - Part 41 of 185
The Ring programming language version 1.6 book - Part 43 of 189
The Ring programming language version 1.9 book - Part 49 of 210
The Ring programming language version 1.7 book - Part 44 of 196

What's hot (20)

PDF
The Ring programming language version 1.9 book - Part 50 of 210
PDF
The Ring programming language version 1.3 book - Part 31 of 88
PDF
The Ring programming language version 1.4.1 book - Part 12 of 31
PDF
The Ring programming language version 1.7 book - Part 45 of 196
PDF
The Ring programming language version 1.8 book - Part 46 of 202
PDF
The Ring programming language version 1.8 book - Part 47 of 202
PDF
The Ring programming language version 1.5.4 book - Part 42 of 185
PDF
The Ring programming language version 1.10 book - Part 50 of 212
PDF
The Ring programming language version 1.5.4 book - Part 43 of 185
PDF
The Ring programming language version 1.5.1 book - Part 40 of 180
PDF
The Ring programming language version 1.5.3 book - Part 40 of 184
PDF
The Ring programming language version 1.4 book - Part 12 of 30
PDF
The Ring programming language version 1.5.4 book - Part 67 of 185
PDF
The Ring programming language version 1.5.4 book - Part 40 of 185
PDF
The Ring programming language version 1.10 book - Part 52 of 212
PDF
The Ring programming language version 1.7 book - Part 47 of 196
PPTX
Ogdc 2013 lets remake the wheel
PPTX
OGDC2013_Lets remake the wheel_ Mr Nguyen Trung Hung
PDF
The Ring programming language version 1.5.2 book - Part 41 of 181
PDF
The Ring programming language version 1.2 book - Part 48 of 84
The Ring programming language version 1.9 book - Part 50 of 210
The Ring programming language version 1.3 book - Part 31 of 88
The Ring programming language version 1.4.1 book - Part 12 of 31
The Ring programming language version 1.7 book - Part 45 of 196
The Ring programming language version 1.8 book - Part 46 of 202
The Ring programming language version 1.8 book - Part 47 of 202
The Ring programming language version 1.5.4 book - Part 42 of 185
The Ring programming language version 1.10 book - Part 50 of 212
The Ring programming language version 1.5.4 book - Part 43 of 185
The Ring programming language version 1.5.1 book - Part 40 of 180
The Ring programming language version 1.5.3 book - Part 40 of 184
The Ring programming language version 1.4 book - Part 12 of 30
The Ring programming language version 1.5.4 book - Part 67 of 185
The Ring programming language version 1.5.4 book - Part 40 of 185
The Ring programming language version 1.10 book - Part 52 of 212
The Ring programming language version 1.7 book - Part 47 of 196
Ogdc 2013 lets remake the wheel
OGDC2013_Lets remake the wheel_ Mr Nguyen Trung Hung
The Ring programming language version 1.5.2 book - Part 41 of 181
The Ring programming language version 1.2 book - Part 48 of 84
Ad

Similar to The Ring programming language version 1.5.2 book - Part 40 of 181 (17)

PDF
The Ring programming language version 1.5.3 book - Part 51 of 184
PDF
The Ring programming language version 1.5.3 book - Part 52 of 184
PDF
The Ring programming language version 1.5.3 book - Part 42 of 184
PDF
The Ring programming language version 1.6 book - Part 44 of 189
PDF
The Ring programming language version 1.2 book - Part 30 of 84
PDF
The Ring programming language version 1.5.2 book - Part 42 of 181
PDF
The Ring programming language version 1.3 book - Part 32 of 88
PDF
The Ring programming language version 1.5.2 book - Part 43 of 181
PDF
The Ring programming language version 1.8 book - Part 49 of 202
PDF
The Ring programming language version 1.7 book - Part 48 of 196
PDF
The Ring programming language version 1.7 book - Part 46 of 196
PDF
The Ring programming language version 1.8 book - Part 48 of 202
PDF
The Ring programming language version 1.5.3 book - Part 15 of 184
PDF
The Ring programming language version 1.5 book - Part 8 of 31
PDF
The Ring programming language version 1.5.1 book - Part 41 of 180
PDF
The Ring programming language version 1.6 book - Part 46 of 189
PDF
The Ring programming language version 1.9 book - Part 51 of 210
The Ring programming language version 1.5.3 book - Part 51 of 184
The Ring programming language version 1.5.3 book - Part 52 of 184
The Ring programming language version 1.5.3 book - Part 42 of 184
The Ring programming language version 1.6 book - Part 44 of 189
The Ring programming language version 1.2 book - Part 30 of 84
The Ring programming language version 1.5.2 book - Part 42 of 181
The Ring programming language version 1.3 book - Part 32 of 88
The Ring programming language version 1.5.2 book - Part 43 of 181
The Ring programming language version 1.8 book - Part 49 of 202
The Ring programming language version 1.7 book - Part 48 of 196
The Ring programming language version 1.7 book - Part 46 of 196
The Ring programming language version 1.8 book - Part 48 of 202
The Ring programming language version 1.5.3 book - Part 15 of 184
The Ring programming language version 1.5 book - Part 8 of 31
The Ring programming language version 1.5.1 book - Part 41 of 180
The Ring programming language version 1.6 book - Part 46 of 189
The Ring programming language version 1.9 book - Part 51 of 210
Ad

More from Mahmoud Samir Fayed (20)

PDF
The Ring programming language version 1.10 book - Part 212 of 212
PDF
The Ring programming language version 1.10 book - Part 211 of 212
PDF
The Ring programming language version 1.10 book - Part 210 of 212
PDF
The Ring programming language version 1.10 book - Part 208 of 212
PDF
The Ring programming language version 1.10 book - Part 207 of 212
PDF
The Ring programming language version 1.10 book - Part 205 of 212
PDF
The Ring programming language version 1.10 book - Part 206 of 212
PDF
The Ring programming language version 1.10 book - Part 204 of 212
PDF
The Ring programming language version 1.10 book - Part 203 of 212
PDF
The Ring programming language version 1.10 book - Part 202 of 212
PDF
The Ring programming language version 1.10 book - Part 201 of 212
PDF
The Ring programming language version 1.10 book - Part 200 of 212
PDF
The Ring programming language version 1.10 book - Part 199 of 212
PDF
The Ring programming language version 1.10 book - Part 198 of 212
PDF
The Ring programming language version 1.10 book - Part 197 of 212
PDF
The Ring programming language version 1.10 book - Part 196 of 212
PDF
The Ring programming language version 1.10 book - Part 195 of 212
PDF
The Ring programming language version 1.10 book - Part 194 of 212
PDF
The Ring programming language version 1.10 book - Part 193 of 212
PDF
The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 211 of 212
The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 192 of 212

Recently uploaded (20)

DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Approach and Philosophy of On baking technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
KodekX | Application Modernization Development
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Spectroscopy.pptx food analysis technology
PPT
Teaching material agriculture food technology
PDF
Encapsulation theory and applications.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Empathic Computing: Creating Shared Understanding
PDF
Network Security Unit 5.pdf for BCA BBA.
The AUB Centre for AI in Media Proposal.docx
Digital-Transformation-Roadmap-for-Companies.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
The Rise and Fall of 3GPP – Time for a Sabbatical?
Chapter 3 Spatial Domain Image Processing.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Approach and Philosophy of On baking technology
Building Integrated photovoltaic BIPV_UPV.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
KodekX | Application Modernization Development
Reach Out and Touch Someone: Haptics and Empathic Computing
Encapsulation_ Review paper, used for researhc scholars
Mobile App Security Testing_ A Comprehensive Guide.pdf
Spectroscopy.pptx food analysis technology
Teaching material agriculture food technology
Encapsulation theory and applications.pdf
Programs and apps: productivity, graphics, security and other tools
Empathic Computing: Creating Shared Understanding
Network Security Unit 5.pdf for BCA BBA.

The Ring programming language version 1.5.2 book - Part 40 of 181

  • 1. Ring Documentation, Release 1.5.2 The Response #!c:ringbinring.exe -cgi Load "weblib.ring" Import System.Web New Page { divstart([ :style = styledivcenter("800px","500px") ]) boxstart() text ( "HTTP GET Response" ) newline() boxend() divstart([ :style = stylefloatleft()+stylewidth("10%")+ 47.5. HTTP Get Example 365
  • 2. Ring Documentation, Release 1.5.2 stylecolor("black")+stylegradient(58) ]) newline() text ( "Name : " ) newline() newline() text ( "Address : " ) newline() newline() text ( "Phone : " ) newline() newline() text ( "Age : " ) newline() newline() text ( "City : " ) newline() newline() text ( "Country : " ) newline() newline() text ( "Note : " ) newline() newline() divend() divstart([ :style = stylefloatleft()+stylewidth("90%")+ stylecolor("black")+stylegradient(47) ]) divstart([ :style = stylefloatleft() + stylewidth("1%") ]) newline() divend() divstart([ :style = stylefloatleft() + stylewidth("95%") ]) newline() text ( aPageVars["Name"] ) newline() newline() text ( aPageVars["Address"] ) newline() newline() text ( aPageVars["Phone"] ) newline() newline() text ( aPageVars["Age"] ) newline() newline() text ( aPageVars["City"] ) newline() newline() text (aPageVars["Country"] ) newline() newline() text ( aPageVars["Notes"] ) newline() newline() divend() divend() divend() } Screen Shot: 47.5. HTTP Get Example 366
  • 3. Ring Documentation, Release 1.5.2 47.6 HTTP POST Example The Page User Interface #!c:ringbinring.exe -cgi Load "weblib.ring" Import System.Web New Page { boxstart() text( "Post Test") newline() boxend() divstart([ :style=StyleFloatLeft()+StyleWidth("100px") ]) newline() text( "Number1 : " ) newline() newline() text( "Number2 : " ) newline() newline() divend() formpost("ex7.ring") divstart([ :style = styleFloatLeft()+StyleWidth("200px") ]) newline() textbox([ :name = "Number1" ]) newline() newline() textbox([ :name = "Number2" ]) newline() newline() submit([ :value = "Send" ] ) divend() formend() } Screen Shot: 47.6. HTTP POST Example 367
  • 4. Ring Documentation, Release 1.5.2 The Response #!c:ringbinring.exe -cgi Load "weblib.ring" Import System.Web New Page { boxstart() text( "Post Result" ) newline() boxend() divstart([ :style = styleFloatLeft()+styleWidth("200px") ]) newline() text( "Number1 : " + aPageVars["Number1"] ) newline() newline() text( "Number2 : " + aPageVars["Number2"] ) newline() newline() text( "Sum : " + (0 + aPageVars["Number1"] + aPageVars["Number2"] ) ) newline() divend() } Screen Shot: 47.6. HTTP POST Example 368
  • 5. Ring Documentation, Release 1.5.2 47.7 Upload Files The Page User Interface #!c:ringbinring.exe -cgi Load "weblib.ring" Import System.Web New page { boxstart() text( "Upload File" ) newline() boxend() for x = 1 to 3 newline() next formupload("ex9.ring") text( "Customer Name : " ) textbox([ :name = "custname" ]) newline() newline() divstart([ :style = styleFloatLeft() + styleWidth("90px") ]) uploadfile("file") newline() newline() uploadfile("file2") newline() newline() submit([ :value = "Send" ]) divend() formend() } Screen Shot: 47.7. Upload Files 369
  • 6. Ring Documentation, Release 1.5.2 The Response #!c:ringbinring.exe -cgi Load "weblib.ring" Import System.Web cUploadPath = "C:/Apache2.2/htdocs/ringapp/upload/" cUploadFolder = "/ringapp/upload/" New page { boxstart() text( "Upload Result" ) newline() boxend() newline() divstart([ :style= styleFloatLeft() + styleWidth("100px") ]) text( "Name : " + aPageVars["custname"] ) newline() divend() if aPageVars["file"] != char(13) getuploadedfile(self,"file") ok if aPageVars["file2"] != char(13) getuploadedfile(self,"file2") ok } Func getuploadedfile oObj,cFile # here we use object.property # instead of object { } to avoid executing braceend method cFileName = cUploadPath + oObj.getfilename(aPageVars,cFile) 47.7. Upload Files 370
  • 7. Ring Documentation, Release 1.5.2 write(cFileName,aPageVars[cFile]) system("chmod a+x "+cFileName) oObj.newline() oObj.text( "File "+cFileName+ " Uploaded ..." ) oObj.newline() imageURL = cUploadFolder+oObj.getfilename(aPageVars,cFile) oObj.link([ :url = imageURL, :title = "Download" ]) oObj.newline() oObj.image( [ :url = imageURL , :alt = :image ] ) oObj.newline() Screen Shot: 47.7. Upload Files 371
  • 8. Ring Documentation, Release 1.5.2 47.8 Cookies The Page User Interface #!c:ringbinring.exe -cgi Load "weblib.ring" 47.8. Cookies 372
  • 9. Ring Documentation, Release 1.5.2 Import System.Web New page { boxstart() text( "Cookie Test" ) newline() boxend() newline() link([ :url = "ex11.ring", :title = "Use Cookies" ]) cookie("custname","Mahmoud Fayed") cookie("custage",28) } Screen Shot: The Response #!c:ringbinring.exe -cgi Load "weblib.ring" Import System.Web New Page { boxstart() text( "Cookies Values" ) newline() boxend() link([ :url = "ex10.ring", :title = "back" ]) newline() divstart([:style="float:left;width:200px"]) text( "Name : " + aPageVars["custname"] ) newline() text( "Age : " + aPageVars["custage"] ) newline() divend() } Screen Shot: 47.8. Cookies 373
  • 10. Ring Documentation, Release 1.5.2 47.9 URL Encode The Page User Interface #!c:ringbinring.exe -cgi Load "weblib.ring" Import System.Web New Page { boxstart() text( "URLEncode" ) newline() boxend() link([ :url = "ex5.ring?Name="+URLEncode("-*{Mahmoud}*-")+ "&Address=Egypt&Phone=123456&Age=28&Notes=Programmer", :title = "Test URL Encode" ]) } Screen Shot: Screen Shot: 47.9. URL Encode 374