如何在特定用户主页中添加事件? [英] how to add a event in particular user home page?
本文介绍了如何在特定用户主页中添加事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
event.php
<? php
session_start();
include(' connection.php');
function checkValues($ value)
{
$ value = 修整($值);
if (get_magic_quotes_gpc())
{
$ value = stripslashes($ 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'];
< span class =code-summarycomment>
if(@ $ _ REQUEST ['val'])
{
$ EventInput = checkValues($ _ REQUEST [' EventInput']);
$ datepicker = checkValues( $ _REQUEST [' datepicker']);
$ datepicker = $ datepicker。' '。$ _ REQUEST ['start_time_min'];
$ datepicker = strtotime($ datepicker);
$ where_text = checkValues($ _ REQUEST [' 其中']);
$ 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(日期(Ymd H: i:s))。'));
$ limit = limit 1 ;
}
$ result = mysql_query( SELECT * FROM facebook_event 其中 users_ip =' 。$ users_ip。' order 按 id desc 。$ limit);
< span class =code-summarycomment>
while ($ row = mysql_fetch_array ($ result))
{
? >
< div class = show_event >
< img src = ico.png style = float:left; alt = / >
< label 样式 = float:left class = text >
< b > <? php echo $ row ['EventInput'];? > < / b >
< br / >
<? < span class =code-summarycomment> php echo $ row ['where_text'];? >
< br / >
<? php echo date( F d, < span class =code-summarycomment> Y h:ia,$ row ['datepicker'] ); >
< / label >
< < span class =code-leadattribute> a href = # class = delete id = record-<?php echo $ row ['id']?> > x < / a >
< br clear = 全部 / >
< / div >
<? php
}
? >
解决方案
value)
{
< span class =code-summarycomment>
value = trim(
value);
if (get_magic_quotes_gpc())
{
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
}
?>
解决方案
value) {
value = trim(
value); if (get_magic_quotes_gpc()) {
这篇关于如何在特定用户主页中添加事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文