Jump to content

How would you make this in PHP? (Online magic trick) Is it even possible?


Recommended Posts

There's this really old website called http://ipolygraph.com/google/

 

Basically it mimics the Google homepage (as you can see it's been a while since they've updated) but the idea is really simple but clever. If you go to the search box and type cars (or whatever) and click search, it searches Google for "cars". However if you type something like  /php manual/  you'll notice it changes what you're searching to "What is...etc etc". The idea is say you tell your friend you're on Google and you ask them to think of a card, if you type    /4c/ is bob thinking of?  it'll look as if you're typing "What is Bob thinking of?", when you hit search it'll be the 4 of clubs.

 

Is there any way to make something similar to this? The idea came to me after I learned about the file_get_contents command in PHP.

Just trying to understand what's happening here. I've been trying all sorts to get the result you asked in the search bar, but it's not working for me.

Whether I type "/php manual/" or "/4c/ is bob thinking of?" (without the "" of course), I see no difference in the google results.

 

Any other special characters you put in?

I got it to work, but the effect seems to be coded in Flash, not PHP or anything. You couldn't really do this in PHP alone. You'd have to use at least Javascript in addition to PHP. And still, I'm wondering why exactly you thought of file_get_contents?

dcro2 is right, the only way to mimic this would be in Javascript and I have to say, I don't understand why you would want such a feature.  It's as if you're making a phishing scam for the visually impaired.... or the visually careless and ignorant.  Who in their right mind would type /php manual/    ....,    see "What is bob thinking of" and hit Enter or click Search?  This sounds like a way to prey on someone's ignorance IMO.

haha sorry guys, I'm not trying to scam anybody, I just found it interesting and was trying to see what's possible (it's my 2nd week learning).

 

Who in their right mind would type /php manual/    ....,    see "What is bob thinking of" and hit Enter or click Search?  This sounds like a way to prey on someone's ignorance IMO.

 

It was just a random example, the site is basically a magic trick. So if you're at school and you tell someone to think of a card, and they say seven of hearts, you'd simply type "/7h/ is Zanus thinking of?" into what appears to be Google but actually displays the card they're thinking of.

 

Anyways thanks for the help guys

PHP only process information "after" you submit a page, or "before" you load a page. Only javascript allows dynamic page, so that is javascript, not PHP.

If you right click on the search box, you can definitely see its flash. It might even be a bit difficult with javascript

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.