Hi, I need to read data from a form submitted by an ASP page.
I have tried using $_POST['FormFieldName']; but it hasn't worked. I just get a blank entry.
In case anyone is wondering why I would want to be using ASP, its so I can get the domain username without any prompts. As far as I'm aware, that is something I can't do with PHP.
I've included the ASP and PHP script below for you to have a look at.
Any help would be great.
PS: sudden thought, it wouldn't be anything to do with the fact that in order for the ASP script to run correctly anonymous access isn't permitted. It has to be set to 'Integrated', for IIS anyway.
Cheers, Dan.
******ASP SCRIPT*******
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Username = Request.ServerVariables("LOGON_USER")
ShortUsername=Replace(Username,"DomainName\","")
%>
<body>
<form name="form1" method="post" action="sms.php?source=ren.asp">
<table width="700" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="150">Username:</td>
<td colspan="4"><input type="text" name="username" readonly="TRUE" value="<% =ShortUsername %>"></td>
</tr>
<tr>
<td>Send Message to: </td>
<td width="172">ICT Team
<input name="sendto" type="radio" value="ICT"></td>
<td width="377" colspan="3">Site Team
<input name="sendto" type="radio" value="SST">
(Staff Only)</td>
</tr>
<tr>
<td>Message:</td>
<td colspan="4"><textarea cols="60" rows="5" name="message"></textarea></td>
</tr>
<tr align="center">
<td colspan="5"><p>
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p></td>
</tr>
</table>
</form>
</body>
************END OF ASP********
********PHP FILE********
<?php
$username = $POST['username'];
$sendto = $POST['sendto'];
$message = $_POST['message'];
echo '<br>'.$username.'<br>';
echo '<br>'.$sendto.'<br>';
echo '<br>'.$message.'<br>';
?>
***********END OF PHP*****