Jump to content

clearstatcache

Members
  • Posts

    159
  • Joined

  • Last visited

    Never

Everything posted by clearstatcache

  1. You may use tinyint length = 1. 1 for true and 0 for false
  2. try this... $delete_query = "delete links, pagelinks from links left join pagelinks on links.linkid = pagelinks.linkid where links.linkid=ID";
  3. the file you include is not found by the script...may be you have a wrong include_path...
  4. make sure your $id has a value......
  5. you forgot the single qoute for town='$town'
  6. i think if else is more applicable in this situation....
  7. u used that key as unique_key......aside from ur primary key....u need to have another index(s) which is unique in your table.....to be more efficient....
  8. try changing preg_match("/\<Link\>/", $line) to preg_match("/http:\/\//", $line)
  9. how about adding another index key.....say, Sequence_Key.....
  10. use function define in defining your variables in your config.php for you to be able to get the values defined in your config.php. http://www.php.net/manual/en/function.define.php
  11. not sure if this is what u want.... $str = "www.something.com"; $new = preg_replace("/($str)/", "<a href=$1>$1[/url]", $str);
  12. just a syntax error...forgot the $ sign in first line... date1=array(); ==> $date1 = array();
  13. try this... $line = "<Link> I WANT TO EXTRACT THIS 3 </Link>"; if (preg_match("/\<Link\>/", $line)) { $clean = preg_replace("/(\<Link\>)|(\[b\])|(\[\/b\])|(\<\/Link\>)/", "", $line); } print "$line\n"; print "$clean\n";
  14. I found the book in electronic format (.chm), someone maybe interested so I thought I'll share it with others: where can i find that copy??
  15. i think you need to save ur current reference value to another table...something like a system_config table....and each time you save new data to your table, u access this table..... just a suggestion.....hehehe =)
  16. this works in me.... <?php $location = array( 'uk' => 'United Kingdom', 'af' => 'Afghanistan', 'al' => 'Albania', 'dz' => 'Algeria', 'as' => 'American Samoa', 'ad' => 'Andorra', 'ao' => 'Angola', 'ai' => 'Anguilla', 'aq' => 'Antarctica', 'ag' => 'Antigua And Barbuda', 'ar' => 'Argentina', 'am' => 'Armenia', 'aw' => 'Aruba', 'au' => 'Australia', 'at' => 'Austria', 'aw' => 'Aruba', 'ax' => 'Aland Islands' ); $result_nation = 'ar'; echo "<select class=\"forminput\" name=\"result_nation\">"; foreach ($location as $key => $value) { echo "<option value=\"$key\""; if ($key==$result_nation) { echo " selected"; } echo ">$value</option>\n"; } echo "</select>"; ?>
  17. if final is a string u add single quotes Line 2 = <? if ($val != 'final'){} ?> if final is a variable Line 2 = <? if ($val != $final){} ?>
  18. <?php $a = mysql_query(" select q1.reply from ( select reply, count(*) as data_cnt from sample where 1 group by reply ) as q1 left join ( select reply, count(*) as check_cnt from sample where `check`=1 group by reply ) as q2 on q1.reply=q2.reply where data_cnt = check_cnt "); while($b = mysql_fetch_assoc($a)) { mysql_query("DELETE FROM `table` WHERE `reply` = '$b[reply]'"); } ?>
  19. dunno if i get u right..... $file = "file.html"; $stat = stat($file); if ( (time() - $stat['mtime']) > 600) { // 600 seconds // send email .... }
  20. select * from table where FIELD like '%$text1%' or FIELD like '%$text2%'
  21. try this one...... <?php function bximagecrawl($name) { $url = "http://images.google.com/images?hl=en&q=$name&btnG=BX&gbv=2"; $user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_FAILONERROR, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_PORT, 80); curl_setopt($ch, CURLOPT_TIMEOUT, 5); curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); $document = curl_exec($ch); $images = array(); $images = explode('img src=http://', $document); array_shift($images); foreach($images as $key => $value) { $tokens = preg_split('/\>|\"| /', $value); $images[$key] = "http://".$tokens[0]; } return $images; } $name = 'danielradcliff'; $images = bximagecrawl($name); print_r($images); ?>
  22. not sure wd this.....hehehe <?php function bximagecrawl($name) { $url = "http://images.google.com/images?hl=en&q=$name&btnG=BX&gbv=2"; $user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_FAILONERROR, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_PORT, 80); curl_setopt($ch, CURLOPT_TIMEOUT, 5); curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); $document = curl_exec($ch); $images = array(); $images = explode('href="http://', $document); array_shift($images); foreach($images as $key => $value) { $tokens = preg_split('/\>|\"| /', $value); $images[$key] = "http://".$tokens[0]; } return $images; } $name = 'danielradcliff'; $images = bximagecrawl($name); print_r($images); ?>
×
×
  • 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.