Added: 6 months ago
From: phpacademy
Views: 4,383
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (22)

Sign In or Sign Up now to post a comment!
  • can you just put the php code below the html one? coz that's what i do and i found no errors..i think..

  • 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.

  • I'd just add an @ before the variable :)

  • @EmilsMC That's Cheating! Haha!

  • You are an absolute don!!!

  • I found other solution, copy and paste this code to your scripts.

    error_reporting (E_ALL ^ E_NOTICE);

  • 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.

  • 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 That's true. It's personal preference really. I just feel it's cleaner to specify a hidden value.

  • 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 No! Never do this. It will decrease script performance (load time).

  • @phpacademy I see your point, tho I would have liked if it was even merely mentioned.

  • 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 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"

  • You could also turn error reporting off error_reporting(0);

  • since when can you do commas instead of dots for concatenating?

  • @winfr34k I'm not sure either. Hopefully he answers this.

  • @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 Thank you very much, never knew that!

  • thank you very much to upload this video...i have been getting this error most of the time while do login/registeration page....&others

  • last

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more