Jump to content

moola

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

Everything posted by moola

  1. Hey I was just wondering if there is a way to block Cyberbuddy (look it up on google) from accessing my site and stealing my bandwith. In my stats it appears as a browser called cyberbuddy; I basically want to stop leeching from my site. Thanks
  2. Can anyone help me log into dailymotion.c o m with curl ? Thanks
  3. http://s64.photobucket.com/albums/h162/Chuckie82892/?action=view&current=Shannon411.flv How do you match h162 (letter number number number) *variable and Chuckie82892 (username) *variable and Shannon411.flv (videoname) *variable Thanks
  4. lol ok. But... how about my question ??? hahaha
  5. Hope this help? for ($x = 0; $x < 200; $x++){ $progress->tickUpdate("Tick: $x"); $servers = array( "$url$x", "$url2$x", "$url3$x", "$url4$x", "$url5$x" ); $mode = current($servers); $filesize = remote_file_size($mode); if ($filesize($url1$x)>0){ do this exit } if ($filesize($url2$x)>0){ do this exit } .............. } // Shutdown progress and display output $progress->stop(); I actually want to see my progress meter in action. The point is it never shows up when the script is executing. It only shows up after the script is done. AND the script always ends prematurely.
  6. Godaddy does not allow fsocketopen! Does anyone know how to modify the script below to curl? Here's some help. I couldnt figure it out http://www.paypaldev.org/topic.asp?TOPIC_ID=12900. http://www.pdncommunity.com/pdn/board/message?board.id=basicpayments&message.id=4155 http://www.paypaldev.org/topic.asp?TOPIC_ID=13079&SearchTerms=ew,portal <?php require_once($phpbb_root_path . 'includes/lw_ipn_grp_functions.'.$phpEx); // // Set page ID for session management // if(phpversion() <= "4.0.6") { $_POST = ($HTTP_POST_VARS); } // read the post from PayPal system and add 'cmd' $req = 'cmd=_notify-validate'; while (list($key, $value) = each($_POST)) { $value = urlencode(stripslashes($value)); $req .= "&$key=$value"; } // post back to PayPal system to validate $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; $fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30); // Below Instant Payment Notifiction Variables $business = (isset($_POST['business']) ? htmlspecialchars($_POST['business']) : ''); $receiver_email = (isset($_POST['receiver_email']) ? htmlspecialchars($_POST['receiver_email']) : ''); $item_name = (isset($_POST['item_name']) ? htmlspecialchars($_POST['item_name']) : ''); $item_number = (isset($_POST['item_number']) ? htmlspecialchars($_POST['item_number']) : ''); $quantity = (isset($_POST['quantity']) ? htmlspecialchars($_POST['quantity']) : ''); //Advanced and Custom information $invoice = (isset($_POST['invoice']) ? htmlspecialchars($_POST['invoice']) : ''); $custom = (isset($_POST['custom']) ? htmlspecialchars($_POST['custom']) : ''); $memo = (isset($_POST['memo']) ? htmlspecialchars($_POST['memo']) : ''); $tax = (isset($_POST['tax']) ? htmlspecialchars($_POST['tax']) : ''); $option_name1 = (isset($_POST['option_name1']) ? htmlspecialchars($_POST['option_name1']) : ''); $option_selection1 = (isset($_POST['option_selection1']) ? htmlspecialchars($_POST['option_selection1']) : ''); $option_name2 = (isset($_POST['option_name2']) ? htmlspecialchars($_POST['option_name2']) : ''); $option_selection2 = (isset($_POST['option_selection2']) ? htmlspecialchars($_POST['option_selection2']) : ''); // Shopping Cart Information $num_cart_items = (isset($_POST['num_cart_items']) ? htmlspecialchars($_POST['num_cart_items']) : ''); // Transaction Information $pending_reason = (isset($_POST['pending_reason']) ? htmlspecialchars($_POST['pending_reason']) : ''); $reason_code = (isset($_POST['reason_code']) ? htmlspecialchars($_POST['reason_code']) : ''); $payment_date = (isset($_POST['payment_date']) ? htmlspecialchars($_POST['payment_date']) : ''); $txn_id = (isset($_POST['txn_id']) ? htmlspecialchars($_POST['txn_id']) : ''); $txn_type = (isset($_POST['txn_type']) ? htmlspecialchars($_POST['txn_type']) : ''); $payment_type = (isset($_POST['payment_type']) ? htmlspecialchars($_POST['payment_type']) : ''); $payment_status = (isset($_POST['payment_status']) ? htmlspecialchars($_POST['payment_status']) : ''); // Currency and Exchange Information $mc_gross = (isset($_POST['mc_gross']) ? htmlspecialchars($_POST['mc_gross']) : ''); $mc_fee = (isset($_POST['mc_fee']) ? htmlspecialchars($_POST['mc_fee']) : ''); $mc_currency = (isset($_POST['mc_currency']) ? htmlspecialchars($_POST['mc_currency']) : ''); $settle_amount = (isset($_POST['settle_amount']) ? htmlspecialchars($_POST['settle_amount']) : ''); $settle_currency = (isset($_POST['settle_currency']) ? htmlspecialchars($_POST['settle_currency']) : ''); $exchange_rate = (isset($_POST['exchange_rate']) ? htmlspecialchars($_POST['exchange_rate']) : ''); $payment_gross = (isset($_POST['payment_gross']) ? htmlspecialchars($_POST['payment_gross']) : ''); $payment_fee = (isset($_POST['payment_fee']) ? htmlspecialchars($_POST['payment_fee']) : ''); // Auction Information $for_auction = (isset($_POST['for_auction']) ? htmlspecialchars($_POST['for_auction']) : ''); $auction_buyer_id = (isset($_POST['auction_buyer_id']) ? htmlspecialchars($_POST['auction_buyer_id']) : ''); $auction_closing_date = (isset($_POST['auction_closing_date']) ? htmlspecialchars($_POST['auction_closing_date']) : ''); $auction_multi_item = (isset($_POST['auction_multi_item']) ? htmlspecialchars($_POST['auction_multi_item']) : ''); // Buyer Information $first_name = (isset($_POST['first_name']) ? htmlspecialchars($_POST['first_name']) : ''); $last_name = (isset($_POST['last_name']) ? htmlspecialchars($_POST['last_name']) : ''); $address_name = (isset($_POST['address_name']) ? htmlspecialchars($_POST['address_name']) : ''); $address_street = (isset($_POST['address_street']) ? htmlspecialchars($_POST['address_street']) : ''); $address_city = (isset($_POST['address_city']) ? htmlspecialchars($_POST['address_city']) : ''); $address_state = (isset($_POST['address_state']) ? htmlspecialchars($_POST['address_state']) : ''); $address_zip = (isset($_POST['address_zip']) ? htmlspecialchars($_POST['address_zip']) : ''); $address_country = (isset($_POST['address_country']) ? htmlspecialchars($_POST['address_country']) : ''); $address_status = (isset($_POST['address_status']) ? htmlspecialchars($_POST['address_status']) : ''); $payer_email = (isset($_POST['payer_email']) ? htmlspecialchars($_POST['payer_email']) : ''); $payer_id = (isset($_POST['payer_id']) ? htmlspecialchars($_POST['payer_id']) : ''); $payer_status = (isset($_POST['payer_status']) ? htmlspecialchars($_POST['payer_status']) : ''); // Below are Subscription - Instant Payment Notifiction Variables $notify_version = (isset($_POST['notify_version']) ? htmlspecialchars($_POST['notify_version']) : ''); $verify_sign = (isset($_POST['verify_sign']) ? htmlspecialchars($_POST['verify_sign']) : ''); $subscr_date = (isset($_POST['subscr_date']) ? htmlspecialchars($_POST['subscr_date']) : ''); $subscr_effective = (isset($_POST['subscr_effective']) ? htmlspecialchars($_POST['subscr_effective']) : ''); $period1 = (isset($_POST['period1']) ? htmlspecialchars($_POST['period1']) : ''); $period2 = (isset($_POST['period2']) ? htmlspecialchars($_POST['period2']) : ''); $period3 = (isset($_POST['period3']) ? htmlspecialchars($_POST['period3']) : ''); $amount1 = (isset($_POST['amount1']) ? htmlspecialchars($_POST['amount1']) : ''); $amount2 = (isset($_POST['amount2']) ? htmlspecialchars($_POST['amount2']) : ''); $amount3 = (isset($_POST['amount3']) ? htmlspecialchars($_POST['amount3']) : ''); $mc_amount1 = (isset($_POST['mc_amount1']) ? htmlspecialchars($_POST['mc_amount1']) : ''); $mc_amount2 = (isset($_POST['mc_amount2']) ? htmlspecialchars($_POST['mc_amount2']) : ''); $mc_amount3 = (isset($_POST['mc_amount3']) ? htmlspecialchars($_POST['mc_amount3']) : ''); $recurring = (isset($_POST['recurring']) ? htmlspecialchars($_POST['recurring']) : ''); $reattempt = (isset($_POST['reattempt']) ? htmlspecialchars($_POST['reattempt']) : ''); $retry_at = (isset($_POST['retry_at']) ? htmlspecialchars($_POST['retry_at']) : ''); $recur_times = (isset($_POST['recur_times']) ? htmlspecialchars($_POST['recur_times']) : ''); $username = (isset($_POST['username']) ? htmlspecialchars($_POST['username']) : ''); $password = (isset($_POST['password']) ? htmlspecialchars($_POST['password']) : ''); $subscr_id = (isset($_POST['subscr_id']) ? htmlspecialchars($_POST['subscr_id']) : ''); /* Now that IPN was VERIFIED below are a few things which you may want to do at this point. 1. Check that the "payment_status" variable is: "Completed" 2. If it is Pending you may want to wait or inform your customer? 3. You should Check your datebase to ensure this "txn_id" or "subscr_id" is not a duplicate. txn_id is not sent with subscriptions! 4. Check "payment_gross" or "mc_gross" matches match your prices! 5. You definately want to check the "receiver_email" or "business" is yours. */ if (!$fp) { // HTTP ERROR } else { fputs ($fp, $header . $req); while (!feof($fp)) { $res = fgets ($fp, 1024); if (strcmp ($res, "VERIFIED") == 0) { // check the payment_status is Completed // check that txn_id has not been previously processed // check that receiver_email is your Primary PayPal email // check that payment_amount/payment_currency are correct // process payment $PayPal_Data = array( 'ITEM_NUMBER' => $item_number, 'TXN_TYPE' => $txn_type, 'PAYMENT_STATUS' => $payment_status, 'RECEIVER_ACCT' => $receiver_email, 'PAYER_ACCT' => $payer_email, 'MC_CURRENCY' => $mc_currency, 'TXN_ID' => $txn_id, 'MC_GROSS' => $mc_gross, 'GATEWAY_TYPE' => GATEWAY_PAYAPL, ); lw_process_subs_payment_V4($PayPal_Data); } else if (strcmp ($res, "INVALID") == 0) { //do nothing } } fclose ($fp); } die("Process Finished"); ?>
  7. I've tried the settings in php.ini and set_time_limit(0 or more)... The script still times out on the browser. (im not sure if time out is the real problem, but thats what i'm calling it) The code needs to check over 1000 urls. I have a progress meter embedded in the script, which I do not show here, but the problem is that the progress meter only shows up after the script is done executing. In other words after you submit data to the page, it shows as if it is loading the page. After about 30 seconds the script is done and shows the progress at about 20% completed. It never runs to full completion. Does anyone have a clue how to embed this in ajax, or make it run to completion? function remote_file_size ($url){ $head = ""; $url_p = parse_url($url); $host = $url_p["host"]; if(!preg_match("/[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*/",$host)){ // a domain name was given, not an IP $ip=gethostbyname($host); if(!preg_match("/[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*/",$ip)){ //domain could not be resolved return -1; } } $port = intval($url_p["port"]); if(!$port) $port=80; $path = $url_p["path"]; //echo "Getting " . $host . ":" . $port . $path . " ..."; $fp = fsockopen($host, $port, $errno, $errstr, 20); if(!$fp) { return false; } else { fputs($fp, "HEAD " . $url . " HTTP/1.1\r\n"); fputs($fp, "HOST: " . $host . "\r\n"); fputs($fp, "User-Agent: http://www.example.com/my_application\r\n"); fputs($fp, "Connection: close\r\n\r\n"); $headers = ""; while (!feof($fp)) { $headers .= fgets ($fp, 128); } } fclose ($fp); //echo $errno .": " . $errstr . "<br />"; $return = -2; $arr_headers = explode("\n", $headers); // echo "HTTP headers for <a href='" . $url . "'>..." . substr($url,strlen($url)-20). "</a>:"; // echo "<div class='http_headers'>"; foreach($arr_headers as $header) { // if (trim($header)) echo trim($header) . "<br />"; $s1 = "HTTP/1.1"; $s2 = "Content-Length: "; $s3 = "Location: "; if(substr(strtolower ($header), 0, strlen($s1)) == strtolower($s1)) $status = substr($header, strlen($s1)); if(substr(strtolower ($header), 0, strlen($s2)) == strtolower($s2)) $size = substr($header, strlen($s2)); if(substr(strtolower ($header), 0, strlen($s3)) == strtolower($s3)) $newurl = substr($header, strlen($s3)); } // echo "</div>"; if(intval($size) > 0) { $return=intval($size); } else { $return=$status; } // echo intval($status) .": [" . $newurl . "]<br />"; if (intval($status)==302 && strlen($newurl) > 0) { // 302 redirect: get HTTP HEAD of new URL $return=remote_file_size($newurl); } return $return; } for ($x = 0; $x < 200; $x++){ $url = a url link to video file; $filesize = remote_file_size($url); } Note I've tried two different remote_file_size ($url) functions, and I still get the same problem.
  8. Whats the best way to run a memory intensive php script. I have a long script that will take approximately 2 mins to execute. Is that a way to embed php code in javascript or something that will keep the webpage up whilst doing background work, waiting for the result. Thanks
  9. I've tried everything guys.. This may help: I have a progress bar thing that works when index2.php is running on my localhost (apache server on my computer -> http://localhost/index2.php). But when i'm running the script on example.com/index2.php, it won't show the progress "live"... it only runs for about 30 seconds on the browser (indicating that the page is loading) and then the end result is the output of index2.php (the progress bar). Whereas when its running on localhost/index2.php the progress bar is "live" (ie you see it progressing). Why does it work on my localhost/index2.php ... but not on hosting server when i call example.com/index2.php? * The script works perfectly and does what it is supposed to on my computer (apache) but on my hosting server (godaddy) it stops. I have tried all php.ini settings. And I have tried a differed remote_file_size($url) function with curl.
  10. function remote_file_size ($url){ $head = ""; $url_p = parse_url($url); $host = $url_p["host"]; if(!preg_match("/[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*/",$host)){ // a domain name was given, not an IP $ip=gethostbyname($host); if(!preg_match("/[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*/",$ip)){ //domain could not be resolved return -1; } } $port = intval($url_p["port"]); if(!$port) $port=80; $path = $url_p["path"]; //echo "Getting " . $host . ":" . $port . $path . " ..."; $fp = fsockopen($host, $port, $errno, $errstr, 20); if(!$fp) { return false; } else { fputs($fp, "HEAD " . $url . " HTTP/1.1\r\n"); fputs($fp, "HOST: " . $host . "\r\n"); fputs($fp, "User-Agent: http://www.example.com/my_application\r\n"); fputs($fp, "Connection: close\r\n\r\n"); $headers = ""; while (!feof($fp)) { $headers .= fgets ($fp, 128); } } fclose ($fp); //echo $errno .": " . $errstr . "<br />"; $return = -2; $arr_headers = explode("\n", $headers); // echo "HTTP headers for <a href='" . $url . "'>..." . substr($url,strlen($url)-20). "</a>:"; // echo "<div class='http_headers'>"; foreach($arr_headers as $header) { // if (trim($header)) echo trim($header) . "<br />"; $s1 = "HTTP/1.1"; $s2 = "Content-Length: "; $s3 = "Location: "; if(substr(strtolower ($header), 0, strlen($s1)) == strtolower($s1)) $status = substr($header, strlen($s1)); if(substr(strtolower ($header), 0, strlen($s2)) == strtolower($s2)) $size = substr($header, strlen($s2)); if(substr(strtolower ($header), 0, strlen($s3)) == strtolower($s3)) $newurl = substr($header, strlen($s3)); } // echo "</div>"; if(intval($size) > 0) { $return=intval($size); } else { $return=$status; } // echo intval($status) .": [" . $newurl . "]<br />"; if (intval($status)==302 && strlen($newurl) > 0) { // 302 redirect: get HTTP HEAD of new URL $return=remote_file_size($newurl); } return $return; } for ($x = 0; $x < 200; $x++){ $url = a url link to video file; $filesize = remote_file_size($url); } Is there an easier way to get the filesize of a remote file through url? I tried getfilesize($content) // didn't work...
  11. Ok at least this is what I think my problem is: I have a script that is being submited a post variable (or get variable) that works fine from my computer (on apache); but when I run it on my hosting server online it times out(stops exectuting halfway). I have tried the max_exectution_time and set_time_limit but it still quits on me. Does anyone have any clue what could be going on? Thanks
  12. SELECT i.*, u.username, u.email, g.gallery_name, CONCAT('http://tutaka.com/images/',u.username,'/', i.name, '.', type) AS image_url, CONCAT('http://tutaka.com/thumbs/',u.username,'/', i.name, '.jpg') AS thumb_url FROM images i LEFT OUTER JOIN galleries g ON i.gallery_id=g.gallery_id, users u WHERE i.user_id=u.user_id AND i.user_id=3 ORDER BY i.uploaded desc LIMIT -5,5 mySQL Says: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-5,5' at line 1 I can't figure what the error is all about?
  13. Hi guys. I was just wondering how I could stop some directories from being accessed on my siteL: eg. http://tutaka.com/images/ and http://tutaka.com/images/tester/ What do I need to do? How come I can't find the .htaccess file when I log on to my server through ftp. Like I see all the .php files,,etc.. but I don't ever see a .htaccess even though it says it's there. If I upload a test .htaccess it will still not show up.
  14. Hi guys. I'm a newbie and I've tried searching everywhere for an answer to this, but I'm not sure I'm searching right. Just wondering how I would select the first few rows in an sql table rather than using the while loop (as shown below). What I want to do exactly (if it helps) is to display 3 pieces on information from list_id on line1 and then 2 pieces of information on line 2. Then on the next page... the other 3 and the other 2 (ie traverse the list downwards) From column list_id in table videos. (I'm using http://www.phpfreaks.com/tutorials/147/0.php for pagination. ) [code]while ($list = mysql_fetch_array($getlist)) {   echo "<tr>";   echo "<td>{$list['list_id']}</td>";     echo "</tr>"; } // end while [/code]
  15. [code]<td width="170" valign="top" onmouseover="FlyOver( 'ImSweetLikeThat5' );" onmouseout= [/code] Just wondering how I would get the ImSweetLikeThat5 from a html page with numerous code that resembles the above code except has different flyover names. I need to match all the names in the code and store them in a variable so I could view each one. Thanks
  16. Is there a way to have a variation on the 11 to adjust for less or more characters.
  17. I have a form where users can submit urls. How do I verify a url is submitted in these forms exactly: [code]http://www.youtube.com/v/shgRSgYwBv0[/code] or [code]http://www.youtube.com/watch?v=shgRSgYwBv0[/code]\ else Exit the script and prompt the user for a correct url.
  18. One last thing. (Each id is now in a file called (test.txt); How do I write a page in php that reads the first 5 ids? and the next page reads the next 5 and so on... I want to index them for easy access with a little bit of math. I'm thinking this in the txt file which is going to be read(test.txt): " 0: bW55-ybLzYE" " 1: ilewoJIaYLg" ... So page 1 will have ids 0 to 5. Page two will have 6 to 10. etc... But the problem is another regex  (which I suck at). Maybe setting a tab delimeter between 0: and the id would help?
  19. Hey guys I have a bunch of these [code](value="http://www.youtube.com/v/shgRSgYwBv0" />)[/code] in an html file as you can see below. I want to run through the whole code and extract shgRSgYwBv0 (video ids). NOTE: I also have urls that look like this [code]http://www.youtube.com/watch?v=shgRSgYwBv0[/code] in the html file. I don't want to include those results in the extraction process. Or vice versa. How do I run through the file and echo all the ids out or write them to a file. I know the basics (reading opening etc) but I don't know how to identify the id and extract it from the plethora of other codes around. Could someone help. Thanks Sample from html file: [code] <object width="250" height="250">         <param name="movie" value="http://www.youtube.com/v/shgRSgYwBv0" />         </param>         <embed src="http://www.youtube.com/v/shgRSgYwBv0" type="application/x-shockwave-flash" width="250" height="250"></embed>       </object>       <object width="250" height="250">         <param name="movie" value="http://www.youtube.com/v/zHKlefHeed8" />         </param>         <embed src="http://www.youtube.com/v/zHKlefHeed8" type="application/x-shockwave-flash" width="250" height="250"></embed>[/code]
  20. Ok this isn't helping too much because I'm a newbie at php. I'm really not sure how to do it
  21. [quote author=Hypnos link=topic=118891.msg486301#msg486301 date=1166304469] If you want to write a script like you said (checking your hotmail email), then you have to have it login, get the cookie, and send the cookie back when it requests the page for your inbox. [/quote] How do you get it to login?? Thanks I'll check the curl extension.
  22. Maybe I should reword my question with an example Say I want to log on to hotmail to check my email. I want my php script to log me in and gather the information from the inbox using fget($url). If i use fget without logging in I wont be able to get my mail or access things a member cannot thats why i want to see if i can log in through the script itself without me having to do it manually.
  23. Say there's a page where you have to enter my username and password... Is there a way to get php to automatically put those in and log in so i can get into my members area and get the info I want. Because if I don't log in my script won't work...
  24. Test Location:  United States - South Carolina - Greenville - Bellsouth.net In I need to grab the following Greenville and South Carolina from the exact format of the string above.. I am using the fget function to get the string from a website into an $buffer $buffer .= fgets($fd, 4096); Basically i need to extract South Carolina and put it into $state And Greenville and put it into $city other variables would be cool but not necessary. This may be a bit of an easy question but I really got no time to master regex's right not I would love to learn it soon. I'm new to php still learning some other stuff before i get to everyone favorite lol
×
×
  • 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.