Jump to content

raphael75

Members
  • Posts

    46
  • Joined

  • Last visited

  • Days Won

    1

raphael75 last won the day on February 16 2015

raphael75 had the most liked content!

Profile Information

  • Gender
    Not Telling

raphael75's Achievements

Member

Member (2/5)

1

Reputation

  1. It turned out to be a non-breaking space that was on the line ($b == false) && after the 2nd &. Removing that fixed the issue.
  2. Here is my PHP code: <?php $a = 76; $b = true; $c = 0; $d = 500; $check = ( ($a > 0) && ($b == false) && ($c == 0) && ($d > 0) ); echo '[' . $check . ']' . "\n"; //echoes [] // ------------------------------- $a = 76; $b = false; $c = 0; $d = 500; $check = ( ($a > 0) && ($b == false) && ($c == 0) && ($d > 0) ); echo '[' . $check . ']' . "\n"; ?> This generates this error: PHP Fatal error: Uncaught Error: Call to undefined function () in /home/abc/code/php_test/test_boolean.php:26 Stack trace: #0 {main} thrown in /home/abc/code/php_test/test_boolean.php on line 26 I can't figure out why this error is occurring. Why does changing $b to false make it think it's a function call? I get this error if I run it in the browser or on the command line. However, testing it in different online php testers doesn't cause an error and produces the expected output. I don't know why this is causing an error on my local. I tried with both php7.3.31 and php 8.0.12
  3. Zip should support 64-bit archives. If you can't get it to work, you could try using WinRAR for Linux and call it from exec().
  4. PHP runs under a certain user account. On Linux it's usually www-data (which is what apache usually runs under, and thus PHP). But this could be different. On Windows/IIS it's usually IUSR_MACHINE. Whatever the user account is, it has to have permission to access the file.
  5. Irfanview has a lot of advanced batch operations: http://www.irfanview.com/
  6. Should this line: if (empty($date)) { be if (empty($data)) { ?
  7. It's also possible that enclosing the <h3> inside <p> is causing problems, especially if the <p> is floating. I'm pretty sure it's a CSS/HTML issue, because all the data is there in the code in the screenshot. I think all the rows are on top of each other due to CSS positioning.
  8. Different browsers are picky about the syntax of the HTML tags. values should always be enclosed in double-quotes, so where you have: <img src='yuklemeler123.jpg'> or <a href=detay.php?id=2> change it to <img src="yuklemeler123.jpg"> or <a href="detay.php?id=2">
  9. Replace what you have with this: if(isset($_GET['dir'])){ echo '<title>' . $_GET['dir'] . '</title>'; } else{ echo '<title>A Star Maths and Physics Notes</title>'; }
  10. Are you working on a windows- or linux-based system?
  11. Have you added it to the example page (http://astarmathsandphysics.com/notes/?dir=gcse-physics) yet?
  12. Try this: if($this->files) { $count = 0; foreach ($this->files as $file) { $cur_file = $this->location->getDir(false, true, false, 0).$file->getNameEncoded(); $finfo = finfo_open(FILEINFO_MIME_TYPE); $cur_mime_type = finfo_file($finfo, $cur_file); if(($cur_mime_type == 'image/gif') || ($cur_mime_type == 'image/png')){ continue; } $row_style = ($row ? "one" : "two"); print "<tr class=\"row ".$row_style.(++$count == count($this->files)?" last":"")."\">\n"; print "<td class=\"name\">\n"; print "\t\t<a href=\"".$this->location->getDir(false, true, false, 0).$file->getNameEncoded()."\""; if(EncodeExplorer::getConfig('open_in_new_window') == true) print "target=\"_blank\""; print " class=\"item file"; if($file->isValidForThumb()) print " thumb"; print "\">"; print $file->getNameHtml(); if($this->mobile == true) { print "<span class =\"size\">".$this->formatSize($file->getSize())."</span>"; } print "</a>\n"; print "</td>\n"; if($this->mobile != true) { print "<td class=\"size\">".$this->formatSize($file->getSize())."</td>\n"; print "<td class=\"changed\">".$this->formatModTime($file->getModTime())."</td>\n"; } if($this->mobile == false && GateKeeper::isDeleteAllowed()){ print "<td class=\"del\"> <a data-name=\"".htmlentities($file->getName())."\" href=\"".$this->makeLink(false, false, null, null, $this->location->getDir(false, true, false, 0).$file->getNameEncoded(), $this->location->getDir(false, true, false, 0))."\"> <img src=\"?img=del\" alt=\"Delete\" /> </a> </td>"; } print "</tr>\n"; $row =! $row; } }
  13. From a high-level view, it is usually helpful to parse a form first with javascript and make any adjustments you need to. This will help the PHP script that will process the form to enter the correct data. Usually if I have a series of radio buttons or a checkbox, I will have the javascript create a delimited list or set 1/0 values, respectively, in hidden form fields if necessary, before submitting the form. Once you get the right data going to the PHP and it is able to insert the form data in the database, the other half is displaying that data. When the page that will display the form data loads, in some cases you load all the data with 1 SQL statement, or possibly more than one depending on the complexity of the data and how it is structured. If you store true/false values in your database as 1/0, then when PHP is building the page it needs to look for 1/0. It all depends on how you decide to store it. If you have a series of radio buttons, you would usually have a loop to create the HTML. It would set the id (<input type="radio" id="rad_0"... >, <input type="radio" id="rad_1"... >, etc.) of each <input> and as it's looping through, look for the selected value from the database. How you store that is your choice. I hope this helps.
  14. Just a guess, but is this code on the index.php page? If so, is there a condition that could cause the CheckLogin function to fail on that page? If so, it could set up an infinite loop where the index.php is redirecting back to itself.
×
×
  • 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.