Passing many variable encapsulated in one variable in url

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Eugene
Forum Newbie
Posts: 24
Joined: Tue Jun 18, 2002 12:40 pm
Location: Montreal

Passing many variable encapsulated in one variable in url

Post by Eugene »

I am trying to write a simple script which will allow people who surf on my web site to send emails to their friends containg a link to the various section/articles that interest them.

There will be a image/text link on every page saying something like: Email this to your friends

1st possiblity: Make a form, containg a hidden variable which will be URL and that I can get through $_POST[]. Question is, (this is pure html actually), can I have a text link being the submit button of a form??????

2nd possibility: Have a text link linking to something like : send_mail.php?url=$url

only problem is that $url is its self a bunch of php variable, and will look somethimng like : $url=c=1&a=3. I cant obviously send that through the url. Is it possible to have something like $url="c=1&a=3" such that I have:


Code: Select all

send_mail.php?url="c=1&a=3"
I am not sure this is possible.

Thank you all in advance
User avatar
scorphus
Forum Regular
Posts: 589
Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:

Re: Passing many variable encapsulated in one variable in ur

Post by scorphus »

Eugene wrote:(...)1st possiblity: Make a form, containg a hidden variable which will be URL and that I can get through $_POST[]. Question is, (this is pure html actually), can I have a text link being the submit button of a form??????(...)
I'm not sure if you can have a text link (maybe yes). But I'm sure you can have an image to do that. I answered a question a bit like yours in this thread. I hope it helps.

Cheers,
Scorphus.
Doolittle
Forum Newbie
Posts: 19
Joined: Sun May 04, 2003 11:45 pm

Post by Doolittle »

If you need to pass variables through a form its no problem

<form action="x.php?x=2&y=5" mtheod=...>
Post Reply