Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,199,760 members, 7,972,723 topics. Date: Friday, 11 October 2024 at 05:03 PM |
Nairaland Forum / Science/Technology / Webmasters / Webmasters Enter Here If You Can Solve These PHP Questions... (9471 Views)
Webmasters: Enter Here And Clarify Me Biko! / Webmasters: Enter Here And Clarify Me Biko! / All Nairaland Webmasters: Enter Here Now!! (2) (3) (4)
Webmasters Enter Here If You Can Solve These PHP Questions... by FRInteractives: 10:10pm On Apr 28, 2015 |
Hello NL webmasters, I will be posting some Questions in php which I have the answers already and you will figure them out for yourselves. You can also post your own questions here for others to solve. |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by FRInteractives: 10:12pm On Apr 28, 2015 |
Question 1 Q: What is wrong with this query: "SELECT * FROM table WHERE id = $_POST [ 'id' ]" ? |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by FRInteractives: 10:16pm On Apr 28, 2015 |
Question 2 Q: What is the preferred way to write this if statement, and why? if( 5 == $someVar ) or if( $someVar == 5 ) |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by FRInteractives: 10:17pm On Apr 28, 2015 |
Question 3 Q: Given this code: function doSomething( &$arg ) { $return = $arg; $arg += 1; return $return; } $a = 3; $b = doSomething( $a ); ...what is the value of $a and $b after the function call and why? |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by FRInteractives: 10:31pm On Apr 28, 2015 |
Question 4 Q: Consider these lines of codes: //first code $myVar = "I am Something"; $myVar .= "So Special"; echo "Do you Know $myVar"; And //second code $myVar = "I am Something"; $myVar .= "So Special"; echo 'Do you Know $myVar'; Now if you run these two codes in a Browser what will be the output? |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by Nobody: 10:51pm On Apr 28, 2015 |
1.) nothing really,just SQL injection (and probably table should be table name,*sniffs*) 2.).if( $someVar == 5 )...it actually checks if some var is equal to 5 not the other way round.. 3.) both a and b are 3 since return is equal to the argument plus that fact that the return variable is what the function outputted.. 4.) first one echoes the string the variable is holding while the second does not *updated* 7 Likes 2 Shares |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by FRInteractives: 10:58pm On Apr 28, 2015 |
well done jregz but you did'nt get question 4 correctly. |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by FRInteractives: 11:01pm On Apr 28, 2015 |
Question 5 (OOP) Q: What is the difference between p u b l i c, p r o t e c t e d and p r i v a t e in a class definition? |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by Nobody: 11:06pm On Apr 28, 2015 |
FRInteractives:oh my bad, my eyes kind of failed me....didn't notice the single quote |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by spikesC(m): 11:33pm On Apr 28, 2015 |
FRInteractives: Question 1 is also wrong. FRInteractives: You cannot have the single quotes of an array index when the array is in a double quote. It is a syntax error. Therefore, "SELECT * FROM table WHERE id = $_POST [ id ]" Pls post reasonable questions, this is really too basic 4 Likes |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by FRInteractives: 11:37pm On Apr 28, 2015 |
spikesC: NOTED good observation |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by Craigston: 12:25am On Apr 29, 2015 |
FRInteractives:
1 Like |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by FRInteractives: 12:33am On Apr 29, 2015 |
Craigston:good one bro |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by Craigston: 1:02am On Apr 29, 2015 |
FRInteractives:
FRInteractives:
FRInteractives:
|
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by FRInteractives: 3:01pm On Apr 29, 2015 |
You Nailed it Bro. Keep it up. I'll be posting some more difficult questions soon Craigston: |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by Craigston: 6:18pm On Apr 29, 2015 |
FRInteractives:That's great. I'm a beginner so the basics are still fresh in my skull. I hope the harder trivia will spur me on to learn fast. I just finished the basics of objects and arrays, and I'm now learning SQL (MySQL). After that, I'll integrate it with PHP in a small project and learn JS too. Holla. 2 Likes 1 Share |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by Nobody: 2:25pm On Apr 30, 2015 |
Learning mood activated. Please check my signature too. Thanks. |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by pretydiva(f): 2:25pm On Apr 30, 2015 |
Walks outta here majestically |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by Hollawaley(m): 2:27pm On Apr 30, 2015 |
Walahi, my head iyaf scatter wit these php codes. Malegirl |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by afrinaija2: 2:28pm On Apr 30, 2015 |
h |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by hotwax: 2:28pm On Apr 30, 2015 |
FRInteractives: Hackers cake. Prone to attack |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by Nobody: 2:28pm On Apr 30, 2015 |
Hahahaha |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by tunwumi: 2:32pm On Apr 30, 2015 |
Ok I hear |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by umar4info(m): 2:33pm On Apr 30, 2015 |
webmasters are also agents of change in this country |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by Nobody: 2:35pm On Apr 30, 2015 |
Funny 1 Like |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by peteruuu(m): 2:35pm On Apr 30, 2015 |
ff |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by Horlaarsco: 2:36pm On Apr 30, 2015 |
hmmn |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by iykebesbt1(m): 2:36pm On Apr 30, 2015 |
OP are u reading from the original copy? |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by Terahertz(m): 2:38pm On Apr 30, 2015 |
It will actually return 3 the initial value but will change the variable $a to 4.... Craigston: |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by Tobilastik(m): 2:40pm On Apr 30, 2015 |
. |
Re: Webmasters Enter Here If You Can Solve These PHP Questions... by Tobilastik(m): 2:43pm On Apr 30, 2015 |
Craigston: where do u learn this?? I need sth like this 2 Likes 1 Share |
Governor of Poker 3 unlimited chips hack cheat tool download Android iOS / Why You Should Use HTTPS Instead Of HTTP On Your Website / 5 Simple Steps To Writing Effective Emails
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 34 |