By ahotel on
I want a Drupal page to display this information:
Hello Peter. You live in New York.
I can call the page like this:
www.mysite.com/showinfo.htm?Peter?New York
What code do I use in the Drupal page so that it shows the person's information?
Kindly show me how one can do this.
Comments
I'm not entirely sure of what
I'm not entirely sure of what you're asking here.
Are you trying to pass variables to GET on the URL? drupal is a bit different.
what do you mean "the persons information" their profile information?
what are we working with here, be as explicit as you can please? :D
I want to display info from another program on a Drupal page
In another program (outside of Drupal) I store a person's first name and city. They click a button in this program to go to my Drupal website.
I would like to take them to a page in my website that shows them their name and city.
So I made the button click do this:
www.mysite.com/showinfo.htm?Peter?New YorkI can change this if required.
I don't know how to show these parameters on a Drupal page. How do I use the information and display it on a page?
I am a novice at html and php, but if you could show me how to do my simple example, that will be great.
So how do I make a Drupal page say:
Hello Peter. You live in New York.
Thanks
Do like this.. Imagine you
Do like this..
Imagine you are sending that to node/1 of your drupal site..
www.mysite.com/node/1?name=Peter&place=New York
So in body of node/1 write a small php code..
How do I use isset
Thanks, that was helpful. I got it working OK.
I couldn't work out how to use isset(). Can you show how to use it for the example above?
Try this
if(isset($_GET['name']) && isset($_GET['place']))
Try double quotes if needed.
security
To prevent this being a security hole you could use check_plain():
Or you could use t() and take advantage of Drupal's translation facility as well as the security benefits:
How to implement isset
Thanks all for the helpful suggestions.
This is what I have so far.
www.mysite.com/node/1?name=Peter&place=New YorkNOTE: I don't know how to implement isset(). How would I use isset() in the code above?
Also any suggested changes to the above code are welcome.
isset() implementation example
isset()
Thanks Tomark - that works fine.