File "envoi_forum.php"

Full path: /home/meharicl/www/diaporama/envoi_forum.php
File size: 4.86 B
MIME-type: text/html
Charset: 8 bit

Download   Open   Edit   Advanced Editor   Back

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>
<title>Sans Titre</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="generator" content="HAPedit 3.1">
</head>
<body bgcolor="#FFFFFF">
<?php
  // Your code here
  $link = mysqli_connect("mehariclmod1.mysql.db", "mehariclmod1", "Pva131254", "mehariclmod1");
if (!$link) {
    echo "Erreur : Impossible de se connecter  MySQL." . PHP_EOL;
    echo "Errno de dbogage : " . mysqli_connect_errno() . PHP_EOL;
    echo "Erreur de dbogage : " . mysqli_connect_error() . PHP_EOL;
    exit;
}      //var_dump($_POST);
       $album_title=$_POST['album'];
       $post_id=$_POST['user']; //echo("*****".$post_id);
       $bbcode_uid=random_string();
       $text= $_POST['description']."-------------[diaporama:".$bbcode_uid."]".$album_title ."[/diaporama:".$bbcode_uid."]";
       //$crc=md5($text);
       //echo($text);
       //echo( $bbcode_uid);
       /*$sql="INSERT INTO `phpbb3_posts` ( `post_id` , `topic_id` , `forum_id` , `poster_id` , `icon_id` , `poster_ip` , `post_time` , `post_approved` , `post_reported` , `enable_bbcode` , `enable_smilies` , `enable_magic_url` , `enable_sig` , `post_username` , `post_subject` , `post_text` , `post_checksum` , `post_attachment` , `bbcode_bitfield` , `bbcode_uid` , `post_postcount` , `post_edit_time` , `post_edit_reason` , `post_edit_user` , `post_edit_count` , `post_edit_locked` )
VALUES (
'', '53101', '58', '".$post_id."', '0', '', '".time()."', '1', '0', '1', '1', '1', '1', '', '', '".
$text.
"', '".$crc."', '0', 'AAAB', '".
$bbcode_uid.
"', '1', '0', '', '0', '0', '0')

";
$session_post = $link->query($sql);


echo($sql);
echo("<br>".time().'<br>'); */

$session_post = $link->query("SELECT `post_id` , `topic_id` , `forum_id` , `poster_id` , `icon_id` , `poster_ip` , `post_time` , `post_approved` , `post_reported` , `enable_bbcode` , `enable_smilies` , `enable_magic_url` , `enable_sig` , `post_username` , `post_subject` , `post_text` , `post_checksum` , `post_attachment` , `bbcode_bitfield` , `bbcode_uid` , `post_postcount` , `post_edit_time` , `post_edit_reason` , `post_edit_user` , `post_edit_count` , `post_edit_locked`
FROM `phpbb3_posts` 
WHERE  `post_id` = 214209");
while ($row_user = $session_post->fetch_assoc()) {
$post_text=$row_user['post_text']; //echo($post_text."<br>");
$bbcode_uid=$row_user['bbcode_uid']; //echo($bbcode_uid."<br>");
}
$session_post = $link->query("
SELECT `user_id` , `user_type` , `group_id` , `user_permissions` , `user_perm_from` , `user_ip` , `user_regdate` , `username` , `username_clean` , `user_password` , `user_passchg` , `user_pass_convert` , `user_email` , `user_email_hash` , `user_birthday` , `user_lastvisit` , `user_lastmark` , `user_lastpost_time` , `user_lastpage` , `user_last_confirm_key` , `user_last_search` , `user_warnings` , `user_last_warning` , `user_login_attempts` , `user_inactive_reason` , `user_inactive_time` , `user_posts` , `user_lang` , `user_timezone` , `user_dst` , `user_dateformat` , `user_style` , `user_rank` , `user_colour` , `user_new_privmsg` , `user_unread_privmsg` , `user_last_privmsg` , `user_message_rules` , `user_full_folder` , `user_emailtime` , `user_topic_show_days` , `user_topic_sortby_type` , `user_topic_sortby_dir` , `user_post_show_days` , `user_post_sortby_type` , `user_post_sortby_dir` , `user_notify` , `user_notify_pm` , `user_notify_type` , `user_allow_pm` , `user_allow_viewonline` , `user_allow_viewemail` , `user_allow_massemail` , `user_options` , `user_avatar` , `user_avatar_type` , `user_avatar_width` , `user_avatar_height` , `user_sig` , `user_sig_bbcode_uid` , `user_sig_bbcode_bitfield` , `user_from` , `user_icq` , `user_aim` , `user_yim` , `user_msnm` , `user_jabber` , `user_website` , `user_occ` , `user_interests` , `user_actkey` , `user_newpasswd` , `user_form_salt` , `user_new` , `user_reminded` , `user_reminded_time`
FROM `phpbb3_users` 
WHERE 1 AND `user_id` = ". $post_id);
while ($row_user = $session_post->fetch_assoc()) {
$username=$row_user['username']; //echo($username."<br>");
}
$new_text=$_POST['description']."-----Par ".$username."--------[diaporama:".$bbcode_uid."]".$album_title ."[/diaporama:".$bbcode_uid."]"."\r\n";
$new_text=$new_text.$post_text;
//echo($new_text."<br>");
$sql="UPDATE `phpbb3_posts` SET `post_time` = '".time()."',
`post_text` = '".$new_text."',
`post_checksum` = '".md5($new_text)."' WHERE `post_id` = '214209'
";
//echo($sql);
$link->query($sql);
//header('Location: http://www.mehariclubdefrance.com/diaporama/mail.php');
header('Location: http://www.mehariclubdefrance.com/phpBB3/viewtopic.php?f=58&p=214209#p214209');

function random_string($length=8){
    $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
    $string = '';
    for($i=0; $i<$length; $i++){
        $string .= $chars[rand(0, strlen($chars)-1)];
    }
    return $string;
}
?>
</body>

</html>