BG Development


: (3) 1 2 [3]   ( ) Reply to this topicStart new topicStart Poll

>  ,
borrak
: 21-04-2017, 21:06
Quote Post



:
:
:

: 16
: 13.04.17



QUOTE (erazor @ 21-04-2017, 20:11)
QUOTE (borrak @ 21-04-2017, 17:20)
SB-SYSTEM

88 user_id , .

- http://localhost/user.php?ID=1

http://localhost/user.php?ID=

!!!

!!!!
PM
Top
borrak
   : 22-04-2017, 20:07
Quote Post



:
:
:

: 16
: 13.04.17



. $_GET['ID']

http://localhost/show_post.php?postID=1

show_post.php?postID=1 SQL ID.. !!

:
CODE
if (isset($_GET['postID']) > 0) {
$postID = (int)$_GET['postID'];
$postRow = mysqli_query($dbconnect, 'SELECT * FROM sb_posts WHERE sb_post_id=' . $postID);
while ($resultPost = $postRow->fetch_assoc()) {
echo '<h1><a href="show_post.php?postID=' . $resultPost['sb_post_id'] . '">' . $resultPost['sb_post_title'] . '</a></h1>
<p class="meta"><span>:<b><a href="user.php?ID=' . $_SESSION['user_info']['user_id'] . '">' . $_SESSION['user_info']['user_name'] . '</a></b> | :<b><a href="cats.php?ID="></a></b> |:<b>30.03.2017</b></span> <span class="right">:<a href="commets.php?ID=">20 </a></span></p>
<hr class="style18">
<p>' . $resultPost['sb_post_content'] . '</p>
<hr class="style18">
<a class="comments" href="show_post.php?postID='.$resultPost['sb_post_id'].'"></a>
<hr class="style18">';
}
}


borrak 22-04-2017, 20:10
PM
Top
relax4o
: 22-04-2017, 23:07
Quote Post



:
:
:

: 1130
: 04.04.07



GET show_post.php?postID=1 - ? , ( GET, $_SERVER).

. , TRUE/FALSE > 0.

, . . , , .


--------------------
:D

QUOTE (oveRLuckEd)
PHP, .


QUOTE (nbacool2)
input , SQL Very Happy
PM
Top
borrak
   : 23-04-2017, 14:39
Quote Post



:
:
:

: 16
: 13.04.17



QUOTE (relax4o @ 22-04-2017, 23:07)
GET show_post.php?postID=1 - ? , ( GET, $_SERVER).

. , TRUE/FALSE > 0.

$_SERVER .
, .

!!!
PM
Top
borrak
: 24-04-2017, 18:02
Quote Post



:
:
:

: 16
: 13.04.17



Email, !!!
.
!!!
, !!!
CODE

<?php
include 'include/function.php';

if (isset($_SESSION['isLogged'])) {
is_logged(" ");
if (isset($_POST["submit"])) {
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$human = intval($_POST['human']);
$from = ' ';
$headers = "Content-Type: text/plain;charset=utf-8";
$to = asdasd@abv.bg';
$subject = 'Message from Contact Demo ';

$body = "From: $name\n E-Mail: $email\n Message:\n $message";
// Check if name has been entered
if (!$_POST['name']) {
$errName = ' ';
}

// Check if email has been entered and is valid
if (!$_POST['email'] || !filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
$errEmail = ' Email ';
}

//Check if message has been entered
if (!$_POST['message']) {
$errMessage = ' ';
}
//Check if simple anti-bot test is correct
if ($human !== 5) {
$errHuman = ' ';
}
// If there are no errors, send the email
if (!$errName && !$errEmail && !$errMessage && !$errHuman) {
if (mail($to, $subject, $body, $from, $headers)) {
$result = '<div class="alert alert-success"> . !!!</div>';
} else {
$result = '<div class="alert alert-danger">Sorry there was an error sending your message. Please try again later.</div>';
}
}
}
?>
<section>
<form class="form-horizontal" role="form" method="post" action="">
<div class="form-group">
<label for="name" class="col-sm-2 control-label"></label>
<div class="col-sm-10">
<input type="text" id="name" name="name" placeholder=" " value="<?php echo htmlspecialchars($_POST['name']); ?>">
<?php echo "<p class='text-danger'>$errName</p>"; ?>
</div>
</div>
<div class="form-group">
<label for="email" class="col-sm-2 control-label">Email</label>
<div class="col-sm-10">
<input type="email" id="email" name="email" placeholder="example@domain.com" value="<?php echo htmlspecialchars($_POST['email']); ?>">
<?php echo "<p class='text-danger'>$errEmail</p>"; ?>
</div>
</div>
<div class="form-group">
<label for="message" class="col-sm-2 control-label"></label>
<div class="col-sm-10">
<textarea placeholder=" " rows="4" name="message"><?php echo htmlspecialchars($_POST['message']); ?></textarea>
<?php echo "<p class='text-danger'>$errMessage</p>"; ?>
</div>
</div>
<div class="form-group">
<label for="human" class="col-sm-2 control-label">2 + 3 = ?</label>
<div class="col-sm-10">
<input type="text" id="human" name="human" placeholder="">
<?php echo "<p class='text-danger'>$errHuman</p>"; ?>
</div>
</div>
<div class="form-group">
<div class="col-sm-10 col-sm-offset-2">
<input id="submit" name="submit" type="submit" value="" class="btn btn-primary">
</div>
</div>
<div class="form-group">
<div class="col-sm-10 col-sm-offset-2">
<?php echo $result; ?>
</div>
</div>
</form>
</section>
<?php
} else {
my_header(" ");
if (isset($_POST["submit"])) {
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$human = intval($_POST['human']);
$from = ' ';
$to = 'asdasd@abv.bg';
$subject = 'Message from Contact Demo ';

$body = "From: $name\n E-Mail: $email\n Message:\n $message";
// Check if name has been entered
if (!$_POST['name']) {
$errName = ' ';
}

// Check if email has been entered and is valid
if (!$_POST['email'] || !filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
$errEmail = ' Email ';
}

//Check if message has been entered
if (!$_POST['message']) {
$errMessage = ' ';
}
//Check if simple anti-bot test is correct
if ($human !== 5) {
$errHuman = ' ';
}
// If there are no errors, send the email
if (!$errName && !$errEmail && !$errMessage && !$errHuman) {
if (mail($to, $subject, $body, $from)) {
$result = '<div class="alert alert-success"> . !!!</div>';
} else {
$result = '<div class="alert alert-danger">Sorry there was an error sending your message. Please try again later.</div>';
}
}
}
?>
<section>
<form class="form-horizontal" role="form" method="post" action="">
<div class="form-group">
<label for="name" class="col-sm-2 control-label"></label>
<div class="col-sm-10">
<input type="text" id="name" name="name" placeholder=" " value="<?php echo htmlspecialchars($_POST['name']); ?>">
<?php echo "<p class='text-danger'>$errName</p>"; ?>
</div>
</div>
<div class="form-group">
<label for="email" class="col-sm-2 control-label">Email</label>
<div class="col-sm-10">
<input type="email" id="email" name="email" placeholder="example@domain.com" value="<?php echo htmlspecialchars($_POST['email']); ?>">
<?php echo "<p class='text-danger'>$errEmail</p>"; ?>
</div>
</div>
<div class="form-group">
<label for="message" class="col-sm-2 control-label"></label>
<div class="col-sm-10">
<textarea placeholder=" " rows="4" name="message"><?php echo htmlspecialchars($_POST['message']); ?></textarea>
<?php echo "<p class='text-danger'>$errMessage</p>"; ?>
</div>
</div>
<div class="form-group">
<label for="human" class="col-sm-2 control-label">2 + 3 = ?</label>
<div class="col-sm-10">
<input type="text" id="human" name="human" placeholder="">
<?php echo "<p class='text-danger'>$errHuman</p>"; ?>
</div>
</div>
<div class="form-group">
<div class="col-sm-10 col-sm-offset-2">
<input id="submit" name="submit" type="submit" value="" class="btn btn-primary">
</div>
</div>
<div class="form-group">
<div class="col-sm-10 col-sm-offset-2">
<?php echo $result; ?>
</div>
</div>
</form>
</section>
<?php
}
rightSideBar();
my_footer();




borrak 24-04-2017, 18:04
PM
Top
rvc
: 25-04-2017, 09:31
Quote Post



:
:
:

: 2408
: 13.05.11



QUOTE (borrak @ 22-04-2017, 20:07)
. $_GET['ID']

http://localhost/show_post.php?postID=1

show_post.php?postID=1 SQL ID.. !!

:
CODE
if (isset($_GET['postID']) > 0) {
$postID = (int)$_GET['postID'];
$postRow = mysqli_query($dbconnect, 'SELECT * FROM sb_posts WHERE sb_post_id=' . $postID);
while ($resultPost = $postRow->fetch_assoc()) {
echo '<h1><a href="show_post.php?postID=' . $resultPost['sb_post_id'] . '">' . $resultPost['sb_post_title'] . '</a></h1>
<p class="meta"><span>:<b><a href="user.php?ID=' . $_SESSION['user_info']['user_id'] . '">' . $_SESSION['user_info']['user_name'] . '</a></b> | :<b><a href="cats.php?ID="></a></b> |:<b>30.03.2017</b></span> <span class="right">:<a href="commets.php?ID=">20 </a></span></p>
<hr class="style18">
<p>' . $resultPost['sb_post_content'] . '</p>
<hr class="style18">
<a class="comments" href="show_post.php?postID='.$resultPost['sb_post_id'].'"></a>
<hr class="style18">';
}
}

CODE
$_GET['postID']
PMEmail PosterUsers Website
Top
borrak
: 25-04-2017, 11:24
Quote Post



:
:
:

: 16
: 13.04.17



QUOTE (rvc @ 25-04-2017, 09:31)
QUOTE (borrak @ 22-04-2017, 20:07)
. $_GET['ID']

http://localhost/show_post.php?postID=1

show_post.php?postID=1 SQL ID.. !!

:
CODE
if (isset($_GET['postID']) > 0) {
$postID = (int)$_GET['postID'];
$postRow = mysqli_query($dbconnect, 'SELECT * FROM sb_posts WHERE sb_post_id=' . $postID);
while ($resultPost = $postRow->fetch_assoc()) {
echo '<h1><a href="show_post.php?postID=' . $resultPost['sb_post_id'] . '">' . $resultPost['sb_post_title'] . '</a></h1>
<p class="meta"><span>:<b><a href="user.php?ID=' . $_SESSION['user_info']['user_id'] . '">' . $_SESSION['user_info']['user_name'] . '</a></b> | :<b><a href="cats.php?ID="></a></b> |:<b>30.03.2017</b></span> <span class="right">:<a href="commets.php?ID=">20 </a></span></p>
<hr class="style18">
<p>' . $resultPost['sb_post_content'] . '</p>
<hr class="style18">
<a class="comments" href="show_post.php?postID='.$resultPost['sb_post_id'].'"></a>
<hr class="style18">';
}
}

CODE
$_GET['postID']

PM
Top
1 (1 , 0 )
, :

Topic Options : (3) 1 2 [3]  Reply to this topicStart new topicStart Poll

 


Copyright © 2003-2015 | BG Development | All Rights Reserved
RSS 2.0