Click here to Skip to main content
11,477,625 members (74,612 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: PHP MySQL
event.php
<?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
}
?>
Posted 3-Jan-13 2:15am
Edited 3-Jan-13 11:52am
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

This is a code dump, not a question. The answer is, make your code check the logged in user id, and emit the event if it's required.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 239
1 Richard Deeming 225
2 Tomas Takac 150
3 Sascha Lefèvre 145
4 _duDE_ 140
0 Sergey Alexandrovich Kryukov 7,675
1 OriginalGriff 7,256
2 Sascha Lefèvre 3,034
3 Maciej Los 2,491
4 Richard Deeming 2,305


Advertise | Privacy | Mobile
Web01 | 2.8.150520.1 | Last Updated 3 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100