Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,181,321 members, 7,913,762 topics. Date: Wednesday, 07 August 2024 at 12:11 PM

Please Help Me With These Php Questions - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Please Help Me With These Php Questions (1254 Views)

Post Your PHP Questions Here (2) (3) (4)

(1) (Reply) (Go Down)

Please Help Me With These Php Questions by cr80vity(m): 9:31pm On Jan 20, 2016
pls help me wt ds simple questions...I.actually dnt understand dem...
what does. echo<<<_END, and _END means....
secondly, wats d essence or importance of $_SESSION
thanks in anticipation my boss....
Re: Please Help Me With These Php Questions by hexy40: 9:56pm On Jan 20, 2016
The essence SESSION: When you create a log in page, some of the detail(eg user name) is set as session. This enables the other pages to prevent those that are not loged in from assessing a page. Ie if not for session, you will have to log in on each page. as for "echo<<<_END'....it just comments out every thing after, I have no Idea of its essence
Re: Please Help Me With These Php Questions by cr80vity(m): 10:19pm On Jan 20, 2016
hexy40:
The essence SESSION: When you create a log in page, some of the detail(eg user name) is set as session. This enables the other pages to prevent those that are not loged in from assessing a page. Ie if not for session, you will have to log in on each page. as for "echo<<<_END'....it just comments out every thing after, I have no Idea of its essence
thanks bro but if dere s sth like
$error = invalid username
$_SESSION['error'] = $error ...what is d person tryin to do
Re: Please Help Me With These Php Questions by Emperoo: 10:42pm On Jan 20, 2016
cr80vity:
pls help me wt ds simple questions...I.actually dnt understand dem...

what does. echo<<<_END, and _END means....

secondly, wats d essence or importance of $_SESSION

thanks in anticipation my boss....

Since question on session is answered, echo _____end , is used when you want to write or include html in a php file, example

echo"html code here";


you end echo with "; .
Re: Please Help Me With These Php Questions by hexy40: 11:57pm On Jan 20, 2016
cr80vity:

thanks bro but if dere s sth like
$error = invalid username
$_SESSION['error'] = $error ...what is d person tryin to do

Thinking of how to put the answer to your question in English.......
The person is trying to set the session "error",giving it a value "invalid username". When you insert an invalid username into the log in area, the error session will be set to " invalid username" instead of may be setting the username as session . "invalid username" will now be echoed back to the user.... it depends on how the programmer wants to handle the situation
Re: Please Help Me With These Php Questions by DonSegmond(m): 1:56am On Jan 21, 2016
The <<< syntax is a carry over from other unix languages.

it allows one to have a string that spans multiple lines, in php it's called heredocs.

_END is just an arbitary marker and could be anything.

I usually use _EOF_ for strings or _SQL_ if it's a long sql statement.

You can read more about it here.

http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc

(1) (Reply)

Programming Buddy Wanted... / Per Project Sublime Text Settings / Statistician With Good Knowledge Of R Programming, Spss, Excel, And Sas Needed!

(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. 12
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.