?
Solved

Strip off old header information

Posted on 2012-04-11
3
Medium Priority
?
319 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 84

Accepted Solution

by:
Dave Baldwin earned 2000 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 84

Expert Comment

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

Featured Post

Industry Leaders: 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

Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

719 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