0

I'm using in my add-vehicle.php the following code to redirect my users after submitting a form and it works..(this is not the whole code)

if(isset($_GET['success'])  && empty($_GET['success'])) ....(is true)

header('Location: www.mysite.com/add-vehicle?succses');

But I want to redirect my users to a unique webadres. For example:

www.mysite.com/add-vehicle?succses/car_id=1 and the next one to www.mysite.com/add-vehicle?succses/car_id=2'

so I want to output the data of my Database in my url.. What is the best way to do it?

2
  • Query the database for the information, and append it to the location string. Commented Oct 29, 2013 at 20:36
  • fetch the data from the database, bind it to a variable and put it into your url string. Commented Oct 29, 2013 at 21:05

1 Answer 1

1

You can just use your PHP variable to adjust the URL.

header('Location: http://' . $_DBPage);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.