Home
 

Customer Support

Search for keywords:

Browse by category:

Why doesn't mivascript interpret GET variables?

If you have a mivascript page that you want to access at a URL like:

http://example.com/test.mvc?test=hello

and you are expecting a variable named "test" to be set to the value "hello" in your script, then you need to be aware of a Miva security setting that turns off GET variables by default.

If you really want to use GET variables, you'll need to write a helper function to parse out the GET vars from the URL querystring.



User-Contributed Notes

add a note
29-Sep-2003 00:36
I wrote this script to get the parameters 
from the query_string:

Call the script...
<MVDO FILE="parsequery.mv"  NAME="IGNORE"
VALUE="{parseNV(query_string)}">

=== parsequery.mv - begin cut ===
<MVFUNCTION NAME="parseNV" PARAMETERS="PARSE_STRING">
<MVASSIGN  NAME="PARSE_STRING" VALUE="{ query_string $ '&' }">
<MVASSIGN  NAME="RESULT" VALUE="{ 'OK' }">
<MVASSIGN  NAME="COUNT" VALUE="{1}">
<MVWHILE EXPR="{(RESULT NE '') AND (COUNT LT 30)}">
         <MVASSIGN NAME="RESULT" VALUE="{gettoken(query_string, '&',
COUNT) }">
         <MVIF EXPR="{RESULT NE ''}">
                 <MVASSIGN NAME="varname"
VALUE="{gettoken(RESULT,'=',1)}">
                 <MVASSIGN NAME="varvalue"
                        
VALUE="{decodeattribute(gettoken(RESULT,'=',2))}">
                 <MVIF EXPR="{ varname NE ''}">
                         <MVASSIGN NAME="{'g.' $ varname }" VALUE="{ 
varvalue }">
                 </MVIF>
         </MVIF>
         <MVASSIGN NAME="COUNT" VALUE="{ COUNT + 1 }">
</MVWHILE>
</MVFUNCTION>
=== end cut ===

You just have to call that function at the top of a page that uses GET 
variables and they are set properly.

add a note

Related Questions:


Can I have a crontab?

Why does your service seem slow?

How do I do a traceroute to diagnose network problems?

My POST to a secure form results in a blank page, the same form, or a 500 Internal Server Error.

Internet Explorer shows a blank page on an SSL website like the Control Panel or signup page.

How do I get a command prompt on my own computer?

After I install Bugzilla, I get error 403 Forbidden.

How do I install Gallery?

I am having trouble installing phpBB2

Where can I find links to 'Standards-Compliant' Web browsers?

Do you provide CVS?

How do I use a robots.txt file?

Can I use streaming media on my site?

Do you support Flash, Shockwave, Java Applets?

I installed Norton Internet Security, and now I can't see video and other multimedia.

How do I use MnogoSearch Indexer?

Do you run Linux?

Can I use a blog or other content management system?

Do you have Postgres?

How do I contact my registrar?

What does everything in a Wusage report mean?

Whenever I make changes with Movable Type I get SBOX errors.

Are there any resources for dealing with comment spam in a Movable Type blog?

How Do I Add A Google Sitemap To My Website?

Do you provide SVN?

What can I do to improve Drupal's loading speed?

Browse Categories:

Getting Started, FTP, Telnet/SSH, Moving Domains, E-mail, Traffic Reports, Mailing Lists, Apache, PHP, CGI, Other Server-Side Scripting, MySQL Database, Imaging Libraries, Other Software, Billing & Terms, Control Panel, E-commerce, Pre-Sales


Tiny Modwest Logo         Copyright 2000-2008 by Modwest, Inc.          About Us    |    Blog    |    Jobs    |    Web Design    |    Contact Us