Solved

Web statisics with php

Posted on 2001-06-20
2
182 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

813 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

19 Experts available now in Live!

Get 1:1 Help Now