I learned php a few months ago, built a high volume trading application. two weeks ago, it was hacked. for a while i've been feeling discouraged, but i've realized that i was never meant to be a php programmer, because you can't write anything securely without a framework, which seems like a huge waste of time to learn. I thought of trying ROR, then i thought of node js, but i keep coming back to a burning desire to write C++. it has a similar syntax to php, and i find it extremely easy to read and understand however, my knowledge of C++ consists of some minor dicking around with bitcoin's source code and compiling it under windows/unix.
So, my question really is more of a crash course of what i need to learn, but haven't necessarily found anything descriptive on the internet.
i need to know:
1. a crash course on creating a website with either POCO or CSP, something that will allow me to avoid pointers and memory management, atleast until i have gained the basic understanding of C++.
2. i need to learn simple ways to accomplish the following tasks:
a. for loop i use in php often to render results to the view(webpage)
ex:
1 2 3 4 5 6
|
for(i = 0; i < mysql_num_rows(query); i++){
//script here
foo = mysql_result(query, i, "foo");
bar = mysql_result(query, i, "bar");
echo foo."</br>".bar."</br>";
}
|
b. while loop
ex:
1 2 3
|
while(row = mysql_fetch(query){
//script here
}
|
c. connection to a mysql db.
d. a mysql query
e. building a real time websocket(for a chat, or a real time orderbook display, etc.)
f. handling get requests and post requests in POCO or CSP.
g. passing variables to jquery/javascript with C++
h. working with arrays( php equivalents of:
array()
,
in_array()
,
array_sum()
,
print_r()
etc.)
i. database transactions( i dread learning this again but its a must)
j. equivalent of php's
switch()
function if possible.
k. equivalent of php's `hash` function which roughly would look like
hash('sha512', variable . salt);
l. best way to generate randomness(numbers, strings, etc.) for password salting/csrf tokens etc.)
m. how to properly construct functions and classes in C++.
n. if its possible to wrap cout>> in a function, to making printing things in html simpler(like echo and print do in php).
additionally, a quick run down of syntax rules/common pitfalls would be appreciated. the bitcoin code is so complex i really haven't gained much knowledge of C++ other than the basic things(if statements, type casting(for integers, though i really don't understand all the differences), basic syntax rules like braces, semicolons.)
aside from this knowledge, about the only thing i would need help with is library linking, file inclusion rules, and general compiling help for POCO/CSP. thanks!
admin, feel free to move as necessary, though i suppose beginners is the most fitting forum for me