Search This Blog

Wednesday, May 20, 2009

URL Variables Passing - 20th May

Before I was writing this blog, I hit a snag again since yesterday. It was the issue of passing the URL variables to another page besides the intended target page. All i want to do was like:-

I've made a page called [ item_list.php ] where there are currently 2 links to [ item_info.php?item_id=1 ] and [ item_info.php?item_id=2 ]. When a user clicks either they will go to page for item 1 or item 2. [ item_info.php ] is a page that will be used to display each item's information individually, depending on item_id passed earlier. In [ item_info.php ], there's also a form for users to add further info, displayed only if they're logged in. The login form is also in the [ item_info.php ] page for convenience.

So, my question is, what do i put into the success redirect page box? I've tried:- item_info.php?item_id={GET.item_id} and item_info.php?item_id=echo $_GET('item_id') into the redirect box but both doesn't work....they redirected me to item_info with item_id=0

But I finally got it to work moments ago. There was a typo error with my code, where the login success redirect page should be:

-> item_info.php?item_id={GET.item_id}
instead of -> item_info.php? item_id={GET.item_id}

Just a minor spacing error and everything's haywire. Coding is such a fickle thing.

No comments: