handlemap.php
Gesponsorde koppelingen
PHP script bestanden
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
require_once("config/classmap.php");
require_once("config/config.php");
$handleModuleObjects = new mapModule( $user, $pass, $host, $db );
if($_SERVER['REQUEST_METHOD'] === 'POST' ){
if($handleModuleObjects->connectMySQL()){
if( isset($_POST['placeObject']) ){
$searchForObject = $handleModuleObjects->performQuery("SELECT id, objectname, objectimage FROM objectlist WHERE id='". mysql_real_escape_string( $_POST['object'])."'");
if( mysql_num_rows( $searchForObject ) > 0 ){
$fetchDataObject = mysql_fetch_assoc( $searchForObject );
$insertObject = $handleModuleObjects->performQuery( "INSERT INTO objects ( objectnaam, objectimage, userid, xPos, yPos )
VALUES
( '". mysql_real_escape_string($fetchDataObject['objectname']) ."', '". mysql_real_escape_string($fetchDataObject['objectimage']) ."', '". mysql_real_escape_string($_POST['userID']) . "', '". mysql_real_escape_string($_POST['xPos']) ."', '". mysql_real_escape_string($_POST['yPos']) ."' )");
echo $fetchDataObject['objectimage'];
}
}
}
}
?>
require_once("config/classmap.php");
require_once("config/config.php");
$handleModuleObjects = new mapModule( $user, $pass, $host, $db );
if($_SERVER['REQUEST_METHOD'] === 'POST' ){
if($handleModuleObjects->connectMySQL()){
if( isset($_POST['placeObject']) ){
$searchForObject = $handleModuleObjects->performQuery("SELECT id, objectname, objectimage FROM objectlist WHERE id='". mysql_real_escape_string( $_POST['object'])."'");
if( mysql_num_rows( $searchForObject ) > 0 ){
$fetchDataObject = mysql_fetch_assoc( $searchForObject );
$insertObject = $handleModuleObjects->performQuery( "INSERT INTO objects ( objectnaam, objectimage, userid, xPos, yPos )
VALUES
( '". mysql_real_escape_string($fetchDataObject['objectname']) ."', '". mysql_real_escape_string($fetchDataObject['objectimage']) ."', '". mysql_real_escape_string($_POST['userID']) . "', '". mysql_real_escape_string($_POST['xPos']) ."', '". mysql_real_escape_string($_POST['yPos']) ."' )");
echo $fetchDataObject['objectimage'];
}
}
}
}
?>