Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 115342

sdoss on "Passing a variable value from WordPress pages to an external cgi application"

$
0
0

Ok, so progress report...
a) The add_query_arg function works just fine. If all three parameters are literal, and not variable, the function will append what you tell it to appropriately.
b) No, you cannot embed your own php UNLESS you are using a plug-in that allows you to do so. To that end, I've applied the following plugin:

Allow PHP in Posts and Pages

and, indeed, it allows you to very easily put php code on your page.
c) No, I'm not out of my mind...I'm just ignorant. So, here is where I now am:

I'm trying to append a variable order number to a link on the page. The variable order number, ideally, will be passed from page to page via a url query parameter.

As mentioned above, I can retrieve the order number quite easily in the page template and place it in what I believed was a global variable.

So, I went to a page, and changed
<a href="http://aamorders.curreyadkins.com/aam1000.cgi?PAGE=4">
to
<a href="http://aamorders.curreyadkins.com/aam1000.cgi?PAGE=4&ORDERNUMBER=[php]echo $ORDER_NUMBER[/php]">
and voila - the code was broken, and I end up with an actual </br>(break), so no href.

I can even change the php at the 'echo' part to utilize the add_query_arg function (in place of the global variable), and as long as everything in the function is literal, I'm ok. But, as soon as I change anything to be a variable, the html is broken.

Again: php noob, html half-wit. But I have a good heart :) If anyone has experienced this, whether or not in the Allow PHP in Posts and Pages plugin, please.....help?


Viewing all articles
Browse latest Browse all 115342

Trending Articles