Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6206445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:27:04+00:00 2026-05-24T05:27:04+00:00

I am programming a php registration system where there is two points of entry

  • 0

I am programming a php registration system where there is two points of entry (if that makes sense):

  1. If the client wants to purchase a product but doesn’t have an account and it stores the id of the product all the way through the registration process. Then it allows to process the payment after registration.

  2. The client is registering first time without trying to purchase the product.

These are the links directing the user to the registration pages for the two methods above:

1. <a href="register.php?id=<?php echo $row['product_id'] ?>"></a>
2. <a href="register.php?type=first"></a>

This is the code for the file register.php:

<?php
if(empty($_GET['type'])== "first") {
    header("Location: register.php?type=first&step=1");
}
if(empty($_GET['id'])) {
     if($_GET['type']) {
         //show the content first registration
}
    header("Location: register.php?type=first&step=1");

}else{
    $product_id=$_GET['id'];
    header("Location: register.php?id=".$product_id."&step=1");
    //show the content with the product information
}
?>

<html>...</html>

The problems are:

  1. When using the 1st method above the php says it has a redirect loop and i can’t seem to work it out. Once we have this working i want is to show the content but this leads on to the second problem.

  2. When using the second method it works and shows the content for first registration but it doesn’t show any of the html content below this code.

Any help would be appreciated.

Thanks

UPDATE:

Thanks to your answers i have rewritten it like this and it works now.

<?php
if($_GET['type'] == "first" && empty($_GET['step'])) {
    header("Location: register.php?type=first&step=1");

    //If user clicks on (<a href="register.php?type=first"></a>)

    //show the content first registration

}elseif(empty($_GET['id']) && empty($_GET['type'])) {
    header("Location: register.php?type=first&step=1");

    //if user types in the address bar www.domain.co.uk/register.php

    //redirect and show the content first registration

}elseif(isset($_GET['id']) && empty($_GET['step'])){
    $product_id=$_GET['id'];
    header("Location: register.php?id=".$product_id."&step=1");

    //if the user clicks on <a href="register.php?id=<?php echo $row['product_id'] ?>"></a>

    //show the content with the product information

}
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T05:27:05+00:00Added an answer on May 24, 2026 at 5:27 am

    His update will work

    <?php
    if($_GET['type'] == "first" && empty($_GET['step'])) {
        header("Location: register.php?type=first&step=1");
    
    
    }elseif(empty($_GET['id']) && empty($_GET['type'])) {
        header("Location: register.php?type=first&step=1");
    
    
    }elseif(isset($_GET['id']) && empty($_GET['step'])){
        $product_id=$_GET['id'];
        header("Location: register.php?id=".$product_id."&step=1");
    
    }
    ?>
    

    Because it is what i have worked out myslf

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to PHP programming and I wanted to know that is it possible
When programming in PHP I always try to create meaningful 'models' (classes) that correspond
I am programming in PHP and I want to check if there are any
I'm studying php programming and I'm pretty convinced I know base rules that permit
I'm new to PHP programming language. Currently, i want to develop a page that
I'm not taking about programming in php but php itself. Is it possible that
Programming PHP in Eclipse PDT is predominately a joy: code completion, templates, method jumping,
I'm programming in PHP and would like to create web pages which have email
I have been programming using PHP, Javascript and have been a designer for a
I am programming in PHP mysql. I have recently got into OOP programming. So

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.