Solved

Web statisics with php

Posted on 2001-06-20
2
187 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

689 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