Jump to content

dreamwest

Members
  • Posts

    1,223
  • Joined

  • Last visited

    Never

Everything posted by dreamwest

  1. One thing i do like about the new forum is the pink ad div at the end of each post... ...BUT its a little lacking - it should be sandwiched between each comment as well
  2. Is there a way around this?
  3. I want to pass an image to the browser then unlink() it Ive tried this but it doesnt work echo "<img src='image.jpg' border='0' />"; unlink('image.jpg');
  4. Well its hard to spell, it only took me 12 years to spell it right. BUT...I can spell America - U.S.A
  5. No, it says "austrailia" Thats how I used to spell it - I now know its Australia
  6. Damn, your Australian? Yeah - its in my profile We have one thing i cant live without.........LEGAL BROTHELS!!
  7. At least its not in the negative Ill give you $50 (AU) if you write me a decent javascript tutorial for my site with examples. Dont copy and paste it from some site though. But you can compile it from different sources.
  8. function redirect( $url ){ if (! headers_sent( ) ){ header( "Location: ".$url ); exit( 0 ); } echo "<script language=Javascript>document.location.href='".$url."';</script>"; exit( 0 ); } redirect('http://www.cars.com/buses/coachescontent/index.html');
  9. I have some php code snippets stored in my database: <?php echo 'Hello'; ?> How can i select this and execute it?? If not is there an alternative?? $res = mysql_query("select * from code were id =1"); $row= mysql_fetch_assoc($res); $code = $row['code']; //this is the code to be executed
  10. No Way! Next youll tell me santa isnt coming to see me this year.....
  11. $q = 'community channel'; $q = str_replace(' ','%20',$q); $src = @file_get_contents("http://gdata.youtube.com/feeds/videos?vq={$q}&start-index=1&max-results=5")
  12. Properly because of the type of content your after - ppl's private info. Im not going to ask what you intend to do with it. preg_match_all() will definatley work with a foreach loop
  13. You need the absolute path /home/user/htdocs/uploads/ and $_FILES["file"]["name"] if(unlink("/home/user/htdocs/uploads/".$_FILES["file"]["name"])){ echo 'Deleted original file!'; }
  14. Also remember if u have a 7 digit code thats millions of combinations alone
  15. This will produce the codes you need using chr() function password_gen($min=6,$max=6,$id){ /*has a default min value of 6 and maximum value of 6*/ $pwd=""; // to store generated password for($i=0;$i<rand($min,$max);$i++){ $num=rand(48,122); if(($num >= 97 && $num <= 122)) $pwd.=chr($num); else if(($num >= 65 && $num <= 90)) $pwd.=chr($num); else if(($num >=48 && $num <= 57)) $pwd.=chr($num); else $i--; } return $pwd; } echo password_gen(6,6, 12 );
  16. chr() will give you random codes like "KILhh5jhd32" etc..
  17. $link = connectToDB(); if(isset($_POST['submit'])){ $filename=$_POST['filename']; $handle = fopen("$filename", "r"); //GRAB LAST ID FROM LOG TABLE $batchid=mysql_insert_id(); //INSERT EACH ROW INTO THE TABLE $cnt = 1; while (($data = fgetcsv($handle, 1000, ",")) !== FALSE){ $import="INSERT INTO inventoryTable(campcode,imbatchid, importdate,fname, mname, lname, phone, address1, address2, city, state, zip) VALUES('$data[0]','$batchid',NOW(),'$data[1]','$data[2]','$data[3]', '$data[4]','$data[5]','$data[6]','$data[7]','$data[8]','$data[9]')"; mysql_query($import) or die(mysql_error()); ++$cnt; } fclose($handle); print "Import done"; //LOG THE BATCH IMPORT $user=$_SESSION['SESS_MEMBER_ID']; $log_query="INSERT INTO batchImportLog(ImportDate,FileLocation,RecordCount, ImUserID ) VALUES(NOW(),'xxx','{$cnt}','{$user}')"; mysql_query($log_query) or die(mysql_error()); print '<br>All done!'; }else{ print "<form action='import.php' method='post'>"; print "Type file name to import:<br>"; print "<input type='text' name='filename' size='20'><br>"; print "<input type='submit' name='submit' value='submit'></form>"; }
  18. Welll forgetting about the class, this will get the info you want. Your not getting multiple items per page so you wont need preg_match_all() $u = 'http://whitepages.anywho.com/results.php?ReportType=34&qi=0&qk=10&qn=A&qs=AK'; $g = @file_get_contents($u); //remove @ to show errors $a = explode('<span class="singleName">',$g); $a = explode('</div></div>',$a[1]); $a= $a[0]; echo $a; echo '<hr>Done!'; Just str_replace() the divs so you can put it into the database
  19. You have to check if headers have been sent yet: function redirect( $url ){ if (! headers_sent( ) ){ header( "Location: ".$url ); exit( 0 ); } echo "<script language=Javascript>document.location.href='".$url."';</script>"; exit( 0 ); } redirect('any url here you want');
  20. Also file_get_contents() is crappy if you dont know what pages your going after. If the page redirects youll get nothing. Curl is better for this. If you definitley know the page is http://site.com then file_get_contents() is ok but if it redirects http://site.com -> http://www.site.com then your screwed
  21. What do you want the spider to get from this url: http://whitepages.anywho.com/results.php?ReportType=34 eg links, meta tags etc...
×
×
  • 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.