Url weiterleitung

Alles, was PHP betrifft, kann hier besprochen werden.

Url weiterleitung

Postby flovo97 » 28. March 2011 13:04

Hallo Leute,
ich möchte gern wenn sich ein neuer User regestriert, dass er seine Seite über www.seite.de/NICKNAME erreichen kann aber dann intern(also ohne das er es im URL sieht) zu profil.php weiter geleitet wird.
Das mit der Userid, kann mann denn NICKNAME der Hineter dem "unechten" Url übergeben wird als Variable auf profil.php mitnehmen und dorten dadurch nachd er ID suchen?
flovo97
 
Posts: 2
Joined: 28. March 2011 12:56

Re: Url weiterleitung

Postby Altrea » 28. March 2011 13:11

Dein Vorhaben versteht hier niemand.

Drücke dich bitte so aus, dass man auch versteht was du möchtest.
Anderenfalls wird es sehr schwer, dir zu helfen.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Url weiterleitung

Postby flovo97 » 28. March 2011 13:18

Ja sry das ist immer meine Problem xD
Also ich versuch anhand eines Beispieles:
User regsistriert sich mit dem Nickname: Test seine ID ist: 1.
Und dieser User hat eine eigene Profilseite: profil.php?id=1 .
Der User kann aber auch einen andern URL benutzen /Test .
Und wird über die Seite Test auf profil.php weitergeleitet und von dort soll der alte Url Anhängsel(Test) abgerufen werden und damit nachd er ID gesucht.
Das alles soll aber intern passieren und die URL /Test soll bleiben aber wie bekomme ich das hin das nur echte Nicknames zu Profil weietrgeleitet werden bzw. wie bekomme ich das überhaupt hin das /Test zu /profil.php weitergeleitet wird, weil die Seite /Test exsisitiert in echt ja gar nicht.
Und gibt es die möglichkeit die unechte URL mit zunehmen um eben die ID zufinden.

Wichtig: Die URL soll nicht sichtbar gewechselt werden!
Hoffe es ist besser so?!
flovo97
 
Posts: 2
Joined: 28. March 2011 12:56

Re: Url weiterleitung

Postby jannicars » 02. April 2011 15:21

mit mod_rewrite.
jannicars
 
Posts: 17
Joined: 02. April 2011 14:51

Re: Url weiterleitung

Postby johnwright456 » 31. May 2011 10:36

try this code......


<?php

if (<condition>) {
echo "<META HTTP-EQUIV=\"Refresh\"
CONTENT=\"5; URL=html-redirect1.html\">";
} else {
echo "<META HTTP-EQUIV=\"Refresh\"
CONTENT=\"5; URL=html-redirect2.html\">";
}

?>

On Monday 26 September 2005 1:27 pm, Daryl Booth wrote:
> But I want to redirect to different places when the condition (if) is
> different. The condition works but the conditional redirect doesn't. I
> tried fopen() but that just sends the output to the variable as text.
>
> -----Original Message-----
> From: Micah Stevens [mailto:micah [at] raincross-tech.com]
> Sent: Montag, 26. September 2005 22:20
> To: php-db [at] lists.php.net
> Subject: Re: [PHP-DB] URL Forwarding in PHP...
>
> Okay, then you should use an HTML meta tag to forward.. uhh.. (looking it
> up
>
> since I haven't done this in a while)
>
> Here, try this:
>
> http://www.billstclair.com/html-redirect.html
>
> -Micah
>
> On Monday 26 September 2005 1:10 pm, Daryl Booth wrote:
> > I'm new to PHP and so I don't understand what you mean by "note that this
> > cannot be set once any output has been sent to the browser. At least not
> > without using output buffering."
> >
> > What do you mean by output buffering? I want the site to display a table
> > then forward to another site atomatically.
> >
> > -----Original Message-----
> > From: Joseph Crawford [mailto:codebowl [at] gmail.com]
> > Sent: Montag, 26. September 2005 22:02
> > To: Daryl Booth; [PHP-DB] Mailing List
> > Subject: Re: [PHP-DB] URL Forwarding in PHP...
> >
> > header("Location: http://www.php.net/");
> >
> > note that this cannot be set once any output has been sent to the
> > browser. atleast not without using output buffering.
> >
> > --
> > Joseph Crawford Jr.
> > Zend Certified Engineer
> > Codebowl Solutions, Inc.
> > 1-802-671-2021
> > codebowl [at] gmail.com

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
johnwright456
 
Posts: 3
Joined: 31. May 2011 10:28

Re: Url weiterleitung

Postby jannicars » 02. June 2011 14:57

johnwright456 wrote:try this code......


<?php

if (<condition>) {
echo "<META HTTP-EQUIV=\"Refresh\"
CONTENT=\"5; URL=html-redirect1.html\">";
} else {
echo "<META HTTP-EQUIV=\"Refresh\"
CONTENT=\"5; URL=html-redirect2.html\">";
}

?>

On Monday 26 September 2005 1:27 pm, Daryl Booth wrote:
> But I want to redirect to different places when the condition (if) is
> different. The condition works but the conditional redirect doesn't. I
> tried fopen() but that just sends the output to the variable as text.
>
> -----Original Message-----
> From: Micah Stevens [mailto:micah [at] raincross-tech.com]
> Sent: Montag, 26. September 2005 22:20
> To: php-db [at] lists.php.net
> Subject: Re: [PHP-DB] URL Forwarding in PHP...
>
> Okay, then you should use an HTML meta tag to forward.. uhh.. (looking it
> up
>
> since I haven't done this in a while)
>
> Here, try this:
>
> http://www.billstclair.com/html-redirect.html
>
> -Micah
>
> On Monday 26 September 2005 1:10 pm, Daryl Booth wrote:
> > I'm new to PHP and so I don't understand what you mean by "note that this
> > cannot be set once any output has been sent to the browser. At least not
> > without using output buffering."
> >
> > What do you mean by output buffering? I want the site to display a table
> > then forward to another site atomatically.
> >
> > -----Original Message-----
> > From: Joseph Crawford [mailto:codebowl [at] gmail.com]
> > Sent: Montag, 26. September 2005 22:02
> > To: Daryl Booth; [PHP-DB] Mailing List
> > Subject: Re: [PHP-DB] URL Forwarding in PHP...
> >
> > header("Location: http://www.php.net/");
> >
> > note that this cannot be set once any output has been sent to the
> > browser. atleast not without using output buffering.
> >
> > --
> > Joseph Crawford Jr.
> > Zend Certified Engineer
> > Codebowl Solutions, Inc.
> > 1-802-671-2021
> > codebowl [at] gmail.com

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


it's not this what he is looking for.
jannicars
 
Posts: 17
Joined: 02. April 2011 14:51


Return to PHP

Who is online

Users browsing this forum: No registered users and 15 guests