Jump to content

Search the Community

Showing results for tags 'html'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

  1. <div class="row"> <label for="a" id="lbName">Name:</label> <input type="text" name="name" id="name"> </div> The if statement sending variables, lblTag and errorLbl to function "errorMessage", the error message I am getting is "TypeError: Cannot read properties of null (reading 'style'), which also means that the last line in the errorMessage function is also going to getting an error message, but won't show until the first error is cleared. The error message is for variable lblTag if (name ==""){ lblTag = "lbName" errorLbl = "Name" errorMessage(lblTag, errorLbl) } function errorMessage(lblTag, errorLbl){ console.log(errorLbl) // getting undefined in the console here and the other variable as well and getting error message // error message: TypeError: Cannot read properties of null (reading 'style') document.getElementById(`${lblTag}`).style.color = `red` document.getElementById('error-lbl-message').innerHTML = errorLbl + " is empty" }
  2. Hello, photos do not appear in the following cases 1- inserting photo inside <picture> tag (In Server Side Only), Working normally in local 2- Not Working when site domain only www.mysite.com ,, Working when site domain = www.mysite.com/index.php <picture class="hover1 runHover2"> <img src="assets/img/central-business-district-singapore.jpg"> </picture> Note: -The path is right, and when opening inspect to check the photo, I find it - Tried to change the path to /assets/img/central-business-district-singapore.jpg or www.mysite.com/assets/img/central-business-district-singapore.jpg , but not solved
  3. I am trying to develop an PHP MySQL database application where edit details is not working.I am new to PHP and doing this with the help of various web resources such as youtube videos, tutorials, similar programs etc .I am able to fetch the data from the database, but when it comes to edit, the data remains the same even after changing.Can anyone suggest the solution of this problem. manage-profile.php <?php session_start(); require('connection.php'); //If your session isn't valid, it returns you to the login screen for protection if(empty($_SESSION['sl_no'])){ header("location:access-denied.php"); } //retrive student details from the student table $result=mysqli_query($con, "SELECT * FROM student WHERE sl_no = '$_SESSION[sl_no]'"); if (mysqli_num_rows($result)<1){ $result = null; } $row = mysqli_fetch_array($result); if($row) { // get data from db $stdId = $row['sl_no']; $stdRoll = $row['roll_no']; $stdName = $row['name']; $stdClass = $row['class']; $stdSex= $row['sex']; } ?> <?php // updating sql query if (isset($_POST['update'])){ $myId = addslashes( $_GET[$id]); $myRoll = addslashes( $_POST['roll_no'] ); $myName = addslashes( $_POST['name'] ); $myClass = addslashes( $_POST['class'] ); $myGender = $_POST['sex']; $sql = mysqli_query($con,"UPDATE student SET roll_no='$myRoll', name='$myName', class='$myClass', sex='$myGender' WHERE sl_no = '$myId'" ); // redirect back to profile header("Location: manage-profile.php"); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Student Profile Management</title> <link href="css/student_styles.css" rel="stylesheet" type="text/css" /> <script language="JavaScript" src="js/user.js"> </script> </head> <body bgcolor="#e6e6e6"> <center><b><font color = "black" size="6">Online Voting System</font></b></center><br><br> <div id="page"> <div id="header"> <h2>Manage Profile</h2> <a href="student.php">Home</a> | <a href="vote.php">Current Polls</a> | <a href="manage-profile.php">Manage My Profile</a> | <a href="changepassword.php">Change Password</a>| <a href="logout.php">Logout</a> </div> <div id="container"> <table border="0" width="620" align="center"> <CAPTION><h3>Update Profile</h3></CAPTION> <form action="manage-profile.php?$id=<?php echo $_SESSION['sl_no']; ?>" method="post" onsubmit="return updateProfile(this)"> <table align="center"> <tr><td>Roll Number:</td><td><input type="text" style="background-color:#e8daef; font-weight:regular;" name="roll_no" maxlength="50" value="<?php echo $row["roll_no"]; ?>"></td></tr> <tr><td>Name:</td><td><input type="text" style="background-color:#e8daef; font-weight:regular;" name="Name" maxlength="30" value="<?php echo $row["name"]; ?>"></td></tr> <tr><td>Class:</td><td><select name='sclass' style='background-color:#e8daef; font-weight:regular;' maxlength='10' id='class' required='true'> <option value='HS-1st Year' <?php if($row["class"]=='HS-1st Year') { echo "selected"; } ?> >HS-1st Year</option> <option value='HS-2nd Year' <?php if($row["class"]=='HS-2nd Year') { echo "selected"; } ?> >HS-2nd Year</option> <option value='BA-1st Sem' <?php if($row["class"]=='BA-1st Sem') { echo "selected"; } ?> >BA-1st Sem</option> <option value='BA-3rd Sem' <?php if($row["class"]=='BA-3rd Sem') { echo "selected"; } ?> >BA-3rd Sem</option> <option value='BA-5th Sem' <?php if($row["class"]=='BA-5th Sem') { echo "selected"; } ?> >BA-5th Sem</option> <option value='BCom-1st Sem' <?php if($row["class"]=='BCom-1st Sem') { echo "selected"; } ?> >BCom-1st Sem</option> <option value='BCom-3rd Sem' <?php if($row["class"]=='BCom-3rd Sem') { echo "selected"; } ?> >BCom-3rd Sem</option> <option value='BCom-5th Sem' <?php if($row["class"]=='BCom-5th Sem') { echo "selected"; } ?> >BCom-5th Sem</option> </select> </td></tr> <tr><td>Sex:</td><td> <input type='radio' style='background-color:#e8daef; font-weight:regular;' name='gender' id='male' value='Male' <?php if($row["sex"]=='Male') { echo "checked"; } ?> >Male<br> <input type='radio' style='background-color:#e8daef; font-weight:regular;' name='gender' id='female' value='Female' <?php if($row["sex"]=='Female') { echo "checked"; } ?> >Female<br></td></tr> <tr><td>&nbsp;</td></tr><tr><td><input type="submit" name="update" value="Update Profile"></td></tr> </table> </form> </div> <div id="footer"> <div class="bottom_addr">Student Union Election,Anonymous College</div> </div> </body> </html>
  4. I want to scrape a website content. here is the example html source code of that site. <div class="entry-content"> <h2>hi tags?</h2> <ul> <li>some text</li> <li>sometext</li> <li>sometext</li> <li>sometext</li> </ul> <h2>hi tags2 ?</h2> <ul> <li>some text</li> <li>sometext</li> <li>To ometext</li> <li>Theometext</li> </ul> </div> I want to extract data of <li> tags from first <ul> html code. Here I've tried. include('../simple_html_dom.php'); // get DOM from URL or file //$html = check above html code $articles = $html->find('div[class="entry-content"]') ? $html->find('div[class="entry-content"]') : []; foreach($articles as $article) { $items = $article->find('ul',0) ? $article->find('ul',0) : false; if($items !==false){ $lis = $item->find('li') ? $item->find('li') : []; foreach($lis as $b){ $mcpcons .= $b->plaintext; } } } Help me by giving the correct info how can I do that?
  5. hey basically my code is something like taxi meter but with time i have made functions that calculates money by minute whenever it reaches a minute the money will add by far i made a confirm button which when i click on it i want to send money and time values to data base how ever i had no errors in all my codes but still the values don't want to be sent to my db help me <form id ="data" method ="post" > <h2 id ="done"></h2> <div class="jumbotron jumbotron-single d-flex align-items-center" style="background-image: url(img/billard.jpg)"> <div class="col-md-3 col-sm-10 text-center mt-2"> <div class="shadow rounded feature-item align-items-center p-2 mb-2" data-aos="fade-up"> <div class="my-4"> <i class="lnr lnr-cog fs-40"></i> </div> <h4>Post 1 </h4> <div id="timer"> <span id="hours">00:</span> <span id="mins">00:</span> <span id="seconds">00</span> <br><span id="money">0TND</span> </div> <div id="controls"> <button id="start">Start</button> <button id="stop">Stop</button> <button id="reset">Reset</button> <button id="confirm" >confirm</button><br> <button id="tarifA">TarifA</button> <button id="tarifB">TarifB</button> <button id="tarifC">TarifC</button> </div> <p>Post de PS5</p> </div> </form> $('#confirm').click(function(e) { e.preventDefault(); clearTimeout(timex); $.ajax({ method: "post", url : "collect.php", data: $('#data').serialize(), datatype: "text", success : function (response){ $('#done').html('done'),1000;} })}); <?php if (isset($_POST['money'])) { sleep(4); $servername='localhost'; $username='root'; $password=''; $dbname = "khalil"; $conn=mysqli_connect($servername,$username,$password,"$dbname"); if($conn){print_r("connected ");} $money=$_POST['money']; $hours=$_POST['hours']; $mins=$_POST['mins']; $seconds=$_POST['seconds']; $sql = "INSERT INTO `history` (`prix`,`time1`,`date1`) VALUES (`$money`,`mins`,`wassim`)"; // insert in database $rs = mysqli_query($conn, $sql); if($rs) { $success= "done"; } } ?>
  6. I need to use a php variable in an if.. else clause outside of the block of php code and can't get it working. The existing code block is below. All help is appreciated. $chk is the variable from the php block and is numeric. <?php if($chk == 0) { <div id='showMe'> <div class="container"> <div class="row" style="color:red; padding-top:6rem; text-align:center;"> <h1>Database Update Failed</h1> </div> </div> </div> } else { <div id='showMe'> <div class="container"> <div class="row" style="padding-top:6rem; text-align:center;" > <h1><center>Database Update Successful</center></h1> </div> </div> endif </div> </div> </body> </html> Thanks much.
  7. What I'm hoping to do is , when an <a> tag is click it will send a text value to php to change whatever name is assigned on the $table variable. To give an example. On the side are all the branches this clinic has. Instead of creating new php file for each of the branch ( with the same design and functionality) and href it accordingly, once click it will send a text to replace the default value of $table. I think AJAX will help do the trick but I'm new to it. Please help me, I'm so lost. Below is my code that displays all the branch, and what it looks like. <div class="BNavcontainer" > <div id="branchnav" class="SideBNav"> <?php /* To display Branch Name from djams_db */ $brnch = $conn->query("SELECT * FROM branches") or die($conn->error); while($row=$brnch->fetch_assoc()): ?> <a data-id='<?php echo $row['brnch_id'] ?>' href="djams_rmc.php?<?php echo $row['brnch_name'] ?>" id="b<?php echo ($row['brnch_id']) +1 ?>" > <?php echo ($row['brnch_name']) ?> </a> <?php endwhile; ?> </div> </div>
  8. Hi Freaks, the weekend is upon us again. I wish you all well. I have an issue I've been working on today and have hit a mental roadblock. Hoping someone with the time and will will talk me through it. I'm creating a table while looping through an API array and I've hit a couple snags. Here is the repeated HTML -> $html = " <tr class='mt-2'> <td>{$rank}.</td> <td><img src='{$image}' height='75' width='75'></td> <td>{$name}</td> <td class='bold'>\${$final_worth}B</td> <td class='{$class}'>\${$last_change}</td> <td>{$country}</td> <td>{$source}</td> <td><button class='bg-color-primary text-color-third px-2' id='more_btn' onclick='showDetails({$cnt})'>More</button></td> </tr> <tr > <div id='details'>lorem fucking ipsum wahoo baby</div> </tr> "; Everything was going as expected until I went to add the second row (div#details). There's actually 2 issues at play here - the first is how I make each button/div#details connected so button1 only effects div1 etc. I can't tackle that one yet though, because right now when any button is clicked div#details shows up above the table header rather than underneath the previous row. So until I have the positioning correct I can't really tackle the js functionality. Can someone please tell me why the <tr><div#details> is not appearing underneath it's previous row? The js code is as follows -> <script> var cnt = <?php echo $cnt; ?>; function showDetails(cnt) { var details = "details"; var x = document.getElementById(details); if (x.style.display === "none") { x.style.display = "block"; } else { x.style.display = "none"; } } </script> I know the code is a mess right now. It's kind of shameful lol but like I said I can't really do more with it until I can figure out why that table row isn't positioning properly
  9. CSS in one of my nightmares, it is the one thing that causes me the most frustration. I have a question for those who are a bit more graceful with it than I am - I have a comment area in a practice project, it looks like this -> <div class="comment-content d-flex"> <div class="comment-author"> <img src="img.jpg" alt="author"> </div> <div class="comment-meta"> <a href="#" class="post-author">Commenter Name</a> <a href="#" class="post-date">Comment date</a> <p>Donec turpis erat, scelerisque id euismod sit amet, fermentum vel dolor. Nulla facilisi. Sed pellen tesque lectus et</p> </div> <!-- I added this area myself <div class='d-flex align-items-center'> <a href='#' class='comment-like'><span><i class="fa fa-thumbs-up"></i> like</span></a>&nbsp;&nbsp; <a href='#' class='comment-respond'><span><i class="fa fa-comment"></i> respond</span></a> </div> --> </div> in the area that I commented that I added myself .comment-like and .comment-respond are not yet defined. At the moment it flows to the right of the comment area and I want them below it. Easy enough to do with positioning except that I need it to be positioned relative to the content of the comment that it belongs to. This whole block will eventually be echoed from a PHP class but I like to get the styling and html correct on the page it will display on first (probably like most people). Can I get some advice on the best way to resolve this issue from you folks please. TIA
  10. Hi again, Freaks, hope you've all been well. I have what I would have considered a simple problem if not for the trouble it's giving me. I have the following bit -> <?php if(!$message) : ?> <h4>Leave a comment</h4> <?php else : ?> <div class='success'> <p class='bg-success text-center'>We have your comment and it will be added after approval</p> </div> <?php endif; ?> this code is obviously in the body of the page. At the top I have this -> <?php require("assets/initializations.php"); $post_obj = new Post($conn, $user); //simply increase #views per page load if(isset($_GET['post_id']) && !empty($_GET['post_id'])) { $id = $_GET['post_id']; $query = mysqli_query($conn, "SELECT * FROM news WHERE id=$id"); $row = mysqli_fetch_array($query); $category = $row['post_category']; $views = $row['num_views']; $views ++; mysqli_query($conn, "UPDATE news SET num_views='$views', time_stamp=NOW() WHERE id=$id"); //comment to db $message = false; if(isset($_POST['submit'])) { mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); $comment_obj = new Comment($conn); if($comment_obj->addComment($id, $_POST['name'], $_POST['email'], $_POST['comment'])) { $message = true; } } } ?> Everything works fine except I can't get the body if statement to show anything other "Leave a Comment". The comment gets to the database but the success message won't show. I've tried this various ways before using this format. I assigned the $message up top and tried echoing it in the body. I then tried ternary style. Then I remembered that I had to do the same thing months ago when I made the registration form. So I decided to try that style here. The code from the register.php is this -> <?php if(!empty($errors)) : ?> <div class="errors"> <p class="bg-danger text-center"><?php echo implode( '</p><p class="bg-danger text-center">', $errors ); ?></p> </div> <?php elseif($sent) : $js_switch = true; ?> <div class="success"> <p class="bg-success">You've been successfully registered. Login and enjoy the network.</p> </div> <?php endif; ?> This code works great and is why I decided to do the same on my current issue, but nothing that I do gets "Leave a Comment" to change to the success message. Is there some obscure rule of PHP I've overlooked? I really can't figure out why the bit I'm working on now isn't working correctly like that bit I copied it from. Thanks for all responses
  11. The $a variable contains the news text. The $link variable contains a link to the page with the full text of this news. Need to write the abbreviated text of the news in the $b variable according to the rules: - crop up to 180 characters - assign an ellipsis - make the last 2 words and ellipsis a link to the full text of the news.
  12. I've been working on JSON and have found a way to send variables from the PHP to the JavaScript using AJAX and no JQuery. For an ecommerce site does it make more sense to send the variables : description, title, cost, etc. to the JavaScript page, or would it make more sense to echo the html on the PHP page? The idea, right now, is a product page for editing and deleting product. Thanks, Josh
  13. Hi friends, Css is not working without clean and close tab. i am cleaning cache and closing tab. When i opened new tab is working css codes. i uninstalled and reinstall browsers. But it isn't working again. It is working other computers. But it is not working my computer. index.php <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Site</title> <link type="text/css" rel="stylesheet" href="css/style.css"> </head> <body> <div class="container"> <div class="bir">Bir</div> <div class="iki">İki</div> <div class="uc">Üç</div> <div class="dort">Dört</div> <div class="bes">Beş</div> <div class="alti">Altı</div> </div> </body> </html> style.css .container { width:100%; height:800px; } .bir { color:red; } .iki { font-size:30px; } .uc { font-weight:bold; } .dort { width:1000px; height:150px; color:#fff; font-weight:bold; background-color:blue; } .bes { width:300px; height:50px; background-color:red; } .alti { width:100px; height:200px; background-color:brown; color:#fff; }
  14. Not being able to upload images in the directory with a path name in the database? 1) This is my code for insert into the database and directory: <?php $host="localhost"; $username="root"; $pass=""; $db="registration"; $conn=mysqli_connect($host,$username,$pass,$db); if(!$conn){ die("Database connection error"); } // insert query for register page if(isset($_POST['ronel'])){ $images = $_FILES['file']['name']; $target_dir = "uploads/"; $target_file = $target_dir . basename($_FILES["file"]["name"]); // Select file type $imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION)); // Valid file extensions $extensions_arr = array("jpg","jpeg","png","gif","pdf"); // Check extension if( in_array($imageFileType,$extensions_arr) ) { $details=$_POST['details']; $location=$_POST['location']; $checkbox=$_POST['checkbox']; $injured=$_POST['injured']; $agegender=$_POST['agegender']; $contact=$_POST['contact']; $empid=$_POST['empid']; $dept=$_POST['dept']; $organization=$_POST['organization']; $summary=$_POST['summary']; $name=$_POST['name']; $outcome=$_POST['outcome']; $cause=$_POST['cause']; $action=$_POST['action']; $reportedname=$_POST['reportedname']; $position=$_POST['position']; $organisation=$_POST['organisation']; $reportedcontact=$_POST['reportedcontact']; $reporteddept=$_POST['reporteddept']; $status="Pending"; $comment=$_POST['comment']; $query="INSERT INTO `proposals` (`details`,`location`,`date`,`time`,`checkbox`,`injured`,`agegender`,`contact`,`empid`,`dept` ,`organization`,`summary`,`image`,`outcome`,`cause`,`action`,`reportedname`,`position`,`organisation`,`reportedcontact`,`reporteddept`,`status`,`comment`) VALUES ('$details','$location', current_timestamp(),current_timestamp(),'$checkbox','$injured','$agegender','$contact','$empid','$dept' ,'$organization','$summary','$name','$outcome','$cause','$action','$reportedname','$position','$organisation','$reportedcontact','$reporteddept','$status','$comment')"; $res=mysqli_query($conn,$query); if($res){ $_SESSION['success']="Not Inserted successfully!"; header('Location:'); }else{ echo "<script>alert('Proposal not applied!');</script>"; } // Upload file move_uploaded_file($_FILES['file']['tmp_name'],$target_dir.$image); } } date_default_timezone_set("Asia/Kolkata"); ?> 2) Here is the input file: <form class="form-horizontal" method="post" action="" enctype="multipart/form-data"> <input type="hidden" name="ronel" value=""> <div class="form-group"> <label style="position:absolute; left:63%; top:425px;" for="inputEmail" class="col-lg-3"><b>Upload Images Here :</b></label><br><br> <div class="col-lg-9"> <input style="position:absolute; left:78%; top:420px;" type="file" name="file" enctype="multipart/form-data" class="form-control" name="incident_reference" onchange="document.getElementById('inc_ref').src = window.URL.createObjectURL(this.files[0]); document.getElementById('inc_ref').className +='_active'; document.getElementById('inc_ref_span').className += '_hidden'"> </div><iframe id="inc_ref" class="form-group" width="220px" height="130px" style="position:absolute; left:78%; top:32%;"></iframe></div> </form> 3) error code: Notice: Undefined index: name in /opt/lampp/htdocs/create-nearmiss.php on line 57 ONGC TRIPUR
  15. <?php include 'includes/header.php'; include 'includes/navbar.php'; include 'includes/leftSidebar.php'; ?> <?php if(isset($_GET['update'])){ $the_mentor_id = $_GET['update']; $query = "SELECT * FROM mentor WHERE mentor_id = '$the_mentor_id' "; $update_mentor = mysqli_query($db, $query); while ( $row = mysqli_fetch_assoc($update_mentor) ) { $mentor_id = $row['mentor_id']; ?> <h1>i am h1</h1> <?php } } ?> <?php include 'includes/footer.php'; ?> Why <h1> I am h1</h1> this line is not showing, I am totally new in PHP , Please Help me
  16. I am using a countdown timer I've found in google, I just modify some line of codes to make the timer to count up instead of counting down and I want it to not reset if the page is refresh or the browser is restart. From what I know I need to use cookies for this but I don't know how to incorporate it to my code. Here's the code. <html> <html> <head> <title>Timer</title> <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> </head> <body> <span id="countup">00:00:00</span> </body> </html> <script type="text/javascript"> (function(){ $(document).ready(function() { var time = "00:00:00", parts = time.split(':'), hours = +parts[0], minutes = +parts[1], seconds = +parts[2], span = $('#countup'); function correctNum(num) { return (num<10)? ("0"+num):num; } var timer = setInterval(function(){ seconds++; if(seconds > 59) { minutes++; seconds = 0; if(minutes > 59) { hours++; seconds = 0; minutes = 0; if(hours >= 24) { alert("timer finished"); } } } span.text(correctNum(hours) + ":" + correctNum(minutes) + ":" + correctNum(seconds)); }, 1000); }); })() </script>
  17. Hi, So I am currently making a real estate site for my class at school but I am having a tiny issue with the listing display page. So what I want to do is show a bunch of listing that the agent owns on their dashboard which I have already done. Now I have two links one to update the listing and one to view the listing. Now what I am trying to do is when the view listing link is clicked it will take the user to the listing-display page and then I want it to display all the information for the listing that the link was clicked under. But i cannot for the life of me figure out how to do that! This is currently the code for the dashboard where you only view the listing headline <?php // If the session was never set with a user id $output = ''; $conn = db_connect(); if($_SESSION['userType'] != AGENT) { $_SESSION['RedirectError'] = "You were not logged in as an Agent<br/>"; header("Location:login.php"); } if (isset($_GET["page"])) { $page = $_GET["page"]; $index = ($page -1) * IMAGE_LIMIT; } else { $page=1; $index = 0; } ?> <!-- start of main page content --> <div class="container" style="margin-top: 2em;"> <h2>Dashboard</h2> <p>Welcome back <?php echo $_SESSION['userId']; ?> you last logged in on <?php echo $_SESSION['last_access']; ?></p> <h4>Your Listings</h4> <?php $sql = "SELECT listing_id FROM listings WHERE user_id = '".$_SESSION['userId']."' AND status = 'o' ORDER BY listing_id"; $result = pg_query($conn, $sql); $listings = pg_fetch_all($result); for($index; $index < pg_num_rows($result); $index++) { $sql = "SELECT * FROM listings WHERE listing_id = '".$listings[$index]['listing_id']."'"; $listing_result = pg_query($conn, $sql); $arrayRow = pg_fetch_assoc($listing_result); echo (build_listing_card($arrayRow)); if($index !=0 && ($index +1) % IMAGE_LIMIT ==0){ break; } } ?> </div> <br/> <?php $total_pages = ceil(count($listings) / IMAGE_LIMIT); $pageLink = "<div class='pagination'>"; for ($i=1; $i<=$total_pages; $i++) { if($i == $page) { $pageLink .= "<a class='active' href='dashboard.php?page=".$i."'>".$i."</a>"; } else { $pageLink .= "<a href='dashboard.php?page=".$i."'>".$i."</a>"; } }; ?> </div> <br/> and this is the code for the listing-display page where I want all the listing information to be displayed <?php if (isset($_GET['listing_id'])) { $_SESSION['listing_id'] = $_GET['listing_id']; } else { $_SESSION['listing_id'] = 0; echo "ERROR: listing information was not find"; } $sql = 'SELECT * FROM listings WHERE listing_id = ' . $_SESSION['listing_id']; echo "<BR>".$sql; $result = pg_query(db_connect(), $sql); $records = pg_num_rows($result); echo "<BR>".pg_fetch_result($result, 0, "listing_id"); echo "<BR>".pg_fetch_result($result, 0, "user_id"); echo "<BR>".pg_fetch_result($result, 0, "status"); echo "<BR>".pg_fetch_result($result, 0, "price"); echo "<BR>".pg_fetch_result($result, 0, "headline"); echo "<BR>".pg_fetch_result($result, 0, "description"); echo "<BR>".pg_fetch_result($result, 0, "postal_code"); echo "<BR>".pg_fetch_result($result, 0, "images"); echo "<BR>".pg_fetch_result($result, 0, "city"); echo "<BR>".pg_fetch_result($result, 0, "property_options"); echo "<BR>".pg_fetch_result($result, 0, "bedrooms"); echo "<BR>".pg_fetch_result($result, 0, "bathrooms"); echo "<BR>".pg_fetch_result($result, 0, "garage"); echo "<BR>".pg_fetch_result($result, 0, "purchase_type"); echo "<BR>".pg_fetch_result($result, 0, "property_type"); echo "<BR>".pg_fetch_result($result, 0, "finished_basement"); echo "<BR>".pg_fetch_result($result, 0, "open_house"); echo "<BR>".pg_fetch_result($result, 0, "schools"); ?> <h1> Listing Display </h1> <hr/> <table style="width:50%" border="1px solid black"> <tr> <th>Listing Image</th> <th>Listing Description</th> </tr> <tr> <th rowspan="2"> <img src="" alt="Oshawa House" width="300px" height="200px"/> </th> <td align="left" valign="top"> <h3><?php echo pg_fetch_result($result, 0, "headline") ?></h3> <ul> <li>Open house?: <?php echo get_property('open_house', pg_fetch_result($result, 0, "open_house"))?> </li> <li>Finished Basement?: <?php echo get_property('finished_basement', pg_fetch_result($result, 0, "finished_basement"))?></li> <li><?php echo get_property('purchase_type', pg_fetch_result($result, 0, "purchase_type"))?></li> <li>Garage Type: <?php echo get_property('garage_type', pg_fetch_result($result, 0, "garage"))?></li> <li>Near school?: <?php echo get_property('schools', pg_fetch_result($result, 0, "schools"))?></li> <li>Status: <?php echo get_property('listing_status', strtolower(pg_fetch_result($result, 0, "status"))) ?></li> <li>Washrooms: <?php echo get_property('washrooms',pg_fetch_result($result, 0, "bathrooms")) ?></li> <li>Bedrooms: <?php echo get_property('bedrooms',pg_fetch_result($result, 0, "bedrooms")) ?></li> <li>Description: <?php echo pg_fetch_result($result, 0, "description") ?></li> </ul> </td> </tr> <tr> <td align="left" valign="top"><ul> <li>Location: <?php echo get_property('cities',pg_fetch_result($result, 0, "city")) ?></li> <li>Postal Code: <?php echo pg_fetch_result($result, 0, "postal_code") ?></li> <li>Price: <?php echo pg_fetch_result($result, 0, "price") ?></li> </ul> </td> </tr> </table> <form action="listing-matches.php"> <p> <input type="submit" name="submit" value="Back"/></p> </form>
  18. I'm going crazy. I have two arrays. The first has working hours and the array is like this: ```array(7) { [0]=> array(4) { ["morning_from"]=> string(6) "closed" ["morning_to"]=> string(6) "closed" ["afternoon_from"]=> string(5) "13:00" ["afternoon_to"]=> string(5) "19:00" }``` The second one is the busy times, the array is like this: ```array(2) { [0]=> { ["title"]=> string(13) "Test" ["start_date"]=> string(19) "2019-11-25 13:00:00" ["end_date"]=> string(19) "2019-11-25 14:00:00" } }``` Now I do a cycle of 15 times because I need to make the list for the next 15 days from today. Then I compare the working hours in the morning with the appointments, if the time is occupied by an appointment I add a class to the div. The HTML that comes out should look like this: ``` <ul> <li> <div> <p>Sun</p><p>24 Nov</p> </div> <div class="uk-book-a-visit-closed">Closed</div> </li> <li> <div> <p>Mon</p> <p>25 Nov</p> </div> <div> <a class="uk-button-book-a-visit-hour uk-button-book-a-visit-hour-busy" id="a-book-a-visit" data-book-day="2019-11-25" data-book-hour="13:00">13:00</a> <a class="uk-button-book-a-visit-hour uk-button-book-a-visit-hour-busy" id="a-book-a-visit" data-book-day="2019-11-25" data-book-hour="13:30">13:30</a> <a class="uk-button-book-a-visit-hour uk-button-book-a-visit-hour-busy" id="a-book-a-visit" data-book-day="2019-11-25" data-book-hour="14:00">14:00</a> <a class="uk-button-book-a-visit-hour" id="a-book-a-visit" data-book-day="2019-11-25" data-book-hour="14:30">14:30</a> <a class="uk-button-book-a-visit-hour" id="a-book-a-visit" data-book-day="2019-11-25" data-book-hour="15:00">15:00</a> </div> </li> </ul> ``` Unfortunately it does not work as I would like, it does not mark correctly if the date is occupied. I'll post a piece of code: ```for ($book_i=0; $book_i <= 15; $book_i++) { if($book_i == 0){ $book_today_day = date('Y-m-d', strtotime($book_today)); }else{ $book_today_day = date('Y-m-d', strtotime($book_today . ' +'.$book_i.' day')); } $book_day = ucwords(strftime('%d %h', strtotime($book_today_day))); $book_name_day = ucwords(strftime('%a', strtotime($book_today_day))); if(count($getListCalendarStartToday) > $count_list_calendar_p){ $day_appointment_p_start = date('Y-m-d', strtotime($getListCalendarStartToday[$count_list_calendar_p]["start_date"])); $day_appointment_p_end = date('Y-m-d', strtotime($getListCalendarStartToday[$count_list_calendar_p]["end_date"])); }else{ $day_appointment_p_start = "N.D."; $day_appointment_p_end = "N.D."; } if($day_appointment_p_start == $book_today_day){ $count_more_appointment_on_some_days_morning = 0; $count_more_appointment_on_some_days_afternoon = 0; foreach ($getListCalendarStartToday as $key => $value) { $day = date('Y-m-d', strtotime($value["start_date"])); if($day == $book_today_day){ $count_more_appointment_on_some_days_morning += 1; $count_more_appointment_on_some_days_afternoon += 1; } } $book_output .= "<li>"; if(isset($user["working_time"]) && $user["working_time"]){ $book_output .= "<div><p>".$book_name_day."</p><p>".$book_day."</p></div>"; if($book_name_day == $lang["days-mon"]){ $book_day_int = 0; }else if($book_name_day == $lang["days-tue"]){ $book_day_int = 1; }else if($book_name_day == $lang["days-wed"]){ $book_day_int = 2; }else if($book_name_day == $lang["days-thu"]){ $book_day_int = 3; }else if($book_name_day == $lang["days-fri"]){ $book_day_int = 4; }else if($book_name_day == $lang["days-sat"]){ $book_day_int = 5; }else if($book_name_day == $lang["days-sun"]){ $book_day_int = 6; } $book_morning_from = $book_array_working_time[$book_day_int]["morning_from"]; $book_morning_to = $book_array_working_time[$book_day_int]["morning_to"]; $book_afternoon_from = $book_array_working_time[$book_day_int]["afternoon_from"]; $book_afternoon_to = $book_array_working_time[$book_day_int]["afternoon_to"]; $book_morning_from_hour = (int)substr($book_morning_from, 0, 2); $book_morning_to_hour = (int)substr($book_morning_to, 0, 2); $book_morning_from_min = (int)substr($book_morning_from, 3, 5); $book_morning_to_min = (int)substr($book_morning_to, 3, 5); $book_afternoon_from_hour = (int)substr($book_afternoon_from, 0, 2); $book_afternoon_to_hour = (int)substr($book_afternoon_to, 0, 2); $book_afternoon_from_min = (int)substr($book_afternoon_from, 3, 5); $book_afternoon_to_min = (int)substr($book_afternoon_to, 3, 5); $book_morning_from_hour_duplicated = $book_morning_from_hour; $book_morning_to_hour_duplicated = $book_morning_to_hour; $book_afternoon_from_hour_duplicated = $book_afternoon_from_hour; $book_afternoon_to_hour_duplicated = $book_afternoon_to_hour; $book_check_closed = 0; $check_day_morning = 0; if($book_afternoon_from_hour == 0 && $book_afternoon_to_hour == 0){ if($book_afternoon_from_hour == 0 && $book_afternoon_to_hour == 0 && $book_check_closed == 0){ $book_output .= "<div class='uk-book-a-visit-closed'>".$lang["system-appointment-book-a-visit-closed"]."</div>"; $book_check_closed = 1; } }else{ $book_output .= "<div>"; for ($n=0; $n < $count_more_appointment_on_some_days_afternoon; $n++) { if($count_list_calendar_p === $count_more_appointment_on_some_days_afternoon && $count_more_appointment_on_some_days_afternoon > 1){ $count_list_calendar_p -= 1; } $day_appointment_p_start_hour = date('H', strtotime($getListCalendarStartToday[$count_list_calendar_p]["start_date"])); $day_appointment_p_end_hour = date('H', strtotime($getListCalendarStartToday[$count_list_calendar_p]["end_date"])); $day_appointment_p_start_min = date('i', strtotime($getListCalendarStartToday[$count_list_calendar_p]["start_date"])); $day_appointment_p_end_min = date('i', strtotime($getListCalendarStartToday[$count_list_calendar_p]["end_date"])); for($book_afternoon_from_hour; $book_afternoon_from_hour <= $book_afternoon_to_hour; $book_afternoon_from_hour++){ if($book_afternoon_from_hour_duplicated != $book_afternoon_from_hour){ continue; } if($book_afternoon_from_hour != $book_afternoon_to_hour){ if($day_appointment_p_start_hour == number_add_leading_0($book_afternoon_from_hour)){ $book_afternoon_from_hour_duplicated += 1; $count_list_calendar_p += 1; if($book_afternoon_from_min == 0){ if($day_appointment_p_start_hour == $day_appointment_p_end_hour){ if($day_appointment_p_start_min >= 0 && $day_appointment_p_start_min <= 30){ $book_output .= "<a class='uk-button-book-a-visit-hour uk-button-book-a-visit-hour-busy' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($day_appointment_p_start_hour).":00'>".number_add_leading_0($day_appointment_p_start_hour).":00</a>"; $book_output .= "<a class='uk-button-book-a-visit-hour' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($day_appointment_p_start_hour).":30'>".number_add_leading_0($day_appointment_p_start_hour).":30</a>"; }else{ $book_output .= "<a class='uk-button-book-a-visit-hour' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($day_appointment_p_start_hour).":00'>".number_add_leading_0($day_appointment_p_start_hour).":00</a>"; $book_output .= "<a class='uk-button-book-a-visit-hour uk-button-book-a-visit-hour-busy' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($day_appointment_p_start_hour).":30'>".number_add_leading_0($day_appointment_p_start_hour).":30</a>"; } }else{ $count_hour_appointment = 0; for($day_appointment_p_start_hour; $day_appointment_p_start_hour <= $day_appointment_p_end_hour; $day_appointment_p_start_hour++) { if($day_appointment_p_start_hour == $day_appointment_p_end_hour){ if($day_appointment_p_end_min >= 0 && $day_appointment_p_end_min <= 30){ $book_output .= "<a class='uk-button-book-a-visit-hour uk-button-book-a-visit-hour-busy' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($day_appointment_p_start_hour).":00'>".number_add_leading_0($day_appointment_p_start_hour).":00</a>"; $book_output .= "<a class='uk-button-book-a-visit-hour' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($day_appointment_p_start_hour).":30'>".number_add_leading_0($day_appointment_p_start_hour).":30</a>"; }else{ $book_output .= "<a class='uk-button-book-a-visit-hour' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($day_appointment_p_start_hour).":00'>".number_add_leading_0($day_appointment_p_start_hour).":00</a>"; $book_output .= "<a class='uk-button-book-a-visit-hour uk-button-book-a-visit-hour-busy' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($day_appointment_p_start_hour).":30'>".number_add_leading_0($day_appointment_p_start_hour).":30</a>"; } }else{ if($day_appointment_p_start_min >= 0){ $book_output .= "<a class='uk-button-book-a-visit-hour uk-button-book-a-visit-hour-busy' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($day_appointment_p_start_hour).":00'>".number_add_leading_0($day_appointment_p_start_hour).":00</a>"; $book_output .= "<a class='uk-button-book-a-visit-hour uk-button-book-a-visit-hour-busy' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($day_appointment_p_start_hour).":30'>".number_add_leading_0($day_appointment_p_start_hour).":30</a>"; }else{ $book_output .= "<a class='uk-button-book-a-visit-hour uk-button-book-a-visit-hour-busy' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($day_appointment_p_start_hour).":30'>".number_add_leading_0($day_appointment_p_start_hour).":30</a>"; } $count_hour_appointment += 1; } } $book_afternoon_from_hour_duplicated += $count_hour_appointment; $count_list_calendar_p += 1; } break; }else{ if($book_i == 0){ if($day_appointment_p_start_min >= $book_afternoon_from_min && $day_appointment_p_start_min <= 30){ $book_output .= "<a class='uk-button-book-a-visit-hour uk-button-book-a-visit-hour-busy' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($day_appointment_p_start_hour).":".number_add_leading_0($book_afternoon_from_min)."'>".number_add_leading_0($day_appointment_p_start_hour).":".number_add_leading_0($book_afternoon_from_min)."</a>"; }else{ $book_output .= "<a class='uk-button-book-a-visit-hour' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($book_afternoon_from_hour).":".number_add_leading_0($book_afternoon_from_min)."'>".number_add_leading_0($book_afternoon_from_hour).":".number_add_leading_0($book_afternoon_from_min)."</a>"; $book_output .= "<a class='uk-button-book-a-visit-hour uk-button-book-a-visit-hour-busy' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($day_appointment_p_start_hour).":30'>".number_add_leading_0($day_appointment_p_start_hour).":30</a>"; } }else{ if($day_appointment_p_start_min >= $book_afternoon_from_min && $day_appointment_p_start_min >= 30){ $book_output .= "<a class='uk-button-book-a-visit-hour uk-button-book-a-visit-hour-busy' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($day_appointment_p_start_hour).":30'>".number_add_leading_0($day_appointment_p_start_hour).":30</a>"; }else{ $book_output .= "<a class='uk-button-book-a-visit-hour uk-button-book-a-visit-hour-busy' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($book_afternoon_from_hour).":00'>".number_add_leading_0($book_afternoon_from_hour).":00</a>"; $book_output .= "<a class='uk-button-book-a-visit-hour' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($day_appointment_p_start_hour).":30'>".number_add_leading_0($day_appointment_p_start_hour).":30</a>"; } } $book_output .= "<a class='uk-button-book-a-visit-hour' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($book_afternoon_from_hour).":00'>".number_add_leading_0($book_afternoon_from_hour).":00</a>"; } }else{ $book_afternoon_from_hour_duplicated += 1; $count_list_calendar_p += 1; if($book_afternoon_from_min == 0){ $book_output .= "<a class='uk-button-book-a-visit-hour' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($book_afternoon_from_hour).":00'>".number_add_leading_0($book_afternoon_from_hour).":00</a>"; $book_output .= "<a class='uk-button-book-a-visit-hour' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($book_afternoon_from_hour).":30'>".number_add_leading_0($book_afternoon_from_hour).":30</a>"; }else{ if($book_i == 0){ $book_output .= "<a class='uk-button-book-a-visit-hour' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($book_afternoon_from_hour).":".number_add_leading_0($book_afternoon_from_min)."'>".number_add_leading_0($book_afternoon_from_hour).":".number_add_leading_0($book_afternoon_from_min)."</a>"; }else{ $book_output .= "<a class='uk-button-book-a-visit-hour' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($book_afternoon_from_hour).":30'>".number_add_leading_0($book_afternoon_from_hour).":30</a>"; } $book_output .= "<a class='uk-button-book-a-visit-hour' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($book_afternoon_from_hour).":00'>".number_add_leading_0($book_afternoon_from_hour).":00</a>"; } } }else{ if($book_afternoon_from_min == $book_afternoon_to_min){ $book_output .= "<a class='uk-button-book-a-visit-hour uk-button-book-a-visit-hour-closed' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($book_afternoon_from_hour).":00'>".number_add_leading_0($book_afternoon_from_hour).":".number_add_leading_0($book_afternoon_from_min)."</a>"; }else{ if($book_afternoon_from_min == 0){ $book_output .= "<a class='uk-button-book-a-visit-hour' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($book_afternoon_from_hour).":00'>".number_add_leading_0($book_afternoon_from_hour).":00</a>"; $book_output .= "<a class='uk-button-book-a-visit-hour uk-button-book-a-visit-hour-closed' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($book_afternoon_from_hour).":".number_add_leading_0($book_afternoon_from_min)."'>".number_add_leading_0($book_afternoon_from_hour).":".number_add_leading_0($book_afternoon_from_min)."</a>"; }else{ $book_output .= "<a class='uk-button-book-a-visit-hour' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($book_afternoon_from_hour).":".number_add_leading_0($book_afternoon_from_min)."'>".number_add_leading_0($book_afternoon_from_hour).":".number_add_leading_0($book_afternoon_from_min)."</a>"; $book_output .= "<a class='uk-button-book-a-visit-hour uk-button-book-a-visit-hour-closed' id='a-book-a-visit' data-book-day='".$book_today_day."' data-book-hour='".number_add_leading_0($book_afternoon_from_hour).":30'>".number_add_leading_0($book_afternoon_from_hour).":30</a>"; } } } } } $book_output .= "</div>"; } $book_output .= "</li>"; ```
  19. So I'm posting this in CSS because I think I'm having a CSS issue. Basically, I have this right now: I'm trying to vertically center the blue box and everything inside it. I've tried line-height, vertical-align, display: inline-block, position relative and absolute. The only way that works is if I do it manually with absolute or margin. But absolute isn't responsive so that's a problem. I'm using Bootstrap from the CDN if that matters. I'm only going to include code for the first box so that it doesn't get messy. HTML: <div class="container category-forums clearfix"> <div class="container category-forums-wrap"> <div class="container category-icon clearfix"></div> <div class="container forum-details-wrapper clearfix"> <div class="container forum-details-container"> <p class="forum-name">News Center</p> <p class="forum-desc">Stay up to date with all the latest news and, more importantly, familiarize yourself with the rules.</p> <div class="sub-forum-container container clearfix"> <p class="sub-forums clearfix">Sub-Category 1</p> <p class="sub-forums clearfix">Sub-Category 2</p> <p class="sub-forums clearfix">Sub-Category 3</p> </div> </div> </div> <div class="container forum-threads clearfix"> <h4>108</h4> <p>Threads</p> </div> <div class="container forum-posts clearfix"> <h4>2000</h4> <p>Posts</p> </div> <div class="container forum-latest-posts clearfix"> <div class="container last-avatar clearfix"></div> <p>Lastest thread</p> <p>Yesterday 3:15pm</p> </div> </div> </div> CSS: .category-forums { width: 100%; height: 41%; background-color: #ecf0f1; padding: 0; border-bottom-left-radius:.25rem!important; border-bottom-right-radius:.25rem!important; } .category-icon { width: 7%; height: 100%; border-right: 1px dotted lightgray; margin: 0; float: left; line-height: 100%; } .category-forums-wrap { height: 70%; width: 100%; border: 1px dotted blue; padding: 0; display: inline-block; vertical-align: middle; } .forum-details-wrapper { width: 55%; height: 100%; border-right: 1px dotted lightgray; margin: 0; float: left; padding: 0; } .forum-details-container { width: 100%; height: 100%; border: 1px dotted gray; margin: 0; } .forum-name { margin: 0; } .sub-forum-container { width: 100%; float: left; margin: 0; } .sub-forums { width: 31%; margin: 0; float: left; } .forum-desc { margin: 0; font-size: 1.3rem; } .forum-threads { width: 9%; height: 100%; border-right: 1px dotted lightgray; float: left; text-align: center; line-height: 100%; } .forum-posts { width: 9%; height: 100%; border-right: 1px dotted lightgray; float: left; line-height: 100%; } .forum-latest-posts { width: 20%; height: 100%; float: left; } .last-avatar { width: 25%; height: 100%; border-right: 1px dotted lightgray; float: left; text-align: center; line-height: 100%; } I'm having a tough time even centering the text vertically.
  20. I created a login system with bootstrap but for some reason I cannot delete the "placeholder" (in which it is written "admin") in both the inputs of the form ("uname" and "psw"). Even if I change the placeholder it's remain "admin". Have you any idea? This is the code: <!DOCTYPE html> <html> <head> <title>Login</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script> <link rel="stylesheet" type="text/css" href="css/styles.css"> </head> <body> <div class="container"> <div class="jumbotron text-center" id="jumbo_log"> <h1>Login Page</h1> <p>You must login to enter</p> <form id="theform" method="get"> <div class="container2"> <label for="uname"><b>Username</b></label> <input type="text" id= "uname" name="uname" required><br> <label for="psw"><b>Password</b></label> <input type="password" id="psw" name="psw" required><br><br> <input type="submit" id="submit" class="btn btn-info" value="Login"><br><br> <a class="btn btn-primary" href="registration.php" role="button">Click here if you are not registered</a> </div> </form> </div> </body> </html>
  21. Hello Experts, I need help on a wordpress plugin "Easy Student Results". I installed this plugin for my ITI Institute results and when entered all institution trades, courses, students separated with trades and then started adding results on the basis of trades then this plugin doesn't show results of all trades students. It only shows results of firstly created trades students results. All other trades students results are showing unavailability error. So i need your help. https://wordpress.org/plugins/easy-student-results Thank you Manish Bajpai
  22. I have a database written in and stored on a server. The table I will be accessing is called dataRep and houses Rep Data. This data is user input via form submission. Upon coming to the website there is an option to "View Rep Information" by submitting the Rep's ID that was given. That Rep ID will be the auto increment repID from the table. Upon clicking the button, it opens a new window that should display the rep's data. It does not, however. Here is the [html] the user will see: <div class="pop_box"> <a class="rms-button" href="#popup1">Enter Rep Number Here</a> </div> <div id="popup1" class="overlay"> <div class="popup"> <a class="close" href="#">×</a> <div align="center"><br> <br> <p>Enter rep number in box below. Submission will open new window.</p> <form method="get" action="/data/repPrepare.php" target="_blank" > <input type="text" id="repSelect" name="repSelect" placeholder="Enter Rep Number Given Here" /> <button type="submit" class="newbutton">VIEW</button> </form> </div> </div> ...and here is the [php] I have tried, which I get the following error: [indent]"Could not get data: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '[repSelect]' at line 1"[/indent] <?php $dbhost = 'mhhost'; $dbuser = 'myuser'; $dbpass = 'mypass'; $conn = mysql_connect($dbhost, $dbuser, $dbpass); if(! $conn ) { die('Could not connect: ' . mysql_error()); } $sql = 'SELECT * FROM dataRep WHERE repID = [repSelect]'; mysql_select_db('reviewmy_jos1'); $retval = mysql_query( $sql, $conn ); if(! $retval ) { die('Could not get data: ' . mysql_error()); } while($row = mysql_fetch_array($retval, MYSQL_ASSOC)) { echo "Rep ID :{$row['repID']} <br> ". "Rep NAME : {$row['repName']} <br> ". "Rep Bio : {$row['repBio']} <br> ". "Rep Certs : {$row['repCerts']} <br> ". "--------------------------------<br>"; } echo "Fetched data successfully\n"; mysql_close($conn); ?> I am truly stuck and have been dealing with this issue for two weeks. I would appreciate any assistance that can be provided. I just need the [php] to pull the data tied the repID that the user puts in the box. When I started this I assumed it would be rather easy. I guess that's what I get for assuming. Either way, I'm missing something here. Is there a possibility that this can not be done? Like, I should be using AJAX instead?
  23. Hello, The below is the code i have i want to track down the ipaddress of the people who ever subscribed to my list. I am beginner in php kindly do the needful. Thanks a lot in advance. <!-- Subscribe form --> <form action="subscribe/NLprocess.php" method="post"> <h6 class=footer-widget-heading>Enter your email:</h6> <div class="input"> <input type="text" class="button" name="email" placeholder="Email address"> <input type="submit" class="button" id="submit" value="Subscribe"> </div> </form> <!-- End subscribe form --> The processing file NLprocess.php ---- $emailmanager = 'smallstamps@gmail.com'; // SECOND: // save this file, and close it. Thank you! error_reporting(0); $email = trim($_POST['email']); $Ok = ereg("^([a-zA-Z0-9_\.-]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$", $email); if ($Ok) { mail($emailmanager,'Subscribe','','From: '.$email); if(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$",$UNameFrm)) { ?> <script language = 'javascript'> alert('Thank you, Now you Subcribed to smallstamps.com Updates'); history.go(-1); </script> <? exit(); } } else { if(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$",$UNameFrm)) { ?> <script language = 'javascript'> alert('Sorry, please provide a valid Email address.'); history.go(-1); </script> <? exit(); } } ?> Kindly let me know what i have to do to track the ip address.
  24. I got a page where user able to search data by filtering using datepicker(date range) or using dropdown selection option. There are two button on the page which are search button and print button. I want to pass the data which i have search to another page where i using mpdf. How to pass the searched value to another page(mpdf).. im using method POST for my form. what kind of unique ID or value that i can pass to another page?
  25. Hello I want to run a contest on my website and i am asking visitors to post their names and BTC addresses and i'll use random.org's list randomizer to pick one from the list what i did so far: <?php if ($_POST) { $name = $_POST['commentName']; $txt = $_POST['commentBTC']; $handle = fopen("comments.html","a"); fwrite($handle, "<b>" . $name . "</b> : " . $txt . "<br/>"); fclose($handle); } ?> and ] <form action="" method="POST" onsubmit="return checkform(this);"> Some Name: <input type="text" maxlength="10" name="commentName"/><br> BTC Address: <input type="text" maxlength="34" pattern="^[123][a-km-zA-HJ-NP-Z1-9]{25,34}$" name="commentBTC" required/><br> so i get a html list, which is great. the problem is that some visitors are signing up multiple times is there a way to check 'comments.html' for 'commentBTC' and if exists, to deny signing up? i can drop the 'commentName' field if it's easier to have only a bitcoin address list. help? thank you!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.