0

I have to sign-up users. For that, I have a sign-up page with a form, form validation and generating error messages. For uploading the user's data, I have created another file where I have to get the URL of the signup.php file to ensure that users have successfully entered their data.

To get the URL of current file we can use:

http://$_SERVER['HTTP_HOST']$_SERVER['REQUEST_URI'];

How I can get the URL of signup.php file in the other file?

Emma
  • 27,428
  • 11
  • 44
  • 69
  • If I understand, you need link to signup.php? Eg. http://$_SERVER['HTTP_HOST'] . '/signup.php'.? – daremachine Aug 05 '19 at 00:44
  • You may refer to this SO post [Answer in SO](https://stackoverflow.com/questions/6768793/get-the-full-url-in-php) – Muaz Aug 05 '19 at 02:13
  • Perhaps you should write a function and call it from when you need it, including in the singup.php file. That'll reduce the chance of getting mistakes exponentially, because when you expand the function, you'll be expanding both files at the same time since they'll be using the same function. – user3153340 Aug 05 '19 at 08:52

0 Answers0