Passing a variable

Permalink
Declaration: I am a dabbler, not a skilled coder!

I'm transferring an existing site into C5 and going great guns. I'm using single_page types to recreate the more complex pages that make db calls.

It was going well until I hit a page which relies on retrieving the necessary var by the $_GET method.

The only thing that seems to work is for the form passing the var to post it to the receiving page's numerical id, as opposed to its canonical one (i.e. index.php?cID=115). This of course prevents me tagging the string on the to the passed URL like this:
<a href=\"index.php?cID=115?reg=$reg\">


I have a horrible feeling the answer to this is going to go over my head! Is there a simple solution I'm missing or will I need to re-write the pages to POST the vars? Or something more effective/complex?

Apologies for what is probably an utterly newbie question, but any advice appreciated.

 
Mnkras replied on at Permalink Reply
Mnkras
take a look at $this->action('');
ofandg replied on at Permalink Reply
Ah, thank you Mnkras. That's got me going in the right direction!

Now I'm passing
index.php?cID=115$reg->action('reg=$reg');


It shows the correct value of $reg (i.e ('reg=UKE01191') in the resulting link - so that's progress.

Now my problem is that the receiving page/script isn't reading the value

The first line of that receiving script is
$reg = $_GET['reg'];


So the previous page is reading the value I need into that string, but it's not being read by the following script.

I know this is probably a fundamental lack of understanding on my part, but I now have a feeling it's easily fixed... I'm still plugging away trying to find my own answer :-) but if anyone can chip in, it my save me some hair.
Mnkras replied on at Permalink Reply
Mnkras
i think you are misuderstanding what $this->action does

$this->action('blah') in the view will trigger the function function action_blah()

as an example look at the theme switcher addon (free)
SVijay replied on at Permalink Reply
SVijay
Hi,

try this

echo '<a href="index.php?cID=115?reg='.$reg.'">';