Wrox Programmer Forums
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old May 9th, 2007, 11:53 PM
Registered User
Join Date: Nov 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default hide query string

i have a page1 and page2.

in the page on a have this php code :

$query = "select code, name from mscustomer";

$rs = mysql_query($query);

while($row = mysql_fetch_array($rs))
     echo "<a href=\"detail.php?id=".$row['code']."\">".$row['name']."</a>";
example data :


when i click justin it will redirect to page 2, but i don't want to show the querystring url in page 2 -> detail.php

but when in page2 i use echo $id
it will print K01

how can i do that

Old May 11th, 2007, 03:13 AM
Friend of Wrox
Join Date: Oct 2006
Posts: 114
Thanks: 0
Thanked 0 Times in 0 Posts

You could hold the information in a form and submit the form to the next page so that instead of the $_POST, you have $_GET (or vice versa, not sure which way it is).

In essence you have some HTML that looks like a like, with an onClick event that sets the value of an input box and clicks the submit button, both of which have a style='display: none' so that noone sees them.

May not be perfect, but would work.


Sean Anderson

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tab item display prob / hide TABS query socoolbrewster CSS Cascading Style Sheets 4 June 13th, 2006 12:59 PM
How to hide the values in query string Ramakrishna.G General .NET 8 May 8th, 2006 07:29 PM
hide query string keng1509 General .NET 1 April 5th, 2005 11:51 PM
Query String Baby_programmer ASP.NET 1.0 and 1.1 Basics 3 December 24th, 2004 11:14 AM
Query String Nitin_sharma VBScript 1 December 16th, 2004 07:58 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.