Page 1 of 1

Passing variables back in the URL

Posted: Sat Sep 09, 2006 4:15 am
by Hodge
Hi,

I'm just getting to grips with CMS Made Simple, and love it so far. For the most part, transfering our old content has been easy - however, I'm currently having a small problem with one of my user defined tags.

Basically, the tag prints a simple form, with one text input field. The data input in this field is sent to an external PHP script, which validates the data, and either processes it, or returns the user to the requesting url (the tag is on every page), with a message attached, i.e:

1) user inputs data into the field from, say, http://www.mydomain.com/cms/index.php/mypage
2) the tag sends the data to http://www.mydomain.com/other_scripts/validate.php
3) validate.php either processes the data or rejects it - if it processes it, the user is simply returned to the requesting url (this part works fine).
4) on rejection, validate.php returns the user to http://www.mydomain.com/cms/index.php/mypage (using the header('Location: http://www.mydomain.com/cms/index.php/mypage'). However, I want to pass a variable to this location, eg:

header('Location: http://www.mydomain.com/cms/index.php/m ... '.$message);

I've also tried header('Location: http://www.mydomain.com/cms/index.php/m ... '.$message);

5) the tag should then pick up the message variable, and print it.

However, I just get a 404 page not found.

I appologise if this sounds stupid, but this system, including search engine friendly URLs is all new to me :) So, is there any way I can pass this variable back to the requesting page, and successfully print the result?

Thank you so much for any information.

Re: Passing variables back in the URL

Posted: Sat Sep 09, 2006 7:54 am
by tsw
those variables get stuck in pretty urls instead try returning to

http://domain.tld/cms/index.php?page=my ... ourmessaeg

hope this helps

Re: Passing variables back in the URL

Posted: Sat Sep 09, 2006 8:13 am
by Hodge
Thanks for the reply, tsw - that's what I'm using currently, but I was hoping that I could somehow get around the variables getting stuck :)

Ah well, old skool it is. Thanks anyway :)