phpbridge / docs Goto Github PK
View Code? Open in Web Editor NEWThis project forked from railsbridge/docs
Curriculum for PHPBridge workshops
Home Page: phpbridge.org
License: Other
This project forked from railsbridge/docs
Curriculum for PHPBridge workshops
Home Page: phpbridge.org
License: Other
Immediately after ($fruits), here:
for ($i = 0; $i < sizeof($fruits), $i++) {
echo $fruits[$i] . PHP_EOL;
}
I'm having issues with the Pretty URL's. When I click on edit or delete I get Object not found! When I edit .htaccess with a WordPress mod rewrite, I no longer get the error but it will not load the edit or delete files.
In the page
http://phpbridge.org/installfest/windows?back=choose_your_operating_system
you mention a VM files. Where are ? Thank you
Security is a mindset, not an after the fact addition
The db stuff does a good job of mentioning using bound params to deal with sql injection but there is nothing about the other end of security - FIEO
From the first moment POST and GET are mentioned and used the idea of filtering input (validating you got what you expected) and escaping output (a wrapper with htmlspecialchars would suffice for beginners) should be introduced
Just the basics are needed, nothing fancy - an output escaper function/method to use when echoing stuff out and the use of filter_var to make sure data is right from a POST is plenty good for a beginner level, but introducing the idea of "the user is a jerk and will try to break stuff" is good for beginning dev minds ;)
When I first downloaded the package last night,I saw an error when I ran bundle install
$ bundle install
Gemfile syntax error compile error
on line 25: syntax error, unexpected ':', expecting $end
gem 'debugger', group: [:development, :test]
^
I'm running on PHP 5.3. The use of [] verses array() also is a problem. Any idea why routes don't work though?
Files are a mix of tabs and spaces for indents. Which should we use? If spaces, how many?
https://phpbridge.org/intro-to-php/pretty_urls?back=configuration
I was following most of the instructions until I hit a snag on this part of the tutorial.
I'm using LARAGON as Vagrant is not working with me on windows 10..
$_SERVER['PATH_INFO'] doesn't seem to be working or always empty. Help..
there's a random mix of '' and "" in (for example) step 5 of "create a data class" which is probably going to screw someone up - I'd suggest using one or another throughout the examples and code ('' would be my preference for beginners) - the usage of " blah " . is especially egregious
I've attended last week a Code.org workshop about teaching K-5 kids computers. Unfortunately, when you look at the upcoming "Hour of code" (http://code.org/learn), PHP for kids is missing there.
Could you please create a "PHP Tutorial" version for kids, similar to Ruby's http://hackety.com/ or
Python's https://groklearning.com/ - both are mentioned on http://code.org/learn
If we want the young generations to use PHP, we need something to win their hearts and minds!
Need a better way to word things maybe? It is confusing for people to distinguish between index.php and the index view, possibly just adding a tip so that people pay more attention to it could work.
The code here indicates that a delete operation can be conducted within a GET operation. This is not ideal, as an automated system (web crawler, link pre-fetcher) might go off and delete things, seemingly at random.
To protect against this, wrap the item list in a POST form and use a submit button for the delete. The handler code needs to be updated to only respond to POST, too.
public function getAllTopics()
{
$query = $this->connection->prepare("SELECT * FROM topics");
$query->execute();
return $query;
}
The function return the query object and not the topics.
I think you need change "return $query;" for "return $query->fetchAll();"
Another option is modify the function getAllTopics with oneline
"return $this->connection->query("SELECT * FROM topics");"
Currently serving Cloudfare
Error 522 Ray ID: 2f21fe3ff5ba0ce3 โข 2016-10-15 08:45:39 UTC
Connection timed out
Make sure to add instructions for exiting psysh
From where I can download the content of vm and project folder. Please guide me so I can follow the PHPBridge curriculum. Thank you.
I suggest the following code (taken from here):
<html>
<head>
<title>Suggestotron</title>
</head>
<body>
<?php
foreach ($topics as $topic) {
echo "<h3>" .$topic['title']. " (ID: " .$topic['id']. ")</h3>";
echo "<p>";
echo nl2br($topic['description']);
echo "</p>";
echo "<p>";
echo "<a href='/edit.php?id=" .$topic['id']. "'>Edit</a>";
echo " | ";
echo "<a href='/delete.php?id=" .$topic['id']. "'>Delete</a>";
echo "</p>";
}
?>
</body>
</html>
becomes like so:
<html>
<head>
<title>Suggestotron</title>
</head>
<body>
<?php foreach ($topics as $topic): ?>
<h3>
<?php echo $topic['title'] ?> (ID: <?php echo $topic['id'] ?>)
</h3>
<p>
<?php echo echo nl2br($topic['description']) ?>
</p>
<p>
<a href="/edit.php?id=<?php echo $topic['id'] ?>">Edit</a>
|
<a href="/delete.php?id=<?php echo $topic['id'] ?>">Edit</a>
</p>
<?php endforeach ?>
</body>
</html>
Reasoning: HTML should not be trapped inside echo statements. It prevents modern editors from syntax-checking the HTML or colourising it. Also, there's less need for concatenation, so it looks nicer.
Incidentally, I've swapped the brace-style foreach
for a colon-style. There's a rule of thumb that the former belongs in code files and the colon-style is preferred in template files, because the ending is much more explicit. Not essential for this ticket but nice to add, IMO.
I expect there are others too, but it's worth raising a ticket to see if this is in keeping with house style first. Of course, htmlspecialchars()
is required too, but that's another ticket.
The edit.php step by step is either out of order or has an additional "view output" in the wrong spot. If you create edit.php with the <?=$topic in it, you'll get an undefined variable warning.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.