Jump to content

Simple Question Regarding Page Redirection


Nightkon

Recommended Posts

Hi All,

 

I have a form which when updated takes the user to an update screen. I was wondering if it was possible to redirect the user back to the screen where they entered the information and refresh the data basically just refreshing the page (and obviously updating the data in the database which is working fine).

 

I have tried using some code and I can easily redirect back to the right page but I also need to have the 'id' selected so that it displays the recently updated record. Below is the code I attempted to use (i have tried everything I can think of). Any help would be appreciated.   

 

header('Location: OrganiseIDASX.php?id=echo $_GET[$id]');

Hi MadTechie,

 

thanks for your help. The full code I am using in the update.php file is:

 

<?php

include ('./mysql_connect.php');
$rrr_score = $_POST['rrr_score'];
$bs_score = $_POST['bs_score'];
$frs_score = $_POST['frs_score'];
$fs_score = $_POST['fs_score'];
$strength_summary = $_POST['strength_summary'];
$ms_score = $_POST['ms_score'];
$id = $_POST['id'];

$query = "UPDATE company SET rrr_score = '$rrr_score', bs_score = '$bs_score', frs_score = '$frs_score', 
fs_score = '$fs_score', ms_score = '$ms_score', strength_summary = '$strength_summary' WHERE FileSerial= '$id'";

$result = mysql_query($query);
header("Location: OrganiseIDASX.php?id={$_GET[$id]}");
mysql_close($link);

?>

 

Using the code you provided returns the following in the URL:

 

http://localhost:8888/OrganiseIDASX.php?id=

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.