Solved

Strip off old header information

Posted on 2012-04-11
3
294 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
  • 2
3 Comments
 
LVL 82

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 82

Expert Comment

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

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now