Page 1 of 1

Passing many variable encapsulated in one variable in url

Posted: Thu May 22, 2003 8:35 pm
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

Re: Passing many variable encapsulated in one variable in ur

Posted: Fri May 23, 2003 12:34 am
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.

Posted: Fri May 23, 2003 2:06 am
by Doolittle
If you need to pass variables through a form its no problem

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