$WBPOSTURL - get data from URL (POST method)

Availability
$WBPOSTURL is available for use with all WBSP commands.

Syntax
$WBPOSTURL{URL|PostData|FullPage|ContentType|SoapAction|Options|Headers}
$WBPOSTURL[URL|PostData|FullPage|ContentType|SoapAction|Options|Headers]

Parameters
URL - The Internet address of the resource (page, file) you want to include in your page. It can be either absolute (containing entire address including protocol, server, path and resource) or relative (to document root of virtual server if it starts with slash / character, or to the directory where the WBSP file is located).
PostData - data to be posted in format var1=value 1&var2= value 2&...&varn= value n for ordinary POST or as XML for SOAP.
FullPage - optional parameter. If set to true (T) function will return entire page code without truncating code outside <body> and </body> tags.
ContentType - optional parameter. Sets the Content-Type clause in HTTP request header. If omitted WhizBase will send the default value application/x-www-form-urlencoded
SoapAction - optional parameter. Sets the SOAPAction clause in HTTP request header for web services. If omitted no default value will be sent.
Options - optional parameter. Contains comma-separated list of ServerXMLHTTP options in form optionnumber=optionvalue.
Headers - optional parameter. Contains  comma-separated list of ServerXMLHTTP request headers in form headername= headervalue



Returns
Source code of the received page/file. If source code contains <body> and </body> tags and FullPage is not set to true, function will include only the source code between these tags.

Example
File PostCookiesA.wbsp

[FormFields]
wb_command=R
<!--WB_BeginTemplate-->
<html>
<head>
<LINK href="$wbif[
"$wbgc[css]"=""
|
$wbif["$wbrv[style]"=""|style1.css|$wbrv[style]]
|
$wbif["$wbv[css]"=""|style1.css|$wbposturl[changecss.wbsp|css=$wbv[css]]]
]" type=text/css rel=stylesheet>
<title>Cookie test</title>
</head>
<body>
Cookie value:($wbgc[css])<br>
Variable value:($wbrv[style])<br><br>
<form action="setcookieA.wbsp" method="post">
<input type="hidden" name="css" value="style1.css">
<input type="hidden" name="sp" value="$wbe[script_name]">
<input type="submit" value="Style 1">
</form>
<form action="setcookieA.wbsp" method="post">
<input type="hidden" name="css" value="style2.css">
<input type="hidden" name="sp" value="$wbe[script_name]">
<input type="submit" value="Style 2">
</form>
</body>
</html>

File SetCookieA.wbsp

[FormFields]
wb_command=R
wb_redirect=http://$wbe[server_name]$wbv[sp]?css=$wbv[css]
wb_addcookie=CSS=$wbv{CSS}

File ChangeCss.wbsp

<!--
[FormFields]
wb_filename=/default.inc
wb_command=wf
wb_keyname=Style
wb_keyvalue=$wbv{css}
wb_section=Userdata
-->
<!--WB_BeginTemplate-->$wbv[css]

File style1.css

body{
font-family:Verdana;
font-size:12px;
color:#333333;
background-color:#efefef;
}
a{
text-decoration:none;
color:#0065b7;
font-weight:bold;
}
a:hover{
color:#cc0000;
}

File style2.css

body{
font-family:Verdana;
font-size:12px;
color:#0000cc;
background-color:#ffffff;
}
a{
text-decoration:none;
color:#6500b7;
font-weight:bold;
}
a:hover{
color:#00cc00;
}

After running this example (file postcookiesa.wbsp) the page will change its appearance depending on value of cookie named CSS (if it exists) or depending on a value of user defined variable Style in file /default.inc, or if neither of those two exists, it will use file style1.css. When you click the either of buttons ("Style 1" and "Style 2") it will set the cookie to selected value, call the file changecss.wbsp (with selected value as parameter named CSS) using $WBPOSTURL function, and write new value to file /default.inc as user-defined variable "Style".