Jump to content

fanfavorite

Members
  • Posts

    344
  • Joined

  • Last visited

    Never

Everything posted by fanfavorite

  1. Try going to http://www.machosports.com/VwSportSelection.asp and then seeing what http://www.machosports.com/VwSportSelection.asp shows. Just the middle content is what is changed. Radio buttons for the middle content through curl, when they are href for other. It also doesn't have one of the key variables tmpPeriod.
  2. I am trying to get information from a particular website and I can output the entire website, however one section seems to display differently when I use cURL compared to when I go directly to the URL. The code is: <? $URL1 = "http://www.domain.com/"; //ASP Website $ch = curl_init(); curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt"); curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt"); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_TIMEOUT,3); curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1); curl_setopt($ch, CURLOPT_URL,$URL1); if ($buffer = curl_exec($ch)) { echo $buffer; } curl_close ($ch); ?> Is there a way to figure out what might be causing the different data to display?
  3. Adding: curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt"); curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt"); Seems to work fine.
  4. oh wait sorry... $target_path = $_SERVER[document_root]."/".$_SESSION[uid] @mkdir($target_path); $target_path .= "/".basename( $_FILES['uploadedfile']['name']); move_uploaded_file($_FILES['YOUR FIELD NAME']['tmp_name'], $target_path)
  5. try: $target_path = $_SERVER[document_root]."/".$_POST[username]."/".basename( $_FILES['uploadedfile']['name']);
  6. No because UPDATE requires WHERE values. You need to run a check: $q = mysql_query("SELECT * FROM $logstable WHERE ip = '$ip'") if (mysql_num_rows($q) > 0) { mysql_query("UPDATE $logstable VALUES('$line[m_id]','$line['m_user']',".time().",'$ip') WHERE ip = '$ip'"); } else { mysql_query("INSERT INTO $logstable VALUES('$line[m_id]','$line['m_user']',".time().",'$ip')"); }
  7. I assume it is because you see the php code when you hit submit? Make sure that: <?php // Contact subject $subject ="$subject"; // Details $message="$detail"; // Mail of sender $mail_from="$customer_mail"; // From $header="from: $name <$mail_from>"; // Enter your email address $to ='petzje@coldwaterschools.org'; $send_contact=mail($to,$subject,$message,$header); // Check, if message sent to your email // display message "We've received your information" if($send_contact){ echo "We've received your contact information"; } else { echo "ERROR"; } ?> is the only thing that is in the file.
  8. I agree, post to the same page. Mainly due to the fact that if you need to return them to the page again for not filling out a form or an error or something, you don't have to repost the variables when redirecting back to the page for them to fix the errors.
  9. Or if username is a session, change to $_SESSION[username].
  10. $target_path = $_POST[username]."/".basename( $_FILES['uploadedfile']['name']); move_uploaded_file($_FILES['YOUR FIELD NAME']['tmp_name'], $target_path)
  11. Watch the space in $_POST['password ']... should be $_POST['password']
  12. Heres a live example of problems reading asp pages: <? $URL1 = "http://www.w3schools.com/asp/default.asp"; $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_URL,$URL1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1); $buffer = curl_exec($ch); echo $buffer; curl_close ($ch); ?> It stops at the <body> tag.
  13. http://www.weberdev.com/get_example-4335.html is another example you may want to try.
  14. To check for if the website has something, try reading this http://bytes.com/forum/thread2406.html.
  15. Well if you want to know if the domain is registered, you can use checkdnsrr, which you can read about here http://ca3.php.net/checkdnsrr. If it does not exist, then obviously there is no website. Keep in mind though that domains that are parked, with no website, will still show as true.
  16. I may be misinterpreting your question, but basically you just need to limit your results to only 5? Just add "LIMIT 5" to the end of the query string: $query = "SELECT * FROM feed WHERE (`owner` = '3' AND `owner`) AND `feedDate` >= '$twoDaysAgo' ORDER BY `feedDate` DESC, `id` DESC LIMIT 5"
  17. I just want to be able to be able to read in the page as it is displayed in html when I go to the site.
  18. Ok, I am trying to use cURL to read from an ASP page. I wanted to use file_get_contents, however the server blocks it. When I use cURL and echo the results, I get the error: Microsoft JScript runtime error '800a138f' 'length' is null or not an object /CommonFunctions.asp The code is: $URL1 = "http://www.somewebsite.com/somefile.asp"; $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_URL,$URL1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1); $buffer = curl_exec($ch); echo $buffer; curl_close ($ch); Any ideas on how to get around this? The code just stops at this error. Thanks.
  19. I would setup a database with two columns (Files,RandomKeys). When someone selects the files, it inserts a row with the files (file1.zip,file2.zip,file3.zip) and generates a random key that is sent is a url (yourdomain.com/download.php?id=".$randomkeyhere). Then when the page link displays, it pulls the files out of the database based on the Random Key value.
  20. Take a look at some of these applications http://www.codango.com/php/dir/webapps/communic/sms/
  21. You can have the application find out what the entire number is based on the 10 digit phone number, however you need to have a database that has the other data (i.e. Canada is country code...).
  22. Do a print_r(matches); after and see what is displayed. If there is nothing, then it found nothing. If there is something, then it may just be the wrong array portion that you are grabbing (matches[1][0]).
  23. Looks like its all fixed now. Seems Bothwell got to the bottom of it!
  24. This should be in the REGEX forum. First you need to figure out what stays the same in the amazon URL. $data = '<iframe src="http://rcm.amazon.com/e/cm?t=nikondigitalcamera-20&o=1&p=8&l=as1&asins=B000HJPK0Y&fc1=000000&IS2=1&lt1=_blank&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="width:120px;height:240px;" scrolling="No" marginwidth="0" marginheight="0" frameborder="0"></iframe>'; preg_match_all("/asins=(.*)&fc1/Uis",$data, $matches); echo '<iframe src="product_link.php?ASIN='.$matches[1][0].'" width="120" height="240" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>'; The above will take out the asin from the URL and put it into your iframe.
×
×
  • 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.