Basically it's for Drexel University who's email addys end in @drexel.edu.
When you go to post, you have to have an email with @drexel.edu in it. If not, you cant post, and if you enter something else or no email at all, you cant post.
How can i accomplish this? I have posted by code below:
<?
///WRITING TO THE FILE OFFICE.TXT
function WriteToFile ($Description, $EmailAddress, $FullName) {
$TheFile = "office.txt";
$CurrentDate = date("l F j, Y");
$Open = fopen ($TheFile, "a");
if ($Open) {
fwrite ($Open,
"<table><tr><td width='400' valign='top'><font size='2' color='#333333'>$Description</font></td></tr><tr><td width='400' valign='top'><font size='2' color='#333333'><u>$FullName</u> <b><a href='mailto:$EmailAddress'>$EmailAddress</a></b><BR><BR>
</font></td></tr></table><BR>\n");
trim ($Description);
fclose ($Open);
$Worked = TRUE;
} else {
$Worked = FALSE;
}
return $Worked;
}
///FORCE VALID E-MAIL
///NEED THE CODE HERE
$CallFunction = WriteToFile
($Array["Description"], $Array["EmailAddress"], $Array["FullName"]);
if ($CallFunction) {
print ("\n");
} else {
print ("Your data did not go through because of an error. Contact your project leader.\n");
}
?>
<HTML>
<HEAD>
<TITLE>OmniPlace | Workspace</TITLE>
</HEAD>
<BODY BGcolor="#FFFFFF" ALINK="#555555" VLINK="#CCCCCC" LINK="#000000">
<font size="1" face="arial" color="#333333">
<center>
<TABLE>
<TR>
<TD width="400" valign="top">
<img src="omnilogo.jpg"><BR>
<FORM ACTION="office-version.php" METHOD=POST>
<font size="1" face="arial" color="#333333">
OmniView | Workspace Information
<b>Enter your project information and personal information below.</b><BR>
Full Name:<BR>
<INPUT TYPE="TEXT" NAME="Array[FullName]" SIZE="35"><BR>
E-mail Address:<BR>
<INPUT TYPE="TEXT" NAME="Array[EmailAddress]" SIZE="35"><BR>
Project Input:<BR>
<TEXTAREA name="Array[Description]" ROWS=5 COLS=40></TEXTAREA>
<BR><BR>
<INPUT TYPE="HIDDEN" NAME="CurrentDate">
<INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="Process">
</TD>
<TD width="10"></TD>
<TD width="500" valign="top">
<font size="2" face="arial" color="#333333">
<b>Current Project Notes</b></font>
<BR><BR>
<font size="1" face="arial" color="#333333">
<?php
$file = "office.txt";
if (!$file_handle = fopen($file,"r")) { echo "Cannot open file."; }
if (!$file_contents = fread($file_handle, filesize($file))) { echo "Cannot retrieve file contents."; }
else { echo "$file_contents\n<P><P>"; }
fclose($file_handle);
?>
</font>
</TD>
</TR>
</TABLE>
</center>
</BODY>
</HTML>
And you can check it out here:
http://www.junkthatrocks.com/fairview/o ... ersion.php
To anyone who helps, I really really really appreciate it. You truely are a good person.