Jump to content

finkrattaz

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

About finkrattaz

  • Birthday 06/10/1971

Contact Methods

  • MSN
    finkrattaz@msn.com
  • Website URL
    http://mattsdesigns.biz
  • Yahoo
    finkrattaz

Profile Information

  • Gender
    Male
  • Location
    Tucson

finkrattaz's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I gave the wrong connection code: <?php define('LINKTO','10.6.166.173');define('USR','matts');define('PWD','Jordan0!'); define('SCHEMA','matts'); class conn{ function connect(){$msdc = mysql_connect(LINKTO,USR,PWD) or die(mysql_errno());return $msdc;}} class db extends conn{ function dbuser(){ conn::connect();$dbreturn = mysql_select_db(SCHEMA) or die(mysql_errno());return $dbreturn;}} class customer extends db { function inD($name,$city,$state,$zip,$make,$model,$completevideo,$likevideo,$purchasedvideo,$comments){ $name = customer::errorC($name); $city = customer::errorC($city); $state = customer::errorC($state); $zip = customer::errorC($zip); $make = customer::errorC($make); $model = customer::errorC($model); $completevideo = customer::errorC($completevideo); $likevideo = customer::errorC($likevideo); $purchasedvideo = customer::errorC($purchasedvideo); $comments = customer::errorC($comments); if(empty($completevideo)) { echo "<script>alert('Fields are empty');window.history.back(-1);</script>"; } else{ $query = sprintf("INSERT INTO customer (CustName, City, State, Zip, Make, Model, CompleteVideo, LikeVideo, PurchasedVideo, Comments) VALUES('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",$name,$city,$state,$zip,$make,$model,$completevideo,$likevideo,$purchasedvideo,$comments); $qrSet = mysql_query($query); if ($_SESSION['view_start_time_v1'] == $_SESSION['view_stop_time_v1']) { // Its still the same hour..so parsing is fine. $total_time_v1 = $_SESSION['view_stop_time_v1'] - $_SESSION['view_start_time_v1']; $total_time_v2 = $_SESSION['view_stop_time_v2'] - $_SESSION['view_start_time_v2']; $vp1_query = sprintf("INSERT INTO session(name, url_viewed, date_viewed,time_viewed) VALUES('%s','%s','%s','%s')", $name, 'VideoPage1',date('m/d/Y'), $total_time_v1); $vp2_query = sprintf("INSERT INTO session(name, url_viewed, date_viewed,time_viewed) VALUES('%s','%s','%s','%s')", $name, 'VideoPage2',date('m/d/Y'), $total_time_v2); mysql_query($vp1_query); mysql_query($vp2_query); } if($qrSet) { echo "<script>alert('Congratulation! You have successfully completed the feedback form');window.location='videoPage.php';</script>"; } } } function errorC($var) { $temsp = trim($var); $temp = mysql_real_escape_string($temsp); return $temp; } } ?>
  2. I am sort of having the same problem, but I am trying to get the length of time a user is logged into the page. There are two different pages were are trying to get the time from. If there is a way to get it just have the login time for the page and logout time for the page that will be great. When we look at the data from the database http://stealthtrackervideos.com/Sessions.php it is showing zero and I have it set as an INT. Can someone help determine what could be wrong? Page Code: <?php session_start(); $_SESSION['view_start_time_v1'] = date('h, i, s'); require_once('dbcon2.php'); if(isset($_POST['SUBMITME'])) { $_SESSION['view_stop_time_v1'] = date('h, i, s'); $dbr = new db;$dbr->dbuser(); $in = new customer;$in->inD($_POST['name'],$_POST['city'],$_POST['state'],$_POST['zip'],$_POST['make'],$_POST['model'],$_POST['completevideo'],$_POST['likevideo'],$_POST['purchasedvideo'],$_POST['comments'],1); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script language="javascript"> function dovalidation() { if(document.getElementById("completevideo").value=="") { alert('Did you watch completed video should not be blank.'); document.getElementById("completevideo").focus(); } } </script> <title>Stealth Safety Security Notification for Vehicles</title> </head> <body bgcolor="#ffffff"> <table width="750" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="250" align="left"><font face="tahoma" size="3" color="black"><b>Welcome: </b><?php echo $_SESSION['LoggedInD']; ?></font></td> <td width="250" align="center"><font face="tahoma" size="3" color="black"><b>Todays Date: </b><?php echo date('m/d/Y');?></font></td> <td width="250" align="right"><a href="Logout.php?flag=1"><font face="tahoma" size="3" color="black"><b>Logout</b></font></a></td> </tr> </table> <hr style="color:#66FF00"> <center><a href="videoPage.php"><font face="tahoma" size="2" color="black">back</font></a></center><p> <center><font face="tahoma" size="3" color="black"><b>STEALTH SAFETY SECURITY NOTIFICATION FOR VEHICLES</b></font></center><p> <table width="640" border="0" align="center" cellpadding="0" cellspacing="0" style="border:3px solid #000000;"> <tr> <td width="640" align="center"> <center> <embed src="http://mattsdesigns.biz/dealership/stealth01.wmv" width="640" height="380"></embed> </center> </td> </tr> </table> <form name="form1" id="form1" action="" method="post" onSubmit="return dovalidation()"> <center><font face="tahoma" size="3" color="red"><b>PLEASE COMPLETE THE FORM!!!</b></font></center><br> <table width="500" border="0" cellspacing="2" cellpadding="2" style="border:1px solid #000000;" align="center"> <tr> <td width="250" align="left" ><font face="tahoma" size="2" color="black">Customer Name:</font></td> <td width="250" align="left"><font face="tahoma" size="2" color="black"><input name="name" type="text" id="name"></font></td> </tr> <tr> <td align="left"><font face="tahoma" size="2" color="black">City:</font></td> <td align="left"><font face="tahoma" size="2" color="black"><input name="city" type="text" id="city"></font></td> </tr> <tr> <td align="left"><font face="tahoma" size="2" color="black">State:</font></td> <td align="left"><font face="tahoma" size="2" color="black"><input name="state" type="text" id="state"></font></td> </tr> <tr> <td align="left"><font face="tahoma" size="2" color="black">Zip Code:</font></td> <td align="left"><font face="tahoma" size="2" color="black"><input name="zip" type="text" id="zip"></font></td> </tr> <tr> <td align="left"><font face="tahoma" size="2" color="black">Make:</font></td> <td align="left"><input name="make" type="text" id="make"> </td> </tr> <tr> <td align="left"><font face="tahoma" size="2" color="black">Model:</font></td> <td align="left"><input name="model" type="text" id="model"></td> </tr> <tr> <td align="left"><font face="tahoma" size="2" color="black">Did you watch the complete video?</font><br> <font face="tahoma" size="1" color="red">*Answer is Required*</font></td> <td align="left"><font face="tahoma" size="2" color="black"><input name="completevideo" type="radio" value="yes">Yes <input name="rdcompleted" type="radio" value="no">No</font></td> </tr> <tr> <td align="left"><font face="tahoma" size="2" color="black">Did you like the product?</font></td> <td align="left"><font face="tahoma" size="2" color="black"><input name="likevideo" type="radio" value="yes">Yes <input name="likevideo" type="radio" value="no">No</font></td> </tr> <tr> <td align="left"><font face="tahoma" size="2" color="black">Would you purchase the product?</font></td> <td align="left"><font face="tahoma" size="2" color="black"><input name="purchasedvideo" type="radio" value="yes">Yes <input name="purchasedvideo" type="radio" value="no">No</font></td> </tr> <tr> <td align="left"><font face="tahoma" size="2" color="black">Comments About the Product</font></td> <td align="left"><font face="tahoma" size="2" color="black"><textarea name="comments" cols="30" rows="3"></textarea></font></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr align="center"> <td colspan="2"><font face="tahoma" size="2" color="black"><p><input type="hidden" name="SUBMITME"><input name="submit" type="submit"> - <input name="reset" type="reset"></font></td> </tr> </table> </td> </tr> </table> </form> </body> </html> Connection Code: <?php define('LINKTO','10.6.166.173');define('USR','matts');define('PWD','Jordan0!'); define('SCHEMA','matts'); class conn{ function connect(){$msdc = mysql_connect(LINKTO,USR,PWD) or die(mysql_errno());return $msdc;}} class db extends conn{ function dbuser(){ conn::connect();$dbreturn = mysql_select_db(SCHEMA) or die(mysql_errno());return $dbreturn;}} class customer extends db { function inD($name,$city,$state,$zip,$txtMake,$txtModel,$txtVideoName,$rdcompleted,$rdliked,$rdpurchased,$txtcomments){ $name = customer::errorC($name); $city = customer::errorC($city); $state = customer::errorC($state); $zip = customer::errorC($zip); $txtMake = customer::errorC($txtMake); $txtModel = customer::errorC($txtModel); $txtVideoName = customer::errorC($txtVideoName); $rdcompleted = customer::errorC($rdcompleted); $rdliked = customer::errorC($rdliked); $rdpurchased = customer::errorC($rdpurchased); $txtcomments = customer::errorC($txtcomments); if(empty($rdcompleted)) { echo "<script>alert('Fields are empty');window.history.back(-1);</script>"; } else{ $query = sprintf("INSERT INTO customer (`CustName`, `City`, `State`, `Zip`, `Make`, `Model`, `VideoName`, `CompleteVideo`, `LikeVideo`, `PurchasedVideo`, `Comments`) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",$name,$city,$state,$zip,$make,$model,$videoname,$completevideo,$likevideo,$purchasevideo,$comments); echo $query; $qrSet = mysql_query($query); if($qrSet) { echo "<script>alert('Congratulation! You have successfully completed the feedback form');window.location='videoPage.php';</script>"; } } } function errorC($var) { $temsp = trim($var); $temp = mysql_real_escape_string($temsp); return $temp; } } ?>
  3. How can I track the time of a user when they view a page? Does anyone have any directions to create this code.
  4. I am trying to record when a user logs into a page and how long they were on the page. There two pages. Page 1 <?php session_start(); $_SESSION['view_start_sec_v1'] = date('s'); require_once('dbcon2.php'); if(isset($_POST['SUBMITME'])) { $_SESSION['view_stop_sec_v1'] = date('s'); $dbr = new db;$dbr->dbuser(); $in = new customer;$in->inD($_POST['name'],$_POST['city'],$_POST['state'],$_POST['zip'],$_POST['make'],$_POST['model'],$_POST['completevideo'],$_POST['likevideo'],$_POST['purchasedvideo'],$_POST['comments'],1); } ?> Page 2 <?php session_start(); $_SESSION['view_start_sec_v2'] = date('s'); require_once('dbcon2.php'); if(isset($_POST['SUBMITME'])) { $_SESSION['view_stop_sec_v2'] = date('s'); $dbr = new db;$dbr->dbuser(); $in = new customer;$in->inD($_POST['name'],$_POST['city'],$_POST['state'],$_POST['zip'],$_POST['make'],$_POST['model'],$_POST['completevideo'],$_POST['likevideo'],$_POST['purchasedvideo'],$_POST['comments'],1); } ?> if ($_SESSION['view_start_sec_v1'] == $_SESSION['view_stop_sec_v1']) { // Its still the same hour..so parsing is fine. $total_time_v1 = $_SESSION['view_stop_sec_v1'] - $_SESSION['view_start_sec_v1']; $total_time_v2 = $_SESSION['view_stop_sec_v2'] - $_SESSION['view_start_sec_v2']; $vp1_query = sprintf("INSERT INTO session(name, url_viewed, date_viewed,time_viewed) VALUES('%s','%s','%s','%s')", $name, 'VideoPage1',date('m/d/Y'), $total_time_v1); $vp2_query = sprintf("INSERT INTO session(name, url_viewed, date_viewed,time_viewed) VALUES('%s','%s','%s','%s')", $name, 'VideoPage2',date('m/d/Y'), $total_time_v2); mysql_query($vp1_query); mysql_query($vp2_query); } Also in the database the time_viewed is set to VARCHAR and I don't know if it correct. http://stealthtrackervideos.com is the site and the page where viewing the database is http://stealthtrackervideos.com/Session.php - Time Viewed is coming up as zero.
  5. I would like to make it smaller, maybe where the registration and login are on the same page. the site is http://mattsdesigns.biz/dealership.
  6. CONNECTION CODE <?php mysql_connect("localhost", "matts", "jordan") or die(mysql_error()); mysql_select_db("matts_videoportal") or die(mysql_error()); $custname = $_POST['custname'];; $city = $_POST['city']; $state = $_POST['state']; $zip = $_POST['zip']; $make = $_POST['make']; $model = $_POST['model']; $video_name = $_POST['videoname']; $complete_video = $_POST['completevideo']; $liked_video = $_POST['likedvideo']; $purchased_video = $_POST['purchasedvideo']; $comments = $_POST['comments']; $customer_register_query = sprintf("INSERT INTO customer (custname, city, state, zip, make, model, videoname, completevideo, likedvideo, purchasedvideo, comments) VALUES (`$custname`, `$city`, `$state`, `$zip`, `$make`, `$model`, `$videoname`, `$completevideo`, `$likedvideo`, `$purchasedvideo`, `$comments`)"); $dealer_register_query = sprintf("INSERT INTO dealership (`DealerName`, `Dealership`, `City`, `State`,`Zip`,`Email`,`Login`,`Password`) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",$name,$dealership,$city,$state,$zip,$email,$login,$password); function RegisterCustomer() { if (!mysql_query($customer_register_query)) { echo "<script language=\"javascript\">\r\n"; echo "document.form1.RegisterCompletionNotifier.type=\"text\";\r\n"; echo "document.form1.RegisterCompletionNotifier.value=\"Registration was completed successfully. Thank You!\";\r\n"; echo "</script>"; } else { echo "<script language=\"javascript\">\r\n"; echo "document.form1.RegisterCompletionNotifier.type=\"text\";\r\n"; echo "document.form1.RegisterCompletionNotifier.value=\"Registration Failed! Please contact site Administrator!\";\r\n"; echo "</script>"; } } function RegisterDealer() { if (!mysql_query($dealer_register_query)) { echo "<script language=\"javascript\">\r\n"; echo "<!--"; echo "document.registration.DealerRegisterConfirmation.type=\"textarea\""; echo "document.registration.DealerRegisterConfirmation.cols=\"10\" "; echo "document.registration.DealerRegisterConfirmation.rows=\"10\" "; echo "document.registration.DealerRegisterConfirmation.value=\"Sorry, your registration could not be saved!\" "; echo "document.registration.DealerRegisterConfirmation.value+=\"Please contact the site administrator!!!!\" "; echo "</script>"; } else { echo "<script language=\"javascript\">\r\n"; echo "<!--"; echo "document.registration.DealerRegisterConfirmation.type=\"textarea\""; echo "document.registration.DealerRegisterConfirmation.cols=\"10\" "; echo "document.registration.DealerRegisterConfirmation.rows=\"10\" "; echo "document.registration.DealerRegisterConfirmation.value=\"Registration received. Thank You!\" "; echo "//-->"; echo "</script>"; } } ?>
  7. USER LOGIN <?php session_start(); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Dealer Login Page</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- #bk a:link,#bk a:visited {color: #FFFFFF; font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: 18px;text-decoration:none; } #bk a:hover {color:#CCFF00; font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: 18px;text-decoration:underline; } body {background-color: #000000;} .style1 {color: #FFFFFF; font-weight: bold;} --> </style> </head> <body> <center> <form name="login" id="login" action="" method="post"> <p> </p> <p> </p> <p> </p> <p> </p> <table width="363" border="0" cellpadding="2" cellspacing="2" bgcolor="#000000" style="border:2px dotted #FFFFFF;"> <tr align="center"> <td colspan="2"><font face="tahoma" size="3" color="white"><b>User Login Panel </b></font></td> </tr> <tr> <td width="183"> </td> <td width="243"> </td> </tr> <tr> <td><p> <font face="tahoma" size="2" color="white">Login:</font></td> <td><font face="tahoma" size="2" color="white"><input name="user" type="text" maxlength="30" minlength="5"></font></td> </tr> <tr> <td><font face="tahoma" size="2" color="white">Password:</font></td> <td><font face="tahoma" size="2" color="white"><input name="password" type="password" maxlength="30" minlength="5"></font></td> </tr> <tr align="center"> <td colspan="2"><font face="tahoma" size="2" color="white"> <p><input name="Submit" type="submit" value="Login"></font></td> </tr> </table> <br> <div id="bk" align="center"><a href="DealerReg.php">New User? Click here to Register.</a></div> </form> </center> </body> </html> <?php require_once('dbcon2.php'); $dbr = new db;$dbr->dbuser(); if(isset($_POST['Submit'])) { if($_POST['user']=="" || $_POST['password']=="") { ?> <div id="m" align="center"> <div id="error" align="center" style="background-color:#FFFFCC;color:#FFFF00;width:450px;height:30px;border:1px solid #CC0000;top:700px;left:500px;"> <div id="midd" style="margin-top:6px;color:#FF0000; "> <strong><font face="tahoma" size="3">Please enter username and password.</font></strong> </div> </div> </div> <?php } $query = sprintf("SELECT * FROM dealership WHERE Login='%s' AND Password='%s'", mysql_real_escape_string(trim($_POST['user'])), mysql_real_escape_string(trim($_POST['password']))); $dealername = mysql_fetch_array(mysql_query($query)); if(mysql_num_rows(mysql_query($query))<=0 && $_POST['user']!="" && $_POST['password']!="") { ?> <div id="mm" align="center"> <div id="msgalert" align="center" style="background-color:#FFFFCC;color:#FFFF00;width:450px;height:30px;border:1px solid #CC0000;top:700px;left:500px;"> <div id="midd" style="margin-top:6px;color:#FF0000; "> <strong><font face="tahoma" size="3">Invalid input! or Incorrect Login Details</font> </strong> </div> </div> </div> <?php } else { $_SESSION['LoggedInD']= $dealername['DealerName']; $_SESSION['LoggedInID']= $dealername['DealerID']; if(mysql_num_rows(mysql_query($query))>0 ) { $_SESSION['LoggedInDCnt']=1; echo "<script>window.location='videoPage.php';</script>"; } } } ?> <p> </p> <p><div id="bk" align="center"><a href="index.php">back</a></div></p>
  8. I am try to get the User Registration Validated and input the information throught the connection and then it opens it goes to the login page. USER REGISTRATION <?php require_once('dbcon2.php'); if(isset($_POST['submit'])) { } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Registration Page</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script language="JavaScript" type="text/javascript"> function validationregistration() var frmvalidator = new Validator("registration"); frmvalidator.addValidation("name","req","Please enter your Name"); frmvalidator.addValidation("name"); frmvalidator.addValidation("name","alpha"); frmvalidator.addValidation("login","req","Please enter your Login"); frmvalidator.addValidation("login"); frmvalidator.addValidation("password","req","Please enter your Password"); frmvalidator.addValidation("password"); frmvalidator.addValidation("reenter","req","Please re-enter your Password"); frmvalidator.addValidation("reenter"); var frm = document.forms["registration"]; if(frm.password.value != frm.reenter.value) { alert('The Password and verified password does not match!'); return false; } else { return true; } } </script> </head> <body bgcolor="#000000"> <center> <form name="registration" id="registration" action="dbcon2.php" method="post" onSubmit="return validationregistration()"> <table width="500" border="0" cellspacing="1" cellpadding="1"> <tr> <td colspan="2" align="center"><font face="tahoma" size="3" color="white"><b>USER REGISTRATION</b></font></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td><p> <font face="tahoma" size="2" color="white">User Name:</font></td> <td><font face="tahoma" size="2" color="white"><input name="dealername" type="text" id="dealername"></font></td> </tr> <tr> <td><font face="tahoma" size="2" color="white">Dealership:</font></td> <td><font face="tahoma" size="2" color="white"><input name="dealership" type="text"></font></td> </tr> <tr> <td><font face="tahoma" size="2" color="white">City:</font></td> <td><font face="tahoma" size="2" color="white"><input name="city" type="text"></font></td> </tr> <tr> <td><font face="tahoma" size="2" color="white">State:</font></td> <td><font face="tahoma" size="2" color="white"><input name="state" type="text"></font></td> </tr> <tr> <td><font face="tahoma" size="2" color="white">Zip Code:</font></td> <td><font face="tahoma" size="2" color="white"><input name="zip" type="text"></font></td> </tr> <tr> <td><font face="tahoma" size="2" color="white">Email:</font></td> <td><font face="tahoma" size="2" color="white"><input name="Email" type="text"></font></td> </tr> <tr> <td><font face="tahoma" size="2" color="white">Create Your Login:</font></td> <td><font face="tahoma" size="2" color="white"><input name="login" type="text" id="login"></font></td> </tr> <tr> <td><font face="tahoma" size="2" color="white">Create Your Password:</font></td> <td><font face="tahoma" size="2" color="white"><input name="password" type="password" id="password"></font></td> </tr> <tr> <td><font face="tahoma" size="2" color="white">Re-Enter Your Password:</font></td> <td><font face="tahoma" size="2" color="white"><input name="reenter" type="password" id="reenter"></font></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr align="center"> <td colspan="2"><font face="tahoma" size="2" color="white"><p><input name="submit" type="submit" onClick<?=RegisterDealer();?>> - <input name="reset" type="reset"></font> </td> </tr> </table> <p><div id="bk" align="center"><a href="index.php">back</a></div></p; </form> </center> </body> </html>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.