Jump to content

Ch0cu3r

Staff Alumni
  • Posts

    3,404
  • Joined

  • Last visited

  • Days Won

    55

Everything posted by Ch0cu3r

  1. The contents of the page your want to "password protect" need to go where this line is <!-- normal page content -->, Example <html> <head> <title> Basisschool De Regenboog </title> <style> img { position: absolute; left: 60%; } </style> </head> <body> <script> </script> <!-- header of your page, up until the content area --> <?php if (!isset($_POST["password"]) || $_POST["password"] != "123") { // no password or wrong password ?> <form action="" method="post"> <p>Password: <input type="password" name="password"> <button type="submit">Enter</button></p> </form> <?php } else { // correct password ?> <!-- normal page content --> <a href="http:/www.youtube.com"><img src="Plaatjes/youtube.png" /></a> <?php } ?> <!-- footer of your page --> </body> </html> If the user has not submitted the correct password then the login form will show. Only until the user has entered the correct password (currently 123) then the youtube link will display.
  2. Maybe the tab/spaces is coming from $item->station_id . Try applying trim to that variable. fclose needs to be moved outside of the loop.
  3. Why cant you use $_GET? This is what it is for GET is used for requesting resources You cannot do pagination using Post/Sessions
  4. We have a Best Answer button in the bottom right hand corner of each post.
  5. Did you miss my post? I have explained what you need to do also pointed to relevant documentation pages. I am not going to write the code for you. Have a go yourself if you become stuck then post what you have tried. I have removed your contact number, not a good idea posting your personal contact details on open forum on the internet.
  6. This must be down to your editor. PHP will not change the source code for no reason. Can you explain how you are editing/saving your .php files?
  7. Start with using glob to list files in a directory. Outputting each file in HTML anchor tag, in the url for each link pass the filename as a querystring parameter Use $_GET superglobal variable to get the filename from the querystring. Checking to make sure the file exists. if the file does exist use then usefile_get_contents to output the contents of the file. You may to use header for setting the correct mime type in order for the browser to display the contents of the file properly.
  8. Doesn't have to be. If the the form is submitting to itself then in the forms action add a hash, eg <form action="#invoice" method="post"> ... form ields ... </form> When the page loads, in javascript use window.location.hash to get the hash value, it it is equal to #invoice then have the invoice tab be the active tab rather than the customer tab. Judging by your screenshot you are possibly using Bootstrap tabs component? Looking at the documentation you should be able to call the .show() method on your invoice tab to set as active, eg if(window.location.hash == '#ivoice') { $('#invoiceTabIdHere').tab('show'); // should make the invoice tab active }
  9. Try adjusting the xpath query to be $rows = $xpath->query('//table[@id="r"]/tbody[@class="table-text"]/tr[not(descendant::td[contains(@class, "break-row")])]'); It should ignore any table row that contains a <td> tag with the class "break-row"
  10. You will want to use Googles Analytics Embed API for integrating your analytic's into your webpage.
  11. There shouldn't be double quotes around mysqli_connect. It should be $conn = mysqli_connect(db_host, db_user, db_pass, db_name);
  12. First you need to use the following xpath query. $rows = $xpath->query('//table[@id="r"]/tbody[@class="table-text"]/tr'); As your HTML table is not syntax formatted then the following lines will no longer work. // explode on each newline character in nodeValue (note the HTML tags are stripped out, leaving just the text inside the td tags) // and merge with the $defaults array $values = array_replace($defaults, explode("\n", trim($row->nodeValue))); // remove any whitespace before or after each value $values = array_map('trim', $values); Instead replace them with the following // get the values for the child "td" tags in the row $values = getChildNodeValues($row->childNodes, 'td'); And add the following function before the foreach loop function getChildNodeValues(&$nodeList, $nodeName) { $values = array(); foreach($nodeList as $node) { if($node->nodeName == $nodeName) $values[] = trim($node->nodeValue); } return $values; }
  13. Tried checking your servers error logs?
  14. You would use $dom->loadHTMLFile() in place of $dom->loadHTML()
  15. In the php.ini You can run phpinfo to see your current php configuration settings
  16. Have you tried easyUI combogrid it has an option for multiple selections with checkboxes (click Multiple ComboGrid in the list on the left for demo)
  17. Yes it is possible you have send the email containing vCalander meta data. I found a few tutorials/discussions/code snippets by googling the term "php outlook send calendar invite"
  18. Hello, Welcome to PHPFreaks please note the PHP Help forum is for getting help with PHP code not CSS, we have a dedicate forum section for this. I have moved the topic for you. It would be helpful if you could post your HTML (or link to your webpage). What do you mean by "I want to shrink the whole thing down"?
  19. Rather than use regex to try to and parse the HTML table to find your values, instead use DOMXpath to get the data inside the table $html = <<<HTML <table> <tr class="row-border-top marked-row"> <td>13 Dec 15, Sun</td> <td>OFF(Z)</td> <td>DOZ</td> <td>: </td> <td>: </td> <td></td> </tr> <tr class="row-border-top marked-row"> <td>12 Dec 15, Sat</td> <td>B/HOL(Z)</td> <td>DOZ</td> <td>: </td> <td>: </td> <td></td> </tr> <tr class="marked-row"> <td>8 Dec 15, Tue</td> <td>3329</td> <td>RZS</td> <td>17:20</td> <td>21:55</td> <td>DOZ</td> </tr> </table> HTML; $doc = new DOMDocument(); $doc->loadHTML($html); $xpath = new DOMXPath($doc); // use xpath to find all <tr> tags that has the class "marked-row" $rows = $xpath->query('//tr[contains(@class,"marked-row")]'); // fill an array with 6 empty values $defaults = array_fill(0, 6, ''); // loop over each row found by xpath foreach($rows as $row) { // explode on each newline character in nodeValue (note the HTML tags are stripped out, leaving just the text inside the td tags) // and merge with the $defaults array $values = array_replace($defaults, explode("\n", trim($row->nodeValue))); // remove any whitespace before or after each value $values = array_map('trim', $values); // use dateTime to parse the date $dt = new DateTime($values[0]); // convert date to d/m/Y format $date = $dt->format('d/m/Y'); // using the same dateTime object to convert the date to Y/m/d format $sectordate = $dt->format('Y/m/d'); // set rest of values $duty = $values[1]; $dep = $values[2]; $begin = $values[3]; $end = $values[4]; $arr = $values[5]; // insert values into database here }
  20. Yes, default is set to not expire You can set your own session settings using the php.ini or using ini_set. The following page outlines all the runtime settings for sessions http://php.net/manual/en/session.configuration.php You will need do this before calling session_start() session_start() is a function, which you must call at the of all pages that uses sessions.
  21. Because your #dataBox div is still hidden you need to call .show() when the user has clicked the link $('div #dataBox').removeClass().addClass('pData').show();
  22. If you dont want to rotate the text then you will have to resort to using line breaks after every character <p> H<br />e<br />l<br />l<br />o </p> Or write each character on its own line and apply white-space: pre <style> .vert-text { white-space: pre; } </style> <p class="vert-text">H e l l o</p>
  23. Yes you would have use namespaces but why would you define three functions with the same name? Whats is the differences between them?
  24. You wouldn't need to do that, your webhost will have everything setup for you. Unless you have dedicated hosting.
  25. That error is caused because have a variable scope issue. You are trying to bind $path to the :image_path placeholder. Problem is $path is defined inside the resize() function. Functions have their own variable scope. Meaning variables defined inside them are not accessible outside of them, unless you define them as global - WHICH YOU SHOULD NOT DO The resize function is returning the path for thumbnail it has created. You would need to execute the prepared statement inside the foreach loop if you want to store the path for each thumbnail being created. Each thumbnail will be inserted as a new row.
×
×
  • 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.