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. Hi, I have a website(HTML) where I sell 1 tour in 3 languages. In the root I have the index.html and tour.html both in English (English is default). Then there are 2 folders, one folder is ES (Spanish) and one folder DE (German), both have index.html and tour.html with the same contents but in their specific language. I am trying for some time now to solve these 2 error-messages in Google Search Console: - Duplicate without user-selected canonical - Duplicate, Google chose different canonical than user My question is where and in which page(s) (index or tour) to put "<link rel="canonical" href="http://www.mywebsite.com/???.html" />" Thanks for your help.
  2. Hi. I've been thrown in the deep end with a community shed website when the person who knows HTML bailed out I have very little knowledge of writing forms - none actually. I've done my best at writing (plagarising) an application form with no success. Can someone give me a heads up where I've gone wrong? This is the application HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> <title>Application</title> <meta content="Alistair" name="author"> <style> body { background-color:rgb(102, 255, 255); } ul { list-style-type: none; display: flex; margin: 70; padding: 60; overflow: hidden; spacing: 120; # background-color:rgb(102, 255, 255); } li { float: left; } li { margin-right: 110px; } li a, .dropbtn { display: inline-block; color: black; text-align: center; padding: 14px 16px; text-decoration: none; } li a:hover, .dropdown:hover .dropbtn { background-color: grey; } li.dropdown { display: inline-block; } .dropdown-content { display: none; position: absolute; background-color: #f9f9f9; min-width: 160px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: 1; } .dropdown-content a { color: black; padding: 12px 16px; text-decoration: none; display: block; text-align: left; } .dropdown-content a:hover {background-color: #f1f1f1;} .dropdown:hover .dropdown-content { display: block; } </style> </head> <body style="margin-left: 0px; width: 1303px;"> <table style="width: 1280px; height: 129px;" border="0"> <tbody> <tr> <td style="width: 377.25px; text-align: right;"><img style="width: 302px; height: 115px;" alt="Logo" src="Images/logo.png"></td> <td style="width: 560.883px;"> <div style="text-align: center;"><font size="+3"><span style="font-family: serif;"><span style="font-family: Helvetica,Arial,sans-serif;">Livingston Community Shed <div style="text-align: center;"><small style="font-family: sans-serif;">Application Form</small><br> </div> <font size="+3"><span style="font-family: serif;"><span style="font-family: Helvetica,Arial,sans-serif;"></span></span></font></span></span></font></div> <big> <font size="+3"> <font size="+3"><span style="font-family: serif;"></span></font> </font></big></td> <td style="width: 402.867px; text-align: left;"><span><img src="Images/smsa-logo.png" alt="smsa logo" style="width: 279px; height: 102px;"><br> </span></td> </tr> </tbody> </table> <ul> <li style="font-weight: bold;"><big><a href="index.html">Home</a></big></li> <li style="font-weight: bold;"><big><a href="about.html">About</a></big></li> <li style="font-weight: bold;"><big><a href="findus.html">Find Us</a></big></li> <big> </big> <li style="font-weight: bold;" class="dropdown"><big> <a href="javascript:void(0)" class="dropbtn">News</a></big> <div style="top: 178px; left: 671px;" class="dropdown-content"><a href="updates.html">Updates</a><a href="projects.html">Projects</a><a href="gardens.html">Gardens</a><a href="videos.html">Videos</a></div> </li> <li style="font-weight: bold;"><big><a href="join.html">Join</a></big></li> <big> <big> </big> </big> <li style="font-weight: bold;"><big><a href="contact.html">Contact</a></big></li> </ul> <div style="text-align: center;"><!-- ************ End of Headings ************** --> <br> <big><big><big><span style="font-family: Helvetica,Arial,sans-serif; color: rgb(51, 51, 255); font-weight: bold;">Livingston Community Shed Application Form</span></big></big></big> </div> <div style="text-align: center; width: 1199px;"><br> </div> <table style="text-align: left; width: 900px; margin-left: auto; margin-right: auto;" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="vertical-align: top; width: 464px;"> <form style="margin-left: 0px; width: 410px;"><!-- ************ Forename ************** --> <div style="margin-left: 0px; width: 391px;"> <div style="text-align: left;"> <label for="fname">First name:</label><br> </div> <div style="text-align: left;"><input id="fname" name="fname" value="" type="text"><br> <br> </div> <!-- ************ Surname ************** --> <div style="text-align: left;"><label for="sname">Surname:</label><br> </div> <div style="text-align: left;"><input id="sname" name="sname" value="" type="text"><br> <br> </div> <!-- ************ Address 1 ************** --> <div style="text-align: left;"> <label for="add1">Address 1:</label><br> </div> <div style="text-align: left;"><input size="30" id="add1" name="add1"><br> <br> </div> <!-- ************ Address 2 ************** --> <div style="text-align: left;"><label for="add2">Address 2:</label><br> </div> <div style="text-align: left;"><input size="30" id="add2" name="add2"><br> <br> </div> <!-- ************ Town ************** --> <div style="text-align: left;"> <label for="town">Town / City:</label><br> </div> <div style="text-align: left;"><input id="town" name="town" value="" type="text"><br> <br> </div> <!-- ************ Postcode ************** --> <div style="text-align: left;"><label for="pcode">Postcode:</label><br> </div> <div style="text-align: left;"><input size="8" name="pcode" id="pcode"><br> <br> </div> <!-- ************ email ************** --> <div style="text-align: left;"><label for="email">Email:<br> <input id="email" name="email" type="email"><br> </label></div> <!-- ************ Phone number ************** --> <div style="text-align: left;"><label for="phone">Phone Number:</label><br> </div> <div style="text-align: left;"><input size="15" name="phone" id="phone" type="tel"><br> <br> </div> <!-- ************ Birthday ************** --> <div style="text-align: left;"><label for="bday">Date of Birth:</label><br> </div> <div style="text-align: left;"><input size="8" id="bday" name="bday" value="" type="date"><br> <br> </div> </div> </form> </td> <td style="vertical-align: top; width: 632px;"> <form style="width: 529px;"> <label for="cname">Contact name:</label><br> <input id="cname" name="cname" value="" type="text"><br> <br> <label for="relat">Relationship:</label><br> <input id="relat" name="relat" value="" type="text"> <br> <br> <label for="cphone">Contact Phone Number:</label><br> <input id="cphone" name="cphone" type="tel"> <span style="font-weight: bold;"><br> <br> </span> <div><label for="allergy">Please list any allergies you may have:<br> </label> <div style="text-align: left; margin-left: 0px; width: 978px;" class="fcf-input-group"> <textarea cols="30" id="allergy" name="allergy" class="fcf-form-control" rows="5" maxlength="1000" required=""></textarea> </div> <br> <label for="skill">Please list any skills/interests which may be useful to the shed:</label><br> <div style="text-align: left; margin-left: 0px; width: 978px;" class="fcf-input-group"> <textarea cols="30" id="skill" name="skill" class="fcf-form-control" rows="5" maxlength="1000" required=""></textarea> </div> <br> </div> </form> </td> </tr> </tbody> </table> <table style="text-align: left; width: 950px; margin-left: auto; height: 31px; margin-right: auto;" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="vertical-align: top; width: 874px;"><input id="permit" name="permit" value="No" type="checkbox"> <label for="permit">May we include a summary of this and a photo in the member&#8217;s section of the website?</label><br> </td> </tr> </tbody> </table> <table style="text-align: left; height: 151px; margin-right: auto; width: 950px; margin-left: auto;" cellpadding="2" cellspacing="2"> <tbody> <tr> <td colspan="1" rowspan="1" style="vertical-align: top; text-align: center; width: 950px;"> <p style="line-height: 100%; margin-bottom: 0cm;" align="left"><font style="font-size: 14pt;" size="4"><b>Constitution acceptance</b></font></p> <span style="font-weight: bold;"></span> <p style="line-height: 100%; margin-bottom: 0cm;" align="left"><font style="font-size: 12pt;" size="3"><input id="perm" name="agree" value="No" type="checkbox"> <label for="agree">I agree to abide by the constitution of the Livingston Community Shed, a copy of which is held in the shed and on this Website.</label><br> </font><br> </p> <p style="line-height: 100%; margin-bottom: 0cm;" align="left"><font style="font-size: 12pt;" size="3"><input id="smsa" name="smsa" value="No" type="checkbox"><label for="smsa">By applying, I also agree to abide by the Scottish Men&#8217;s Sheds Association (SMSA) Constitution and Purposes to which we are affiliated with group membership.</label></font></p> <form style="margin-top: 16px; height: 55px;" enctype="text/plain" method="post" action="/application.php"> <input style="height: 50px; width: 70px;" value="Submit" align="middle" type="submit"><br> <!-- **** If you click the "Submit" button, the form-data will be sent to a page called "/application.php **** --> </form> </td> </tr> </tbody> </table> </body> </html> The PHP page that accompanies it is: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <?php if (isset($_POST['Email'])) { // EDIT THE 2 LINES BELOW AS REQUIRED $email_to = "merg.eosag@gmail.com"; $email_subject = "New Application Request."; function problem($error) { echo "We are very sorry, but there were error(s) found with the form you submitted. "; echo "These errors appear below.<br><br>"; echo $error . "<br><br>"; echo "Please go back and fix these errors.<br><br>"; die(); } // validation expected data exists if ( !isset($_POST['fname']) || !isset($_POST['sname']) || !isset($_POST['email']) || !isset($_POST['bday']) || !isset($_POST['agree']) || !isset($_POST['smsa']) ) { problem('We are sorry, but there appears to be a problem with the form you submitted.'); } $fname = $_POST['fname']; // required $sname = $_POST['sname']; // required $email = $_POST['email']; // required $fname = $_POST['bday']; // required $sname = $_POST['agree']; // required $email = $_POST['smsa']; // required $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; if (!preg_match($email_exp, $email)) { $error_message .= 'The Email address you entered does not appear to be valid.<br>'; } $string_exp = "/^[A-Za-z .'-]+$/"; if (!preg_match($string_exp, $fname)) { $error_message .= 'The Name you entered does not appear to be valid.<br>'; } $string_exp = "/^[A-Za-z .'-]+$/"; if (!preg_match($string_exp, $sname)) { $error_message .= 'The Name you entered does not appear to be valid.<br>'; } $string_exp = ""; if(!preg_match($string_exp,$bday)) { $error_message .= 'You did not choose a date.<br />'; } if (isset($_POST['agree'])) { // Checkbox is checked } else { $error_message .= 'You did not agree to the constitution.<br>'; } if (isset($_POST['smsa'])) { // Checkbox is checked } else { $error_message .= 'You did not agree to the SMSA rules.<br>'; } $email_message = "Form details below.\n\n"; function clean_string($string) { $bad = array("content-type", "bcc:", "to:", "cc:", "href"); return str_replace($bad, "", $string); } $email_message .= "Foreame: " . clean_string($fname) . "\n"; $email_message .= "Surname: " . clean_string($sname) . "\n"; $email_message .= "Address1: " . clean_string($add1) . "\n"; $email_message .= "Address2: " . clean_string($add2) . "\n"; $email_message .= "Town: " . clean_string($town) . "\n"; $email_message .= "Postcode: " . clean_string($pcode) . "\n"; $email_message .= "Email: " . clean_string($email) . "\n"; $email_message .= "Phone Number: " . clean_string($phone) . "\n"; $email_message .= "Date of Birth: " . clean_string($bday) . "\n"; $email_message .= "Contact Name: " . clean_string($cname) . "\n"; $email_message .= "Relationship: " . clean_string($relat) . "\n"; $email_message .= "Contact Phone: " . clean_string($cphone) . "\n"; $email_message .= "Allergies: " . clean_string($allergy) . "\n"; $email_message .= "Skills: " . clean_string($skill) . "\n"; $email_message .= "Page Permission: " . clean_string($permit) . "\n"; $email_message .= "Abide by LCS Rules: " . clean_string($agree) . "\n"; $email_message .= "Abide by SMSA Rules: " . clean_string($smsa) . "\n"; // create email headers $headers = 'From: ' . $email . "\r\n" . 'Reply-To: ' . $email . "\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); ?><!-- include your success message below --> <title>Application.php</title> </head> <body style="color: rgb(0, 0, 0); background-color: rgb(102, 255, 255);" alink="#000099" link="#000099" vlink="#990099"> <br> <div style="text-align: center;"><?php } ?> <br> <br> <big>Thank you for your application. We will be in touch with you very soon. <br> </big> </div> <div style="text-align: center;"><big><a href="index.html"><br> Back to Home page</a></big><br> </div> </body> </html>
  3. Hi all I want to display the same drop down list (selection) in every row of my table but I can't seem to work out how to do it, the drop down always seems to come at the end of the table and not on each row. The drop down list is a SQL query (a stored procedure) which is called. I managed to get the dropdown to appear in the correct place when it's just one row in a table. <?php $statement = db()->prepare("EXEC fe_uspAdminUserShowRegisteredAgencies"); $statement->execute(); $agencies= $statement->fetchAll(PDO::FETCH_ASSOC); ?> <p> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <table> <thead> <tr bgcolor="#FFF8DC"></b> <th><center><i>inviter</th> <th><center><i>inviter email</th> <th><center><i>inviter contact</th> <th><center><i>inviter region</th> <th><center><i>inviter skill</th> <th>refer to</th> <th></th> </i> </center> </tr> </thead> <p> </p> <?php if($inviterdetails) { foreach ($inviterdetails as $inviterdetail) { echo "<tr bgcolor=#FFF8DC>"; echo "<td><center>" . $inviterdetail['fullname'] . "</td>"; echo "<td><center>" . $inviterdetail['inviteremail'] . "</td>"; echo "<td><center>" . $inviterdetail['invitercontact'] . "</td>"; echo "<td><center>" . $inviterdetail['inviterregion'] . "</td>"; echo "<td><center>" . $inviterdetail['inviterskill'] . "</td>"; echo "<form action=LogReferal.php?email=referto>"; // echo "<td><left><input type=email id=referto name=referto></td>"; echo "<input type=hidden name=referred value=$inviterdetail[inviteremail]>"; echo "<td><left><input type=submit value=refer></td>"; } } ?> <td><select name="referto" id ="referto"> <?php foreach($agencies as $agencylist) { echo "<option><name=referto type=email>" . $agencylist['email'] . "</option>"; } Produces the desired result However when I try to repeat the process in a separate table which has multiple rows, I get the selection drop down all over the place in this case at the end of the row and not applicable to any particular row. I have managed to get it everywhere except on the row it should be and it doesn't repeat and be relevant to the row. <?php //Connection details section.. $email = current_user(); $statement = db()->prepare("EXEC fe_uspConnectionDetails ?;"); $statement->bindParam(1, $email, PDO::PARAM_STR); $statement->execute(); $details = $statement->fetchAll(PDO::FETCH_ASSOC); ?> <p> <p> <table> <thead> <tr> <th><i>name</th> <th><i>email</th> <th><i>skill</th> <th><i>mobile</th> <th><i>region</th> <th><i>days</th> <th><i><center>refer to</center></th> </tr> </thead> <hr color="#c7c34c" size="4" width="50%"> <p><i>my connections (below)</i></p> <?php if($details) { foreach ($details as $detail) { echo "<td><left>" . $detail['fullname'] . "</td>"; echo "<td><left>" . $detail['connectionemail'] . "</td>"; echo "<td><left>" . $detail['skill'] . "</td>"; echo "<td><left>" . $detail['phonenumber'] . "</td>"; echo "<td><left>" . $detail['region'] . "</td>"; echo "<td><left>" . $detail['daysremaining'] . "</td>"; echo "<form action=LogReferal.php?email=referto>"; // echo "<td><left><input type=email id=referto name=referto></td>"; echo "<input type=hidden name=referred value=$detail[connectionemail]>"; echo "<td><left><input type=submit value=refer></td>"; // echo "<form action=LogReferal.php?email=referto>"; // // echo "<td><left><input type=email id=referto name=referto></td>"; // echo "<input type=hidden name=referred value=$inviterdetail[inviteremail]>"; // echo "<td><left><input type=submit value=refer></td></tr></form>"; } } ?> <td><select name="referto" id ="referto"> <?php foreach($agencies as $agencylist) { echo "<option><name=referto type=email>" . $agencylist['email'] . "</option>"; } ?> </td> I kind of realise the repeating code (for each) has to be somewhere in the main table and not outside the table but I have just got stuck... Any help greatly received Cheers Greg
  4. 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>
  5. 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?
  6. 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"; } } ?>
  7. 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.
  8. 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>
  9. 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
  10. 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
  11. 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
  12. 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.
  13. 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
  14. 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; }
  15. 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
  16. <?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
  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. 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
  20. 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?
  21. 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.
  22. 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?
  23. 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!
  24. So I am creating a small file manager to manage uploaded files into a certain directory on my sever. I have created the attached code, but the issue is that when I click the download button, the webpage (html file) itself gets downloaded instead of the file in the directory that is supposed to be downloaded. Please note that there is no upload file type restrictions, so there are any file type you can imagine in this directory. I can't recognize the error in my code. Any help will be highly appreciated and that you in advance <html> <head> <title>My first PHP Page</title> </head> <body> <table border="1"> <?php $dir = 'uploads'; $files = scandir($dir); sort($files); $count = -1 ; foreach ($files as $file) { $v_download = "download_".$count; $v_delete = "delete_".$count; $v_rename = "rename_".$count; $fileName = $file; if ($file != '.' && $file != '..') { echo "<tr>"; echo "<td>"; echo $count; echo "</td>"; echo "<td>"; echo $file; echo "</td>"; echo "<td>"; echo "<form action='' method='post'><input type='submit' value='Download' name='".$v_download."'/></form>"; if(isset($_POST[$v_download])) { $filename = $_POST[$file]; header('Content-type: '.filetype($filename).'/'.pathinfo($filename, PATHINFO_EXTENSION)); header('Content-Disposition: attachment; filename="'.$filename.'"'); readfile('uploads/'.$filename); exit(); } echo "</td>"; echo "<td>"; echo "<form action='' method='post'><input type='submit' value='Delete' name='".$v_delete."'/></form>"; if(isset($_POST[$v_delete])) { // Your php delete code here echo "delete file : ".$file; } echo "</td>"; echo "<td>"; echo "<form action='' method='post'><input type='submit' value='Rename' name='".$v_rename."'/></form>"; if(isset($_POST[$v_rename])) { // Your php rename code here echo "rename file : ".$file; } echo "</td>"; echo "</tr>"; } $count++; } ?> </table> </body> </html> list.html
  25. Hi, I have forgotpass.php code. But I dont have a forgotpass.html code. I tray somethink but it's not working. I need cust html code, for the this php code. Thank you and regards. <? include("header.php"); $error = $diplay = ""; if(isset($_POST['sendmepass'])) { $mem_email = $affiliater->GetEmailByUsername($_POST['affiliatername']); if ($mem_email != "") { $newpass = generatePassword(); $affiliater->ReminderPassword($_POST['affiliatername'], $newpass); //Send mail $to = $mem_email; $subject = 'Password Reminder'; $body = str_replace("{USERNAME}", $_POST['affiliatername'], FORGOTMAILDETAIL); $body = str_replace("{NEWPASSWORD}", $newpass, $body); $headers = "Content-Type: text/html; charset=iso-8859-1\n"; mail($to, $subject, $body, $headers); $error = "Your password will be e-mailed to you at the e-mail address you registered with the system! Please check it to recovery your password"; $diplay = "style='display: none;'"; }else $error = "User inactive or not exists! Please type exactly affiliatername which you used to registry"; } $template->set_filenames(array("body" => "forgotpass.html")); $template->assign_vars(array( 'ERROR' => $error, 'DIPLAY' => $diplay, 'USERNAME'=> "Username", )); $template->pparse("body"); include("footer.php"); ?>
×
×
  • 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.