Jump to content

paymentstv

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Everything posted by paymentstv

  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?
  14. Hello All, I want to compare a variable ($var) that I have to a database entry ($list) that is comma separated. If any of the entries in $list does not match $var, then I want to carry out some other operations. At the moment, my database entry is a single entry (not comma separated) so I just use the following to find out if it match my variable. if($list!="$var"){} Can you please help me figure out how to go about this if the database entry is a comma separated value? Thanks for any help .
  15. I have tried this but still no luck. They all seems to block my http.open('get',
  16. Thanks for the reply. I have created a .htaccess file and placed the following init <Files .htaccess> order allow,deny deny from all </Files> order allow deny deny from all allow from MY_Server_IP However, I am not able to create any channels after this so it is also denying requests by my server (dedicated IP) Any idea why would above code disable the following? http.open('get', "ajax/createchannel_1.php?channel=" + channelname + "&sitename=" + sitename + "&privateurl=" + privateurl + "&privateurlcheck=" + privateurlcheck); Thanks
  17. Hello All, I am in desperate help here since my site was DDoS attacked by some one in turkey (Ips originate mostly from turkey, Germany, and some other Europe countries). I have installed the ddos deflation and most of the IPs are now blocked. I have a php file in my server that I use to input data into my database and my streaming servers. This file is called connect.php and the hacker is basically created an automated script that repeatedly call the connect.php file from a botnet resulting in both apache and mysql dead. I use connect.php in the following way http.open('get', "ajax/createchannel_1.php?channel=" + channelname + "&sitename=" + sitename + "&privateurl=" + privateurl + "&privateurlcheck=" + privateurlcheck); How can i change the connect.php so that it only accept execution from my server/ Please your help is greatly appreciated.
  18. Hello All, I am trying to get some info from my membership script (Amember_Pro) into an iframe within a product page. Inside iframe I have the following code <?php session_start(); ?> Some HTML Code here... <?php $user = $_SESSION['_amember_user']; print "$user[member_id]"; ?> Above code is able to print the "_amember_user" ID successfully to the page but on top pf the iframe I get a session error. "Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/tb/public_html/product1/link1.php:1) in /home/tb/public_html/product1/link1.php on line 2" Does anyone know why this is happening? I have made sure that there is no space or code before <?php session_start(); ?> There is a help guide at http://manual.amember.com/AMember_Session_Variables that I used to create code above.
  19. ok my bad, this actually worked. fwrite($fp, "{$_SERVER['REMOTE_ADDR']}{$_SESSION["sess_name"]} {$dateTime}\r\n"); just had to add a space between {$_SERVER['REMOTE_ADDR']} and {$_SESSION["sess_name"]} Also i currently have $fp = fopen('ip.txt', 'a'); where ip.txt is hosted in the same folder of server What if i want to write to a file hosted in a different server ? http://domain.com/folder/ip.txt..etc would $fp = fopen('http://domain.com/folder/ip.txt', 'a'); work? tried but not writing with chmod 777 1. What would be the file permission of ip.txt? 2. Should I give same permission to the folder where ip.txt is?
  20. I have tried both methods but still get the out put like this 16.17.51.41SESSION 2011/01/23 12:53:32 There is no space between ip and session. Thanks for both for trying to help.
  21. Hello, I have the following code writting IP,session, and date to a text file (it works) but I want to add a white space after the IP address. fwrite($fp, $_SERVER['REMOTE_ADDR']. $_SESSION["sess_name"]. " $dateTime\r\n"); At the moment it prints like this 16.17.51.41SESSION_ID 2011/01/23 12:53:32 thanks in advance.
  22. When I try the local file it display the image correctly. However, second part of the image is not created $imageurl = "http://domain.com/logo/logo.php?txt=By:"; $file_2 = $imageurl.$sitename;//$sitename is a variable passed on to this logo1.php $image_2 = imagecreatefromjpeg($file_2); I create two images image_1 and image_2 and then use php to copy them to a single image. In this case only the first image (local png file) is displayed. No errors reported.
  23. tried this code <p>PHP version is: <?php echo phpversion(); ?></p> <p>Safe mode is: <?php echo ($bSafeMode) ? "On (this is usually bad)" : "Off (this is good!)"; ?></p> <?php /* * Try opening www.microsoft.com */ @$fIn = fopen("http://www.domain.com/logo/logo.php?txt=By:cn.com","r"); if ($fIn !== FALSE) { echo "<p>URL open succeeded!</p>"; fclose($fIn); } else{ echo "<p>URL open failed: $php_errormsg</p>";} $filecontent=file_get_contents('http://www.phpfreaks.com'); echo $filecontent; ?> Result: PHP version is: 5.2.14 Safe mode is: Off (this is good!) URL open succeeded! Subscribe to PHP Freaks RSS And after that I see contents of phpfreaks site.
×
×
  • 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.