Hi, I'm new to web design and I need some help with page redirection.

I'm using Dreamweaver CS3 with ADDt installed. The story goes like this:-

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 doesnt work....they redirected me to item_info with item_id=0

Please help. Thanks!

Dani AI

Generated

sorted this one out — it was a simple typo — but for anyone else who lands here later, the following checklist and example will help avoid and diagnose common redirect problems when returning users to a dynamic item page.

First, a short troubleshooting checklist: confirm the parameter actually exists at the point you redirect (check request method and variable name), make sure you aren’t sending any output before the redirect (headers must be sent before output), verify the redirect token or placeholder in your editor/add‑on is typed exactly as documented, and validate/sanitize the value you’ll append to the URL. When using server-side redirects, always follow the header call with an exit to stop further output. A quick debug technique is to log or temporarily echo the parameter before redirecting so you can see its value.

A minimal, robust pattern for form processing is: process the POST, save changes, then redirect the user back to a GET URL that includes the item identifier (the POST-Redirect-GET pattern). Example:

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $id = isset($_POST['id']) ? (int) $_POST['id'] : 0;
    // save or update using $id
    header('Location: /details.php?id=' . $id, true, 303);
    exit;
}

Additional tips: use urlencode for non-numeric values, prefer numeric casting for IDs to avoid injection, and consider using absolute URLs if your environment requires them. For more on PHP header behavior and common pitfalls, see the PHP manual on header() (PHP header() docs). For URL encoding rules, see the MDN glossary entry on URL encoding ().

I got it to work already and I found out it to be a typo error. Issue solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.