Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #8496 > unrolled thread
| Started by | Kevin Davis <kevindavis338@gmail.com> |
|---|---|
| First post | 2013-02-26 09:28 -0800 |
| Last post | 2013-02-26 23:23 +0100 |
| Articles | 7 — 4 participants |
Back to article view | Back to comp.lang.php
php url question Kevin Davis <kevindavis338@gmail.com> - 2013-02-26 09:28 -0800
Re: php url question "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-02-26 18:42 +0100
Re: php url question Jerry Stuckle <jstucklex@attglobal.net> - 2013-02-26 12:45 -0500
Re: php url question Kevin Davis <kevindavis338@gmail.com> - 2013-02-26 11:41 -0800
Re: php url question "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-02-26 21:30 +0100
Re: php url question Jerry Stuckle <jstucklex@attglobal.net> - 2013-02-26 15:41 -0500
Re: php url question "Olaf S." <thesys@gmx.de> - 2013-02-26 23:23 +0100
| From | Kevin Davis <kevindavis338@gmail.com> |
|---|---|
| Date | 2013-02-26 09:28 -0800 |
| Subject | php url question |
| Message-ID | <ea1c236c-857b-4b6b-90e3-887f96b0bf60@googlegroups.com> |
Hi there, I have a simple question with PHP URL's setup.. Here is the situation I have a page that is based on the urls.. For example, I have a php file that will display based on the following sample url: http://temp.com/t2, however in some cases the url could be http://temp.com/t2?d=temp or something similar. That type of url tend screw up the settings. Is there a way for me to drop the d=temp so the page settings will not get messed up when the url's is read in. Thank you.
[toc] | [next] | [standalone]
| From | "M. Strobel" <sorry_no_mail_here@nowhere.dee> |
|---|---|
| Date | 2013-02-26 18:42 +0100 |
| Message-ID | <ap4ag5FkmjtU1@mid.uni-berlin.de> |
| In reply to | #8496 |
Am 26.02.2013 18:28, schrieb Kevin Davis: > Hi there, > > I have a simple question with PHP URL's setup.. Here is the situation I have a page that is based on the urls.. For example, I have a php file that will display based on the following sample url: http://temp.com/t2, however in some cases the url could be http://temp.com/t2?d=temp or something similar. That type of url tend screw up the settings. Is there a way for me to drop the d=temp so the page settings will not get messed up when the url's is read in. > Your Url http://temp.com/t2 would not work in the first place, because the web server has to recognize PHP scripts so he/she can hand them to the PHP interpreter. This is normally done by the suffix .php for script files. If you have a special setup with scipt aliases you have to talk about it. Independent from this is the fact that url encoded variables like d=temp would not screw anything up, especially not settings. /Str.
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2013-02-26 12:45 -0500 |
| Message-ID | <kgisa8$tp8$2@dont-email.me> |
| In reply to | #8496 |
On 2/26/2013 12:28 PM, Kevin Davis wrote: > Hi there, > > I have a simple question with PHP URL's setup.. Here is the situation I have a page that is based on the urls.. For example, I have a php file that will display based on the following sample url: http://temp.com/t2, however in some cases the url could be http://temp.com/t2?d=temp or something similar. That type of url tend screw up the settings. Is there a way for me to drop the d=temp so the page settings will not get messed up when the url's is read in. > > Thank you. > What have you tried? -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ==================
[toc] | [prev] | [next] | [standalone]
| From | Kevin Davis <kevindavis338@gmail.com> |
|---|---|
| Date | 2013-02-26 11:41 -0800 |
| Message-ID | <05b8dec3-f955-488f-8531-f2d6ebc010d3@googlegroups.com> |
| In reply to | #8499 |
On Tuesday, February 26, 2013 11:45:47 AM UTC-6, Jerry Stuckle wrote: > On 2/26/2013 12:28 PM, Kevin Davis wrote: > > > Hi there, > > > > > > I have a simple question with PHP URL's setup.. Here is the situation I have a page that is based on the urls.. For example, I have a php file that will display based on the following sample url: http://temp.com/t2, however in some cases the url could be http://temp.com/t2?d=temp or something similar. That type of url tend screw up the settings. Is there a way for me to drop the d=temp so the page settings will not get messed up when the url's is read in. > > > > > > Thank you. > > > > > > > What have you tried? > > > > -- > > ================== > > Remove the "x" from my email address > > Jerry Stuckle > > JDS Computer Training Corp. > > jstucklex@attglobal.net > > ================== One option that I'm trying is $_SERVER['PATH_INFO'] instead of $_SERVER['REQUEST_URI']
[toc] | [prev] | [next] | [standalone]
| From | "M. Strobel" <sorry_no_mail_here@nowhere.dee> |
|---|---|
| Date | 2013-02-26 21:30 +0100 |
| Message-ID | <ap4kbuFn1ptU1@mid.uni-berlin.de> |
| In reply to | #8500 |
Am 26.02.2013 20:41, schrieb Kevin Davis: > On Tuesday, February 26, 2013 11:45:47 AM UTC-6, Jerry Stuckle wrote: >> On 2/26/2013 12:28 PM, Kevin Davis wrote: >> >> >>> I have a simple question with PHP URL's setup.. Here is the situation I have a page that is based on the urls.. For example, I have a php file that will display based on the following sample url: http://temp.com/t2, however in some cases the url could be http://temp.com/t2?d=temp or something similar. That type of url tend screw up the settings. Is there a way for me to drop the d=temp so the page settings will not get messed up when the url's is read in. >> >> >> What have you tried? >> > > One option that I'm trying is $_SERVER['PATH_INFO'] instead of $_SERVER['REQUEST_URI'] > Just put into your script: var_dump($_SERVER); and see what the variables contain. /Str.
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2013-02-26 15:41 -0500 |
| Message-ID | <kgj6iv$1qq$1@dont-email.me> |
| In reply to | #8500 |
On 2/26/2013 2:41 PM, Kevin Davis wrote:
> On Tuesday, February 26, 2013 11:45:47 AM UTC-6, Jerry Stuckle wrote:
>> On 2/26/2013 12:28 PM, Kevin Davis wrote:
>>
>>> Hi there,
>>
>>>
>>
>>> I have a simple question with PHP URL's setup.. Here is the situation I have a page that is based on the urls.. For example, I have a php file that will display based on the following sample url: http://temp.com/t2, however in some cases the url could be http://temp.com/t2?d=temp or something similar. That type of url tend screw up the settings. Is there a way for me to drop the d=temp so the page settings will not get messed up when the url's is read in.
>>
>>>
>>
>>> Thank you.
>>
>>>
>>
>>
>>
>> What have you tried?
>>
>>
>>
>
> One option that I'm trying is $_SERVER['PATH_INFO'] instead of $_SERVER['REQUEST_URI']
>
OK, that will get you the 't2', if that's what you want. A longer way
would be to explode it on the '?'.
$array = explode('?', $_SERVER['REQUEST_URI']);
$array[0] will contain the request. If there are parameters, they will
be in $array[0] (and you could explode that also, but it's all in the
$_GET superglobal anyway).
Is this a case where you're using .htaccess to redirect pages (i.e. in a
CMS)? I'm wondering, because normally scripts know how they were called
(based on the filename). About the only place I've needed such is for
an intelligent error processing page (i.e. 404 Not Found message).
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[toc] | [prev] | [next] | [standalone]
| From | "Olaf S." <thesys@gmx.de> |
|---|---|
| Date | 2013-02-26 23:23 +0100 |
| Message-ID | <512d35f2$0$6583$9b4e6d93@newsspool3.arcor-online.net> |
| In reply to | #8496 |
Am 26.02.2013 18:28, schrieb Kevin Davis:
> Hi there,
>
> I have a simple question with PHP URL's setup.. Here is the situation I have a page that is based on the urls.. For example, I have a php file that will display based on the following sample url: http://temp.com/t2, however in some cases the url could be http://temp.com/t2?d=temp or something similar. That type of url tend screw up the settings. Is there a way for me to drop the d=temp so the page settings will not get messed up when the url's is read in.
>
> Thank you.
>
$org_url = "http://temp.com/t2";
$url_array = explode("?", $org_url);
echo $url_array[0];
// Prints: http://temp.com/t2
$org_url = "http://temp.com/t2?d=temp";
$url_array = explode("?", $org_url);
echo $url_array[0];
// Also prints: http://temp.com/t2
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.php
csiph-web