Page 1 of 1

how to pass parameters / variables ??

Posted: Wed May 12, 2010 7:16 am
by rrn
in my html page , there is a table displayed in page.html
name surname email mobile
abc ccc dhdh@hdh.com 77777 register
mnb kkk jdjj@jjd.com 888888 register

when i click the link 'register' it will go to a page with registration forms ..
in tat form there is a textbox email which is readonly

<td>Email</td>
<td><input type="text" id="email" name="email" value=""/ readonly='true"'></td>

what i need is 'email' should be displayed in the form when directed from the link 'register' , how can i do tat??
pls help ,, any help will be appreciated ... thank u....

Re: how to pass parameters / variables ??

Posted: Wed May 12, 2010 10:11 am
by AbraCadaver

Code: Select all

echo '<href="register.php?email=' . urlencode('dhdh@hdh.com') . '">register</a>';
Then in register.php you can:

Code: Select all

echo $_GET['email'];

Re: how to pass parameters / variables ??

Posted: Wed May 12, 2010 10:36 am
by ColonelSandersLite
Someone really should mention that if you don't know the answer to the question you just asked, you're a *long* ways from handling user authentication and session management and even further from doing it even remotely securely. Don't let that discourage you though. You probably really need to pick up a book on php. Depending on your experience level with other languages, you may be able to pick it up just doing various small tutorials online.

The answer to the question you're asking lies in the <Form> tag and the import_request_variables command though.

Re: how to pass parameters / variables ??

Posted: Thu May 13, 2010 1:48 am
by rrn
thnk u for the suggestion...
but

Code: Select all

echo '<href="register.php?email=' . urlencode('dhdh@hdh.com') . '">register</a>';
above code will not work in an html page...
'register' is in an html page....

Re: how to pass parameters / variables ??

Posted: Thu May 13, 2010 6:32 am
by AbraCadaver
rrn wrote:thnk u for the suggestion...
but

Code: Select all

echo '<href="register.php?email=' . urlencode('dhdh@hdh.com') . '">register</a>';
above code will not work in an html page...
'register' is in an html page....
Then do it in HTML. This is a PHP forum so I did it in PHP.