Jump to content

picwizz

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by picwizz

  1. i have done that here is the full function function like(pid){ $.post('inc/like.php', {pid:pid}, function(data){ if(data == "yes"){ countlike(pid); $('.likehide'+pid).html('<a href="#" onclick="unlike(pid); return false;">unlike</a>'); } else { alert("error:"+ data); } }); }
  2. hi, im having trouble with the following code this is just one line from the code which is not working $('.likehide'+pid).html('<a href="#" onclick="unlike(pid); return false;">unlike</a>'); The code works but when i inspect the element, it shows up like this <a href="#" onclick="unlike(pid); return false;">unlike</a> it should not have "pid" it should be displaying the pid value What am i doing wrong in the jquery code? Thanks
  3. HI all. Iv made this ajax comment system it works but not properly. When you first use it, it works but when you add a second post it doesnt show until i refresh the page. So how to i make this work properly, so you can keep commenting more that one post without refreshing. Thanks in advance here is the jquery function postDash(){ var details = $('#postdetails').val(); var pu = $('#profileuser').val(); var dataString = 'details='+ details + '&pu='+ pu; if(details == "" || pu == ""){ $('.postmessage').html("Write something then!"); } else { $('.postmessage').html("Posting now..."); $.ajax({ type: "POST", url: "inc/profilepost.php", data: dataString, cache: false, success: function(data){ $('.postmessage').hide(); $('#eachpostcon').html(data); } }); } return false; } here is the profilepost.php script <?php include_once("func.php"); if($_POST){ $details = $_POST['details']; $pu = $_POST['pu']; mysql_query("INSERT INTO propost (details, pu, su, date) VALUES('$details','$pu','$session_rand', now())") or die (mysql_error()); } else { echo 'No!'; } ?> <div id="conbb"> <div id="coneach"><?php echo $details; ?></div> </div> here is the html <div id="coneach"> <form action="" method="post" onsubmit="return false;"> <textarea rows="3" id="postdetails" placeholder="Post to dashboard" class="dashboardform"></textarea> <input type="hidden" id="profileuser" value="<?php echo $id; ?>" /> <div class="spandbtn"><input type="submit" value="Post!" onclick="postDash()" /></div> <div class="spandmess"><span class="postmessage"></a></div> <div class="clear"></div> </form> </div> </div> <div id="eachpostcon"> </div> <?php $getposts = mysql_query("SELECT * FROM propost WHERE pu='$id' ORDER BY date DESC"); $countposts = mysql_num_rows($getposts); if($countposts > 0){ while($row = mysql_fetch_array($getposts)){ $pdet = $row['details']; $date = $row['date']; echo ' <div id="conbb"> <div id="coneach">' .$pdet. '</div> </div>'; } } else { echo 'No Posts yet'; } ?>
  4. Hey everyone, iv recently made a simple image hosting website for forums, ebay, craigslist etc. Its http://www.picwizz.com Give me feedback And start using it
×
×
  • 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.