Jump to content

Recommended Posts

Hi,

 

I have a site here: ukadulthomepage(dot)co.uk/index.php?verify=true

 

Which functions fine apart from when i add a pixel i can add another one over the top of this which should not happen.

 

Here is the code for the site for when a block is chosen, but i need it to check some where in here that it is not covering an existing block.

 

<?php

$posx = $_GET[x];
$posy = $_GET[y];

$startx = 0;
$endx = 0;
$starty = 0;
$endy = 0;

if ($_GET[ox] > $posx) {
$startx = $posx;
$endx = $_GET[ox];
} else {
$startx = $_GET[ox];
$endx = $posx;
}

if ($_GET[oy] > $posy) {
$starty = $posy;
$endy = $_GET[oy];
} else {
$starty = $_GET[oy];
$endy = $posy;
}

$width = ((($endx+1) - $startx)*10);
$height = ((($endy+1) - $starty)*10);

$totblocks = (($endx+1) - $startx) * (($endy+1) - $starty);

$price = $totblocks * 4;

?>

 

 

Thank you in advance for you help.

 

Adam

Link to comment
https://forums.phpfreaks.com/topic/62622-pixel-home-page-i-have-a-problem/
Share on other sites

Sorry i should have mentioned how the existing entries are stored. I am using an XML database. And is stored like this:

 

<?xml version="1.0" encoding="UTF-8"?>
<news>

<item>
	<id>1</id>
	<user>1185868374</user>
	<posx>16</posx>
	<posy>8</posy>
	<image>1.noimage.JPG</image>
	<link>http://www.test.com</link>
	<alt>Test</alt>
	<w>10</w>
	<h>10</h>
</item>

</news>

 

Cheers

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.