coordinates

Gestart doorSmiegles22 reacties50 weergaven

23 berichten · pagina 1 van 2

Smiegles

Lid · Topicstarter

Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
<!DOCTYPE html>
<html>
<head>
  <style>body {background-color: #eef; }
div { padding: 280px; }</style>
  <script src="http://code.jquery.com/jquery-1.4.4.js"></script>
</head>
<body>
  <div id="log"></div>
<script>$(document).bind(mousemove,function(e){ 
            $("#log").text("e.pageX: " + e.pageX + ", e.pageY: " + e.pageY); 
}); </script>

</body>
</html>


hoe zorg ik ervoor dat hij de coordinates in de database zet?

http://smiegles.nl/beta/index

zo ziet eht eruit
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Via $.get of $.post posten / getten (Leuke naamemo)
En dan op de pagina met PHP een query uitvoeren

EDIT:

Waarom zou je dit eigenlijk willen opslaan?
0
Smiegles

Lid · Topicstarter

Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
ik wil het opslaan om het uit tehalen en op de geklikte plek een afbeelding te zetten
welk stuk zou ik moeten posten?
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Je moet zorgen dat als een gebruiker KLIKT een $.post wordt gedaan anders wordt je host suspended emo
Script is zoiets (Met jQuery wink)

$(document).click(function(e){
            $.post(index.php?geklikt, {x: e.pageX, y: e.pageY}, function(d){
                // D is wat er dan op de pagina staat
            });
        });
0
Smiegles

Lid · Topicstarter

Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
zou je me hier verder me kunnen helpen voor 2 punten?
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Ja ik kan morgen helpensmileStuur me maar een PB met je MSN
0
Smiegles

Lid · Topicstarter

Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Pb gestuurd ik heb dit geprutst

[COLOR= #0000BB]<?php[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]]))
    {[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE INTO coordinates (, click) VALUES ("[/COLOR][COLOR= #007700].([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]click[/COLOR][COLOR= #007700]]).[/COLOR]"[COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]


hoe voeg je dit dan samen zodat hij de coordienaties in de DB zetconfused
0
Berichten
2.692
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
UPDATE INTO Gaat natuurlijk niet werken hea..
En , click ook niet..

[COLOR= #0000BB]<?php[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]]))
    {[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE coordinates SET click = "[/COLOR][COLOR= #007700].([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]click[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());
}[/COLOR]
?>
0
Smiegles

Lid · Topicstarter

Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"config.php"[/COLOR][COLOR= #007700]);[/COLOR]
?>
  <style>body {background: url(/gamebg.PNG); }
div { padding: -10px; }</style>
  <script src="http://code.jquery.com/jquery-1.4.4.js"></script>
  <div id="log"></div>
<script>$(document).bind(mousemove,function(e){ 
            $("#log").text("e.pageX: " + e.pageX + ", e.pageY: " + e.pageY); 
}); </script>
[COLOR= #0000BB]<?php[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]]))
    {[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE coordinates SET click = "[/COLOR][COLOR= #007700].([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]click[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());
}[/COLOR]
?>
<style>
$(document).click(function(e){
            $.post(index.php?geklikt, {x: e.pageX, y: e.pageY}, function(d){
                // D is wat er dan op de pagina staat
            });
</style>
<form method="post" action="">
<table border="0">
<tr>


heb ik nu
hoe laat ik nu de coordinates in de database komen?
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"config.php"[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]x[/COLOR][COLOR= #007700]]) &&[/COLOR] [URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]x[/COLOR][COLOR= #007700]]))
    {[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE coordinates SET click = "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]x[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]"x"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]y[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR][URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700];
}[/COLOR]
?>
  <style>body {background: url(/gamebg.PNG); }
div { padding: -10px; }</style>
  <script src="http://code.jquery.com/jquery-1.4.4.js"></script>
  <div id="log"></div>
<script>$(document).bind(mousemove,function(e){ 
            $("#log").text("e.pageX: " + e.pageX + ", e.pageY: " + e.pageY); 
});
$(document).click(function(e){
            $.post(index.php?geklikt, {x: e.pageX, y: e.pageY}, function(d){
                // D is wat er dan op de pagina staat
            });
</script>
<table border="0">
<tr>
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/error_reporting"]error_reporting[/URL][COLOR= #007700]([/COLOR]E_ALL[COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"config.php"[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]x[/COLOR][COLOR= #007700]]))
    {[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE coordinates SET click = "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]x[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]"x"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]y[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());
}[/COLOR]
?>
0
Smiegles

Lid · Topicstarter

Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/error_reporting"]error_reporting[/URL][COLOR= #007700]([/COLOR]E_ALL[COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"config.php"[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]x[/COLOR][COLOR= #007700]]))
    {[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE coordinates SET click = "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]x[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]"x"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]y[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());
}[/COLOR]
?>
  <style>body {background: url(/gamebg.PNG); }
div { padding: -10px; }</style>
  <script src="http://code.jquery.com/jquery-1.4.4.js"></script>
  <div id="log"></div>
<script>$(document).bind(mousemove,function(e){ 
            $("#log").text("e.pageX: " + e.pageX + ", e.pageY: " + e.pageY); 
});
$(document).click(function(e){
            $.post(index.php?geklikt, {x: e.pageX, y: e.pageY}, function(d){
                // D is wat er dan op de pagina staat
            });
</script>
<table border="0">
<tr>


zet nog niks in de db
http://smiegles.nl/beta/index
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
achter }); moet nog 1x });
dus wordt dat:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/error_reporting"]error_reporting[/URL][COLOR= #007700]([/COLOR]E_ALL[COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"config.php"[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]x[/COLOR][COLOR= #007700]]))
    {[/COLOR]
[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE coordinates SET click = "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]x[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]"x"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]y[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());
}[/COLOR]
?>
  <style>body {background: url(/gamebg.PNG); }
div { padding: -10px; }</style>
  <script src="http://code.jquery.com/jquery-1.4.4.js"></script>
  <div id="log"></div>
<script>$(document).bind(mousemove,function(e){ 
            $("#log").text("e.pageX: " + e.pageX + ", e.pageY: " + e.pageY); 
});
$(document).click(function(e){
            $.post(index.php?geklikt, {x: e.pageX, y: e.pageY}, function(d){
                // D is wat er dan op de pagina staat
            });});
</script>
<table border="0">
<tr>
0
Smiegles

Lid · Topicstarter

Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
doet het ook nietsadleyal bedankt sjoerd

hoe Zorg ik ervoor dat als je klikt met de muis op de pagina dat de coordinatie in de db word gezet?
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren