Jump to content

inVINCEable

Members
  • Posts

    82
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

inVINCEable's Achievements

Member

Member (2/5)

0

Reputation

  1. I am having trouble actually translating this curl API that is not given in PHP form into one that can be used with PHP. Below is what the documentation says. curl -s "https://api.example.com/v1/users/?per_page=3" \ -X GET \ -u app-id:api-key I have tried several examples such as: $ch = curl_init('https://api.example.com/v1/users/?per_page=3'); curl_setopt($ch,CURLOPT_HTTPHEADER,array('app-id:5435435435', 'api-key:fdskajf234jfdsakfhdjkfaas')); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($ch); curl_close($ch); And: $ch = curl_init('https://api.example.com/v1/users/?per_page=3'); curl_setopt($ch,CURLOPT_HTTPHEADER,array('5435435435:fdskajf234jfdsakfhdjkfaas')); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($ch); curl_close($ch); Now what I believe is throwing me off is the "-u". When I navigate to the api URL in my browser, an authentication box comes up asking for my username and password. If I put in the app-id as the username and the api-key as the password it works. But again that is in the browser. How do I get past that with PHP? Any help is greatly appreciated.
  2. I have a flashvars attribute that looks like this: flashvars="ptk=TheStation%252Buser&enablecsi=1&iv_close_button=0&mpvid=AASqkn3jdebiFvtN&hl=en_US&autohide=3&csi_page_type=watch5ad&keywords=Timothydelaghetto%2Cmichellemartinez%2Ckatrinalynnenorman%2Ccrushin%2Cmusicvideo%2Ccalifornia%2Cloasngeles%2Cglee3d%2Cglee%2Cdance%2Cquestcrew%2Cvictorkim%2Ccrushinmusicvideo%2Ctraphik&cr=US&host_language=en&iv3_module=http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswfbin%2Fiv3_module-vflWlNhJk.swf&no_get_video_log=1&fmt_list=45%2F1280x720%2F99%2F0%2F0%2C22%2F1280x720%2F9%2F0%2F115%2C44%2F854x480%2F99%2F0%2F0%2C35%2F854x480%2F9%2F0%2F115%2C43%2F640x360%2F99%2F0%2F0%2C34%2F640x360%2F9%2F0%2F115%2C18%2F640x360%2F9%2F0%2F115%2C5%2F320x240%2F7%2F0%2F0&iv_storage_server=http%3A%2F%2Fwww.google.com%2Freviews%2Fy%2F&iv_storage_server_html5=http%3A%2F%2Fwww.withsite.com%2Fapi%2Freviews%2Fy%2F&targeting_video_doc_id=&trueview=True&theme=dark&invideo=True&ad_preroll=1&tk=cqOuEOxgM6ens8SmBgAmEkx5-0tkLzThot9cFHUc0EefOE3Ghi22sw%3D%3D&sffb=True&ad_channel_code_instream=afv_instream%2Cafv_instream_shortform%2Cafv_instream_shortform_Entertainment%2Cafv_instream_us%2Cafv_user_timothydelaghetto2%2Cytps_default%2Cytel_detailpage%2Cyt_mpvid_AASqkn3jdebiFvtN%2Cyt_cid_12045&sdetail=f%3Atopvideos_entertainment%2Cp%3A%2F&cafe_experiment_id=&sourceid=y&timestamp=1313446060&iv_load_policy=1&ad_host=ca-host-pub-4184977541492624&ad_eurl=http%3A%2F%2Fwww.withsite.com%2Fvideo%2Fry_C69Pdc38&showpopout=1&mpu=True&url_encoded_fmt_stream_map=url%3Dhttp%253A%252F%252Fo-o.preferred.iad09s05.v12.lscache4.c.withsite.com%252Fvideoplayback%253Fsparams%253Did%25252Cexpire%25252Cip%25252Cipbits%25252Citag%25252Cratebypass%25252Coc%25253AU0hQSFRSTl9FSkNOMF9MTFJJ%2526itag%253D45%2526ip%253D0.0.0.0%2526signature%253DC50303682A174068058DF12246AF3AADECA8F611.4239F165E34E482B59AE1A42EAF79C41D1F9DE0B%2526sver%253D3%2526ratebypass%253Dyes%2526expire%253D1313470800%2526key%253Dyt1%2526ipbits%253D0%2526id%253Daf2fc2ebd3dd737f%26quality%3Dhd720%26fallback_host%3Dtc.v12.cache4.c.withsite.com%26type%3Dvideo%252Fwebm%253B%2Bcodecs%253D%2522vp8.0%252C%2Bvorbis%2522%26itag%3D45%2Curl%3Dhttp%253A%252F%252Fo-o.preferred.iad09s05.v2.lscache4.c.withsite.com%252Fvideoplayback%253Fsparams%253Did%25252Cexpire%25252Cip%25252Cipbits%25252Citag%25252Cratebypass%25252Coc%25253AU0hQSFRSTl9FSkNOMF9MTFJJ%2526itag%253D22%2526ip%253D0.0.0.0%2526signature%253DB1E13484F0A5F0F9DF54A187EEC47C121A2028B8.0FA094E0C0D283829002A38E2E43CA5FD44214EB%2526sver%253D3%2526ratebypass%253Dyes%2526expire%253D1313470800%2526key%253Dyt1%2526ipbits%253D0%2526id%253Daf2fc2ebd3dd737f%26quality%3Dhd720%26fallback_host%3Dtc.v2.cache4.c.withsite.com%26type%3Dvideo%252Fmp4%253B%2Bcodecs%253D%2522avc1.64001F%252C%2Bmp4a.40.2%2522%26itag%3D22%2Curl%3Dhttp%253A%252F%252Fo-o.preferred.iad09s05.v15.lscache7.c.withsite.com%252Fvideoplayback%253Fsparams%253Did%25252Cexpire%25252Cip%25252Cipbits%25252Citag%25252Cratebypass%25252Coc%25253AU0hQSFRSTl9FSkNOMF9MTFJJ%2526itag%253D44%2526ip%253D0.0.0.0%2526signature%253DBAB422646BDC975891CD16A98884E77EA894C2EE.1525AEA36DECD9C990EE5EC882556AA464938EC0%2526sver%253D3%2526ratebypass%253Dyes%2526expire%253D1313470800%2526key%253Dyt1%2526ipbits%253D0%2526id%253Daf2fc2ebd3dd737f%26quality%3Dlarge%26fallback_host%3Dtc.v15.cache7.c.withsite.com%26type%3Dvideo%252Fwebm%253B%2Bcodecs%253D%2522vp8.0%252C%2Bvorbis%2522%26itag%3D44%2Curl%3Dhttp%253A%252F%252Fo-o.preferred.iad09s05.v24.lscache5.c.withsite.com%252Fvideoplayback%253Fsparams%253Did%25252Cexpire%25252Cip%25252Cipbits%25252Citag%25252Calgorithm%25252Cburst%25252Cfactor%25252Coc%25253AU0hQSFRSTl9FSkNOMF9MTFJJ%2526algorithm%253Dthrottle-factor%2526itag%253D35%2526ip%253D0.0.0.0%2526burst%253D40%2526sver%253D3%2526signature%253D43A3196174EF169FE09ECD5AEDDFF62CE4B5E761.6BD00C66230185FEE1C65CCE36F63068CFBAF28E%2526expire%253D1313470800%2526key%253Dyt1%2526ipbits%253D0%2526factor%253D1.25%2526id%253Daf2fc2ebd3dd737f%26quality%3Dlarge%26fallback_host%3Dtc.v24.cache5.c.withsite.com%26type%3Dvideo%252Fx-flv%26itag%3D35%2Curl%3Dhttp%253A%252F%252Fo-o.preferred.iad09s05.v8.lscache2.c.withsite.com%252Fvideoplayback%253Fsparams%253Did%25252Cexpire%25252Cip%25252Cipbits%25252Citag%25252Cratebypass%25252Coc%25253AU0hQSFRSTl9FSkNOMF9MTFJJ%2526itag%253D43%2526ip%253D0.0.0.0%2526signature%253DB0E381AF649D79C4E5B4B4E1782CD2A4669E435F.5597144C164373D1692EF2C4F75189452970921A%2526sver%253D3%2526ratebypass%253Dyes%2526expire%253D1313470800%2526key%253Dyt1%2526ipbits%253D0%2526id%253Daf2fc2ebd3dd737f%26quality%3Dmedium%26fallback_host%3Dtc.v8.cache2.c.withsite.com%26type%3Dvideo%252Fwebm%253B%2Bcodecs%253D%2522vp8.0%252C%2Bvorbis%2522%26itag%3D43%2Curl%3Dhttp%253A%252F%252Fo-o.preferred.iad09s05.v20.lscache7.c.withsite.com%252Fvideoplayback%253Fsparams%253Did%25252Cexpire%25252Cip%25252Cipbits%25252Citag%25252Calgorithm%25252Cburst%25252Cfactor%25252Coc%25253AU0hQSFRSTl9FSkNOMF9MTFJJ%2526algorithm%253Dthrottle-factor%2526itag%253D34%2526ip%253D0.0.0.0%2526burst%253D40%2526sver%253D3%2526signature%253D0EE595AED7E02D9258F797A9C65A4D32E8335D61.A388AAEC2E5A2015827D940BCEE010A299D08516%2526expire%253D1313470800%2526key%253Dyt1%2526ipbits%253D0%2526factor%253D1.25%2526id%253Daf2fc2ebd3dd737f%26quality%3Dmedium%26fallback_host%3Dtc.v20.cache7.c.withsite.com%26type%3Dvideo%252Fx-flv%26itag%3D34%2Curl%3Dhttp%253A%252F%252Fo-o.preferred.iad09s05.v19.lscache2.c.withsite.com%252Fvideoplayback%253Fsparams%253Did%25252Cexpire%25252Cip%25252Cipbits%25252Citag%25252Cratebypass%25252Coc%25253AU0hQSFRSTl9FSkNOMF9MTFJJ%2526itag%253D18%2526ip%253D0.0.0.0%2526signature%253D9BD9CD417FDB8B503CE349EBD9A58ECAEEAC4FC3.3F8943149DDC236B1EE3865510CB4736D6B89C10%2526sver%253D3%2526ratebypass%253Dyes%2526expire%253D1313470800%2526key%253Dyt1%2526ipbits%253D0%2526id%253Daf2fc2ebd3dd737f%26quality%3Dmedium%26fallback_host%3Dtc.v19.cache2.c.withsite.com%26type%3Dvideo%252Fmp4%253B%2Bcodecs%253D%2522avc1.42001E%252C%2Bmp4a.40.2%2522%26itag%3D18%2Curl%3Dhttp%253A%252F%252Fo-o.preferred.iad09s05.v9.lscache8.c.withsite.com%252Fvideoplayback%253Fsparams%253Did%25252Cexpire%25252Cip%25252Cipbits%25252Citag%25252Calgorithm%25252Cburst%25252Cfactor%25252Coc%25253AU0hQSFRSTl9FSkNOMF9MTFJJ%2526algorithm%253Dthrottle-factor%2526itag%253D5%2526ip%253D0.0.0.0%2526burst%253D40%2526sver%253D3%2526signature%253D540D699832D9E30FD784211A3F654378EE709AB9.443A2FE0A3F46FB6582D8AFBB820EF42749C9026%2526expire%253D1313470800%2526key%253Dyt1%2526ipbits%253D0%2526factor%253D1.25%2526id%253Daf2fc2ebd3dd737f%26quality%3Dsmall%26fallback_host%3Dtc.v9.cache8.c.withsite.com%26type%3Dvideo%252Fx-flv%26itag%3D5&iv_module=http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswfbin%2Fiv_module-vflSaNpR_.swf&iv_logging_level=3&ad_flags=0&endscreen_module=http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswfbin%2Fendscreen-vflQSpCcW.swf&cid=12045&referrer=http%3A%2F%2Fwww.withsite.com%2F&afv_instream_max=15000&ad_logging_flag=1&t=vjVQa1PpcFMEtQtHQ50gzWe1VF673iDVVx4yQFUGImQ%3D&instream=True&aftv=True&shortform=True&creator=TimothyDeLaGhetto2&allow_embed=1&ad_host_tier=13120&rvs=view_count%3D1130379%26author%3DTimothyDeLaGhetto2%26length_seconds%3D103%26id%3D8vtyPI1IW08%26title%3DNicki%2BMinaj%2BWardrobe%2BMalfunction%2BOn%2BGood%2BMorning%2BAmerica%2521%2Cview_count%3D440767%26author%3DTimothyDeLaGhetto2%26length_seconds%3D387%26id%3DwaPVDRoF7qk%26title%3DDating%2BTips%253A%2BThe%2BFirst%2BDate-%2BGIRLS%252C%2BDON%2527T%2BWATCH%2521%2Cview_count%3D1003471%26author%3DTimothyDeLaGhetto2%26length_seconds%3D243%26id%3DeL4ZkKk41U4%26title%3DSelena%2Band%2BJustin%2BBroke%2BUp%253F%2521%2BYES%2521%2521%2521%2Cview_count%3D788671%26author%3DTimothyDeLaGhetto2%26length_seconds%3D173%26id%3DZjSopneFT1w%26title%3DNo%2BHomo%2Bis%2BGay%2Cview_count%3D84026%26author%3DTraPhikMusik%26length_seconds%3D200%26id%3DyDvzq1qcgCY%26title%3DCrushin-%2BMichelle%2BMartinez%2Bfeat.%2BTraphik%2Cview_count%3D3003%26author%3DKatrinaLynneNorman%26length_seconds%3D224%26id%3Dy5HjkslzBPI%26title%3DKatrina%2527s%2BCorner%2B%25233%2B%2528Q%2B%2526%2BA%2529%2Cview_count%3D659%26author%3DDanceWithUsTV%26length_seconds%3D127%26id%3Dp-zxFxHiamg%26title%3DChris%2BBrown%2Bft.%2BJustin%2BBieber%2B-%2BLadies%2BLove%2BMe%2B%2528DANCE%2529%2Cview_count%3D32110%26author%3DMM2786%26length_seconds%3D167%26id%3D02IMYFEhY5o%26title%3DBow%2BChicka%2BWow%2BWow%2Bby%2BMike%2BPosner%2BREMIX%252FCOVER%2B-%2BMichelle%2BMartinez%2BFREE%2BDOWNLOAD%2Cview_count%3D10991%26author%3DMM2786%26length_seconds%3D272%26id%3DBmFgf8UH9E0%26title%3DCrushin%2BMusic%2BVideo%2B-%2BMichelle%2BMartinez%2Bft.%2BTraphik&vq=auto&iv_enabled_features=TCS&ad3_module=http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswfbin%2Fad3-vflUgNhz5.swf&gut_tag=%2F4061%2Fytpwatch%2Fmain_12045&ptchn=TimothyDeLaGhetto2&as_launched_in_country=1&length_seconds=272&feature=topvideos_entertainment&enablejsapi=1&plid=AASqkn3hipa2q84E&tmi=1&afv=True&ad_tag=http%3A%2F%2Fad-g.doubleclick.net%2Fpfadx%2Fcom.ytpwatch.entertainment%2Fmain_12045%3Bsz%3DWIDTHxHEIGHT%3Bmpvid%3DAASqkn3jdebiFvtN%3B%21c%3D12045%3Bytps%3Ddefault%3Bklg%3Den%3Bkvid%3Dry_C69Pdc38%3Bkpu%3DTimothyDeLaGhetto2%3Bkr%3DF%3Bkt%3DK%3Bko%3Dp%3Bkbz%3D1%3Bkpid%3D12045%3Bkga%3D-1%3Bytvt%3Dw%3Bafct%3Dsite_content%3Bkgg%3D-1%3Bkcr%3Dus%3Bu%3Dry_C69Pdc38%7C12045%3Bafv%3D1%3Bkhd%3D1%3Bdc_dedup%3D1%3Bshortform%3D1%3B&ad_video_pub_id=ca-pub-6219811747049371&ad_slots=0&watermark=http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Flogo-vfl_bP6ud.swf%2Chttp%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Fhdlogo-vfloR6wva.swf&oid=6iPyFcBDxPU&ad_channel_code_overlay=invideo_overlay_480x70_cat24%2Cafv_overlay%2Cafv_overlay_us_1%2Cafv_user_timothydelaghetto2%2Cytps_default%2Cytel_detailpage%2Cyt_mpvid_AASqkn3jdebiFvtN%2Cyt_cid_12045&pyv_in_related_cafe_experiment_id=&video_id=ry_C69Pdc38&dclk=True&sk=zL0zeV1YSbz_sRi_rcoPhEaNIaWG9Q_fC" I want to be able to pull all of the URLs out of that. Is there something with PHP that can help me traverse through the different variables that are set? Thanks
  3. I have a fairly complicated set of flash vars in my HTML meaning it is a few thousand characters. I was just wondering if there is a PHP Library or some function that can break down the different variables automatically. I know I could do some regex but that could get complicated very quickly, I was just wondering if there was an easier way to go about it, thanks!
  4. Hey guys, So i just completed a script I want to sell, but I don't want the activation part able to be viewed to prevent pirated copies of my script floating around. Anyways, I have decided I need to purchse something like ioncube, but the problem is with that, doesn't my client then have to install ioncube on their server? I want something easy that will not change a thing (.i.e they just install the script as normal). Any tips ? I know it isn't possible to create something 100% foolproof, I just want something that will slow most of the bad guys out there. Thanks!
  5. Sorry, I didn't mean to say it is a DB insert, it just logs the info in a file. Here is the info: Here is the php: <?php //lets log visitor information $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; $query = isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : ''; $request_method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : ''; $host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ''; $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; $remote_host = isset($_SERVER['REMOTE_HOST']) ? $_SERVER['REMOTE_HOST'] : ''; $remote_port = isset($_SERVER['REMOTE_PORT']) ? $_SERVER['REMOTE_PORT'] : ''; $request_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ''; $agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; if(file_exists("info.txt")){ $file = fopen("info.txt", "a"); $info = "Referer: " . $referer . "\n\n"; $info .= "Query: " . $query . "\n\n"; $info .= "Request Method: " . $request_method . "\n\n"; $info .= "Host: " . $host . "\n\n"; $info .= "IP: " . $ip . "\n\n"; $info .= "Remote Host: " . $remote_host . "\n\n"; $info .= "Remote Port: " . $remote_port . "\n\n"; $info .= "Request URL: " . $request_uri . "\n\n"; $info .= "Agent: " . $agent . "\n\n"; $info .= "-----------------------------------------"; fwrite($file, $info); } else { $file = fopen("info.txt", "w"); $info = "Referer: " . $referer . "\n\n"; $info .= "Query: " . $query . "\n\n"; $info .= "Request Method: " . $request_method . "\n\n"; $info .= "Host: " . $host . "\n\n"; $info .= "IP: " . $ip . "\n\n"; $info .= "Remote Host: " . $remote_host . "\n\n"; $info .= "Remote Port: " . $remote_port . "\n\n"; $info .= "Request URL: " . $request_url . "\n\n"; $info .= "Agent: " . $agent . "\n\n"; $info .= "-----------------------------------------"; fwrite($file, $info); } ?> And here is the HTML file in its entirety: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Get My Email Guide</title> </head> <body> <?php //lets log visitor information $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; $query = isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : ''; $request_method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : ''; $host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ''; $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; $remote_host = isset($_SERVER['REMOTE_HOST']) ? $_SERVER['REMOTE_HOST'] : ''; $remote_port = isset($_SERVER['REMOTE_PORT']) ? $_SERVER['REMOTE_PORT'] : ''; $request_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ''; $agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; if(file_exists("info.txt")){ $file = fopen("info.txt", "a"); $info = "Referer: " . $referer . "\n\n"; $info .= "Query: " . $query . "\n\n"; $info .= "Request Method: " . $request_method . "\n\n"; $info .= "Host: " . $host . "\n\n"; $info .= "IP: " . $ip . "\n\n"; $info .= "Remote Host: " . $remote_host . "\n\n"; $info .= "Remote Port: " . $remote_port . "\n\n"; $info .= "Request URL: " . $request_uri . "\n\n"; $info .= "Agent: " . $agent . "\n\n"; $info .= "-----------------------------------------"; fwrite($file, $info); } else { $file = fopen("info.txt", "w"); $info = "Referer: " . $referer . "\n\n"; $info .= "Query: " . $query . "\n\n"; $info .= "Request Method: " . $request_method . "\n\n"; $info .= "Host: " . $host . "\n\n"; $info .= "IP: " . $ip . "\n\n"; $info .= "Remote Host: " . $remote_host . "\n\n"; $info .= "Remote Port: " . $remote_port . "\n\n"; $info .= "Request URL: " . $request_url . "\n\n"; $info .= "Agent: " . $agent . "\n\n"; $info .= "-----------------------------------------"; fwrite($file, $info); } ?> <center>*Are You Looking to Go Ahead and Get My Email Guide? </center> <br /> <br /> <br /> <center> <ul> <li>Make Thousands Monthly</li> <li>Do All Kinds of Things You Couldn't Before</li> <li>Get Whatever Car You Want!</li> <li>If you said yes then click the link below!</li> </ul> </center> <center> <a href="http://www.tracklead.net/click.track?CID=107578&AFID=112392&ADID=241750&SID=fb"> Rags to Riches Story Here! </a> </center> </body> </html>
  6. I am checking referrers on a particular site, let's say domain.com/campaigns/2/ is where I am pointing them to. In there I have an index.php file that records the referrer as well as the request URL. Sometimes it is recorded correctly, such as "/campaigns/2/" and other times it comes up null. Either way they are hitting the file there, so what is the explanation as to why it would come up null? Thanks!
  7. Ok, so below is my code, everything seemed to work fine until at the VERY bottom of the code I added this: $file = fopen("text.txt", "r"); $ec = fgets($file); $email_collect = $ec; Right above the header() functions I was using. Now I thought fopen does not send any info to the browser? Is there a way around this? Below is my code, when I remove what I just posted above everything works just fine and the header() functions work as they are supposed to, it is just when I literally added these three lines everything went to hell. Thanks for any suggestions! <? ob_start(); #only allow numeric t202ids if(isset($_POST['lpip'])){ $lpip = $_POST['lpip']; } elseif(isset($_GET['lpip'])){ $lpip = $_GET['lpip']; } if(isset($_POST['email'])){ $email_collect = "&email=".$_POST['email']; } else { $email_collect = null; } if(isset($_POST['pwk'])){ $pwk = $_POST['pwk']; } else { $pwk = $_POST['pwk'] = null; } if (!is_numeric($lpip)) die(); #cached redirects stored here: $myFile = "cached/lp-cached.csv"; # check to see if mysql connection works, if not fail over to cached .CSV stored redirect urls include_once($_SERVER['DOCUMENT_ROOT'] . '/202-config.php'); $dbconnect = @mysql_connect($dbhost,$dbuser,$dbpass); if (!$dbconnect) $usedCachedRedirect = true; if (!$usedCachedRedirect) $dbselect = @mysql_select_db($dbname); if (!$dbselect) $usedCachedRedirect = true; #the mysql server is down, use the txt cached redirect if ($usedCachedRedirect) { $handle = @fopen($myFile, 'r'); while ($row = @fgetcsv($handle, 100000, ",")) { //if a cached key is found for this t202id, redirect to that url if ($row[0] == $lpip) { header('location: '. $row[1]); die(); } } @fclose($handle); die("<h2>Error establishing a database connection - please contact the webhost</h2>"); } include_once($_SERVER['DOCUMENT_ROOT'] . '/202-config/connect.php'); $mysql['landing_page_id_public'] = mysql_real_escape_string($lpip); $tracker_sql = "SELECT 202_landing_pages.user_id, 202_landing_pages.landing_page_id, 202_landing_pages.landing_page_id_public, 202_landing_pages.aff_campaign_id, 202_aff_campaigns.aff_campaign_rotate, 202_aff_campaigns.aff_campaign_url, 202_aff_campaigns.aff_campaign_url_2, 202_aff_campaigns.aff_campaign_url_3, 202_aff_campaigns.aff_campaign_url_4, 202_aff_campaigns.aff_campaign_url_5, 202_aff_campaigns.aff_campaign_payout, 202_aff_campaigns.aff_campaign_cloaking FROM 202_landing_pages, 202_aff_campaigns WHERE 202_landing_pages.landing_page_id_public='".$mysql['landing_page_id_public']."' AND 202_aff_campaigns.aff_campaign_id = 202_landing_pages.aff_campaign_id"; $tracker_row = memcache_mysql_fetch_assoc($tracker_sql); if (!$tracker_row) { die(); } if ( is_writable(dirname(__FILE__) . '/cached' )) { #if the file does not exist create it if (!file_exists($myFile)) { $handle = @fopen($myFile, 'w'); @fclose($handle); } # now save this link to the $handle = @fopen($myFile, 'r'); $writeNewIndex = true; while (($row = @fgetcsv($handle, 100000, ",")) and ($writeNewIndex == true)) { if ($row[0] == $lpip) $writeNewIndex = false; } @fclose($handle); if ($writeNewIndex) { //write this index to the txt file $newLine = "$lpip, {$tracker_row['aff_campaign_url']} \n"; $newHandle = @fopen($myFile, 'a+'); @fwrite($newHandle, $newLine); @fclose($newHandle); } } //grab the GET variables from the LANDING PAGE $landing_page_site_url_address_parsed = parse_url($_SERVER['HTTP_REFERER']); parse_str($landing_page_site_url_address_parsed['query'], $_GET); if ($_GET['t202id']) { //grab tracker data if avaliable $mysql['tracker_id_public'] = mysql_real_escape_string($_GET['t202id']); $tracker_sql2 = "SELECT text_ad_id, ppc_account_id, click_cpc, click_cloaking FROM 202_trackers WHERE tracker_id_public='".$mysql['tracker_id_public']."'"; $tracker_row2 = memcache_mysql_fetch_assoc($tracker_sql2); if ($tracker_row2) { $tracker_row = array_merge($tracker_row,$tracker_row2); } } //INSERT THIS CLICK BELOW, if this click doesn't already exisit //get mysql variables $mysql['user_id'] = mysql_real_escape_string($tracker_row['user_id']); $mysql['aff_campaign_id'] = mysql_real_escape_string($tracker_row['aff_campaign_id']); $mysql['ppc_account_id'] = mysql_real_escape_string($tracker_row['ppc_account_id']); $mysql['click_cpc'] = mysql_real_escape_string($tracker_row['click_cpc']); $mysql['click_payout'] = mysql_real_escape_string($tracker_row['aff_campaign_payout']); $mysql['click_time'] = time(); $mysql['landing_page_id'] = mysql_real_escape_string($tracker_row['landing_page_id']); $mysql['text_ad_id'] = mysql_real_escape_string($tracker_row['text_ad_id']); /* if ($_GET['OVRAW']) { //if this is a Y! keyword $keyword = mysql_real_escape_string($_GET['OVRAW']); } else { $keyword = mysql_real_escape_string($_GET['t202kw']); } $keyword = str_replace('%20',' ',$keyword); $keyword_id = INDEXES::get_keyword_id($keyword); $mysql['keyword_id'] = mysql_real_escape_string($keyword_id); $ip_id = INDEXES::get_ip_id($_SERVER['REMOTE_ADDR']); $mysql['ip_id'] = mysql_real_escape_string($ip_id); $platform_id = INDEXES::get_platform_id(); $mysql['platform_id'] = mysql_real_escape_string($platform_id); $browser_id = INDEXES::get_browser_id(); $mysql['browser_id'] = mysql_real_escape_string($browser_id); $mysql['click_in'] = 0; $mysql['click_out'] = 1; */ /* //this script is going to detect if this click was already recorded by the javascript $mysql['test_time'] = time() - 60*10; //10 minutes $click_sql = "SELECT click_id, click_cloaking, click_cloaking_site_url_id, click_redirect_site_url_id FROM ((clicks LEFT JOIN clicks_record USING (click_id)) LEFT JOIN clicks_advance USING (click_id)) LEFT JOIN clicks_site USING (click_id) WHERE clicks.click_time >= ".$mysql['test_time'] ." AND clicks.user_id = ".$mysql['user_id'] ." AND clicks.aff_campaign_id = '".$mysql['aff_campaign_id']."' AND clicks.ppc_account_id = '".$mysql['ppc_account_id']."' AND clicks.click_cpc = '".$mysql['click_cpc']."' AND clicks.click_payout = '".$mysql['click_payout']."' AND clicks_advance.landing_page_id = '".$mysql['landing_page_id']."' AND clicks_advance.text_ad_id = '".$mysql['text_ad_id']."' AND clicks_advance.keyword_id = '".$mysql['keyword_id']."' AND clicks_advance.ip_id = '".$mysql['ip_id']."' AND clicks_advance.platform_id = '".$mysql['platform_id']."' AND clicks_advance.browser_id = '".$mysql['browser_id']."' AND clicks_record.click_in = 1 AND clicks_record.click_out = 0 ORDER BY click_id DESC"; $click_result = mysql_query($click_sql) or record_mysql_error($click_sql); //now update the old click if the click was detected, and die. if (mysql_num_rows($click_result) > 0) { $click_row = mysql_fetch_assoc($click_result); $mysql['click_id'] = mysql_real_escape_string($click_row['click_id']); $click_sql = "UPDATE clicks_record SET click_out='".$mysql['click_out']."' WHERE click_id='".$mysql['click_id']."'"; $click_result = mysql_query($click_sql) or record_mysql_error($click_sql); //see if cloaking was turned on if ($click_row['click_cloaking'] == 1) { $cloaking_on = true; $mysql['site_url_id'] = mysql_real_escape_string($click_row['click_cloaking_site_url_id']); $site_url_sql = "SELECT site_url_address FROM site_urls WHERE site_url_id='".$mysql['site_url_id']."'"; $site_url_result = mysql_query($site_url_sql) or record_mysql_error($site_url_sql); $site_url_row = mysql_fetch_assoc($site_url_result); $cloaking_site_url = $site_url_row['site_url_address']; } else { $cloaking_on = false; $mysql['site_url_id'] = mysql_real_escape_string($click_row['click_redirect_site_url_id']); $site_url_sql = "SELECT site_url_address FROM site_urls WHERE site_url_id='".$mysql['site_url_id']."'"; $site_url_result = mysql_query($site_url_sql) or record_mysql_error($site_url_sql); $site_url_row = mysql_fetch_assoc($site_url_result); $redirect_site_url = $site_url_row['site_url_address']; } //now we've updated, lets redirect if ($cloaking_on == true) { //if cloaked, redirect them to the cloaked site. header ('location: '.$cloaking_site_url); } else { header ('location: '.$redirect_site_url); } //die this script, we've updated the old click die(); } */ /* //ok we have the main data, now insert this row $click_sql = "INSERT INTO clicks SET user_id=".$mysql['user_id'].", aff_campaign_id = '".$mysql['aff_campaign_id']."', ppc_account_id = '".$mysql['ppc_account_id']."', click_cpc = '".$mysql['click_cpc']."', click_payout = '".$mysql['click_payout']."', click_time = '".$mysql['click_time']."'"; $click_result = mysql_query($click_sql) or record_mysql_error($click_sql); //now gather the info for the advance click insert $click_id = mysql_insert_id(); $new_click = $click_id; $mysql['click_id'] = mysql_real_escape_string($click_id); //now we have the click's advance data, now insert this row $click_sql = "INSERT INTO clicks_advance SET click_id='".$mysql['click_id']."', landing_page_id='".$mysql['landing_page_id']."', text_ad_id='".$mysql['text_ad_id']."', keyword_id='".$mysql['keyword_id']."', ip_id='".$mysql['ip_id']."', platform_id='".$mysql['platform_id']."', browser_id='".$mysql['browser_id']."'"; $click_result = mysql_query($click_sql) or record_mysql_error($click_sql); */ //now gather variables for the clicks record db //lets determine if cloaking is on if (($tracker_row['click_cloaking'] == 1) or //if tracker has overrided cloaking on (($tracker_row['click_cloaking'] == -1) and ($tracker_row['aff_campaign_cloaking'] == 1)) or ((!isset($tracker_row['click_cloaking'])) and ($tracker_row['aff_campaign_cloaking'] == 1)) //if no tracker but but by default campaign has cloaking on ) { $cloaking_on = true; $mysql['click_cloaking'] = 1; //if cloaking is on, add in a click_id_public, because we will be forwarding them to a cloaked /cl/xxxx link $click_id_public = rand(1,9) . $click_id . rand(1,9); $mysql['click_id_public'] = mysql_real_escape_string($click_id_public); } else { $mysql['click_cloaking'] = 0; } /* //ok we have our click recorded table, now lets insert theses $click_sql = "INSERT INTO clicks_record SET click_id='".$mysql['click_id']."', click_id_public='".$mysql['click_id_public']."', click_cloaking='".$mysql['click_cloaking']."', click_in='".$mysql['click_in']."', click_out='".$mysql['click_out']."'"; $click_result = mysql_query($click_sql) or record_mysql_error($click_sql); //now lets get variables for clicks site $click_landing_site_url_id = INDEXES::get_site_url_id($_SERVER['HTTP_REFERER']); $mysql['click_landing_site_url_id'] = mysql_real_escape_string($click_landing_site_url_id); $outbound_site_url = 'http://'.$_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; $click_outbound_site_url_id = INDEXES::get_site_url_id($outbound_site_url); $mysql['click_outbound_site_url_id'] = mysql_real_escape_string($click_outbound_site_url_id); */ if ($cloaking_on == true) { $cloaking_site_url = 'http://'.$_SERVER['SERVER_NAME'] . '/tracking202/redirect/lpc.php?lpip=' . $tracker_row['landing_page_id_public']; $click_cloaking_site_url_id = INDEXES::get_site_url_id($cloaking_site_url); $mysql['click_cloaking_site_url_id'] = mysql_real_escape_string($click_cloaking_site_url_id); } $url = rotateTrackerUrl($tracker_row); $redirect_site_url = $url . $click_id; $click_redirect_site_url_id = INDEXES::get_site_url_id($redirect_site_url); $mysql['click_redirect_site_url_id'] = mysql_real_escape_string($click_redirect_site_url_id); /* //insert this $click_sql = "INSERT INTO clicks_site SET click_id='".$mysql['click_id']."', click_landing_site_url_id='".$mysql['click_landing_site_url_id']."', click_outbound_site_url_id='".$mysql['click_outbound_site_url_id']."', click_cloaking_site_url_id='".$mysql['click_cloaking_site_url_id']."', click_redirect_site_url_id='".$mysql['click_redirect_site_url_id']."'"; $click_result = mysql_query($click_sql) or record_mysql_error($click_sql); //before we finish filter this click $ip_address = $_SERVER['REMOTE_ADDR']; $user_id = $tracker_row['user_id']; FILTER::startFilter($click_id,$ip_id,$ip_address,$user_id); */ //now we've recorded, now lets redirect them $file = fopen("text.txt", "r"); $ec = fgets($file); $email_collect = $ec; if ($cloaking_on == true) { //if cloaked, redirect them to the cloaked site. header('location: '.$cloaking_site_url.$email_collect); } else { header('location: '.$redirect_site_url.$email_collect); }
  8. $target_url = "****"; $userAgent = 'Googlebot/2.1 (http://www.googlebot.com/bot.html)'; // make the cURL request to $target_url $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); curl_setopt($ch, CURLOPT_URL,$target_url); curl_setopt($ch, CURLOPT_FAILONERROR, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_AUTOREFERER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); curl_setopt($ch, CURLOPT_TIMEOUT, 10); $html= curl_exec($ch); if (!$html) { echo " cURL error number:" .curl_errno($ch); echo " cURL error:" . curl_error($ch); exit; } // parse the html into a DOMDocument $dom = new DOMDocument(); @$dom->loadHTML($html); // grab all the on the page $xpath = new DOMXPath($dom); $xml = simplexml_import_dom($dom); $names = $xml->xpath('//textarea'); foreach($names as $name) { echo "$name<br />"; } Ok, everything works perfectly except one thing. When I view my page (here listed as *** to remain private) in the textarea element I get my words that I am scraping AND the html elements that are to be displayed (not the html elements for the page formatting, but HTML elements to actually be viewed so users can copy and paste the code). This works fine when viewing it, but when using the above code to scrape the content, only the words show, not the actual HTML elements that appear in the textarea. Is there a workaround for this? I'm assuming XPATH thinks they are elements of the actual page. Any help is GREATLY appreciated.
  9. check this out it a chart explorer of open flash chart. http://blog.webasp.com.au/2009/05/open-flash-chart-2-jormungandr-explorer/ Wait, so does that use PHP at all, or is that strictly flash?
  10. Can anyone mention a graphing library? My requirements are as follows: 1. Bar & pie charts 2. Must look VERY nice (probably flash integrated) Looks are very important. Thank you for any and all suggestions.
  11. I see, but why would the EXACT same combination of lines be coming up?
  12. Hey everyone, Ok, So I have a program that generates random paragraphs of sentences arranged in files. Each file has about 30 sentences, and I am generating a random sentence from each file. The only problem is, it does not appear to be random at all. After about 15 random paragraph generations, I get the EXACT same order as one previously generated. I must be doing something wrong because the probability of this happening is about 1:9,000,000,000,000, and it has happened two days in a row, about six times. Please take a look at this simple script and offer some advice, it would be greatly appreciated. Perhaps I am just not seeding the random number generator properly? Who knows, thanks again! <html> <head> <?php //EDIT BELOW $current_name = "Linda"; $postingemail = "linda.clark+"; $title = array_map("trim", file("title.txt")); $titlepost = $title[array_rand($title)]; $intro = array_map("trim", file("intro.txt")); $intropost = $intro[array_rand($intro)]; $token1 = array_map("trim", file("token1.txt")); $token1post = $token1[array_rand($token1)]; $token2 = array_map("trim", file("token2.txt")); $token2post = $token2[array_rand($token2)]; $token3 = array_map("trim", file("token3.txt")); $token3post = $token3[array_rand($token3)]; // //here is where we start the custom stuff that was not included // $token4 = array_map("trim", file("token4.txt")); $token4post = $token4[array_rand($token4)]; $token5 = array_map("trim", file("token5.txt")); $token5post = $token5[array_rand($token5)]; $token6 = array_map("trim", file("token6.txt")); $token6post = $token6[array_rand($token6)]; $token7 = array_map("trim", file("token7.txt")); $token7post = $token7[array_rand($token7)]; $token8 = array_map("trim", file("token8.txt")); $token8post = $token8[array_rand($token8)]; $token9 = array_map("trim", file("token9.txt")); $token9post = $token9[array_rand($token9)]; $token11 = array_map("trim", file("token11.txt")); $token11post = $token11[array_rand($token11)]; $token12 = array_map("trim", file("token12.txt")); $token12post = $token12[array_rand($token12)]; $token13 = array_map("trim", file("token13.txt")); $token13post = $token13[array_rand($token13)]; $token14 = array_map("trim", file("token14.txt")); $token14post = $token14[array_rand($token14)]; $token15 = array_map("trim", file("token15.txt")); $token15post = $token15[array_rand($token15)]; $token16 = array_map("trim", file("token16.txt")); $token16post = $token16[array_rand($token16)]; $token17 = array_map("trim", file("token17.txt")); $token17post = $token17[array_rand($token17)]; $email = array_map("trim", file("email.txt")); $emailpost = $email[array_rand($email)]; $emailpost = str_replace("%name%", $current_name, $emailpost); $price = array_map("trim", file("price.txt")); $pricepost = $price[array_rand($price)]; //EDIT ABOVE $number[]="1"; $number[]="2"; $number[]="3"; $number[]="4"; $number[]="5"; $number[]="6"; $number[]="7"; $number[]="8"; $number[]="9"; $numberpost = $number[array_rand($number)]; $numberpost1 = $number[array_rand($number)]; $numberpost2 = $number[array_rand($number)]; $numberpost3 = $number[array_rand($number)]; $numberpost4 = $number[array_rand($number)]; ?> <style> body { background-color:#000000; color:white; } </style> </head> <body> <center> <br><form><input type=button value="REFRESH" onClick="window.location.reload()"> <br> </form> <h2>CL Account </h2> <textarea name="textarea_head" id="textarea" cols="100" rows="1" onClick="this.focus(); this.select();"> <?php echo $postingemail; ?><?php echo $numberpost?><?php echo $numberpost1?><?php echo $numberpost2?><?php echo $numberpost3?><?php echo $numberpost4?>@gmail.com </textarea> <br> <h2>Ad Title </h2> <textarea name="textarea_head" id="textarea" cols="100" rows="1" onClick="this.focus(); this.select();"> <?php echo $titlepost?> </textarea> <br><br> <h2>Price </h2> <textarea name="textarea_head" id="textarea" cols="100" rows="1" onClick="this.focus(); this.select();"> <?php echo $pricepost?> </textarea> <br><br> <h2>Ad Body</h2> <textarea name="textarea_head" id="textarea" cols="100" rows="20" onClick="this.focus(); this.select();"> <?php echo $intropost?> <?php echo $token1post?> <?php echo $token2post?> <br><br> <b><?php echo $token3post?></b><br> - <?php echo $token6post?><br> - <?php echo $token7post?><br> - <?php echo $token8post?><br> - <?php echo $token9post?><br> - <?php echo $token11post?><br> - <?php echo $token12post?><br> - <?php echo $token13post?><br> - <?php echo $token14post?><br> - <?php echo $token4post?><br><br> <u><?php echo $token17post?></u><br> - <?php echo $token16post?><br> - <?php echo $token15post?><br> - <?php echo $token5post?><br> <br> <?php echo $emailpost?> </textarea> </body>
  13. I see. Well it wouldn't be like VNC or controlling a remote computer. Anyways, I really wanted a script, but I guess no one knows of any :/
  14. Hey, I wanted to set up a proxy script for a few of my co-workers to use at work (so we can log onto blocked sites like gmail and facebook). I have a webserver and was just wondering if there were any free/open source scripts like this that are readily available so I don't need to program something custom with cURL + cookie + session management. Any help/advice/direction is greatly appreciated.
×
×
  • 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.