Fork me on GitHub

Nukewrapper, POST, external page  Bottom

  • Ok, I am trying to pass a variable to an external page that is being framed with nukewrapper. I figure to have it load the page with the variable its going to have be setup in the array so that I call it like this:

    page.php?URL=quickquote

    which is a shortcut to:

    http://absreport.aghost.net/index.cfm?show=203&quote=

    Standalone, if I wanted to load the page with a quote for CSCO, i would just add CSCO to the end of the URL, like this:

    http://absreport.aghost.net/index.cfm?show=203&quote=CSCO

    So i figured I should be be able to use a form and POST that variable to the end like this:

    page.php?URL=quickquote&quote=csco. But that doesnt now work and loads no variable. So i tried this:

    'quickquote' => 'http://absreport.aghost.net/index.cfm?show=203&quote=$_POST[\'quote\']',

    No luck there either. As it will try to load $_POST[\'quote\' instead of CSCO

    Any ideas? Thanks.
  • In HTML forms using the POST method, you cannot have query strings in the form Action, as you point out it simply gets dropped. You can instead place the variables in a Hidden field.

    As for placing it in a key, in PHP varables are only parsed in double-quoted strings, and then you'd leave out the single quotes in $_POST['varname']. Anything in single quotes are taken literally, as you found out.
    The solution: Either use double-quotes for the URL part, or exit the single quotes first:

    Code

    (quickquote' => "http://absreport.aghost.net/index.cfm?show=203&quote=$_POST[quote]");
    or
    (quickquote'
    => 'http://absreport.aghost.net/index.cfm?show=203&quote='.$_POST['quote']);

    The "." character after the end single quote appends the POST variable.

    Either way should work.
  • 0 users

This list is based on users active over the last 60 minutes.