topical media & game development

talk show tell print

student-map-addData.php / php



  <?
  
          include(<config.php>);
  
          link = mysql_connect(mysql_host, mysql_user, mysql_pass)
                  or die("Could not connect");
          mysql_select_db(mysql_table)
                  or die("Could not select database");
          
          userid = addslashes(_GET['userid']);
          lat = addslashes(_GET['lat']);
          lon = addslashes(_GET['lon']);
          date = date(Y) . date(m) . date(d);
          time = date(H) . date(i);
          descr = addslashes(_GET['descr']);
          
          if (userid!="") {
                  //echo "INSERT INTO points (id,userid,lat,lon,date,time,descr) VALUES ('','userid','lat','lon','date','time','descr');";
                  result = mysql_query("INSERT INTO points (id,userid,lat,lon,date,time,descr) VALUES ('','userid','lat','lon','date','time','descr');")
                  or die("<data><succes>false</succes><errormsg>Database error #1.</errormsg></data>");
                  if (result) {
                          echo "<data><succes>true</succes></data>";
                  }
          } else {
                  echo "<data><succes>false</succes><errormsg>Invalid Request</errormsg></data>";
          }
  ?>


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.