I decided to take up learning PHP an hour ago. WOW its a powerful language.
The reason I decided to take it up is because I need to create a database for my website.
I am reading allot about PHP going hand in hand with MySQL, but I don't believe its necessary to use MySQL.
So, I started reading official introduction over at the PHP website.
Being someone with A.D.D, I tried so hard not to deviate, but couldn't help myself and started experimenting with code.
Using the tutorial guideline, I created this:
index.html
Code: Select all
<?php
echo "test";
echo $_SERVER['HTTP_USER_AGENT'];
?>
<form action="action.php" method="post">
<p>Enter value: <input type="text" name="value" /></p>
<p><input type="submit" /></p>
</form>Code: Select all
<?php echo htmlspecialchars($_POST['value']); ?>action.php
Code: Select all
<?php if ($_POST == ['1']) {echo "2"};Its pretty obvious what I want to do, so I won't state the obvious.
What I do need to learn is to create a search page for a website using radio box selections with the form POST, then PHP searches a database ("somedir/file.list")in a group list, and if the selected is in that group, then the website outputs some HTML or I guess the selection choices.
I can do it in python, so I am positive it can be done in PHP.
pro-airportpatdown = [party1, party4, party7]
neutral-airportpatdown = [party2, party6, party9]
anti-airportpatdown = [party3, party5, party8]
Then I want something like:
Get what I mean?If question1 input in "pro-airportpatdown' then echo "Parties that support passenger Pat downs:" then output = "/var/www/website1/partylist/party1.html" "/var/www/website1/partylist/party4.html" "/var/www/website1/partylist/party7.html"
I don't have the time do read the entire documentation now, I will do it next week when I have time, but just to give me an example of what I should expect, how can this be done?
Oh God, all these fantastic PHP ideas are coming to my head. I actually have a head ache!
Thanks!