Jump to content

CerealBH

Members
  • Posts

    52
  • Joined

  • Last visited

    Never

Everything posted by CerealBH

  1. i need to chop off the decimals i thought just casting as a (int) would do it but it dosn't, i tired looking at formating but that helped non (int) $page = $numpeople / 15;
  2. does this seem right? $result = mysql_query("SELECT Name FROM johnjrum WHERE Name="$name" LIMIT 1"); if (!$result) { echo 'Could not run query: ' . mysql_error(); exit; } while($row = mysql_fetch_array($result)) { if($row['Name'] == $name) { break out of code already in } else if ($row['Name'] != $name) { Say hi to $name enter $name into database so i dont say hi again } }
  3. you might want to look into a a switch statement, would really make things easier on the eyes
  4. my cookie jar, is not saving the cookies?? i checked the permissions there shouldn't be a problem $cr = curl_init($pof."inbox.aspx?"); curl_setopt($cr, CURLOPT_RETURNTRANSFER, true); // Get returned value as string (don’t put to screen) curl_setopt($cr, CURLOPT_USERAGENT, $useragent); // Spoof the user-agent to be the browser that the user is on (and accessing the php script) curl_setopt($cr, CURLOPT_COOKIEJAR, '/var/www/cookie.txt'); // Use cookie.txt for STORING cookies curl_setopt($cr, CURLOPT_POST, true); // Tell curl that we are posting data curl_setopt($cr, CURLOPT_POSTFIELDS, $data); // Post the data in the array above $output = curl_exec($cr); // Execute! //echo $output; // Spit out what we found curl_close($cr); // Free the memory $cr = curl_init($pof."basicsearch.aspx"); curl_setopt($cr, CURLOPT_RETURNTRANSFER, true); // Get returned value as string (don’t put to screen) curl_setopt($cr, CURLOPT_USERAGENT, $useragent); // Spoof the user agent curl_setopt($cr, CURLOPT_COOKIEFILE, '/var/www/cookie.txt'); // Use cookie.txt for READING cookies $output = curl_exec($cr); curl_close($cr); echo $output;
  5. theres a site, that i can get curl to login, to then i want to navigate through there while still logged in i have added cookiejar but its still not working here is my code function loginpof($username, $password) { $postfields = "?username=" . urlencode($username); $postfields .= "&password=" . urlencode($password); $pof = "http://www.website.com/inbox.aspx".$postfields; $useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1"; $ch = curl_init(); curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookieFileName"); curl_setopt($ch, CURLOPT_USERAGENT, $useragent); curl_setopt($ch, CURLOPT_URL, $pof); curl_setopt($ch, CURLOPT_FAILONERROR, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 3); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($ch); curl_close ($ch); return($result); } that is to login then i want to do this function search(){ $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookieFileName"); curl_setopt($ch, CURLOPT_URL, "http://www.website.com/basicsearch.aspx"); $result = curl_exec($ch); curl_close($ch); return($result); } but it wont stay loggged in, any help?
  6. well ive gotten down to where $regexp = "so.addVariable\(\"content_video\", \"([^>]+)\);"; will return so.addVariable("content_video", "http:/movie.flv"); now i just need to get the other crap out, do i need to perform another regex on it? im sure theres just something that im missing
  7. Here is all the code if that helps any $url = "http://www.site.com/file.html"; $input = @file_get_contents($url) or die('Could not access file: $url'); $regexp = "so.addVariable\(\"content_video\", \"(.*?)"; if(preg_match_all("/$regexp/siU", $input, $matches, PREG_SET_ORDER)) { foreach($matches as $match) { //echo $match[0]; Matches what i want, and the rest of the page //echo $match[1]; Matches what i want, and the rest of the page echo $match[2]; //Supposed to be the link, comes up blank echo "\n"; echo "\n"; }
  8. im parseing a page for so.addVariable("content_video", "http://movielink.flv"); for my regex what i have is so.addVariable\(\"content_video\", \"(.*?) which returns movielink.flv"); how do i get rid of the "); its driving me crazy
  9. think ur looking 4 preg_match_all im not sure if preg_match stops after it finds what its looking for
  10. yes the page im using curl to navigate 2 uses a submit button like that, how do i get curl to evaluate "formSubmit()"? do i jsut do CURLOPT_POST like normal?
  11. My flash is working fine on FF, but of course, ie dosn't want to play nice and its coming up blank, http://rayniceshudde.com/ im not to familar with using flashes im mostly a php person, anyone see anything wrong? <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" id="Movie1" width="600" height="400" > <param name="movie" value="Movie1.swf"> <param name="bgcolor" value="#495f71"> <param name="quality" value="high"> <param name="allowscriptaccess" value="samedomain"> <embed type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" name="Movie1" width="600" height="400" src="http://rayniceshudde.com/test/img/Movie1.swf" bgcolor="#495f71" quality="high" allowscriptaccess="samedomain" > <noembed> </noembed> </embed> </object>
  12. bump before bed, hopefully will wake up 2 a answer!
  13. <?php $nextWeek = time() + (7 * 24 * 60 * 60); // 7 days; 24 hours; 60 mins; 60secs echo 'Now: '. date('Y-m-d') ."\n"; echo 'Next Week: '. date('Y-m-d', $nextWeek) ."\n"; // or using strtotime(): echo 'Next Week: '. date('Y-m-d', strtotime('+1 week')) ."\n"; ?> http://us3.php.net/manual/en/function.time.php
  14. its refering to the class that i was working in, u can disregard the $this-> adn change it to #dir_path.
  15. you could also use perl regex preg_match("<img border=\"0\" alt=\"\" src=\"(.*)\" />", $this->pageSource, $var); (.*) being the information your getting http://www.troubleshooters.com/codecorn/littperl/perlreg.htm
  16. $beg_pos = strpos($this->pageSource,"$before"); $end_pos = strpos($this->pageSource, "$after", $beg_pos); $this->pageSource = substr($this->pageSource, $beg_pos, $end_pos - $beg_pos);
  17. this has absolutely nothign 2 do with the topic, much like my post i use this 4 cookies $randnum = rand(1,9999999); curl_setopt($this->ch, CURLOPT_COOKIEJAR, $this->dir_path."/tmp/cookiejar-$randnum"); curl_setopt($this->ch, CURLOPT_COOKIEFILE, $this->dir_path."/tmp/cookiejar-$randnum");
  18. heh my bad, i need to know how to submit a javascript command..i dont' have a link that i can use as the action of the submit i have to use a javascript command understand what im saying?
  19. I'm using CURL and am trying to get it to submit a form, i can get the form filled out no problem, but the the submit button is javascript that points 2 doPreview() anyone know how to do this, or a reference so i can figure it out?
  20. if ($line['proof']) { $stamp = $line['stamp'] - 1; } if $line['proof'] = 0 the it would make that statement false correct and the if would not evaluate between the {}??
×
×
  • 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.