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 6960331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:23:20+00:00 2026-05-27T15:23:20+00:00

I have been working on a coding problem for some pages I inherited where

  • 0

I have been working on a coding problem for some pages I inherited where the values of two variables are not showing up in the URL of the next page.

The code written by the author, which is probably quite old is

"completeyourorder.php?p=" . $p . "&service=" . $service;

as far as I can tell from my research there should be at least an echo in there

“completeyourorder.php?p=” echo . $p . “&service=” . $service;

or maybe I am missing much more than that.

I’d be grateful for a bit of education on this as I am a newbie and have not been able to find an answer despite many hours of tickering and reading.

Thanks

UPDATE:

PAGE 1

<form action="send-order.php" method="post">
<p>Name<br /><input name="clientname" value="<?echo $clientname;?>" type="text" style="width: 350px;" /></p>

<p><br /><input type="hidden" name="service" value="<?
echo $_GET['service'];
?>" />

<input type="hidden" name="p" value="<?
echo $_GET['p'];
?>"
 />
<input type="submit" value="Order now" /></p>
 </form>

PAGE 2

$go = "completeyourorder.php?p=" . $p . "&service=" . $service;
return header("location:$go");

Let me know if you need anything more

SOLVED:

Brilliant thanks it works! I see now that my error was assuming that I could use the variable values in the location: completeyourorder….. on page 2 without having used $_POST earlier in the code on the same page. Thanks to everyone!

  • 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-27T15:23:21+00:00Added an answer on May 27, 2026 at 3:23 pm

    You recently asked a similar question regarding $_GET vars.

    In this case, it looks like you’re building a string to echo out in a link or something. So perhaps this is the what you may be experiencing: (only an example)

    <?php
    
    if(isset($_GET['p']))
    {
        $p = $_GET['p'];
    }
    
    if(isset($_GET['service']))
    {
        $service = $_GET['service'];
    }
    
    //defaults in case they are not set
    $p or $p = 1; //assuming p = page
    $service or $service = 'laundry'; //since I don't know what service refers to
    
    $link = "completeyourorder.php?p=" . $p . "&service=" . $service;
    
    ?>
    
    <a href="<?php echo $link; ?>">string to click on</a>
    

    Where in this example you can see that you are expecting to build the $link var based on the $_GET vars “p” and “service” and if they do not exist, default to the standard set of page 1 and service of “laundry”

    Obviously you would tailor this to fit your needs, but you will need to provide more info for a better, more relevant answer.

    EDIT

    As per your edit, the basic answer is that your form should be populating the vars for $p and $service, so the revised code would be like this:

    <?php
    if(isset($_POST['p']) && isset($_POST['service']))
    {
        $p = $_POST['p'];
        $service = $_POST['service'];
    
        // do some kind of post processing here
        // possibly do some kind of filtering to ensure the post vars are sanitized 
    
        header("location: completeyourorder.php?p=" . $p . "&service=" . $service);
        exit;
    }
    ?>
    

    isset is not necessary on both, but you can change that to reflect your preferred choice for verifying post data. Some just do:

    if(!empty($_POST))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Recently I have been working with the xml coding,and the problem happened. Given the
I have been working on some legacy C++ code that uses variable length structures
I have been working with Struts for some time, but for a project I
I have been working with Xcode 4.2.1, but following some tutorials and videos from
Problem Scripts on some pages that use jquery are not activating. Scenario Finding that
I have been working on a web services related project for about the last
I have been working with Visual Studio (WinForm and ASP.NET applications using mostly C#)
I have been working with a string[] array in C# that gets returned from
We have been working with CVS for years, and frequently find it useful to
I have been working with relational databases for sometime, but it only recently occurred

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.