473,799 Members | 2,665 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help PHP Question

Hi There,

I firstly wish to thank those who have helped me:) I have one issue that I
sort of am lost in the dark, I have searched google without any luch,

I am passing the following through to a html link

result.php?1001

How can I get the query to recognise that number as the WHERE clause
condition.

Thanking you in advance.

Cheers
Steve
Nov 3 '05 #1
2 1264
Using $_GET :

result.php?num= 1001

Then use $_GET['num'] to get the number 1001.
Using $_SERVER['QUERY_STRING'] :

result.php?1001

Then use $_SERVER['QUERY_STRING'] to get all the string after the ?
mark. In this case it will have the number 1001.

Nov 3 '05 #2
On Thu, 03 Nov 2005 08:29:38 +0200, <el*****@gmail. com> wrote:
Using $_GET :

result.php?num= 1001

Then use $_GET['num'] to get the number 1001.

or you can use Apache's the mod_rewrite:

RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteRule ^result\.php\?([\d]+)$ /?num=$1

(if result.php is in site's root directory)

this should rewrite request result.php?1001 to result.php?num= 1001
you can use even better view construction with mod_rewrite:
RewriteRule ^result\/([\d]+)$ /result.php?num= $1

will rewrite http://mysite.com/result/1001 to
http://mysite.com/result.php?num=1001


Using $_SERVER['QUERY_STRING'] :

result.php?1001

Then use $_SERVER['QUERY_STRING'] to get all the string after the ?
mark. In this case it will have the number 1001.


--
---
Exact Meta Search | Major Search Engine
http://exactsearcher.com
Nov 3 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2578
by: sunaina | last post by:
This is the first program I am writing using PHP and Mysql. I am creating a game where user thinks of an object and my program guesses the object while asking series of yes/no questions. All a user has to do is say yes or no to the questions that my program asks. I have coded until the part where once user thinks of an object and enters submit and the program asks him the first question. Now when the user enters yes/no for this first...
9
2939
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with a device. The definition of the table is as follows: CREATE TABLE devicedata ( device_id int NOT NULL REFERENCES devices(id), -- id in the device
1
1737
by: Mohammed Mazid | last post by:
Basically I want to store the answer of a single-choice question (where candidate selects one answer) and multiple-choice question (where candidate selects more than one answer). I would like to store it in a table and then when I run the quiz application on VB, I would like to track answers for both types of questions. Please help me solve this problem. Much appreciated.
13
3711
by: Chua Wen Ching | last post by:
Hi there, I saw this article here in vb.net. http://www.error-bank.com/microsoft.public.dotnet.languages.vb.1/148992_Thread.aspx and http://www.opennetcf.org/forums/post.asp?method=ReplyQuote&REPLY_ID=3922&TOPIC_ID=2224&FORUM_ID=35
28
1899
by: Siv | last post by:
Hi, If I run the following: strSQL = "Select * FROM Clients;" da = New OleDb.OleDbDataAdapter(strSQL, Conn) 'Create data adapter cb = New OleDb.OleDbCommandBuilder(da) 'Create command builder using the datadapter dt = New Data.DataTable da.Fill(dt) 'pour in the data using the adapter
5
1604
by: Patrick.O.Ige | last post by:
I have an xml and i'm trying to loop each node... When i do FOR EACH i seem not to get my desired result I want to loop through and get only the values that matches the question i specified with the corresponding answers? I don't want to retrieve all the Answer and VoteAnswers nodes <xsl:for-each select="NSurveyVoter/Voter/Question/Answer"> <xsl:value-of select="Answer/Answer/text()"/>
16
2541
by: pamelafluente | last post by:
I am still working with no success on that client/server problem. I need your help. I will submit simplified versions of my problem so we can see clearly what is going on. My model: A client uses IE to talk with a server. The user on the client (IE) sees an ASP net page containing a TextBox. He can write some text in this text box and push a submit button.
0
2410
by: Mike Collins | last post by:
I someone can please help, I am about at an end in trying to figure this out. I am adding some dynamic controls to my page (I found out that I was supposed to be doing that in the oninit event, which I am). I now want to read the text/values of those controls. I have found out that I can read the values if I wait until Page_Load, but then I have the same questions showing up again (along with the new questions) and I do not want them to....
1
1461
by: TexCube | last post by:
Hello everyone, I have an urgent question. Can data be pulled from an access database table to create a directory that can be printed out and bound together? I need to have each row of a database populate a preset page that will be used as a classmate directory. Each page will have info pertinent to an individual classmate. (one page per classmate) I don't want to input the data into a form since it's already been done into an Excel...
3
1169
by: Perry Langla | last post by:
I can not seem to figure this out, please help. This program worked perfectly in Visual Studio 2003. The program gets the information from an Access Database. I am using OleDbSelectCommand to select certain records. When I run the program and click Button1 the test works OK. The problem is when I select another Button the correct records appear but the QuestionCounter is not correct. It shows " Question 10 of 10 ". I think it has...
0
9689
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9550
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10495
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10269
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5597
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4148
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2942
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.