Re: quoting pains

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Patrick Fleming, EA
Date:  
To: plug-discuss
Subject: Re: quoting pains
<snip>

> got that - my problem is my 'string' already exists and is built and is
> used in the source php file. To use your html example (and thanks for
> the effort), I would have to rebuild the string for a second time to
> pass it through - I was specifically trying to avoid that. In fact, if I
> were to rebuild the string a second time, it would make more sense from
> a number of standpoints to send the string and the variable through the
> POST into the target php file and rebuild it there.
>
> Craig
>


Craig,
Maybe the best way to handle this is to "rip" the query string out of
your input/form file, stick it in a function that is called from each
results page and build the query on the back end. That way you aren't
rebuilding the query string on each page and you are only passing the
few variables that you really need to pass, you aren't fighting with
escaped and expanded quotes and life gets a little easier ;)
A side effect is that you can reuse the function on any page which can
come in handy.

So something like:

(results page)

<?php
  include("functions.php");
  if (isset($_POST) && $_POST['user_uid'] != "" && \ 
$_POST['some_other_query_variable']!= "" )
   {
    form_post_query($_POST['user_uid'], \ 
$_POST['some_other_query_variable'])
   }
...
?>


(functions file )
<?php
function form_post_query($var1, $var2) {
//Query would go in here
}
...
?>

Of course you introduce issues of scope and you have to figure out
exactly how you want this to work. I would have the query occur in the
form_post function, that means either declaring your other script
variables as global within or without the function or specifically
passing the variables to the function.
Globals are generally seen as potential security issues and are
recommended against as a general rules.

Seeing that it looks like you are attempting to extend horde I would
definately recommend that you use external functions. That way, when you
upgrade horde you don't have to recustomize it.

Patrick

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss