Jump to content

Changing code passed on by url


tommy2shoes

Recommended Posts

Hi

 

I use Dreamweaver to do a lot of my work on a php/mysql database. I have two tables - applications and contacts and they are linked by the id appid. When I view a page with all of the application and contact details the url contains the appid as a number at the end (eg .../Summary.php?appid=639)

When I want to edit one of the contacts I go to the edit page but this is identified by a contact id so that url looks like:

../EditContact.php?contactid=32

When I update the contact's details I would like to return to the summary page but can't as the url gets muddled between the two different ids so I end up at a page with no info on it.

 

How can I get round this?

 

I'm sorry my explanation isn't very clear but any help is much appreciated.

 

Link to comment
Share on other sites

You can use PHP header function to redirect automatically to the page you will give as an argument. Make sure you don't output anything before header function otherwise it will give error.

for example:-

$contact_detail = $data_to_be_changed;

header(Location: ROOT_DIR/summary.php?appid=123);

Link to comment
Share on other sites

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.