How to redirect page using PHP with values?

Here is the code for simple PHP page redirect. The search engine friendly way of redirecting is the 301 redirect.

1
2
3
4
<!--?php
	Header("HTTP/1.1 301 Moved Permanently"); 
	header( 'Location: http://www.yoursite.com/page.html' ) ;
?-->

Note that if you do not include the first Header line above, the redirect still works. But, instead of a 301 redirect, now it becomes a 302 (temporary) redirect.

Now if you want to redirect to perticluer user page then you need to include user id in the url. Here is the code:

1
2
3
<!--?php
	header("Location: userpage.php?id=".$userId);
?-->
Peter Vegas

68 thoughts on “How to redirect page using PHP with values?

  1. Thus, a rakhi gift should possess some uniqueness about it.
    s iconic color implied meaning by using friendship red, cute
    pink, heartful yellow, wish green and sweet lavender.
    If you want people to think that you are beautiful,
    attractive and good, then the easiest way to do it is to select
    the right perfume.

  2. They can be allowed in with mature crops as long as they
    are monitored and shooed out if they become destructive.
    No one wants to wake up only to find they have been bitten by bed bugs.
    The chickens till the bed up with their scratching,
    thereby eliminating many garden pests.

  3. Excellent goods from you, man. I’ve remember your stuff previous to and you are simply extremely great.
    I actually like what you’ve bought here, certainly like what
    you’re saying and the best way during which you assert it.
    You make it enjoyable and you still care for to
    stay it smart. I can not wait to read far more from you.
    This is actually a tremendous site.

  4. In the meantime, the problem of a ingesting problem or substance abuse is a subject that the DUI or drunk driving offender could also be confronted with.

  5. I’m not sure where you’re getting your info, but great
    topic. I needs to spend some time learning much more or understanding more.
    Thanks for wonderful information I was looking for this information for my mission.

  6. Exercise regularly but take appropriate measure to avoid hypoglycemia.

    Make sure you check the website and collection thoroughly before buying the product of your choice.
    Therefore, in Chinese Dragon Spring Festival, this jewelry brand originated from
    1893 specially launched red series for 2012 Chinese Dragon Year.

  7. hello!,I love your writing so much! share we be in contact more approximately your article
    on AOL? I require an expert on this area to resolve my problem.
    May be that is you! Having a look ahead to see you.

  8. I am in fact glad to glance at this weblog posts which
    carries plenty of valuable information, thanks
    for providing these kinds of statistics.

  9. Hey! Your site is running slow in my opinion, this kind
    of took sort of a minute or two to load, I really have no
    idea whether it is just simply me or your web page on the other hand google loaded
    fine for me. Around the other hand I appreciate you
    for writing fantastic articles. I guess it really has been helpful to many
    people . I really hope I’ll be able to get a lot more awesome stuff and
    I should really flatter your site by telling you have carried out fantastic writing.
    Immediately after looking at the articles, I’ve bookmarked the website.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest updates on your inbox

Be the first to receive the latest updates from Codesdoc by signing up to our email subscription.

    StudentProjects.in