fanfavorite
Members-
Posts
344 -
Joined
-
Last visited
Never
Everything posted by fanfavorite
-
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.
-
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?
-
Adding: curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt"); curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt"); Seems to work fine.
-
Dynamic creation of folders on server?
fanfavorite replied to RottenBananas's topic in PHP Coding Help
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) -
Dynamic creation of folders on server?
fanfavorite replied to RottenBananas's topic in PHP Coding Help
try: $target_path = $_SERVER[document_root]."/".$_POST[username]."/".basename( $_FILES['uploadedfile']['name']); -
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')"); }
-
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.
-
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.
-
Dynamic creation of folders on server?
fanfavorite replied to RottenBananas's topic in PHP Coding Help
Or if username is a session, change to $_SESSION[username]. -
Dynamic creation of folders on server?
fanfavorite replied to RottenBananas's topic in PHP Coding Help
$target_path = $_POST[username]."/".basename( $_FILES['uploadedfile']['name']); move_uploaded_file($_FILES['YOUR FIELD NAME']['tmp_name'], $target_path) -
[SOLVED] Ugh! Now my login is not working again.
fanfavorite replied to rnintulsa's topic in PHP Coding Help
Watch the space in $_POST['password ']... should be $_POST['password'] -
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.
-
Simplest way to ping or test for a website response...
fanfavorite replied to inVINCEable's topic in PHP Coding Help
http://www.weberdev.com/get_example-4335.html is another example you may want to try. -
Simplest way to ping or test for a website response...
fanfavorite replied to inVINCEable's topic in PHP Coding Help
To check for if the website has something, try reading this http://bytes.com/forum/thread2406.html. -
Simplest way to ping or test for a website response...
fanfavorite replied to inVINCEable's topic in PHP Coding Help
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. -
Select 5 results from 3 days (total of 15 results)
fanfavorite replied to The Little Guy's topic in PHP Coding Help
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" -
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.
-
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.
-
Download section, similar to Swapdrive
fanfavorite replied to NathanLedet's topic in PHP Coding Help
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. -
[SOLVED] How to get the msisdn cellphone number?
fanfavorite replied to ryy705's topic in Miscellaneous
Take a look at some of these applications http://www.codango.com/php/dir/webapps/communic/sms/ -
[SOLVED] How to get the msisdn cellphone number?
fanfavorite replied to ryy705's topic in Miscellaneous
The email is probably your best bet though. -
[SOLVED] How to get the msisdn cellphone number?
fanfavorite replied to ryy705's topic in Miscellaneous
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...). -
php file to call a URL and have the URL in an iframe
fanfavorite replied to EddieRock's topic in PHP Coding Help
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]). -
Looks like its all fixed now. Seems Bothwell got to the bottom of it!
-
php file to call a URL and have the URL in an iframe
fanfavorite replied to EddieRock's topic in PHP Coding Help
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<1=_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.