On Friday 16 February 2001 23:57, James, Yz wrote:
OK, I've an error handling page. Basically, I want to split (that
might even be one of the functions I'll have to use) this sort of url:
error.php?/pages/login.php?username=name
That will only cause trouble. URLs with parameters have the
An exceptionally easy way to do this would be to pass both $PHP_SELF and
$REQUEST_URI.
Alternatively, you can use explode():
?php
$array = explode('?',$REQUEST_URI);
?
form method="post" action=?php echo $array[0] ?"
Username: input type="text" name="username"r
etc/form
-Original
i'd use split, to split the value up into an array:
if this is your url
$url = "/pages/error.php?/pages/login.php?user=scott";
and use this code:
$thing = split('\?', $url);
print $thing[0] ." BR\n ";
print $thing[1] ." BR\n ";
print $thing[2] ." BR\n ";
output will be:
Is the PHP split command the same as that in Perl?
ex.
($var_1, $var_2) = split(/:/,$string, 2);
will something like that work?
On Fri, 16 Feb 2001, ..s.c.o.t.t.. [gts] wrote:
i'd use split, to split the value up into an array:
if this is your url
$url =
IL PROTECTED]]
Sent: Friday, February 16, 2001 16:57
To: ..s.c.o.t.t.. [gts]
Cc: php-general
Subject: Re: [PHP] Finding the? in $REQUEST_URI?page=blah
Is the PHP split command the same as that in Perl?
ex.
($var_1, $var_2) = split(/:/,$string, 2);
will some
5 matches
Mail list logo