Solved

Strip off old header information

Posted on 2012-04-11
3
311 Views
Last Modified: 2012-06-22
I am working in php/mysql.  I am calling a page with some additional information in the header.  it looks something like this:

www.mysite.com/mypage.php?Series=CRY140-1

on this page I am doing an insert, and a redirect.

 $theRN = mysql_insert_id();
 $insertGoTo = "store.php?crn=0&rn=$theRN&action=show_detail";

if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
exit();
}

The header is showing as
www.mysite.com/store.php?crn=0&rn=77857845&action=show_detail&Series=CRY140-1

It seems to have carried over the  "Series=CRY140-1".

It does it in ie and firefox.

How do I strip this off?
0
Comment
Question by:jws2bay
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 37833817
Don't add it back.  This line:

$insertGoTo .= $_SERVER['QUERY_STRING'];

is adding the original query string back onto the URL you have created.  If you don't want it added back, you don't need that whole 'if' section.
0
 

Author Closing Comment

by:jws2bay
ID: 37834974
sometimes I just don't see the obvious.  Thanks
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 37835168
You're welcome, it happens to all of us.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question