I'm new to PHP, so I may be missing something obvious or it could be something with the HTML. I wrote an expect script that tests user authentication against a RADIUS server. The username is an email address, including an @ sign. I recently wrote an HTML/PHP front end to allow others to input username/password into a form and then see the results when they hit submit.
Expect code that takes two args username, and password
Code:
expect "#"
send "test aaa group radius [lindex $argv 0] [lindex $argv 1] new-code\r"
expect "#"
This works fine as far as I can tell, the two input boxes pass the input to the php script
Code:
<html>
<head>
<title>Authentication Test</title>
</head>
<body>
<form method= "post" action= "authentication.php">
<font size = "5" color = "blue"><b><u>USER AUTHENTICATION TOOL</u></b></font><br /><br />
Username:
<input type="text" size="30" maxlength="50" name="unstring"/><br />
Password:
<input type="text" size="30" maxlength="50" name="pwstring"/><br /><br />
<input type="submit" value="submit" name="submit"/><br />
</form><br />
</body>
</html
>
This is the php
Code:
<?$uname = $_POST['unstring']?>
<?$passw = $_POST['pwstring']?>
<?$output = shell_exec("expect authentication1.exp {$uname} {$passw}")?>
<?echo "<pre>$output</pre>"?>
Every works as it's supposed to, except for the output of the script. When it displays on the webpage, it's segmented weirdly with all throughout. What I've found is when I remove the @ sign in the username input, it fixes it.
Is there any part of HTML or PHP that treats the @ as a special character? 1 more thing is that I have another HTML/PHP/EXP script that works fine with the @.
Thanks