I've been trying to pass form values from HTML to a PHP function.
This is the sample slice of my codes:
Part A: Registration form
<form action="confirmation.html" method="post"> <table summary="registration form"> <tr> <td><label for="username">Username:</label></td> <td><input type="text" id="username" name="username" size="25" maxlength="25" /></td> </tr> <tr> <td><label for="password">Username:</label></td> <td><input type="password" id="password" name="pass" size="25" maxlength="8" /></td> </tr> </table> </form>
Part B: Confirmation page
<?php registration(); ?> then some html for output.
Part C: registration.php file
<?php function registration($userName, $passWord) { $userName; $passWord; return $userName; return $passWord; ?>
I even tried:
<?php registration('username', 'pass'); ?> even without- '
Also in php file I added this line before the returns:
echo $userName." ".$passWord;
but all I get is a blank page.
I'm trying to code my site's pages purely out of .html and just call the php scripts from a php file. Is this possible?
I've also read about $_GET but it passes the values via URL which I read can cause security issues.
Thank you very much!
This post has been edited by Dormilich: 17 June 2011 - 03:36 PM