Jump to content

paymentstv

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

paymentstv's Achievements

Member

Member (2/5)

0

Reputation

  1. Hello All, I have two php files original.php and return.php retrun.php file returns a variable after I pass $channel_name to it return $return_variable; I want to assign this return variable to a variable in original.php Something like this $results = include ('return.php?channel='.$channel_name.''); I am not sure how to do the above code. When I call the return.php from a browser it works properly. Thanks for any help
  2. $playerWidth etc is defined by the embedder who want to embed my php file (size is customizable). The thing that is killing my income is people put things like %22 to override my ad display.
  3. I think this may work. however, as you can see, the %22 is not assigned to any variable while it is fed to my embed.php file Is it still possible to check the URL and discard it?
  4. Yes when I check the generated source from his hack I see my embed.php code is altered. <div style="position:absolute;width:600px;px; height:400px;top:-400px;-\"px; top:0px; left:0px; right:0px; bottom:0px; z-index:1000; vertical-align:middle; opacity:0.9;filter:alpha(opacity=90); background-color:#ffffff; overflow:hidden;" align="center" id="adsdiv"> <table align="center" height="400px;top:-400px;-\"" width="90%" cellpadding="0" cellspacing="0" border="0"> <tr> <td align="center" valign="middle"> <script type="text/javascript" language="javascript" src="http://cdn.adk2.com/agdhZGsyd2Vicg8LEgdOZXR3b3JrGKOQBQw/player.js?a=agdhZGsyd2VichILEglBZmZpbGlhdGUY6umGAQw&w=300&h=250"></script></td> </tr> </table> </div> I am not sure how to check for the %22 value in the feed URL
  5. Hello All, I am really in need of help because my monetization is hijacked by someone else. Currently I have the following code on embed.php file that I want others to embed on their site. I then display an ad on this embed.php file <div style="position:absolute;width:<?=$playerWidth?>px; height:<?=$playerheight?>px; top:0px; left:0px; right:0px; z-index:1000; vertical-align:middle; opacity:0.9;filter:alpha(opacity=90); background-color:#ffffff; overflow:hidden;" align="center" id="adsdiv"> <table align="center" height="<?=$playerheight?>" width="90%" cellpadding="0" cellspacing="0" border="0"> <tr> <td align="center" valign="middle"> <?=$videobanner?></td> </tr> </table> </div> However, someone is able to override the above ad in the following manner <iframe src="mysite.com/embed.php?fileid=13130590312747&vw=600px;&vh=400px;top:-400px;-%22" frameborder="0" scrolling="no" width="600" frameborder="0" height="400"></iframe> When he has the -%22 in above code my ad is not displayed. Is there any code that I can place on my embed.php to null this effect? I only wants others to feed my embed.php with the following parameters fileid, vw, vh I want to discard anything else that they feed my page. Really appreciate any help regarding this. Thank you
  6. Hello Again to all the JavaScript pros. I've been moved here from php! I have the following code and I want to make sure the [var privateurl] only contains comma separated host list Originally when clients submit privateurl it would be a list with full urls and white space i.e http://www.phpfreaks.com, domain.com/index.php, sub3.domain2.com, site3.com I want the list to be phpfreaks.com,domain.com,sub3.domain2.com,site3.com so that no white spaces and only host values of urls are sent to database. var channelname = document.getElementById( "channelname" ).value ; var sitename = document.getElementById( "sitename" ).value ; //sending private url example.com or null var privateurl = document.getElementById( "privateurl" ).value ; //?sending privateURL check 1 or 0? var privateurlcheck = document.getElementById( "privateurlcheck" ) ; //no value with nothing , checked always 0, with value it is 0 //sending new values if (privateurlcheck.checked == true) { var privateurlcheck = 1; // do something } else { var privateurlcheck = 0;} $vars = array_map('getHost', explode(',', $privateurl)); http.open('get', "ajax/createchannel.php?channel=" + channelname + "&sitename=" + sitename + "&privateurl=" + privateurl + "&privateurlcheck=" + privateurlcheck); http.onreadystatechange = handleProcessResponse; http.send(null); } I have found teh following code function getHostname(str) { var re = new RegExp('^(?:f|ht)tp(?:s)?\://([^/]+)', 'im'); return str.match(re)[1].toString(); } but was told it will only get ride of http, https, ftp Can some one please help me with this?
  7. I think I have to do this using JavaScript since my script uses JavaScript before sending the list variable to database. Could some one move the thread? Sorry for the confusion.
  8. Thanks for pointing that out. I realised this and now focusing on doing this on JavaScript var list = document.getElementById( "list" ).value ; var host = getHostname(str); function getHostname(str) { var re = new RegExp('^(?:f|ht)tp(?:s)?\://([^/]+)', 'im'); return str.match(re)[1].toString(); } I think above will just get rid of ftp://, http://, and https:// prefixe but nothing more. Any ideas?
  9. Hi, Thanks for the reply and help. It was pointed out to me that var list = document.getElementById( "list" ).value ; is Javascript when I try the php code it just won't even submit the form. This is what i have so far. function startProcess() { var channelname = document.getElementById( "channelname" ).value ; var sitename = document.getElementById( "sitename" ).value ; //sending private url example.com or null var privateurl = document.getElementById( "privateurl" ).value ; //?sending privateURL check 1 or 0? var privateurlcheck = document.getElementById( "privateurlcheck" ) ; //no value with nothing , checked always 0, with value it is 0 //sending new values if (privateurlcheck.checked == true) { var privateurlcheck = 1; // do something } else { var privateurlcheck = 0;} $vars = array_map('getHost', explode(',', $privateurl)); http.open('get', "ajax/createchannel.php?channel=" + channelname + "&sitename=" + sitename + "&privateurl=" + privateurl + "&privateurlcheck=" + privateurlcheck); http.onreadystatechange = handleProcessResponse; http.send(null); } function getHost($url) { $parseUrl = parse_url(trim($url)); return trim($parseUrl[host] ? $parseUrl[host] : array_shift(explode('/', $parseUrl[path], 2))); }
  10. Hello All, I have a list of URLs submitted by users. I want to make sure: list has no White-spacing, and it contains only host values i.e site.com,subdomain.site.com,site2.com,site3.net I have the following code at the moment var list = document.getElementById( "list" ).value ; Taking out the white spaces in list $vars = array_map('trim', explode(',', $list)); is $list ok here? I am a newb and not sure the diff b/w $ and var making sure list only contains host values of the intended URLs (from php manual) function getHost($list) { $parseUrl = parse_url(trim($list)); return trim($parseUrl[host] ? $parseUrl[host] : array_shift(explode('/', $parseUrl[path], 2))); } This would only work for one address at a time, can some one help me to make it work for the whole list? Need to iterate this method through the comma separated list Appreciate all your help.
  11. Hell again, It is working when I use the following code, but there is a small issue. If an entry has a space after the comma it will not identify that entry against my $var. i.e in a list of X, Y,Z when I search for Y it returns 0 because there is a space before Y. Is there a method where I can remove any space in the $list? $vars=explode(",", $list); if(in_array($var, $vars))==0{Do this} Thanks for all the help so far, I can use it as it is but would be nice if I don't have to tell my visitors not to enter a space..etc b/c they never listen to me!
  12. else if( privateurl.search("[^A-Za-z0-9\,-.:/ ]") >= 0) solved that issue..testing the solutions now.
  13. Thanks for all the help and I got the general idea of how to go about this. However, while trying to test it I face another obstacle. At the moment I can not enter a comma seperated value into my form because I have the following code allowing me only letters, numbers, "-",".", else if( privateurl.search("[^A-Za-z0-9\-.:/ ]") >= 0) { alert("Only characters and numbers allowed for URL!.") ; document.getElementById( "privateurl" ).focus() ; return false ; privateurl is the variable I hope to store in my database as a comma separated value. Does any one know how can modify above code so that I can allow a comma?
×
×
  • 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.