The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 18, 2019, 07:01:08 PM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Wordpress coolness or open orifice?  (Read 4500 times)
Phaėton
Lifer
*****
Offline Offline

Posts: 555


⎝⏠⏝⏠⎠


View Profile
« on: December 02, 2010, 05:17:52 PM »

http://wordpress.org/extend/plugins/allow-php-in-posts-and-pages/

Code:

[php].code.[/php] in the middle of a post or page and it runs with it..


:shivers?:

 

  .... too soon?
Logged

When I was your age we used to walk to the TV to change the channel....  _̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #1 on: December 02, 2010, 11:25:31 PM »

Hmmm... I don't think so, but I'll check to see if I can make it happen.

The bracketed PHP tag will colorized code inline and make it all purdy for display ... But putting actual inline code would be a gigantic hole if it actually worked.

Watch:
$this that;
$myVar aFunction();
$aLiteral 'Voulez vous coucher avec moi ce soir';
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #2 on: December 02, 2010, 11:26:09 PM »

... And never too soon for Santabop.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
Bompa
Administrator
Lifer
*****
Offline Offline

Posts: 564


Where does this show?


View Profile
« Reply #3 on: December 03, 2010, 03:59:59 AM »

... But putting actual inline code would be a gigantic hole if it actually worked.

Why?

Only the blog admin or those given post permission could do it, right?

Unless I am mistaken, when that post or page is displayed, the code will not show.

Bompa
Logged

"The most beautiful and profound emotion we can experience is the sensation of the mystical..." - Albert Einstein
Phaėton
Lifer
*****
Offline Offline

Posts: 555


⎝⏠⏝⏠⎠


View Profile
« Reply #4 on: December 03, 2010, 09:12:17 AM »

i thought maybe it was to execute php... makes me laugh

'ALLOW' php...

is that what they mean on facebook when they want you to ALLOW.

Well i guess they deserve an allowance..

Speaking of facebook... i wrote a facebook app for shits and gigs and to
play with a free cloud while im learning salesforce..

its a simple magic 8 ball ask the magic 8 ball a question and it does a
random answer.

So i have a log that outputs, ip, user agent, time question asked and answer generated.

I get between 1-3 hits for each request with the same ip and user agent
not really sure where any hit above 1 would come into play.  Since each
answer is random i get possibly 3 answers given per question and i can trace
the one that i was given in my browser to the one in the log by hand if i was the question asker and know manually what answer i saw ...but there are up to two false answers in the log!!! depending on browser type/ access method...

 any ideas where these extra hits are coming from?

I also am working on a wordpress thingie on a Yahoo server and im getting
exactly four hits per request from non phone devices (for now)...




==== my guess is the cloud runs the script in a few places based on guesstimated demand so if one fails the other will have already been handling the request and standing by with an answer?



Does any one else have experience with multiple log entries in a cloud hosting environment Huh? How can I program defensively to realistically log the 8 ball answer given when i have no idea which instance of the php script was the one the user got to see??

« Last Edit: December 03, 2010, 09:15:08 AM by Phaėton » Logged

When I was your age we used to walk to the TV to change the channel....  _̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡
vsloathe
vim ftw!
Global Moderator
Lifer
*****
Offline Offline

Posts: 1669



View Profile
« Reply #5 on: December 07, 2010, 12:00:44 PM »



Does any one else have experience with multiple log entries in a cloud hosting environment Huh? How can I program defensively to realistically log the 8 ball answer given when i have no idea which instance of the php script was the one the user got to see??



What do you mean? It should be irrelevant, it's not PHP keeping logs (except error logs), it's your web server. You should be able to get a full traffic snapshot by combining the httpd (or whatever format) logs from all the servers in your pool. We load balance a couple dozen web servers and the logs are pulled and compressed together nightly.
Logged

hai
vsloathe
vim ftw!
Global Moderator
Lifer
*****
Offline Offline

Posts: 1669



View Profile
« Reply #6 on: December 07, 2010, 12:07:05 PM »

Also, I would never, ever, in a million years configure Wordpress so I could put PHP in posts. For one thing, it's guaranteed to be interpreted outside the scope of all your other code. For another, it has to be post-post-processed. In other words, your webserver gets a request for a page, executes the handler for the script associated with that page (file with a .php extension), finishes processing the script that returns pre-rendered textual (HTML) output, and somewhere in that process it sends what should be a piece of static display code through an interpreter...It makes my skin crawl. I'd assume it's still impossible to interact with or manipulate the DOM of the page before PHP was done processing, but I can think of a couple ways around that, especially if you're doing a MITM on a blog author.
Logged

hai
Phaėton
Lifer
*****
Offline Offline

Posts: 555


⎝⏠⏝⏠⎠


View Profile
« Reply #7 on: December 07, 2010, 05:33:34 PM »

>its not php keeping logs... in this case it is...
when my script gets called i log it by fileappending like this... each php request generates a unique answer.

2010-12-07 19:04:15.000000,adisticntqqblahblahtestingonetwo,/facebook/2.gif,66.220.153.244
2010-12-07 19:04:18.000000,adisticntqqblahblahtestingonetwo,/facebook/7.gif,66.220.153.249

------------------------------------------------------------------------------------------------
The user asked for a distinctqqblablahtestingonetwo and got the '2.gif' answer in this case.
i answered and generated a ghost page for 7.gif (the only way i could even tell i was getting double
hits cause of the random number for each answer.) the user saw 2.gif NEVER saw 7.gif
the ips being from two seperate servers in the facebook squadron.

heres my ISP log for the same two hits:
------------------------------------------------------------------------------------------------
66.220.153.244 - - [07/Dec/2010:19:04:16 -0500] "POST /facebook/?fb_sig_locale=en_US&fb_sig_in_new_facebook=1&fb_sig_time=1291766451.3858&fb_sig_added=0&fb_sig_country=us&fb_sig_api_key=b1fd49a8ae765f7756416cd4105edf8f&fb_sig_app_id=164112123614354&fb_sig=a7e13e36a0ad197710ebfdf3b4fcaff5&string=adisticntqqblahblahtestingonetwo HTTP/1.1" 200 467 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10"
66.220.153.249 - - [07/Dec/2010:19:04:18 -0500] "POST /facebook/?fb_sig_locale=en_US&fb_sig_in_new_facebook=1&fb_sig_time=1291766451.3858&fb_sig_added=0&fb_sig_country=us&fb_sig_api_key=b1fd49a8ae765f7756416cd4105edf8f&fb_sig_app_id=164112123614354&fb_sig=a7e13e36a0ad197710ebfdf3b4fcaff5&string=adisticntqqblahblahtestingonetwo HTTP/1.1" 200 467 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10"


----------------------------------------------------------------------------------------------------

as u can see two seperate facebook servers are sending me the SAME request in place oif the users browser... two seperate processes on two seperate ids makig the same request of me instantiated once by the user, 1-3 times by facebook server and somewhere inside facebook its spitting back one answer to the user and marking up that answer, storing statistics , etc with the other answers.  I want to know which .gif file it let the user get the link to so i can log the answer each person got with their questions and put it on the page as a stream or whatever... but just to know!

facebook is getting the request from the user and hitting my canvas URL twice with the same POST data and everything.... my php program at the canvas url gets two hits and generates two answers in this case....


sometimes its one hit... sometimes its three hits... depending on what metatag stuff is on the page
(its called fbml)

on a YAHOO wp installation i get four identical requests for an answer from my php code log for ONE actual returned to a user page...  both are cloud servers with multiple farms of servers i assume yahoo is, i know that facebook is.... and for some reason they mimic the initial request up to three extra times and do something with the extra 1-3 answers they got.... the tower of babel grows taller...

so the best thing i can think of to do is program defensively in this situation ... i want to have some sort of an idea of keeping a log simply,   what user asked what question and what answer THEY SAW... cause i generated two other answers ..... but since they are copying the exact url and re requesting it theres nothing unique i could generate and pass to tag it later to a 'what they got back'


So how can i log in my php fileappend log the answer received from the extras generated? quite the puzzle!


« Last Edit: December 07, 2010, 05:36:29 PM by Phaėton » Logged

When I was your age we used to walk to the TV to change the channel....  _̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡
Phaėton
Lifer
*****
Offline Offline

Posts: 555


⎝⏠⏝⏠⎠


View Profile
« Reply #8 on: December 07, 2010, 05:45:23 PM »


Code:
1) a user makes a request from a device it goes to fb server...
fb server makes three requests to my canvas url i generate three
answers for the same question and give them to fb server
the requests are coming from seperate urls at facebook!

                                                            exact same url request to canvas url different answer
                                                          /
 [user device] -----> [facebook platform] ---> exact same url request to canvas url different answer
                               duplicates url        \
                                                          ---> exact same url request to canvas url different answer


2) all three answers go back from my canvas url to the facebook servers.  i generate three random pages.
because i got three requests from facebook.
facebook then does whatever with the three answers... and ONE gets passed back to the user device

i was wondering since i cant get into fb logs or know how many requests the facebook platform might make
how can i track the answer actually seen by the user...!?
« Last Edit: December 07, 2010, 05:49:49 PM by Phaėton » Logged

When I was your age we used to walk to the TV to change the channel....  _̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡
Phaėton
Lifer
*****
Offline Offline

Posts: 555


⎝⏠⏝⏠⎠


View Profile
« Reply #9 on: December 09, 2010, 12:50:56 AM »

SO basically

a user requests an answer from the eight ball by going to facebooks url.

facebooks server requests 1-3 answers from my app(called the canvas url)....
 (i have no way of knowing)

my app returns three seperate pages for the facebook servers

then facebook picks one of those 1-3 answers to show the user..

the puzzle is, how to log which user the answer got since 2 of the 3 requests
from the facebook platform are bunk .... any ideas?
Logged

When I was your age we used to walk to the TV to change the channel....  _̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡
Phaėton
Lifer
*****
Offline Offline

Posts: 555


⎝⏠⏝⏠⎠


View Profile
« Reply #10 on: December 09, 2010, 11:43:11 AM »

so how to track the answer seen by the user apart from the identical requests from
facebook drones is the puzzle... i suppose i could ajax back a javascript parse of the dom
and pray that everyone who uses my page has enough java on their device to log
back an answer received, client side... but aside from a javascript returned to parse its
own html and post to a server the answer received can you think of any other way to
seperate the answer actually seen?

if u want i can pm you the url of the facebook app that is doing the multiple requesting of my
canvas url and randomly deciding which answer the device sees...


* howtotrackanswergiven.PNG (28.45 KB, 857x557 - viewed 207 times.)
Logged

When I was your age we used to walk to the TV to change the channel....  _̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!