Jump to content

$php_mysql$

Members
  • Posts

    391
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

$php_mysql$'s Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. oh in my case i do not have registered users there is no login or register on my site its just come and post. how can i implant it for that?
  2. ok u mean while storing the data i even store their session in a row and use that session? can you please guide me to some simple examples? thanks soo much
  3. friends whats wrong with this piece of code that one user on my site spams the same thing over and over tho i have added flood control for 6hours but he posts right after posting one. i have tested myself it works for me but why not for that user? if($_SESSION['last_session_request'] > time() - 21600){ header("location: antiflood.php?post=wait"); exit; } $_SESSION['last_session_request'] = time();
  4. i got that but why is it not executing my sql query? no matter what ever numeric value i input i get it printed by using print_r(); func but when i use $id = $_POST['id']; nothing prints <?php include 'db.php'; print_r($_POST['id']); if(isset($_POST['submit'])){ $id = $_POST['id']; // The $id is not effecting the sql query WHERE id='".$id."' $sql="SELECT `id`, `image` FROM `tbl` WHERE id='".$id."'"; $result = mysql_query($sql); if(!$result){ }else{ while($row = mysql_fetch_array($result)){ if (mysql_num_rows($result)) { $id = $row['id']; if(!unlink($row['image'])){ } } $sql="DELETE FROM tbl WHERE id = '".$id."'"; $result= mysql_query($sql); if(!$result){ } } } } ?> <form action="delete.php" method="POST"> <input type="text" name="id"> <input type="submit" value="Delete"> </form>
  5. something is still not right tho i made method to GET but nothing is happening in act=delete the values are not being executed there
  6. There lies your problem. still no value is being sent to act=delete i tried that too before
  7. Hey all whats wrong when i hit submit the numeric value which i enter is not being sent to act=delete <?php include 'db.php'; $act = $_GET["act"]; $id=$_GET["id"]; echo '<form action="delete.php?act=delete" method="post">'; echo '<input type="text" name="del">'; echo '<input type="submit" value="Delete">'; echo '</form>'; if($act=='delete'){ $id = $_GET['del']; $sql="SELECT `id`, `image` FROM `tbl` WHERE id='".$id."'"; $result = mysql_query($sql); if(!$result){ echo 'SELECT failed: '.mysql_error(); }else{ while($row = mysql_fetch_array($result)){ if (mysql_num_rows($result)) { $id = $row['id']; if(!unlink($row['image'])){ echo "unlink ".$row['image']." failed"; } } $sql="DELETE FROM tbl WHERE id = '".$id."'"; $result= mysql_query($sql); if(!$result){ echo 'DELETE from tbl with id '.$id.' failed: '.mysql_error(); } } } } ?>
  8. thanks mate but i am unable to get it to work with my existing function that i posted above?
  9. Thanks barand will be waiting on it thanks scootstah for the idea :-)
  10. friends this function creates keywords but i am having a issue, if there is a link on my string then the output that this function gives is like: httpwwwsomesitecomdetailsphpid123456 now how to make it that if it finds any http://www.somesite.com/details.php?id=123456, www.somesite.com/details.php?id=123456 or somesite.com/details.php?id=123456 than it ignores the Hyperlink and do not show anything on the output. basically ignore any sort of hyperlinks. function metakeyword($string){ $stopWords = array('i','a','about','an','and','are','as','at','be','by','com','de','en','for','from','how','in','is','it','la','of','on','or','that','the','this','to','was','what','when','where','who','will','with','und','the','www'); $string = preg_replace('/\s\s+/i', ' ', $string); // replace whitespace $string = trim($string); // trim the string $string = preg_replace('/[^a-zA-Z0-9 -]/', '', $string); // only take alphanumerical characters, but keep the spaces and dashes too… $string = strtolower($string); // make it lowercase preg_match_all('/\b.*?\b/i', $string, $matchWords); $matchWords = $matchWords[0]; foreach ( $matchWords as $key=>$item ) { if ( $item == '' || in_array(strtolower($item), $stopWords) || strlen($item) <= 3 ) { unset($matchWords[$key]); } } $wordCountArr = array(); if ( is_array($matchWords) ) { foreach ( $matchWords as $key => $val ) { $val = strtolower($val); if ( isset($wordCountArr[$val]) ) { $wordCountArr[$val]++; } else { $wordCountArr[$val] = 1; } } } arsort($wordCountArr); $wordCountArr = array_slice($wordCountArr, 0, 15); return $wordCountArr; } Please help me out you genius people Thanks in advance.
  11. thanks soo much but its not taking any effect. my current htaccess file looks like this DirectoryIndex index.php ErrorDocument 404 http://www.site.com ErrorDocument 403 http://www.site.com RewriteEngine On RewriteCond %{HTTP_HOST} ^site\.com$ [NC] RewriteRule ^(.*)$ http://www.site.com/$1 [R=301,L] RewriteRule ^details/([a-zA-z0-9-]+)_([0-9]+)$ details.php?category=$1&id=$2 [NC,L] <IfModule mod_deflate.c> <FilesMatch "\.(css|x?html?|php)$"> SetOutputFilter DEFLATE </FilesMatch> </IfModule> <IfModule mod_expires.c> ExpiresActive On ExpiresByType text/css A100 ExpiresByType text/html A100 </IfModule> i have got about 8 categories which looks like this category=animal, category=birds etc etc and details are shown according to category like category=birds&id=23
  12. friends i from my content add 155 characters into the meta description but now how do i get keyword related to the centent using php into meta keyword please guide me. its a database driven site not static. thanks
×
×
  • 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.