function show() { $m = new MongoClient($GLOBALS["MongoHost"]); // connect $db = $m->selectDB("NoteX_mini"); // select a database $collection = $db->{$_GET}['name']; // select a collection $cursor = $collection->find(); // find everything in the collection $idNo = 0; foreach ($cursor as $document) { $link1 = make_links_clickable($document["link"]); $solution = $document["solution"]; $problem = $document["problem"]; // $s=str_replace("<br />","</li><br /><li>",$s); $sol1 = nl2br($solution); // $sol1 = str_replace(array('<p>', '</p>', '<br>', '<br />'), '', $s); echo "<section ><h4><b>{$problem}</b></h4><div id=" . $idNo . "><p>" . $sol1 . "</p></div>" . $link1 . " <h4 class='right-align'><a style='' class='waves-effect waves-light btn ' id=" . $document["_id"] . " name=" . $idNo . " onClick=clickEvent(this.id,this.name) >Edit\n </a></h5></section>"; $idNo++; } }
<input id="pic1" name="logo" type="image" src="./images/logo.jpg" height="100" > </div> <?php session_start(); $_SESSION['pt'] = 1; $_SESSION['pc'] = 1; $post_title = $_POST['title_field']; // Function to make links out of text function make_links_clickable($text) { return preg_replace('!(((ftp|http|https)://)[-a-zA-Zа-яА-Я()0-9@:%_+.~#?&;//=]+)!i', '<a href="$1">$1</a>', $text); } //Saving Special caharacter and return caracters to database $post_content = nl2br(htmlspecialchars(addslashes($_POST['content_info']))); //Making the links clicakable $post_content = make_links_clickable($post_content); if (strlen($_POST['title_field']) >= 1) { $_SESSION['pt'] = 0; } if (strlen($_POST['content_info']) >= 20) { $_SESSION['pc'] = 0; } // Writing poast to DB if ($_SESSION['pt'] == 0 and $_SESSION['pc'] == 0) { include "connect.php"; //Fetching user id from database $uname = $_SESSION['uname']; $post_title = "{$post_title}"; $query_fetchid = "SELECT `id` FROM `reg_users_table` WHERE newid = '{$uname}'"; $resid = mysql_query($query_fetchid, $db) or die(mysql_error($db)); $flag = 0;
// Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } //$userInput=$_POST['userInput']; function make_links_clickable($text) { return preg_replace('!(((f|ht)tp(s)?://)[-a-zA-Zа-яА-Я()0-9@:%_+.~#?&;//=]+)!i', '<a href="$1">$1</a>', $text); } //echo $userInput; Used to test the input rading of keyword //remove once Code is up and running. $result = mysqli_query($connection, "SELECT * FROM links WHERE keyword='{$_GET['Word']}'"); // Format the Display of Data echo "<table border='2' align='center'>\n\t\t<tr> \n\t\t<th>Serial Number</th>\n\t\t<th>Link</th>\n\t\t<th>Intended Keyword</th>\n\t\t<th>Time of Crawling</th>\n\t\t</tr> </font> "; //Display the Data while ($row = mysqli_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['sr_no'] . "</td>"; $temp = $row['link']; $temp1 = make_links_clickable($temp); echo "<td>" . $temp1 . "</td>"; echo "<td>" . $row['keyword'] . "</td>"; //echo "<td>" . $row['link'] . "</td>"; echo "<td>" . $row['date'] . "</td>"; echo "</tr>"; } echo "</table>"; //Close after the work is complete and to avoid SQL Attacks. mysqli_close($connection); ?> </body> </html>
</div> </body> </html> <!-- Checking the correctness of the comment--> <?php $_SESSION['ccheck'] = 1; $uname = $_SESSION['uname']; $post_id = $_GET['id']; function make_links_clickable($text) { return preg_replace('!(((ftp|http|https)://)[-a-zA-Zа-яА-Я()0-9@:%_+.~#?&;//=]+)!i', '<a href="$1">$1</a>', $text); } //Saving Special caharacter and return caracters to database $comment = nl2br(htmlspecialchars(addslashes($_POST['newcomment']))); //Making the links clicakable $comment = make_links_clickable($comment); if (strlen($_POST['newcomment']) >= 2) { $_SESSION['ccheck'] = 0; } if ($_SESSION['ccheck'] == 0) { include "connect.php"; $query_fetchpostid = "SELECT post_id FROM all_users_posts WHERE post_id = '{$post_id}'"; $respostid = mysql_query($query_fetchpostid, $db) or die(mysql_error($db)); $flag = 0; while ($row = mysql_fetch_array($respostid)) { $post_id = $row['post_id']; $flag = 1; } if ($flag == 1) { //Inserting posts into database $query_post = "INSERT INTO all_users_comments (uname,post_id,comment,date_commented) VALUES ('{$uname}',{$post_id},'{$comment}',NOW())";
<?php } ?> <br /> <span style="font-size:26px;"><?php echo $rtasktitle; ?> </div> <div class="moredetail" <?php if ($rtaskcompletedby != "") { echo "style='height:0px;'"; } ?> ><?php echo make_links_clickable(nl2br($rtaskdetail)); ?> <div style="width:100%; text-align:right; "> <textarea taskid="<?php echo $rtaskworkingid; ?> " class="notes" style="margin-top:10px; width:100%; border:1px solid #C0C0C0;"><?php echo $rnotes; ?> </textarea> <div class="notesavebtn">Save</div> </div> </div> <div class="moredetailbtn">more...</div>