0

I'm trying to get numbers automatically in php from url ,

Like this :

http://127.0.0.1/+/number/?p=123
http://127.0.0.1/+/number/?p=2599

...

When i change the (number) from url

http://127.0.0.1/+/number/?p=111

I want to print :

111

enter image description here

1
  • 2
    See $_GET Commented May 16, 2017 at 13:55

2 Answers 2

1
<?php
    echo $_GET['p'];
?>
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks :) , But howa can i create a php page like ?p=123 with dynamic request
you need to learn about url rewriting, which can be achieved by enabling mod_rewrite module in your php settings
1

Do:

echo $_GET['p'];

p being whatever is between ? and =. I mean, to print 1 from /?col=1 do:

echo $_GET['col'];

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.