-
Posts
3,145 -
Joined
-
Last visited
-
Days Won
37
Everything posted by cyberRobot
-
Good luck with the class and welcome!
-
Are these links appearing in a particular section (e.g. page footer) of the website? If so, the styles could also be applied to all links in that section. That way you don't need to create extra classes. For example, if your links are in an HTML5 footer tag: <footer> <p class="mylink"><?=$echo?></p> </footer> You could style the links with the following: footer a { font-size: 4pt; color: #FFFFFF; }
-
Not that we're collecting votes or anything. I also think post #s would be nice. That's usually the first thing I look for when trying to find a link to a specific post. Referring to a post # could also be good for most threads as described above by SaranacLake. There are some longer multi-page threads, however, where it would be better to just link to (or quote) the post. That way people don't need to go digging to see what you are referring to. Of course that's a very minor problem.
-
As mentioned earlier, you could also link to your earlier post. Note the link at the beginning. Perhaps requinix is still looking into this. But I'm guessing it's not given the following:
-
Also note that there is a link behind the timestamps. You could potentially use that to link to the indicated post.
-
can I use the full file URL in an include() function?
cyberRobot replied to ajetrumpet's topic in PHP Coding Help
Just be aware that if the website's domain ever changes, you will need to go through all your scripts to updated the include statements. Another option to consider is specifying an include_path. https://www.php.net/manual/en/ini.core.php#ini.include-path -
can I use the full file URL in an include() function?
cyberRobot replied to ajetrumpet's topic in PHP Coding Help
From the PHP manual for the include statement: More information can be found here, before example 3: https://www.php.net/manual/en/function.include.php -
You need to fetch the row and assign it to $row. Examples can be found here: https://www.php.net/manual/en/mysqli-result.fetch-assoc.php
-
That turns off error reporting. Try adding the following error_reporting(E_ALL); ini_set('display_errors', 1);
-
Are you looking to get the value that appears the open and close column tags (<td>value</td>)? If so, you should be able to run $cols through a loop, like you did for $rows. For example foreach ($cols as $col) { For help understanding the PHP manual, $cols contains a DOMNodeList and $col contains a DOMNode. To get a value from the $col DOMNode, you can use the following: $col->nodeValue
-
Using ORDER BY twice in a query not working?
cyberRobot replied to imgrooot's topic in PHP Coding Help
As it's written, the query results will be sorted by "project_id" in reverse (descending) order. The "featured" part of the clause will only get executed if you have multiple records with the same project_id. If you want the featured records to always appear first, you'll need to sort the results by that column first, then by project ID. -
Also, can I ask what's going on here: $num1 = (5); Is there a reason for the parentheses? Apparently PHP doesn't care if they are there. PHP appears to ignore them. Unless there is a reason for using the parentheses, it would be clearer to use the following: $num1 = 5;
-
There's a syntax error in your if statement. The following manual page provides examples on writing if statements: https://www.php.net/manual/en/control-structures.elseif.php It might also help to review the following page when it comes to the comparison operator: https://www.php.net/manual/en/language.operators.comparison.php
-
So basically, you are looking to loop through an array of numbers. For each number, you want to display the name that corresponds with that number. So in your loop, when you get to 5, it should display "Lee". And 2 should be "John". Correct? If so, where are you stuck? What have you tried so far? Be aware that PHP arrays don't start with 1 for the index, by default.
-
Custom PHP question - Help please! :)
cyberRobot replied to iNeedPHPCodingHelp's topic in PHP Coding Help
Alternatively, you could just update the line that defines $site_title. That way you're not calling get_the_title() multiple times. Plus, the value should be escaped for inclusion in an HTML attribute. $site_title = esc_attr( get_the_title() ); As for the following, WordPress' the_title() function echos the value be default. I forget what happens when you try to echo something that has already been echoed in WordPress, but that probably lead to the issues you were having. -
Perhaps the link below will help. Note the first example on the page. https://www.php.net/manual/en/control-structures.if.php
-
So you're looking to add "Order id..." above the table? If so, you should be able to add that information to the $finalMessage variable, before the open <table> tag.
-
Also note that you are naming the variable "var1". In SCAction.php, it looks like you are expecting a variable named "SC" here: $SC=stripslashes($_GET['$SC']);
-
Did you see Barand's response about PHP variables needing to be outputted in PHP? Try changing this <FORM METHOD="POST" ACTION="SCAction.php/?cmd= set&var1=$SC2"> To this <FORM METHOD="POST" ACTION="SCAction.php/?cmd= set&var1=<?=$SC2?>"> Note the $SC2 variable at the end.
-
Sorry, I misread your post. Are the values in the FINISHED column stored as a MySQL DATE type? If not, switching the column type will make this much easier.
-
You could use MySQL's YEAR() function to extract the year from the FINISHED column. Then sort by that. https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_year
-
As for the other error, $update isn't defined unless the form is submitted. You could add isset() to the following line: if(isset($update)){
-
What does your updated code, where you tried using glob(), look like? The only line you've shown for that is the following: $directoryList = glob($directory); If that's the code you're referring to, we'll need to at least see what $directory is set to.
-
Why does my code automatically think the textbox is empty?
cyberRobot replied to Skittle's topic in PHP Coding Help
Be aware that is_numberic() will accept values that you likely won't want. More information can be found here: https://www.php.net/manual/en/function.is-numeric.php If the values are supposed to be whole numbers, you could give this function a shot: https://www.php.net/manual/en/function.ctype-digit.php