Click here to Skip to main content
15,912,072 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<?php
event.php

session_start();

include('connection.php');

function checkValues($value)
{
    $value = trim($value);
    if (get_magic_quotes_gpc())
    {
        $value = stripslashes($value);
    }
    $value = strtr($value,array_flip(get_html_translation_table(HTML_ENTITIES)));
    $value = strip_tags($value);
    $value = mysql_real_escape_string($value);
    $value = htmlspecialchars($value);
    return $value;
}
$limit = "";
$users_ip = $_SERVER['REMOTE_ADDR'];


if(@$_REQUEST['val'])
{
    $EventInput     = checkValues($_REQUEST['EventInput']);
    $datepicker     = checkValues($_REQUEST['datepicker']);

    $datepicker     = $datepicker.' '.$_REQUEST['start_time_min'];
    $datepicker     = strtotime($datepicker);

    $where_text     = checkValues($_REQUEST['Where']);
    $WhoInvited     = checkValues($_REQUEST['WhoInvited']);

    mysql_query("INSERT INTO facebook_event (EventInput,datepicker,where_text,WhoInvited,users_ip,date_created) VALUES('".$EventInput."','".$datepicker."','".$where_text."','".$WhoInvited."','".$users_ip."','".strtotime(date("Y-m-d H:i:s"))."')");

    $limit = "limit 1";
}

$result = mysql_query("SELECT * FROM facebook_event where users_ip = '".$users_ip."'  order by id desc " .$limit);

while ($row = mysql_fetch_array($result))
{
?>
   <div class="show_event">
       <img src="ico.png" style="float:left;" alt="" />
       <label style="float:left" class="text">
       <b><?php echo $row['EventInput'];?></b>
       <br />
       <?php echo $row['where_text'];?>
       <br />
       <?php echo date("F d, Y h:ia",$row['datepicker']);?>
       </label>

       <a href="#" class="delete" id="record-<?php  echo $row['id']?>">x</a>
        <br clear="all" />
   </div>
<?php
}

?>



THE BELOW MY USER HOME BELOW PAGE:
homrad.php
// Inialize session
session_start();

// Check, if username session is NOT set then this page will jump to login page
if (!isset($_SESSION['email'])) {
header('Location: index.php');
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Radbook</title>
<link href="file:///C|/wamp/www/radform/style.css" rel="stylesheet" type="text/css" />
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />

<!-- WALLPOST JQRY SCRIPTS

<link href="facebox.css" media="screen" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="jquery-1.2.6.min.js"></script>
<script type="text/javascript" src="jquery.livequery.js"></script>
<link href="dependencies/screen.css" type="text/css" rel="stylesheet" />

<script src="jquery.elastic.js" type="text/javascript" charset="utf-8"></script>

<script src="jquery.watermarkinput.js" type="text/javascript"></script>

<script type="text/javascript">

// <![CDATA[

$(document).ready(function(){

$('#shareButton').click(function(){

var a = $("#watermark").val();
if(a != "What's on your mind?")
{
$.post("posts.php?value="+a, {

}, function(response){

$('#posting').prepend($(response).fadeIn('slow'));
$("#watermark").val("What's on your mind?");
});
}
});


$('.commentMark').livequery("focus", function(e){

var parent = $('.commentMark').parent();
$(".commentBox").children(".commentMark").css('width','320px');
$(".commentBox").children("a#SubmitComment").hide();
$(".commentBox").children(".CommentImg").hide();

var getID = parent.attr('id').replace('record-','');
$("#commentBox-"+getID).children("a#SubmitComment").show();
$('.commentMark').css('width','300px');
$("#commentBox-"+getID).children(".CommentImg").show();
});

//showCommentBox
$('a.showCommentBox').livequery("click", function(e){

var getpID = $(this).attr('id').replace('post_id','');

$("#commentBox-"+getpID).css('display','');
$("#commentMark-"+getpID).focus();
$("#commentBox-"+getpID).children("CommentImg").show();
$("#commentBox-"+getpID).children("a#SubmitComment").show();
});

//SubmitComment
$('a.comment').livequery("click", function(e){

var getpID = $(this).parent().attr('id').replace('commentBox-','');
var comment_text = $("#commentMark-"+getpID).val();

if(comment_text != "Write a comment...")
{
$.post("add_comment.php?comment_text="+comment_text+"&post_id="+getpID, {

}, function(response){

$('#CommentPosted'+getpID).append($(response).fadeIn('slow'));
$("#commentMark-"+getpID).val("Write a comment...");
});
}

});

//more records show
$('a.more_records').livequery("click", function(e){

var next = $('a.more_records').attr('id').replace('more_','');

$.post("posts.php?show_more_post="+next, {

}, function(response){
$('#bottomMoreButton').remove();
$('#posting').append($(response).fadeIn('slow'));

});

});

//deleteComment
$('a.c_delete').livequery("click", function(e){

if(confirm('Are you sure you want to delete this comment?')==false)

return false;

e.preventDefault();
var parent = $('a.c_delete').parent();
var c_id = $(this).attr('id').replace('CID-','');

$.ajax({

type: 'get',

url: 'delete_comment.php?c_id='+ c_id,

data: '',

beforeSend: function(){

},

success: function(){

parent.fadeOut(200,function(){

parent.remove();

});

}

});
});

/// hover show remove button
$('.friends_area').livequery("mouseenter", function(e){
$(this).children("a.delete").show();
});
$('.friends_area').livequery("mouseleave", function(e){
$('a.delete').hide();
});
/// hover show remove button


$('a.delete').livequery("click", function(e){

if(confirm('Are you sure you want to delete this post?')==false)

return false;

e.preventDefault();

var parent = $('a.delete').parent();

var temp = parent.attr('id').replace('record-','');

var main_tr = $('#'+temp).parent();

$.ajax({

type: 'get',

url: 'delete.php?id='+ parent.attr('id').replace('record-',''),

data: '',

beforeSend: function(){

},

success: function(){

parent.fadeOut(200,function(){

main_tr.remove();

});

}

});

});

$('textarea').elastic();

jQuery(function($){

$("#watermark").Watermark("What's on your mind?");
$(".commentMark").Watermark("Write a comment...");

});

jQuery(function($){

$("#watermark").Watermark("watermark","#369");
$(".commentMark").Watermark("watermark","#EEEEEE");

});

function UseData(){

$.Watermark.HideAll();

//Do Stuff

$.Watermark.ShowAll();

}

});

//

</script> -->


<!-- WALLPOST JQRY SCRIPTS ENDS -->






</head>

<body>

   


<!-- chat section --!> <!-->

<img src="images/head1.jpg" alt="heading" width="1000" height="71" /> 

<img src='http://www.gravatar.com/avatar/?d=mm' class='avatar_img'/>


<!--


<form action="" method="post" name="postsForm">




<textarea class="input" id="watermark" name="watermark" style="height:20px" cols="60"></textarea>









</form>








-->



Chat Window

From(Your Name or Id):  <input type="text" name="sender" id="sender">



 

Online Users



<style type="text/css">
.chat_box{
border-style:solid;
border-width:medium;
width:200px;
height:300px;
float:left;

}
#msg{
width:200px;
height:200px;
overflow:auto;
}
#new_msg_text
{
width:200px;
height:50px;
}
#close_button{
width:20px;
height:20px;
}
.user_list{

}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
window.setInterval(function() {
viewMsg();
viewOnlineUsers();
createNewChatBox();

},1000);
});

function creatNewBox(receiver)
{
var newbox ="
"+
"
<input type='text' name='receiver[]' READONLY value='"+
receiver+"' id='receiver'><img id='close_button' src='images/close_button.jpg' alt='X' önclick='closeWindow($(this))'/>
"+
"
"+
"





"+
"
<textarea rows='4' cols='10' id='new_msg_text'> </textarea>
"+
"<input type='button' id='btn' önclick='saveMsg($(this))'>"+
"
";

return newbox;
}

function createNewChatBox()
{
var sender=$("#sender").val();
$("#chat_list").load('back.php?opt=get_chat&sender='+sender);
$("input[name='chat_users[]']").each(function(){

viewBox($(this).val());
});
}
function viewBox(receiver)
{
if($.trim($("#sender").val())==$.trim(receiver))
return;
$(document).ready(function(){
var flag=false;
$("input[name='receiver[]']").each(function(){

if($(this).val()==receiver)
{flag=true;}
});
if(flag==false)$("#chat_view").append(creatNewBox(receiver));
});
}

function viewOnlineUsers()
{
var sender=$("#sender").val();
$("#users").load('back.php?opt=view_users&sender='+sender);

}
function closeWindow(obj)
{
obj.parent().parent().remove();
}

function viewMsg()
{
var sender=$("#sender").val();
$("input[name='receiver[]']").each(function(){
var receiver=$(this).val();
$("#chat_box_"+receiver).find("#msg").load('back.php?opt=view_msg&sender='+sender+"&receiver="+receiver);
});
}

function saveMsg(obj)
{
var receiver=obj.parent().find("#receiver").val();

var sender=$("#sender").val();
var msg=obj.parent().find("#new_msg_text").val();

$.ajax({
type: 'POST',
url: 'back.php?opt=save',
data: {"receiver":receiver,"sender":sender,"msg":msg},
success: function(){

alert("success");
}

});
}
</script>






 
ur updating status is waitingrss
PAGE FEEDS 
EVENTS  
LIKE PAGES 
CREATE PAGES 




</body>
</html>
pls anybdy knowledge help me abt!!!!!
Thanking uu
Posted
Updated 2-Jan-13 20:54pm
v2
Comments
Abhishek Pant 3-Jan-13 3:06am    
improve your question as well formatted code
Killzone DeathMan 3-Jan-13 5:16am    
Agree!
Interesting question...
Zamshed Farhan 14-Jan-13 10:00am    
Please, make the code well-look to check, it's very hazy!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900