473,385 Members | 2,015 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how to hide query string

5
i have a page1 and page2.

in the page on a have this php code :

Expand|Select|Wrap|Line Numbers
  1.  
  2. $query = "select code, name from mscustomer";
  3.  
  4. $rs = mysql_query($query);
  5.  
  6. while($row = mysql_fetch_array($rs))
  7. {
  8.      echo "<a href=\"detail.php?id=".$row['code']."\">".$row['name']."</a>";
  9. }
  10.  
  11.  
example data :

justin
harry
david

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
May 10 '07 #1
3 2257
You need to explain this better!
May 10 '07 #2
I think what your getting at is when you're on the second page you are using the ID and you want to get the name,

What you need to do on the second page is another query:

$sql = "select * from table where id = ". $_GET['id'];

and from that get the information you need to display!
May 10 '07 #3
pbmods
5,821 Expert 4TB
[PHP]$sql = "select * from table where id = ". $_GET['id'];[/PHP]
Should be:

[PHP]$sql = "select * from table where id = ". addslashes($_GET['id']);[/PHP]

to prevent an SQL injection attack.
May 10 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: ST Wong | last post by:
Hi, all, We've an application that requires passing username and password as query string to an URL, e.g. http://myapp.com?username=abc&password=pwd. This string will be displayed on browser...
2
by: Mark | last post by:
Hi all, I have a pop-up which has several command buttons which allow users to run a few stored query's. Having the query's displayed as report is not an option due to several reasons. My problem...
7
by: Mark | last post by:
Hi All, I have a report which is based on a query which is used to produce QC check sheets. I have quite a few text boxes which are used to display questions depending on the value of one...
4
by: -=franz=- | last post by:
is there a way to hide the query string? i receive a variable with a querystring from an external domain. i need to hide it cause it's a important data. thanks franz from italy
2
by: bhavik | last post by:
hi i want to know how to hide the values in query string in ASP.net. here i want to send the values from one page to another page through query string with out explicitly visible the values in...
2
by: prefersgolfing | last post by:
Is there a way to hide the query string in the address bar?
3
by: =?Utf-8?B?Um9iZXJ0IENoYXBtYW4=?= | last post by:
Hi, I have a GridView with a fixed number of columns being returned from a SQL query and each having a simple template: <asp:TemplateField HeaderText="Allocations"> <edititemtemplate>...
22
karthickkuchanur
by: karthickkuchanur | last post by:
I want to hide the following value to hide when i call the url <script> function callEmployeeEducationalHistory() { ...
9
by: deepikashalini | last post by:
Hi, im new to html. i don't know how to hide query string in url. Example: http://localhost:1067/sample/defaultx.aspx?rnd=0.16709316722305073&filter=Category&id=3 i want to hide the...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.