whoa did not know you can do isset for multiple variables and separate with commas. In your beginner tutorials on thenewboston, you typed isset for each one. Good thing I saw this video, saves lots of typing.
Also good idea on that indentation. Looks much cleaner.
@killerbng btw what I mean is right now, if u type something in something_else but not in something...u would still get an error for the something seem as this example has no validation so all fields would be "optional"
@winfr34k The echo construct is loosely regarded as a function, which can take an unlimited amount of parameters. Hence, each string can be separated by a comma.
can you just put the php code below the html one? coz that's what i do and i found no errors..i think..
XxBlackRockBlankxX 1 week ago
whoa did not know you can do isset for multiple variables and separate with commas. In your beginner tutorials on thenewboston, you typed isset for each one. Good thing I saw this video, saves lots of typing.
Also good idea on that indentation. Looks much cleaner.
PancakePlease 2 weeks ago
I'd just add an @ before the variable :)
EmilsMC 1 month ago
@EmilsMC That's Cheating! Haha!
McbainGames 3 weeks ago
You are an absolute don!!!
RomaineRC 2 months ago
I found other solution, copy and paste this code to your scripts.
error_reporting (E_ALL ^ E_NOTICE);
gervic23 3 months ago
This has been flagged as spam show
does anyone know what is the main reason on my site
A PHP ERROR WAS ENCOUNTERED
Severity: Notice
Message: Trying to get property of non-object
Filename: project/viewProject.php
Line Number: 898
bronzemoontr 3 months ago
Thank you a lot.
I have googled a lot and posted on forums but nothing had worked out even from the book itself [thaugh not finished up reading].
Using the tips you gave it helped a lot.
Kyumie 4 months ago
hi there you don't have to add a hidden field and check for it you could just
give the submit button a name like this:
input type="submit" value="Submit" name="submit"
and then check if the submit button is clicked like this:
if (issset($_POST['subbmit']){
tyoil 6 months ago
@tyoil That's true. It's personal preference really. I just feel it's cleaner to specify a hidden value.
phpacademy 6 months ago
another way that wasn't mentioned here is to just mark a '@' before the dollar sign, which will remove the error. For example:
if ($_POST['something']) becomes if (@$_POST['something'])
strafir 6 months ago
@strafir No! Never do this. It will decrease script performance (load time).
phpacademy 6 months ago
@phpacademy I see your point, tho I would have liked if it was even merely mentioned.
strafir 6 months ago
why not do 3 if statements, 1 for something is set, 1 for something_else is set and 1 for if both r set :P most forms have optional fields :P
killerbng 6 months ago
@killerbng btw what I mean is right now, if u type something in something_else but not in something...u would still get an error for the something seem as this example has no validation so all fields would be "optional"
killerbng 6 months ago
You could also turn error reporting off error_reporting(0);
computertrick 6 months ago
since when can you do commas instead of dots for concatenating?
winfr34k 6 months ago 2
@winfr34k I'm not sure either. Hopefully he answers this.
TheEpicNewb 6 months ago
@winfr34k The echo construct is loosely regarded as a function, which can take an unlimited amount of parameters. Hence, each string can be separated by a comma.
phpacademy 6 months ago 5
@phpacademy Thank you very much, never knew that!
winfr34k 6 months ago
thank you very much to upload this video...i have been getting this error most of the time while do login/registeration page....&others
krishnankuta 6 months ago
last
heydude8999 6 months ago