473,789 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accessing URL parameters

How do I access URL parameters, and ideally as an associative array ?

Many thanks in adance,

Aaron
Dec 31 '07 #1
5 1827
On Mon, 31 Dec 2007 18:24:28 +0100, Aaron Gray <an********@gma il.com>
wrote:
How do I access URL parameters, and ideally as an associative array ?

Many thanks in adance,
Do you want to examine the URL string?
http://www.php.net/parse_url
http://www.php.net/parse_str

Or in the current request, it's offcourse in the $_GET array.
--
Rik Wasmus
Dec 31 '07 #2
"Rik Wasmus" <lu************ @hotmail.comwro te in message
news:op******** *******@metalli um.lan...
On Mon, 31 Dec 2007 18:24:28 +0100, Aaron Gray <an********@gma il.com>
wrote:
>How do I access URL parameters, and ideally as an associative array ?

Many thanks in adance,

Do you want to examine the URL string?
http://www.php.net/parse_url
http://www.php.net/parse_str

Or in the current request, it's offcourse in the $_GET array.
parse_url() looke helpful, but I wanted the current pages URL parameters, is
the $_GET ?

Aaron

Dec 31 '07 #3
On Mon, 31 Dec 2007 18:45:07 +0100, Aaron Gray <an********@gma il.com
wrote:
"Rik Wasmus" <lu************ @hotmail.comwro te in message
news:op******** *******@metalli um.lan...
>On Mon, 31 Dec 2007 18:24:28 +0100, Aaron Gray <an********@gma il.com>
wrote:
>>How do I access URL parameters, and ideally as an associative array ?

Many thanks in adance,

Do you want to examine the URL string?
http://www.php.net/parse_url
http://www.php.net/parse_str

Or in the current request, it's offcourse in the $_GET array.

parse_url() looke helpful, but I wanted the current pages URL
parameters, is
the $_GET ?
The parameters from the query string indeed.

http://www.example.com/path/to/file.ext?foo=foz&bar=baz

...will result in a $_GET array while running file.ext:
array(
'foo' ='foz',
'bar' ='baz')

If you want other information as well, search the $_SERVER array for your
needs.
--
Rik Wasmus
Dec 31 '07 #4
Aaron Gray wrote:
How do I access URL parameters, and ideally as an associative array ?
$_GET

Cheers,
--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

Proudly running Debian Linux with 2.6.22-3-amd64 kernel, KDE 3.5.8, and PHP
5.2.4-2 generating this signature.
Uptime: 19:00:06 up 39 days, 5:15, 4 users, load average: 0.62, 0.51,
0.56

Dec 31 '07 #5
"Rik Wasmus" <lu************ @hotmail.comwro te in message
news:op******** *******@metalli um.lan...
On Mon, 31 Dec 2007 18:45:07 +0100, Aaron Gray <an********@gma il.com>
wrote:
"Rik Wasmus" <lu************ @hotmail.comwro te in message
news:op******** *******@metalli um.lan...
>On Mon, 31 Dec 2007 18:24:28 +0100, Aaron Gray <an********@gma il.com>
wrote:
>>How do I access URL parameters, and ideally as an associative array ?

Many thanks in adance,

Do you want to examine the URL string?
http://www.php.net/parse_url
http://www.php.net/parse_str

Or in the current request, it's offcourse in the $_GET array.

parse_url() looke helpful, but I wanted the current pages URL parameters,
is
the $_GET ?
The parameters from the query string indeed.

http://www.example.com/path/to/file.ext?foo=foz&bar=baz

...will result in a $_GET array while running file.ext:
array(
'foo' ='foz',
'bar' ='baz')

If you want other information as well, search the $_SERVER array for your
needs.

Thanks,

Aaron
Dec 31 '07 #6

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

Similar topics

4
1785
by: stjulian | last post by:
I have a stored procedure that is supposed to 1. Increment a counter in Table A via a transaction 2. Use this value as the primary key to add in an address to customers Table B (Referenced as a "DECLARE @CustomerID INT" just after the AS clause) 3. Return the primary key. This works perfectly when being called from Query Analyzer supplying values in an EXEC line, however, accessing it from .ASP (IIS 5.0 on Win2K), the
1
1874
by: Jay | last post by:
I hope this is the correct place to post this. I'm using a stored procedure to simply look up and return a value from a database. The db key is an integer, everything else is varchar. The stored proc is: CREATE procedure SP_IMAGE_NAME( @MAT_ID varchar(13), @TYPE varchar(1), @IMAGE_NM varchar(100) OUTPUT ) as
1
4554
by: Mullin Yu | last post by:
hi, i'm using System.Data.OracleClient; but it seems not having Varchar2 and i use Varchar instead. Then when i call a Oracle Procedure update a table with varchar2, i got the following error: ============== Error Message ==============
8
4457
by: Christopher Weaver | last post by:
I'm having trouble accessing the value of an output parameter of a stored procedure. The SP looks like this: SET TERM ^ ; CREATE PROCEDURE SP_NEW_TASK RETURNS ( "uidTask" INTEGER) AS begin
1
8151
by: Garth Wells | last post by:
Using an example in the Jan 2006 release of the Enterprise Library, I came up with the code shown below to create a DAL method for returning several columns of a single row. I place the output parameter values in a comma-separated string, and then split the string to get the individual values on the calling page. This approach works, but I can't help but think there is a more efficient way to accomplish this. Thanks for any insight you...
11
1537
by: Ryan Krauss | last post by:
I have a set of Python classes that represent elements in a structural model for vibration modeling (sort of like FEA). Some of the parameters of the model are initially unknown and I do some system identification to determine the parameters. After I determine these unknown parameters, I would like to substitute them back into the model and save the model as a new python class. To do this, I think each element needs to be able to read...
4
3641
by: raj_genius | last post by:
I hav two queries, whc are as follows: FIRSTLY: is it possible to access the controls(by name) of a parent form(MDI) from its child forms??if yes then how??plzz provide a coded example in VB if possible.. for example..i hav a menu in the parent form named "Administrator" whic has an item "mnuLogIn"..now when i click on login..another child form named "frmLogIn" is displayed..what i want to happen is this: when login form(frmLogIn) is...
10
3933
by: amazon | last post by:
Our vender provided us a web service: 1xyztest.xsd file... ------------------------------------ postEvent PostEventRequest ------------------------------------- authetication authentication eventname string source string ID string
0
1004
by: thedoctor | last post by:
I have a stored procedure which has a table as one of its "out" parameters. I'm not able to call this procedure from c# .net. please let me know how i can access it. The procedure has been called from vb. I want to move the following code from vb to c#. VB code Function ReportTableRetrieved(objReportTable As OraParamArray) As Boolean Const constArraySize = 100 Dim i As Integer Dim strSQL As String Dim...
4
1492
by: imranabdulaziz | last post by:
Dear All, I am using asp.net2.0, C#, sql2005 using Visual studio 2005 Let Me explain the scenario I have checkboxlist containg 15 field. Based on no of checked field . I created dropdownlistbox and label dynamically through loop and assign id as dropdownlist + no of iteration. Now my question is how I access these control as when I am accessing one of the control I am getting nullobjectreference error stating “Object reference not set...
0
9499
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
10374
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...
1
10121
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
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
8995
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5539
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.