Include executable php script of 1 million links

361 Views Asked by At

I am a front end developer (html, css, Wordpress) who is starting to dabble in .js and .php.

I want to create a page similar to the www.milliondollarhomepage.com

I want every one of those million pixels to point at a series of links:

Html

<div class="b">
<a href="/1/"><img class="a" src="/images/1pixelpic.png"></a>
<a href="/2/"><img class="a" src="/images/1pixelpic.png"></a>
<a href="/3/"><img class="a" src="/images/1pixelpic.png"></a>

---Up To ---->

<a href="/999998/"><img class="a" src="/images/1pixelpic.png"></a>
<a href="/999999/"><img class="a" src="/images/1pixelpic.png"></a>
<a href="/1000000/"><img class="a" src="/images/1pixelpic.png"></a>
</div>

css

.a { float:left; }
.b { width:1000px;height:1000px; }

This is too long. It crashes in notepad++.

How do I write a .php include script that would look like:

<include php path="mymillionlinks.php">

And that file would look like

<div class="b">
<php write>

if call "<a href="/{1}/"><img class="a" src="/images/1pixelpic.png"></a>" < 1 000 000

then write "<a href="/{1+1}/"><img class="a" src="/images/1pixelpic.png"></a>"

<end php>
</div>

My php is not good enough yet. I hope I have explained myself well. Thanks. Archie.

1

There are 1 best solutions below

4
On

You need good php for this and good sql and good caching or static image generation with map. And there are multiple approaches to the functionality.

And if you code php in notepad++, you are already defeated. There's are IDEs for us, php devs.

As far as I remember, he only sold pixels in 10x10 batches minimum. Look at his grid. Doing 1x1 will keep you quite busy.

UPDATE

In frontend part you need a method of selection pixel regions and upload their image and setup link. And always do 10x10px increments. Pixel fonts fit 10px heights so that's the starting point.

In backend part:

  • Database stores regions (from and to coordinate pairs), link urls and actual uploaded images.
  • On each new added image you clear the cached version of HTML and generate a new one when the page is shown first time with a clear cache.
  • That new one is stored until a new user uploads a logo in a region.
  • HTML consists of either link or an image map. If you choose an image map, make sure to convert user images into one big image... but it's not really necessary.
  • Positioning on the grid has to be absolute. Make sure you split the grid into CSS or just inline CSS to place the logos on the DIV grid. DIV is position: relative while child regions are position: absolute + top and left.

This is the story of how it should work. Obviously, you'll need to handle user registration, login, payments, image screening so they don't porn you :) and such.

PS: You don't make a million dollars that easy :) You need to have coding kung-fu.