Link to home
Start Free TrialLog in
Avatar of Oliver_Dornauf
Oliver_DornaufFlag for Afghanistan

asked on

Web statisics with php

Does someone know a good statistic software written in php. (visitors/browsers etc..) with grafic output ? (for freeif possible)
ASKER CERTIFIED SOLUTION
Avatar of jimmy282
jimmy282
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of FLA84
FLA84

I am very new at PHP please help.
I have created a HTML Form with Java and it calls my PHP script that
displays your information entered.  Upon clicking the submit button
it should write your name to a text file on the server.
see sample HTML Form below...

                               <script LANGUAGE="JavaScript">
<!--
function submit_form(strPage){
var msg;
if (document.form.A0000001.value.length <3) {
   msg = "You Must Enter Your Social Security Number Correctly\n";
   msg += " \n";
   msg += "     Please try again\n";
   alert(msg);
   return false;
}
if (document.form.A0000002.value.length <2) {
   msg = "You Must Enter Your Social Security Number Correctly\n";
   msg += " \n";
   msg += "     Please try again\n";
   alert(msg);
   return false;
}
if (document.form.A0000003.value.length<4) {
   msg = "You Must Enter Your Social Security Number Correctly\n";
   msg += " \n";
   msg += "     Please try again\n";
   alert(msg);
   return false;
}
if (document.form.A0000004.value <= " ") {
   msg = "You Must Enter Your Last Name\n";
   msg += " \n";
   msg += "     Please try again\n";
   alert(msg);
   return false;
}
if (document.form.A0000006.value <= " ") {
   msg = "You Must Enter Your First Name\n";
   msg += " \n";
   msg += "     Please try again\n";
   alert(msg);
   return false;
}


else{  
   
    document.form.action=strPage;
    document.form.submit();}
      
}
//-->
</script>

<html>
                         
                  
<html>

<head>
<title>BERNARD TEST PAGE Application</title>
<style TYPE="text/css">

</style>
</head>

<body background="paperbkg.gif">

<form name="form" ACTION="TEST1HandleForm.php" method="post">

        </center></div><div align="center"><center><table border="0" cellpadding="0"
      cellspacing="0" width="100%">
       
      </center></div></td>
   
  <p>&nbsp;</p>
 
  <p>&nbsp;</p>
  <div align="center"><center><table width="80%" border="1">
    <tr VALIGN="TOP" ALIGN="LEFT">
      <td colspan="2"> U.S. Social Security number: <font color="#FF0000">*</font>&nbsp;&nbsp;&nbsp;
      <input NAME="A0000001" VALUE SIZE="003" MAXLENGTH="3">-
        <input NAME="A0000002" VALUE SIZE="002" MAXLENGTH="2">-
        <input NAME="A0000003" VALUE SIZE="004" MAXLENGTH="4"> <p><font
      color="red">&nbsp;(If you do not have a Social Security Number, please download printable application and mail to Admissions Office.)</font></td>
    </tr>
    <tr>
      <td>Last name: <font color="#FF0000">*</font></td>
      <td><input NAME="A0000004" VALUE SIZE="025" MAXLENGTH="17"></td>
    </tr>
    <tr VALIGN="TOP" ALIGN="LEFT">
      <td>Jr., III, etc. </td>
      <td><input NAME="A0000005" VALUE SIZE="003" MAXLENGTH="3"> </td>
    </tr>
    <tr VALIGN="TOP" ALIGN="LEFT">
      <td>First name: <font color="#FF0000">* </font></td>
      <td><input NAME="A0000006" VALUE SIZE="025" MAXLENGTH="15"> </td>
    </tr>
    <tr VALIGN="TOP" ALIGN="LEFT">
      <td>Middle name: </td>
      <td><input NAME="A0000007" VALUE SIZE="025" MAXLENGTH="15"> </td>
    </tr>
  </table>
  </center></div><p>&nbsp;</p>
  <hr>
 <p align="right">      
<table border="0" cellpadding="0" cellspacing="0" width="30%">
    <tr>
      <td width="50%"> <input type="reset" value="Reset"
      name="reset" style="background-color: rgb(0,128,0); color: rgb(255,255,255)">
   <input type="button" value="Continue"
      name="continue" style="background-color: rgb(255,128,64); color: rgb(255,255,255)"
      onClick="javascript:submit_form('TEST1HandleForm.php')"></td>
    </tr>
  </table>
  </div>
</form>

<p>&nbsp;</p>
</body>
</html>

The php script  comes up fine  and writes a comma when I place 'submit' inside of
the empty check if ( !empty ($_POST['$Name'])) {   instead of '$Name'  . Can someone
please give me some help here I think I am luke warm ... Please see PHP script below
Thanks in advance....... FLA84

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
     <meta http-equiv="content-type"
     content="text/html; charset=iso-8859-1" />
     <title>BERNARD TEST PAGE Application</title>

</head>

<body background="paperbkg.gif">
<?php
@extract($_POST);
//Address error handling.

ini_set ('display_errors', 1);
//error_reporting(E_ALL); // report everything
error_reporting (E_ALL & ~E_NOTICE);

/* This page receives and handles the data generated by "form.html". */
$idnum = $A0000001 . '-' . $A0000002 . '-' . $A0000003;
$Name = "$A0000004,$A0000006";
print "Your name concatenated is $Name. <BR>\n";
print "Your soc. sec num. is $idnum.<BR>\n";
print "your Last name is  $A0000004.<BR>\n";
print "your First name is $A0000006.<BR>\n";

print "<p> Your information will updated upon clicking the Submit button.</p>";

if(isset ($_POST['submit'])) { // see if Handle form submitted.

  if ( !empty ($_POST['$Name'])) { // Check for required value.

    if ($fp = fopen ('OUTPUT.txt','ab')) { // Try to open file.

        $data="$Name\n";

  fwrite ($fp, $data); // Write the data. Use \r\n on Windows.
  fclose ($fp); // Close the file
print "<p> Your application has been added to the data base.</p>";

} else { // Could not open the file. cond 3
     print "<p> Your information could not be stored due to a system error. </p>";
   } //end of cond 3
} else { // Failed to enter all your data.
    print "<p> Please enter all required data!</p>";

} // end of cond 2

} // END of SUBMIT IF. end of cond 1

// Leave PHP display the Form

?>
<form action="TEST1HandleForm.php" method="post">
<p>
<br />
<input type="submit" name="submit" value="SUBMIT" />
</p>
</form>
</body>
</html>