Click here to Skip to main content
15,443,430 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
AnswerRe: PHP Getting Data From Javascript Pin
Richard Deeming24-Oct-17 2:08
mveRichard Deeming24-Oct-17 2:08 
QuestionHow do I Attach acrobat pdf page to email in codeigniter? Pin
Member 1347022217-Oct-17 4:13
MemberMember 1347022217-Oct-17 4:13 
SuggestionRe: TLDR Pin
Richard Deeming17-Oct-17 4:31
mveRichard Deeming17-Oct-17 4:31 
QuestionThinkphp 5.0 query table how the array of how to get rid of a column? And then save it to another table? Pin
micccn13-Oct-17 23:37
Membermicccn13-Oct-17 23:37 
Questionhelp me on my php script Pin
horlartech8-Sep-17 12:03
Memberhorlartech8-Sep-17 12:03 
SuggestionRe: help me on my php script Pin
Richard MacCutchan8-Sep-17 19:24
mveRichard MacCutchan8-Sep-17 19:24 
GeneralRe: help me on my php script Pin
horlartech10-Sep-17 2:39
Memberhorlartech10-Sep-17 2:39 
GeneralRe: help me on my php script Pin
horlartech10-Sep-17 2:49
Memberhorlartech10-Sep-17 2:49 
this the do post code

0)
{
$binfo = mysql_fetch_array(mysql_query("SELECT * FROM `bannedusers` WHERE username='$user' AND boardid=$bid"));
$reason = $binfo["reason"];
$date = $binfo["date"];
$unbandate = $binfo["unbandate"];
$today = time();
if($today < $unbandate) {
$pagetitle = "You Have Been Banished By one of the Administrator From Posting On This Board!.";
require('incfiles/head.php');
$ud = date('l jS F Y \a\t g:I A', $unbandate);
$bd = date('l jS F Y \a\t g:I A', $date);
echo "

You Have Been Banished By one of the Administrator From Posting On This Board!.

Reason: $reason

Banned Date: $bd

Unbanned Date: $ud

";
require('incfiles/end.php');
die();
} else {
mysql_query("DELETE FROM bannedusers WHERE username='$user' ANd id=$bid");
$pagetitle = "U have Just Been Unbanned";
require('incfiles/head.php');
$msg="U Hav Just Been Unbanned Pls Refresh This Page";
echo "
$msg
";
}
}

$modcheck = mysql_num_rows(mysql_query("SELECT * FROM moderators WHERE username = '$user' AND boardid = '$bid'"));

$admincheck = mysql_num_rows(mysql_query("SELECT * FROM admins WHERE username = '$user'"));

$modcheck2 = mysql_num_rows(mysql_query("SELECT * FROM moderators WHERE username = '$user' AND type = 'super'"));

if($locked > 0 && $admincheck < 1 && $modcheck < 1 && $modcheck2 < 1)
{
$pagetitle = "This topic As Been Locked From Creatin New Post Please Try Again Later";
require('incfiles/head.php');
functions::display_error('This topic As Been Locked From Creatin New Post Please Try Again Later');
require('incfiles/end.php');
die();
}
$erros=array();

if(isset($_FILES["attachment"]))
{

for ($i = 0; $i <= 3; $i++)
{
$ffilename = $_FILES['attachment']['name'][$i];
if($ffilename)
{
$ext = end(explode(".",strtolower($ffilename)));
$valid_exts = $config->validExtension;
$size = $_FILES["attachment"]["size"][$i];
$path = "attachment/".$_FILES['attachment']['name'][$i];

if($size<10)
{
$errors[]="File must be larger than 10Bytes!";
}

if($size>50000000)
{
$errors[]="size too larg!";
}


$img_exts = $config->imgExtension;

if(in_array($ext,$img_exts))
{
if($size > 10000000)
{
$errors[]="size too larg!";
}
}


if(!in_array($ext,$valid_exts))
{
$errors[] ="invalid file extension!";
}

}
}
}




$message = functions::cleaninput($_POST["body"]);

if(empty($message) || strlen($message)<4 || strlen($message)>5000000)
{
$errors[]="Your content is too short or more than 5000000";
}

$ctime = time() - 20;
$pcheck = mysql_num_rows(mysql_query("SELECT * FROM posts WHERE topicid=$id AND date>'$ctime' AND poster='$user' AMD message='$message'"));

if($pcheck > 0)
{
$errors[]="You can't post same post in less than 20sec";
}

if(count($errors) > 0)
{
$string = "";
foreach($errors as $error)
{
$string .= "$error
";
}
$pagetitle = "Error";
require('incfiles/head.php');
functions::display_error($string);
require('incfiles/end.php');
die();
}

$numrows3 = mysql_num_rows(mysql_query("SELECT * FROM posts WHERE topicid=$id"));

$position = $numrows3 + 1;

$date = time();
$query = mysql_query("INSERT INTO posts SET poster='$user', date='$date', topicid='$id', message='$message', type='reply', position='$position'");
if(!$query)
{
$pagetitle = "An error occured";
require('incfiles/head.php');
functions::display_error('An error occured');
require('incfiles/end.php');
die();
}


$fabc = mysql_fetch_array(mysql_query("SELECT * FROM posts WHERE date='$date' AND message='$message' AND topicid='$id'"));
$ffid=$fabc["id"];


if(isset($_FILES["attachment"]))
{
for ($i = 0; $i <= 3; $i++)
{
$ffilename = $_FILES['attachment']['name'][$i];
if($ffilename)
{
$frand=rand(0000, 9999);
$filename = preg_replace('/[^a-zA-Z0-9-_\.]/i','',$_FILES['attachment']['name'][$i]);

$path = $config->attachmentFolder . $frand . preg_replace('/[^a-zA-Z0-9-_\.]/i','',$_FILES['attachment']['name'][$i]);
$sfile = $frand.$filename;
$size = $_FILES["attachment"]["size"][$i];
$ext = end(explode(".",strtolower($ffilename)));
copy($_FILES['attachment']['tmp_name'][$i],
$path);
if(strlen($filename) > 3)
{
mysql_query("INSERT INTO attachment SET `name`='$filename', `by`='$user', `url`='$sfile', size='$size', extension='$ext', `date`='$date', `postid`='$ffid', `topicid`='$id'") or mysql_error();
}

}



}

}
mysql_query("UPDATE topics SET lastposter='$user', lastpostdate='$date' WHERE id=$id");



mysql_query("UPDATE usersfollow SET hasread=hasread+1 WHERE following='$user'");

mysql_query("UPDATE follow SET hasread=hasread+1 WHERE type='topic' AND itemid=$id");

if(isset($_POST["follow"]) && $_POST["follow"] =='on')
{
mysql_query("INSERT INTO follow SET follower='$user', date='$date', itemid='$id', type='topic'");
}

$rowsperpage2 = $config->postsperpage;
$numrows2 = mysql_num_rows(mysql_query("SELECT * FROM posts WHERE topicid='$id'"));
$lpage = ceil($numrows2/$rowsperpage2);


header("location: ".urls::topic($title, $id, $lpage)."#".$ffid."");
exit();

} else {
$pagetitle = "Error";
require('incfiles/head.php');
functions::display_error('Error');
require('incfiles/end.php');
die();
}
?>
QuestionRe: help me on my php script Pin
Richard MacCutchan10-Sep-17 4:17
mveRichard MacCutchan10-Sep-17 4:17 
QuestionCall to a member function prepare() on a non-object Pin
Igoussam28-Aug-17 10:56
MemberIgoussam28-Aug-17 10:56 
AnswerRe: Call to a member function prepare() on a non-object Pin
Richard MacCutchan28-Aug-17 21:36
mveRichard MacCutchan28-Aug-17 21:36 
Questionhow to get hard disk Serial Number using php on server side Pin
Lakshmanan Duraisamy26-Jul-17 23:15
MemberLakshmanan Duraisamy26-Jul-17 23:15 
AnswerRe: how to get hard disk Serial Number using php on server side Pin
Richard MacCutchan26-Jul-17 23:35
mveRichard MacCutchan26-Jul-17 23:35 
AnswerRe: how to get hard disk Serial Number using php on server side Pin
Jochen Arndt27-Jul-17 0:09
professionalJochen Arndt27-Jul-17 0:09 
SuggestionRe: how to get hard disk Serial Number using php on server side Pin
Richard Deeming27-Jul-17 1:31
mveRichard Deeming27-Jul-17 1:31 
QuestionPHP connecting to vb.Net Pin
Member 1296881918-Jul-17 19:48
MemberMember 1296881918-Jul-17 19:48 
AnswerRe: PHP connecting to vb.Net Pin
Richard MacCutchan18-Jul-17 20:49
mveRichard MacCutchan18-Jul-17 20:49 
QuestionTrying to create a secure login script, just have a few questions. Pin
BlackMagix14-May-17 4:40
MemberBlackMagix14-May-17 4:40 
AnswerRe: Trying to create a secure login script, just have a few questions. Pin
Superolmo10-Jul-17 9:09
MemberSuperolmo10-Jul-17 9:09 
QuestionSorting array and adding position numbers while/after sorting Pin
Member 131868238-May-17 4:15
MemberMember 131868238-May-17 4:15 
QuestionHelp Pin
Member 1302311826-Apr-17 3:40
MemberMember 1302311826-Apr-17 3:40 
AnswerRe: Help Pin
Jochen Arndt26-Apr-17 3:58
professionalJochen Arndt26-Apr-17 3:58 
GeneralRe: Help Pin
Member 1302311826-Apr-17 4:14
MemberMember 1302311826-Apr-17 4:14 
GeneralRe: Help Pin
Jochen Arndt26-Apr-17 4:43
professionalJochen Arndt26-Apr-17 4:43 
GeneralRe: Help Pin
Member 1302311826-Apr-17 4:55
MemberMember 1302311826-Apr-17 4:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.