I want to pull part of the URI out to dictate what is pulled from the
database. For example, I want to control what year data is displayed
with a url like this: http://www.mysite.com/display.php?year=2007
I want to pull out the 2007. I can grab the uri, but what is the best
way to pull out just the 2007? 4 5391
On Nov 15, 10:34 am, mtuller <mitul...@gmail .comwrote:
I want to pull part of the URI out to dictate what is pulled from the
database. For example, I want to control what year data is displayed
with a url like this:http://www.mysite.com/display.php?year=2007
I want to pull out the 2007. I can grab the uri, but what is the best
way to pull out just the 2007?
See parse and parse_url function in PHP manual.
On Thu, 15 Nov 2007 06:34:37 +0100, mtuller <mi******@gmail .comwrote:
I want to pull part of the URI out to dictate what is pulled from the
database. For example, I want to control what year data is displayed
with a url like this: http://www.mysite.com/display.php?year=2007
I want to pull out the 2007. I can grab the uri, but what is the best
way to pull out just the 2007?
$url = 'http://www.mysite.com/display.php?yea r=2007';
$querystring = parse_url($url, PHP_URL_QUERY);
$querydata = array();
parse_str($quer ystring, $querydata);
if(isset($query data['year'])) echo "Year is:".$querydat a['year'];
--
Rik Wasmus
On Nov 15, 12:34 am, mtuller <mitul...@gmail .comwrote:
I want to pull part of the URI out to dictate what is pulled from the
database. For example, I want to control what year data is displayed
with a url like this:http://www.mysite.com/display.php?year=2007
I want to pull out the 2007. I can grab the uri, but what is the best
way to pull out just the 2007?
Do you just have a URL in a string or is it the URL of the actual
request? If it's the URL of the request, that value would be in:
$_GET['year']
If it's in a string the other solutions posted here should work.
On Nov 15, 8:19 am, ZeldorBlat <zeldorb...@gma il.comwrote:
On Nov 15, 12:34 am, mtuller <mitul...@gmail .comwrote:
I want to pull part of the URI out to dictate what is pulled from the
database. For example, I want to control what year data is displayed
with a url like this:http://www.mysite.com/display.php?year=2007
I want to pull out the 2007. I can grab the uri, but what is the best
way to pull out just the 2007?
Do you just have a URL in a string or is it the URL of the actual
request? If it's the URL of the request, that value would be in:
$_GET['year']
If it's in a string the other solutions posted here should work.
Yes, it is the URL of the request. LOL I thought it would be harder
than this. I was overthinking it. Thanks. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Ram Laxman |
last post by:
Hi all,
I have a text file which have data in CSV format.
"empno","phonenumber","wardnumber"
12345,2234353,1000202
12326,2243653,1000098
Iam a beginner of C/C++ programming.
I don't know how to tokenize the comma separated values.I used strtok
function reading line by line using fgets.but it gives some weird
behavior.It doesnot stripout the "" fully.Could any body have sample
code for the same so that it will be helfful for my...
|
by: |
last post by:
Hi,
I need to read a big CSV file, where different fields should be converted to
different types,
such as int, double, datetime, SqlMoney, etc.
I have an array, which describes the fields and their types. I would like
to somehow store a reference to parsing operations in this array
(such as Int32.Parse, Double.Parse, SqlMoney.Parse, etc),
so I can invoke the appropriate one without writing a long switch.
|
by: Jon Davis |
last post by:
The date string: "Thu, 17 Jul 2003 12:35:18 PST"
The problem:
// this fails on PST
DateTime myDate = DateTime.Parse("Thu, 17 Jul 2003 12:35:18 PST");
Help?
Jon
|
by: Mark |
last post by:
How do you parse a currency string to a decimal? I'd like to avoid having
to parse the number out, removing the $ manually. That sounds like a hack.
There are times that this string will be currency and others when it will be
a text integer or decimal.
//This bombs because of the string having an improper format.
Decimal.Parse("$9,200.00")
Thanks in advance!
Mark
|
by: Jon Davis |
last post by:
I have put my users through so much crap with this bug it is an absolute
shame.
I have a product that reads/writes RSS 2.0 documents, among other things.
The RSS 2.0 spec mandates an en-US style of date formatting (RFC 822). I
have been using a variation of RFC 1123 (just change the time zone to an
offset, i.e. "-0800"). It seems to be writing okay, but it's failing to
parse.
I've tried changing the regional & language settings in my...
| |
by: Bob Rundle |
last post by:
I would like to get something like this to work...
Type t = FindMyType(); // might be int, float, double, etc
string s = "1233";
object v = t.Parse(s);
This doesn't work of couse, Parse is not a member of Type.
I have to think that this is possible. Is it?
|
by: Slonocode |
last post by:
I have some textboxes bound to an access db. I wanted to format the
textboxes that displayed currency and date info so I did the following:
Dim WithEvents oBidAmt As Binding
oBidAmt = New Binding("Text", Me.Ds1, "Items.BidAmt")
txtBidAmt.DataBindings.Add(oBidAmt)
Private Sub oBidAmt_Format(ByVal sender As Object, ByVal e As
System.Windows.Forms.ConvertEventArgs) Handles oBidAmt.Format
|
by: js |
last post by:
I have a textbox contains text in the format of "yyyy/MM/dd hh:mm:ss".
I need to parse the text using System.DateTime.Parse() function with
custom format. I got an error using the following code. Could someone
help me with the customization? Thanks.
String was not recognized as a valid DateTime. at
System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi,
DateTimeStyles styles) at System.DateTime.Parse(String s,
IFormatProvider...
|
by: Samuel R. Neff |
last post by:
I'm using a quasi open-source project and am running into an exception
in double.Parse which is effectively this:
double.Parse(double.MinValue.ToString())
System.OverflowException: Value was either too large or too small for
a Double.
at System.Number.ParseDouble(String s, NumberStyles style,
NumberFormatInfo info)
|
by: Peter Duniho |
last post by:
I'm sure there's a good explanation for this, but I can't figure it out.
I tried using DateTime.Parse() with a custom DateTimeFormatInfo instance,
in which I'd replaced the DateTimeFormatInfo.FullDateTimePattern property
with my custom format string:
DateTimeFormatInfo dtfi =
(DateTimeFormatInfo)DateTimeFormatInfo.InvariantCulture.Clone();
dtfi.FullDateTimePattern = "dd/MMM/yyyy:HH:mm:ss zzz";
|
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...
| |
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,...
|
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,...
|
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...
|
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...
|
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...
|
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();...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |