picwizz
-
Posts
5 -
Joined
-
Last visited
Posts posted by picwizz
-
-
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);}});} -
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
-
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'; } ?>
-
Hey everyone, iv recently made a simple image hosting website for forums, ebay, craigslist etc.
Give me feedback
And start using it
Experienced Web developer ready to work :D
in Archived Job Offerings
Posted
Hi all, i am an experienced web developer with over 2 years in the following programming languages. Php, PHP OOP, MySQL, Css, Html, ajax, jquery. I have built alot of websites from image hosting websites, shopping websites, custom cms, social networks. Here is just a little bit of my work www.dldesigns.me . If you need a website built just drop me an email contact@dldesigns.me
Thanks