Copy link to clipboard
Copied
I'm using a simple dreamweaver default script to update a record:
$updateGoTo = "cadastro_cliente.php?id=".$row_rsEditar_Receita['id_cliente'];
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
But it's time to redirect the page to the specified page, the script is not using the id number I want.
The script use the same id of the edit page.
Copy link to clipboard
Copied
What ID do you want to use?
You are setting the goto querystring to use the id from your recordset rsEditar. But you are also appending the former querystring value. So you may have conflicting name/values pairs in your querystring.
Copy link to clipboard
Copied
Bregent,
I found a solution:
In the form
<input type="hidden" name="id_cliente" value="<?php echo $row_rsEditar_Receita['id_cliente']; ?>" />
In the script:
$updateGoTo = "cadastro_cliente.php?id=".$_POST['id_cliente'];
header(sprintf("Location: %s", $updateGoTo));
Thanks!
Copy link to clipboard
Copied
Yes, exactly. This will eliminate the multiple instances of a name/value pairs you had in the querystring.
Copy link to clipboard
Copied
Thanks bregent. Sometimes, we need to understand the code instead just copy and paste its
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more