how to pass parameters / variables ??

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
rrn
Forum Commoner
Posts: 46
Joined: Wed Apr 15, 2009 7:54 am

how to pass parameters / variables ??

Post 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....
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: how to pass parameters / variables ??

Post 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'];
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
User avatar
ColonelSandersLite
Forum Commoner
Posts: 35
Joined: Sun May 09, 2010 1:32 am

Re: how to pass parameters / variables ??

Post 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.
rrn
Forum Commoner
Posts: 46
Joined: Wed Apr 15, 2009 7:54 am

Re: how to pass parameters / variables ??

Post 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....
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: how to pass parameters / variables ??

Post 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.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Post Reply