Solved

Web statisics with php

Posted on 2001-06-20
2
181 Views
Last Modified: 2008-03-06
Does someone know a good statistic software written in php. (visitors/browsers etc..) with grafic output ? (for freeif possible)
0
Comment
Question by:Oliver_Dornauf
2 Comments
 
LVL 11

Accepted Solution

by:
jimmy282 earned 100 total points
ID: 6213137
0
 

Expert Comment

by:FLA84
ID: 10812652
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>
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now