Jump to content

willdikuloz

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Everything posted by willdikuloz

  1. Nevermind, the DISTINCT(ip) did the trick! thanks so much!
  2. hmm, now nothing shows up oracle, why is this damn thing so complicated?
  3. I've messed around with it more, (deleted mysql connect to post this) [code] $ipaddy = $_SERVER['REMOTE_ADDR']; $query = "SELECT userip FROM ipbase WHERE userip = '$ipaddy'"; $result = mysql_query($query) or die("mysql error: " . mysql_error()); $line = mysql_fetch_assoc($result); $ipaddy = $_SERVER['REMOTE_ADDR']; $ipad = $line['userip']; if ( $result == '' ){ echo 'Hello!';     $query = "INSERT INTO `ipbase`(`userip`)VALUES('$ipaddy')"; $result = mysql_query($query) or die(mysql_error()); echo "$ipad $ipaddy"; } else  { echo " "; }; [/code] how can I make the Message show if there is no result?
  4. still nothing, I was messing around with the code a bit, I think it has something to do with the if statements where it's not read them right. [code] $ipaddy = $_SERVER['REMOTE_ADDR']; $ipaddy2 = str_replace(".","",$ipaddy); $connect = mysql_connect(localhost,...,...); $db = mysql_select_db(...,$connect); $query = "SELECT userip FROM ipbase WHERE userip=$ipaddy2"; $result = mysql_query($query) or die("mysql error: " . mysql_error()); $line = mysql_fetch_assoc($result); $ipad = $line['ip'];     $ipad2 = $ipaddy2; if ( $ipad == $ipad2){ echo ''; } if ( $ipad != $ipad2) { echo 'Welcome';     $query = "INSERT INTO `ipbase` (`userip`) VALUES('$ipaddy2')"; $result = mysql_query($query) or die(mysql_error()); }; [/code]
  5. The Welcome message for some reason will not show even with the modified new code. weird, I don't know what could be wrong.
  6. [code]$ipaddy = $_SERVER['REMOTE_ADDR']; $ipaddy = str_replace('.','',$ipaddy); $query = "SELECT ip FROM ipbase WHERE ip='$ipaddy'"; $result = mysql_query($query) or die("mysql error: " . mysql_error()); while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { $ipad = $line['ip']; if ( $ipad == $ipaddy ){   echo 'Welcome!'; $query = "INSERT INTO ipbase(ip) VALUES('$ipaddy')"; $result = mysql_query($query) or die(mysql_error()); } else {   echo ""; } }  [/code] I am having problems where if it is a new user, the Welcome message will not show. I know this is a waste of resources but I am sure for my purpose, it will be worth it.
  7. Doesn't work, I heard that empty values is different from null.
  8. Is there a way to SELECT only entries that actually have something in them and ignore the empty ones?
  9. [!--quoteo(post=382554:date=Jun 11 2006, 01:10 PM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Jun 11 2006, 01:10 PM) [snapback]382554[/snapback][/div][div class=\'quotemain\'][!--quotec--] The permission problem is not with the uploaded file, but with the directory you're putting the pictures in. The permissions on the directory have to be set such that the user that the webserver is using (usually nobody) can write to the directory. Ken [/quote] I've heard about that but have no idea how I can do that.
  10. [code]if (isset($_POST['dat'])) { $query = "SELECT post FROM posts ORDER BY post DESC"; $result = mysql_query($query) or die(mysql_error()); $pst = 0; while ($link = mysql_fetch_array($result, MYSQL_ASSOC)) {   if ($link['post'] > $pst) {    $pst = $link['post'];   } } $pst++; $title = $_POST['title']; $dat = $_POST['dat']; $reads = 0; $type = $_POST['type']; $link = $_POST['link'];   $filetype = $_POST['fileupload']; $query = "INSERT INTO posts(post,title,type,link,dat) VALUES('$pst','$title','$type','$link','$dat')"; $result = mysql_query($query) or die(mysql_error()); $target = "$filetype/"; $target = $target . basename( $_FILES['uploaded']['name']); $ok=1; if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else { echo "Sorry, there was a problem uploading your file."; } echo "<h3><center><a href=\"addpost.php\">CLICK HERE</a></center></h3>"; } else { echo "<form action=\"addpost.php\" enctype=\"multipart/form-data\" method=\"POST\">"; echo "<br>"; echo "Title: <input name=\"title\"><br>"; echo "Link: <input name=\"link\"><br>";   echo "Category: <select name=\"type\"> <option>Select A Category!</option> <option value=\"image\">Image</option> <option value=\"movie\">Movie</option> <option value=\"flash\">Flash</option> <option value=\"pron\">Porn</option> <option value=\"link\">Links</option> </select><br>"; echo "File: <input name=\"uploaded\" type=\"file\"><br>";    echo "Type : <select name=\"fileupload\"> <option>Select A Type!</option> <option value=\"images\">Image</option> <option value=\"movies\">Movie</option> <option value=\"flash\">Flash</option> </select><br>"; echo "<input type=\"hidden\" value=\"" . strtotime(now) . "\" name=\"dat\">"; echo "<input name=\"submit\" type=\"submit\" value=\"Add new post!\">"; echo "</form>"; }[/code] here is my code, I have an upload script but the problem is whenever I upload something, it has the wrong permissions, especially with pictures (which can't be viewed due to bad permisisons). Is there anyway I can upload the file with 777 permission?
  11. thanks alot, btw Jin > every other character in Marvel v Capcom period.
  12. [code] if ( $type == link ) { echo ' <tr><td width="50"><img src="' .$type. '.gif"></td><td width="340"><a href="' .$link. '" target="_blank" class="postlink">' .$title. '</a></td><td width="50"><font size="1" face="verdana" color="#A5A5A5"><i>' .$dat. '</i></font></td></tr> '; } else { echo ' <tr><td width="50"><img src="' .$type. '.gif"></td><td width="340"><a href="view.php?view=' .$post. '" class="postlink">' .$title. '</a></td><td width="50"><font size="1" face="verdana" color="#A5A5A5"><i>' .$dat. '</i></font></td></tr> '; }[/code] is it possible to put two words for example [code]if ( $type == link OR image )[/code] obviously "OR" doesn't work but is there anyway for it to look for 2 variables at one time?
  13. Is there a script/snippet to show X amount of banners in random order?
×
×
  • 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.