Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by MarkT

  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. 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. 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. 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.
  16. MarkT

    Weird MySQLi Error

    Hi, I have this code; <?PHP include "./system/connect.php" ?> <?PHP $check = mysqli_query($con,"SELECT * FROM index"); $check2 = mysqli_fetch_array($check); ?> However, on the website it gives this; Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /home/a5813772/public_html/index.html on line 13 Any ideas? Thanks
  17. MarkT

    PHP Mail not working

    Nevermind, the Query must be after the mail.
  18. MarkT

    PHP Mail not working

    Hi, I have this code; if($_GET['sec'] == $check2['security_code']) {$check = mysqli_query($con,"SELECT * from new_players WHERE email_address = '{$_GET['email']}'");$check2 = mysqli_fetch_assoc($check);mysqli_query($con,"UPDATE new_players SET sent='1' WHERE email_address = '{$check2['email_address']}'");$toemail = "mark.ethompson97@gmail.com";$subject = "Website Form: Player Recruitment Interest";$message = "<html><head> <title>Player Recruitment Interest</title></head><body>Hello,Player interest has been shown with the following details: <br>Player Name: {$check2['player_name']} <br>Parent Name: {$check2['parent_name']}<br>Email Address: {$check2['email_address']} <br>Phone Number: {$check2['phone']}<br>School: {$check2['school']}<br>School Year: {$check2['school_year']}<br>Position: {$check2['position']}<br>Previous Clubs: {$check2['previous_clubs']}<br>Address: <br>{$check2['address_1']}<br>{$check2['city']}<br>{$check2['postcode']}<br /><h4>Email sent via player recruitment form on </h4></body></html>";$from2 = $_GET['email_address'];$from = "{$from2}";$headers = 'MIME-Version: 1.0' . "rn";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn";$headers .= "From: ".$from2."rn";mail($toemail,$subject,$message,$headers); And the MySQL query is working fine, but I'm not getting the email? Please can you help?
  19. MarkT

    PHP File Upload

    Hello, I currently have the following code; <?PHP require "./system/connect.php" ?><?php if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br>"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br>"; echo "Type: " . $_FILES["file"]["type"] . "<br>"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>"; echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br>";$filename = $_FILES["file"]["name"];$title = $_POST['name'];$publisher = $_POST['author'];mysqli_query($con,"INSERT INTO gallery (name,photo,author) VALUES ('{$title}','{$filename}','{$publisher}')");echo "<meta http-equiv='refresh' content='1; url=newgallery.php' />"; if (file_exists("gallery/album/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "gallery/album/" . $_FILES["file"]["name"]); echo "Stored in: " . "gallery/album/" . $_FILES["file"]["name"]; } }?> However, I would like the form to have 2 files to be uploaded, how would I embed it?
  20. MarkT

    Cookie Preference

    Hello, Can anyone tell me how to create a cookie preference bar, that starts at the top of the page, but as you scroll down then sticks at the top of the page. I want that sort of thing, but to have an alert at the top, instead of cookie preferences.
  21. Thanks Don, How would you use variables from the; VERIFIED - array ('mc_gross' => '10.00','protection_eligibility' => 'Eligible','address_status' => 'confirmed','payer_id' => '77FWLVRQMKQTU','tax' => '0.00','address_street' => '1 Main St','payment_date' => '21:35:54 Mar 22, 2014 PDT','payment_status' => 'Completed','charset' => 'windows-1252','address_zip' => '95131','first_name' => 'Bruce','mc_fee' => '0.59','address_country_code' => 'US','address_name' => 'Bruce Wayne','notify_version' => '3.7','custom' => '','payer_status' => 'verified','business' => 'd.nu-facilitator@gmail.com','address_country' => 'United States','address_city' => 'San Jose','quantity' => '1','verify_sign' => 'ABr7TF1VNJRHrFfJkVMfCcSa87ETA-vHI9gkqlaorJcID4GyrIyuZUoN','payer_email' => 'whocares_sowhat@yahoo.com','txn_id' => '9J104269XA701392G','payment_type' => 'instant','btn_id' => '2923468','last_name' => 'Wayne','address_state' => 'CA','receiver_email' => 'd.nu-facilitator@gmail.com','payment_fee' => '0.59','shipping_discount' => '0.00','insurance_amount' => '0.00','receiver_id' => 'FGA7J2A7XH3BA','txn_type' => 'web_accept','item_name' => 'Product','discount' => '0.00','mc_currency' => 'USD','item_number' => '','residence_country' => 'US','test_ipn' => '1','shipping_method' => 'Default','handling_amount' => '0.00','transaction_subject' => '','payment_gross' => '10.00','shipping' => '0.00','ipn_track_id' => 'd4b4a4bf77bb5',) In an SQL query, for the if validated?
  22. Hello, I want to create a paypal button, that lets people pay for stuff via paypal, I want it to send it to a paypal acc, use a listener, and if it's a verified payment, execute an SQL statement. Anyone have any ideas how to go about this?
  23. What type of navigation are you doing? Drop down or a basic one?
  24. MarkT

    Floating Elements

    Hello, Haven't been the best at CSS, but I've got a website that uses 2 floating elements, with auto adjusting sizes, next to each other. Whats the code to stop the float, for example, an auto height adjusting div, with the floats inside it, it doesn't fill out the div. Is there a code to stop it? I think it's clear or something. Can't remember.
  • Create New...