Not sure how to ask this I want to put a link at the top of a web page the will

Not sure how to ask this I want to put a link at the top of a web page the will pull up another web page and pass an order number enter by the user. But if the user does not enter the order number then the link does nothing but set there at the top of the web page.

Order Number

this is on the page I am passing to

$order=$_GET[“id”];

Well, you did not show the PHP code, but, in theory this is how you would do it. Since PHP is server-side only,
the output of the PHP code can be stuck into your anchor’s HREF. Here is an example of how it would be
done. (Not knowing any of your code, it is just a sample…)

<?PHP // Set up ID number for inserting into the HREF... $current_id_number = "99"; // Some number you would pull from your database or wherever... ?>

Order Number

As you see, your PHP code would create a variable that contains the ID number. Something like $id would
work, but, I made it clearer… Next in your HTML, you insert the value of that variable. Remember, the PHP
code is handled before it is sent to the browser, therefore, the user never sees the PHP code, just the
output of it. This is one of the most common uses of PHP. ( To insert data into HTML, JS or JQuery…)

Hope that helps…

worked perfect thanks

Glad that helped and glad you solved it so quickly. I will mark this one solved.

When you run into another puzzle, create a new post…

Sponsor our Newsletter | Privacy Policy | Terms of Service