RE: [PHP] URL / slash reduction
| From: | John Holmes | Date: | Tue, 11 Jun 2002 00:19:15 +0000 |
| Subject: | RE: [PHP] URL / slash reduction | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-101480@lists.php.net to get a copy of this message | ||
Take the ' out of $_GET['id'] if you are going to have it within a
string defined by '
Echo 'hello $_GET['id'] world';
How is PHP supposed to know that the two internal ' are not supposed to
be the end of the string?? (FYI: Variables are not parsed within strings
defined by ')
Echo 'hello ' . $_GET['id'] . ' world';
Or...
Echo "hello $_GET[id] world";
Etc...adapt to your needs...
---John Holmes...
> -----Original Message-----
> From: X-power.be [mailto:yla@x-power.be]
> Sent: Monday, June 10, 2002 8:04 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] URL / slash reduction
>
> the nickname 'junni' was an example..
>
> i have this now but its not working :(
>
> <?php
> $url =
>
> str_replace('?id=/','?id=','http://www.tuned-
> belgium.com/user/?id=/$_GET['id
> ']');
> ?>
> <head><META HTTP-EQUIV="Refresh" CONTENT="0;
> URL=http://tuned-
> belgium.com/main/modules.php?name=user&op=userinfo&uname=<?
> print $url ?>"></head>
>
> gives:
>
> Parse error: parse error in /usr/home/v1/a0016905/html/user/filter.php
on
> line 2
>
>
> the meaning of it is that http://user.tuned-belgium.be/nickname
> goes to
> http://tuned-
> belgium.com/main/modules.php?name=user&op=userinfo&uname=nickna
> me
>
>
> ------- ------- ------- ------- ------- -------
> Connecting Tuners @ http://www.Tuned-Belgium.com
> Xbox talk @ http://www.X-power.be
> Gamecube @ http://www.cube-power.be
>
> "Dave" <dave@hawk-systems.com> schreef in bericht
> news:DBEIKNMKGOBGNDHAAKGNGECFPHAA.dave@hawk-systems.com...
> > >this url is the one that i want for my users:
> > >
> > >http://user.tuned-belgium.be/junni
> > >
> > >
> > >but go's now to
> > >
> > >http://www.tuned-belgium.com/user/?id=/junni (slash
> > >junni)
> > >
> > >but must go to
> > >
> > >http://www.tuned-belgium.com/user/?id=junni (without
> > >slash)
> > >
> > >how can i prevent or filter the slash away?
> >
> > without getting eloquent... and assuming your url string is static
each
> time
> > ($id doesn't move withing your url string).
> >
> > $url =
> >
>
> str_replace('?id=/','?id=','http://www.tuned-
> belgium.com/user/?id=/junni');
> >
> > Dave
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php