1

I have a system where in users can create forms dynamically. Once the form is created a unique URL is generated and stored in the database . These URL's are for calling the form back when the users type it out in the browser .

Now i want a particular file to read the url when the users type out the generated url in the browser , so that i can get the last segment of the url which is unique and fetch the respective data at run time .

I cant seem to figure out how to do that .

1
  • 1
    I'm confident someone here can help, it's just hard to understand what you're asking here. Can you rephrase the question a little bit? Commented Aug 3, 2012 at 7:06

1 Answer 1

7

If you are trying to receive data from a URL string, you will need to use the $_GET variable .

If the url is http://domain.com/page.php?var1=some-string

You would retrieve var1 like so:

<?php
$var1 = $_GET['var1'];

echo $var1; //would output "some-string"
?>

Is this what you're asking or is it something more in-depth?

Sign up to request clarification or add additional context in comments.

3 Comments

yes exactly...if the url is pasted on the browser...it shud be read by a particular php file.
When the url xyz.domain.com/form/whatever is typed on the browser at anytime..i want it to be read by a php file.
Well, then this is the code you need. Just substitute out any variables in that you would like. If this is the right answer, please mark it as such.

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.