Jump to content

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=

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.