« Back to IP Phone Services Questions

passing null querystringparam

Combination View Flat View Tree View
Threads [ Previous | Next ]
passing null querystringparam
querystringparam ciscophoneinput null value
Answer
2/1/12 1:51 PM
I'm building a service that will pass a UserID (qsp) from one page to the next.  The UserID is queried on the next page by sql.  If someone accidentally hits submit without entering any information, the phone displays an html error.  My solution at this point is to utilize a default value of 'space'; however, this is not a recommended solution.
Placing 0 as a default value would solve the query issue; however, I cannot have default values visible on the screen.
Is there any way to pass a null value?
Any help is appreciated.  Thank you.
Cindy
 
function InputMenu()
{
    //Phone menu. Gets User ID (input) and forwards to next page.
   
    Response.Write("<CiscoIPPhoneInput>\r\n");
    Response.Write("<Title>IP Time Clock</Title><Prompt>Enter UserID to Clock In</Prompt>\r\n");
    Response.Write("<URL>http://"+serverIP+"/"+SERVICE_DIR+"/timeclock/CIAddPin.asp</URL>\r\n");
   
    Response.Write("<InputItem>\r\n");
    Response.Write("<DisplayName>User ID</DisplayName>\r\n");
    Response.Write("<QueryStringParam>input</QueryStringParam>\r\n");
    Response.Write("<DefaultValue> </DefaultValue>\r\n");
    Response.Write("<InputFlags>N</InputFlags>\r\n");
    Response.Write("</InputItem>\r\n");
   
    Response.Write("</CiscoIPPhoneInput>\r\n");
    return;
}
 
 
Next Page code snippet - to give you an idea of how the value above is being used
 
var SERVICE_DIR="CiscoIPServices";
    var serverIP = Request.ServerVariables("LOCAL_ADDR");
    var input = Request.QueryString("input");
    var sql;
    var Conn = Server.CreateObject("ADODB.Connection");
    var RS = Server.CreateObject("ADODB.Recordset");
    Conn.Open("Provider=SQLNCLI10;xxxx);
    var RS = Server.CreateObject("ADODB.Recordset");
   
    sql=("SELECT * FROM dbo.vw_User_PinList WHERE PERSON_ID =("+input+") "); 
   
    RS.Open(sql, Conn);

Can you not just leave the default value empty?  The URL request will have either '?input=' or be missing the input parameter entirely (depending on phone model), which you should be able to check for in your server side code:
 
http://stackoverflow.com/questions/1890438/how-to-get-parameters-from-the-url-with-jsp

After reviewing the schema, I found that querystringparams minimum value = 1. So leaving an empty space will work, but cannot accept null.