Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

8 Neutral

About MarkT

  • Rank

Previous Fields

  • Languages

Profile Information

  • Interests
    Web Development / Server Hosting / Graphic Design
  1. Your JSFiddle works fine for me. I think you should explain in more detail.
  2. I think I would prefer to use scandir, it looks simpler and more what I would normally use. Could you give me an example of the code that I could implement into my table code shown above. Thanks
  3. Array( [0] => . [1] => .. [2] => bar.php [3] => foo.txt [4] => somedir) Thats what PHP.net says the result is. But I don't know how to go about fetching the results in the format I want. Heres what I want it to be similar to <table class="table table-bordered table-striped table-highlight"> <thead> <tr> <th>#</th> <th>Date</th> <th>Title</th> <th>Opponent</th> <th>Score</th> <?PHP if($de2['team'] == $_SESSION['team']) {echo "<th>Actions</th>";} ?> </tr> </thead> <tbody> <?PHP while($se2 = mysqli_fetch_array($search)) { echo " <tr> <td>" . $se2['id'] . "</td> <td>" . $se2['date'] . "</td> <td>" . $se2['title'] . "</td> <td>" . $se2['against'] . "</td> <td>" . $se2['score'] . "</td>"; if($de2['team'] == $_SESSION['team']) {echo " <td><a href='edit-report.php?pid=" . $se2['id'] . "' class='btn btn-small btn-tertiary'> <i class='btn-icon-only icon-edit'></i> </a> <a href='manage-reports.php?action=dele&pid=" . $se2['id'] . "&team=" . $se2['team'] . "' class='btn btn-small'> <i class='btn-icon-only icon-remove'></i> </a></td>";} echo " </tr> ";} ?> </tbody> </table> Thats what I use at the moment, with the result being $se2['field'] But I don't know how to get the array in that format so that I can use a similar table. Thanks
  4. Thought I'd tell you how you would be able to do it. Basically, what you need is to use PHP to send the mail to your email address, using the variables inputted into the form. http://www.w3schools.com/php/php_mail.asp is a useful URL for you to see what you need to do, but I'll explain it below. Basically, this page says this code; <?php// display form if user has not clicked submitif (!isset($_POST["submit"])) { ?> <form method="post" action="<?php echo $_SERVER["PHP_SELF"];?>"> From: <input type="text" name="from"><br> Subject: <input type="text" name="subject"><br> Message: <textarea rows="10" cols="40" name="message"></textarea><br> <input type="submit" name="submit" value="Submit Feedback"> </form> <?php } else { // the user has submitted the form // Check if the "from" input field is filled out if (isset($_POST["from"])) { $from = $_POST["from"]; // sender $subject = $_POST["subject"]; $message = $_POST["message"]; // message lines should not exceed 70 characters (PHP rule), so wrap it $message = wordwrap($message, 70); // send mail mail("webmaster@example.com",$subject,$message,"From: $fromn"); echo "Thank you for sending us feedback"; }}?> In essence, this code uses the following step-flow; Checks if the form has already been submitted Checks that the user has filled in the 'from' field Defines the variables, and calls them Then you would need to edit the message, to something similar to; $message = "Variable 1: {$variable1}, Variable 2: {$variable2} etc." Then your email address would replace "webmaster@example.com", telling the server where to send the email with the variables to. Then it echos a response and informs the user that the submission was successful I hope this helps you. Please like it if it's what you're looking for.
  5. Hi, How do I use the PHP command scandir I want to scan the directory and then display them in a table, If anyone could explain it in a way that enables it to be displayed similar to an SQL query return, so $query['filename'] or similar so that I can put it into a table with other details. Thank
  6. MarkT

    UPDATE query not working

    Fixed it, The query was being ended early by a ' in the input field. I solved it by using a STR replace $alert = $_POST['alert'];$new2 = str_replace("'", "'", $alert); Then using {$new2} as my variable,
  7. MarkT

    UPDATE query not working

    To be honest, I have it working fine on our old management panel, but it's not working on the new one. I have no idea why.
  8. In the <div class="main section" id="main"> Underneath where it displays the articles above, but still enclosed by the main sector div.
  9. How to create a password for links? Do you mean PHP get method? which would display a url such as www.website.co.uk/index.php?password=Pass And you can then use that in the page to check it is what you want? Hope this helps. Reference; http://www.w3schools.com/php/php_forms.asp
  10. It is not recommended to use javascript for passwords, it is extremely vulnerable thanks to the help of inspect element and view source. I would recommend using a PHP if statement alongside a HTML form. With the PHP, you can use a simple meta refresh tag to load up google if the password matches the one that you want to. For example; <?PHPif($_POST['password'] == "G0ld") {echo '<meta http-equiv="refresh" content="2;url=http://www.google.com" /> Password Correct '; }else {die("Sorry, password incorrect"); ?> Hope this helps.
  11. Hi Anupam, You can use the below code and it will automatically load up the default mail service provider that the user has set up, whether it be gmail or a desktop application such as Windows Mail or Microsoft Outlook. <form action="mailto: someone@yourdomain.com" method="POST" enctype="text/plain"><input type="text" name="name"><input type="email" name="email"><input type="submit" value="Submit"></form> The above form uses the mailto protocol installed into most browsers, so it will set up email contents and it will load up the email application, and then the user will have to click send. It will come out like this name=Value email=Value and the 'to' email address will be the one that you place after the mailto: protocol in the form action. If you wanted to change this so that the user doesn't have to click send in their email provider, Niche had the right solution to use PHP mail so that it sends it from any email address you like. If you need help on that, let us know by replying. Hope this helps.
  12. MarkT

    Structure of form

    I believe, as Dave has said, that you mean the reset button, which you can insert by placing <input type="reset" value="Reset Form"/> Unless you mean the css clear which I think is completely off the beaten track Hope this helps.
  13. MarkT

    ordered list

    Have you tried looking at the source code of the website where you took the first screenshot? Just an idea, as it would give you a clue as to what they have done, whether they have ended the unordered list and then continued it afterwards, or alternative options.
  14. Hi All, Unfortunately, My update query isn't working for a new CMS I'm creating. mysqli_query($con2,"UPDATE system SET sys_alert='{$alert}'"); Is the query, but I think it's getting confused with the table name being called system Would anyone be able to help? It's surrounded by an IF statement, which I know is functional as it is emailing me with the new alert variable (shown in query), and the old alert. I appreciate any assistance you can provide. Thanks in advance
  15. MarkT

    Weird MySQLi Error

    Fixed, Index appears to be interpreted as something else. Resolved by using ' ' around the word index in the query.
  • Create New...