GetSimple Support Forum

Full Version: Passing var on link urls
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Okay, just trying to pass around some variables on a url for a registration process. Is this possible with GetSimple. It's late, I can't seem to get it to work and it's such a simple thing. I have fancy urls on.

Just want to be able to have various links in the content that a person selects to go to a registration page, but the specific link passes a var on the url.

Guess I could make a registration form component, and then create pages for each of the reg types and grab the slug, but that seems a little nutty.

Can't seem to get this simple thing to work. Any ideas?
I was unable to resovle simple values off of the url, when using fancy urls. So I created seperate pages and used a template to make it work. Not ideal.

Am I missing something here?

Real simple standard stuff, someurl.com/register?value=regvalue just that. Is there something under the covers of GetSimple that keeps you from getting a handle on the variable?
there shouldn't be, but honestly I cant say I've tried. The only thing i can think of is that the htaccess file was blocking it somehoe
You’re right, this seems like a mod_rewrite problem. I used the following code in my template to test this:
Code:
<?php
    print '<p>This is an <code>echo</code> of <var>$_GET[\'url\']</var>: ';
    echo $_GET['url'];
    print '</p>';
?>

On the main page, without any slug in your URL, it’ll work:
[Image: 2qLT]

As soon as it needs to use mod_rewrite (when there is a slug) it will lose all the information:
[Image: 2qMU]

Just some quick looks with Google doesn’t give me a good idea of how to fix this. Anyone an idea how to keep the original query string accessible after using mod_rewrite?
Nothing a little regular expression can't handle.

However, I've known of this problem but I just created a file.php in the home dir and used that instead.
Look into [QSA] (query string append) for htaccess files

Try this replacement inside your root .htaccess file: It may work, or there may be a little more tweaking to do:

Code:
RewriteRule /?([A-Za-z0-9-]+)/?$ index.php?id=$1 [QSA,L]
I can positively say that your solution is working, Chris! Do you think this should be added to the SVN build?
Zegnat: Yes. There are two files, one in the root and one in /admin/inc/tmp/
Thank you so much for your feedback. I thought I was loosing my marbles for a bit (which is not uncommon for me). Unfortunately I am not allowed access on the .htacces file (so far), so I worked it out by doing the following:

(only works for one var, then post the form to a controller outside of GetSimple)
Create a faux page with the slug name as the variable I want.
Then pickup the slug with the function and put it in a hidden input
Set the faux page to a template of the actual form.

Not ideal, but working until I can get my htacces the way I want..

Good stuff, thanks for the input. Much appreciated

A

Anyone want to do a preso, online or in person, about the joys of GetSimple to my Adobe Flex User Group? Hit me up and let me know. My folks don't want to hear me speak anymore. Big Grin
adrian Wrote:Unfortunately I am not allowed access on the .htacces file (so far)
How is this possible? You said you were using Fancy URLs, this is only possible when the GetSimple .htaccess file is working in your GetSimple directory. So you must have access to it if you were able to install GetSimple the way you have it.

adrian Wrote:Anyone want to do a preso, online or in person, about the joys of GetSimple to my Adobe Flex User Group? Hit me up and let me know. My folks don't want to hear me speak anymore.
In person? How does that work?
I’d love to do a quick presentation on GetSimple, but I wonder how much there is to say really.
Zegnåt Wrote:
adrian Wrote:Unfortunately I am not allowed access on the .htacces file (so far)
How is this possible? You said you were using Fancy URLs, this is only possible when the GetSimple .htaccess file is working in your GetSimple directory. So you must have access to it if you were able to install GetSimple the way you have it.

Simple, it's owned by apache:apache. The file needs to be chmoded to the correct user. This deals with the bug report already filed that Chris knows about regarding chmod file issues. There is no way around this except through SSH. In fact, I would love to see someone try and do a FTP uninstall of GS and see what files remain.

adrian Wrote:Anyone want to do a preso, online or in person, about the joys of GetSimple to my Adobe Flex User Group? Hit me up and let me know. My folks don't want to hear me speak anymore.

I could possibly do this and create an overview presentation for GS as a whole and have Chris post it here.
What do you guys use for presentations?
internet54 Wrote:Simple, it's owned by apache:apache. The file needs to be chmoded to the correct user.
Being CHMODed to the server does not limit your access to the file through FTP, as far as I know. You should still be able to remove the file or even edit it locally and overwrite it on the server. At least, I’ve always been able to do that.
internet54 Wrote:In fact, I would love to see someone try and do a FTP uninstall of GS and see what files remain.
OK, I’ll bite. Currently setting up GetSimple on my server. After setting it up I’ll:
  • change the content of the index,
  • add a sub page to the index,
  • create two new pages,
  • add a sub page to one of the two pages,
  • upload a file and
  • create a 404 log by calling an nonexisting slug.
We’ll find out what files are left on my server afterwards. Any actions you think I should add to this?
^ You can open a file owned by anyone, however, you cannot make changes to it. So, every file that GS creates will not be modifiable outside the admin panel.